Skip to content

Commit 5e8347a

Browse files
committed
Translate a paragraph
1 parent d940b33 commit 5e8347a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/subtyping.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,15 @@ in its place. Therefore functions are variant over their return type.
378378

379379
が置かれても全く問題ありません。ゆえに、関数は、そのリターン型において変性なのです。
380380

381+
<!--
381382
`*const` has the exact same semantics as `&`, so variance follows. `*mut` on the
382383
other hand can dereference to an `&mut` whether shared or not, so it is marked
383384
as invariant just like cells.
385+
-->
386+
387+
`*const``&` と全く同じセマンティクスを持ちます。つまり変性も `&` に従います。
388+
他方で、 `*mut` は、共有の有無に関わらず `&mut` に参照外し可能です。よって
389+
`*mut` は cell と同じように非変性です。
384390

385391
This is all well and good for the types the standard library provides, but
386392
how is variance determined for type that *you* define? A struct, informally

0 commit comments

Comments
 (0)