Skip to content

Commit aabe55e

Browse files
committed
Translate a paragraph
Not sure how to translate "smuggling", but it refers the lifetime trouble which is caused by &mut, so I translated the word to "こっそり導入する".
1 parent 35effec commit aabe55e

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
@@ -293,9 +293,15 @@ Box の古いライフタイムを「記憶」するものが他に存在しな
293293
弱くするのは問題ありません。変性の `&mut` が問題である理由は、元々の派生型を
294294
記憶している他のものが存在するからです: 実際の所有者です。
295295

296+
<!--
296297
The invariance of the cell types can be seen as follows: `&` is like an `&mut`
297298
for a cell, because you can still store values in them through an `&`. Therefore
298299
cells must be invariant to avoid lifetime smuggling.
300+
-->
301+
302+
cell 型の非変性は次のように見ることが出来ます。すなわち、 `&` は cell における `&mut` のようになります。
303+
なぜなら、 `&` を通して値を保存することも可能だからです。
304+
したがって、ライフタイムをこっそり導入することがないよう、 cell は非変性でなければなりません。
299305

300306
`Fn` is the most subtle case because it has mixed variance. To see why
301307
`Fn(T) -> U` should be invariant over T, consider the following function

0 commit comments

Comments
 (0)