Skip to content

Commit 94577d6

Browse files
committed
Translate a paragraph
1 parent cb1db6e commit 94577d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/subtyping.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,14 @@ them.
257257
値を保存できるからです! 可変参照はすべての型を非変性にします。そしてそれ故に
258258
短く生きる型をこっそり入れることを防ぐのです。
259259

260+
<!--
260261
Being variant allows `Box` and `Vec` to be weakened when shared
261262
immutably. So you can pass a `&Box<&'static str>` where a `&Box<&'a str>` is
262263
expected.
264+
-->
265+
266+
変性であることで、イミュータブルで共有されるときに `Box``Vec` を弱くすることができます。
267+
よって `&Box<&'a str>` が期待される場合に `&Box<&'static str>` を渡すことができるのです。
263268

264269
However what should happen when passing *by-value* is less obvious. It turns out
265270
that, yes, you can use subtyping when passing by-value. That is, this works:

0 commit comments

Comments
 (0)