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