File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -159,10 +159,17 @@ where shorter-lived things are needed.
159
159
これは、短く生きるものが必要なときに、より長く生きるものを渡せるようにするために、
160
160
望ましいものなのです。
161
161
162
+ <!--
162
163
Similar reasoning applies to why it should be variant over T. It is reasonable
163
164
to be able to pass `&&'static str` where an `&&'a str` is expected. The
164
165
additional level of indirection does not change the desire to be able to pass
165
166
longer lived things where shorted lived things are expected.
167
+ -->
168
+
169
+ 似た理由が、なぜ ` &'a T ` が ` T ` において変性であるべきかについて適用できます。
170
+ ` &&'a str ` が求められている場所で ` &&'static str ` を渡せるようにすることが
171
+ 合理的であるからです。間接参照の段階が増えても、短く生きるものが求められている
172
+ 場合により長く生きるものを渡せるようにするという願いは変わりません。
166
173
167
174
However this logic doesn't apply to ` &mut ` . To see why ` &mut ` should
168
175
be invariant over T, consider the following code:
You can’t perform that action at this time.
0 commit comments