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 @@ -36,11 +36,18 @@ correct variance and drop checking.
3636参照しなければなりません。正しくこれを行なうことは、正しい変性とドロップチェックを
3737得るために必要です。
3838
39+ <!--
3940We do this using `PhantomData`, which is a special marker type. `PhantomData`
4041consumes no space, but simulates a field of the given type for the purpose of
4142static analysis. This was deemed to be less error-prone than explicitly telling
4243the type-system the kind of variance that you want, while also providing other
4344useful such as the information needed by drop check.
45+ -->
46+
47+ これを、 ` PhantomData ` という、特別なマーカー型を使って行ないます。
48+ ` PhantomData ` はスペースを消費しませんが、静的分析のために、与えられた型のフィールドを装います。
49+ これは、明白に型システムに、欲しい変種の種類を伝えるよりも、エラーが起こりにくいと思われていた一方、
50+ 例えばドロップチェッカが必要とする情報など、利便なものを提供していました。
4451
4552Iter logically contains a bunch of ` &'a T ` s, so this is exactly what we tell
4653the PhantomData to simulate:
You can’t perform that action at this time.
0 commit comments