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 35effec commit aabe55eCopy full SHA for aabe55e
src/subtyping.md
@@ -293,9 +293,15 @@ Box の古いライフタイムを「記憶」するものが他に存在しな
293
弱くするのは問題ありません。変性の `&mut` が問題である理由は、元々の派生型を
294
記憶している他のものが存在するからです: 実際の所有者です。
295
296
+<!--
297
The invariance of the cell types can be seen as follows: `&` is like an `&mut`
298
for a cell, because you can still store values in them through an `&`. Therefore
299
cells must be invariant to avoid lifetime smuggling.
300
+-->
301
+
302
+cell 型の非変性は次のように見ることが出来ます。すなわち、 `&` は cell における `&mut` のようになります。
303
+なぜなら、 `&` を通して値を保存することも可能だからです。
304
+したがって、ライフタイムをこっそり導入することがないよう、 cell は非変性でなければなりません。
305
306
`Fn` is the most subtle case because it has mixed variance. To see why
307
`Fn(T) -> U` should be invariant over T, consider the following function
0 commit comments