Skip to content

Commit 410a6fe

Browse files
committed
Translate a paragraph
1 parent 193ab27 commit 410a6fe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/subtyping.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,17 @@ where shorter-lived things are needed.
159159
これは、短く生きるものが必要なときに、より長く生きるものを渡せるようにするために、
160160
望ましいものなのです。
161161

162+
<!--
162163
Similar reasoning applies to why it should be variant over T. It is reasonable
163164
to be able to pass `&&'static str` where an `&&'a str` is expected. The
164165
additional level of indirection does not change the desire to be able to pass
165166
longer lived things where shorted lived things are expected.
167+
-->
168+
169+
似た理由が、なぜ `&'a T``T` において変性であるべきかについて適用できます。
170+
`&&'a str` が求められている場所で `&&'static str` を渡せるようにすることが
171+
合理的であるからです。間接参照の段階が増えても、短く生きるものが求められている
172+
場合により長く生きるものを渡せるようにするという願いは変わりません。
166173

167174
However this logic doesn't apply to `&mut`. To see why `&mut` should
168175
be invariant over T, consider the following code:

0 commit comments

Comments
 (0)