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 8b42449 commit 7943d8aCopy full SHA for 7943d8a
src/subtyping.md
@@ -282,10 +282,16 @@ fn get_box<'a>(str: &'a str) -> Box<&'a str> {
282
}
283
```
284
285
+<!--
286
Weakening when you pass by-value is fine because there's no one else who
287
"remembers" the old lifetime in the Box. The reason a variant `&mut` was
288
trouble was because there's always someone else who remembers the original
289
subtype: the actual owner.
290
+-->
291
+
292
+Box の古いライフタイムを「記憶」するものが他に存在しないので、値渡しの際に
293
+弱くするのは問題ありません。変性の `&mut` が問題である理由は、元々の派生型を
294
+記憶している他のものが存在するからです: 実際の所有者です。
295
296
The invariance of the cell types can be seen as follows: `&` is like an `&mut`
297
for a cell, because you can still store values in them through an `&`. Therefore
0 commit comments