Skip to content

Commit 915f612

Browse files
committed
Translate a paragraph
1 parent dec4c8c commit 915f612

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
@@ -266,8 +266,14 @@ expected.
266266
変性であることで、イミュータブルで共有されるときに `Box``Vec` を弱くすることができます。
267267
よって `&Box<&'a str>` が期待される場合に `&Box<&'static str>` を渡すことができるのです。
268268

269+
<!--
269270
However what should happen when passing *by-value* is less obvious. It turns out
270271
that, yes, you can use subtyping when passing by-value. That is, this works:
272+
-->
273+
274+
しかし、**渡しが起きるとき、何が起きるかはあまり明らかではありません。
275+
ええ、値渡しされるときに派生型を使用することは可能だとわかります。
276+
つまり、このコードは動作します。
271277

272278
```rust
273279
fn get_box<'a>(str: &'a str) -> Box<&'a str> {

0 commit comments

Comments
 (0)