We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d940b33 commit 5e8347aCopy full SHA for 5e8347a
src/subtyping.md
@@ -378,9 +378,15 @@ in its place. Therefore functions are variant over their return type.
378
379
が置かれても全く問題ありません。ゆえに、関数は、そのリターン型において変性なのです。
380
381
+<!--
382
`*const` has the exact same semantics as `&`, so variance follows. `*mut` on the
383
other hand can dereference to an `&mut` whether shared or not, so it is marked
384
as invariant just like cells.
385
+-->
386
+
387
+`*const` は `&` と全く同じセマンティクスを持ちます。つまり変性も `&` に従います。
388
+他方で、 `*mut` は、共有の有無に関わらず `&mut` に参照外し可能です。よって
389
+`*mut` は cell と同じように非変性です。
390
391
This is all well and good for the types the standard library provides, but
392
how is variance determined for type that *you* define? A struct, informally
0 commit comments