Skip to content

Commit 7943d8a

Browse files
committed
Translate a paragraph
Weakining what? Box or Vec?
1 parent 8b42449 commit 7943d8a

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
@@ -282,10 +282,16 @@ fn get_box<'a>(str: &'a str) -> Box<&'a str> {
282282
}
283283
```
284284

285+
<!--
285286
Weakening when you pass by-value is fine because there's no one else who
286287
"remembers" the old lifetime in the Box. The reason a variant `&mut` was
287288
trouble was because there's always someone else who remembers the original
288289
subtype: the actual owner.
290+
-->
291+
292+
Box の古いライフタイムを「記憶」するものが他に存在しないので、値渡しの際に
293+
弱くするのは問題ありません。変性の `&mut` が問題である理由は、元々の派生型を
294+
記憶している他のものが存在するからです: 実際の所有者です。
289295

290296
The invariance of the cell types can be seen as follows: `&` is like an `&mut`
291297
for a cell, because you can still store values in them through an `&`. Therefore

0 commit comments

Comments
 (0)