File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -163,13 +163,23 @@ live as long as it does actually were destroyed first.
163
163
Drop トレイトを実装することで、 Inspector が最後に任意のコードを実行するようにできます。
164
164
これは、 Inspector と同じだけ生きる型が、実際には先に破棄されると潜在的に認識できます。
165
165
166
+ <!--
166
167
Interestingly, only generic types need to worry about this. If they aren't
167
168
generic, then the only lifetimes they can harbor are `'static`, which will truly
168
169
live *forever*. This is why this problem is referred to as *sound generic drop*.
169
170
Sound generic drop is enforced by the *drop checker*. As of this writing, some
170
171
of the finer details of how the drop checker validates types is totally up in
171
172
the air. However The Big Rule is the subtlety that we have focused on this whole
172
173
section:
174
+ -->
175
+
176
+ 興味深いことに、ジェネリックな型だけがこれを気に掛ける必要があります。
177
+ もし型がジェネリックでなければ、型が隠蔽できる唯一のライフタイムは ` 'static ` です。
178
+ このライフタイムは本当に* 永遠に* 生き続けます。これが、この問題が* サウンドジェネリックドロップ* として
179
+ 呼ばれている理由です。サウンドジェネリックドロップは* ドロップチェッカ* によって実行されます。
180
+ Rust nomicon の英語版のこの章が書かれた時点で、ドロップチェッカがどのように型の有効性を
181
+ 確かめるかについてのより細かい部分については全く決まっていません。しかし、大まかな規則は、
182
+ この章全体で注目してきた僅かなものです。
173
183
174
184
** For a generic type to soundly implement drop, its generics arguments must
175
185
strictly outlive it.**
You can’t perform that action at this time.
0 commit comments