Skip to content

Commit 8fa6455

Browse files
committed
Translate a paragraph
1 parent e84ea94 commit 8fa6455

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/phantom-data.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,18 @@ correct variance and drop checking.
3636
参照しなければなりません。正しくこれを行なうことは、正しい変性とドロップチェックを
3737
得るために必要です。
3838

39+
<!--
3940
We do this using `PhantomData`, which is a special marker type. `PhantomData`
4041
consumes no space, but simulates a field of the given type for the purpose of
4142
static analysis. This was deemed to be less error-prone than explicitly telling
4243
the type-system the kind of variance that you want, while also providing other
4344
useful such as the information needed by drop check.
45+
-->
46+
47+
これを、 `PhantomData` という、特別なマーカー型を使って行ないます。
48+
`PhantomData` はスペースを消費しませんが、静的分析のために、与えられた型のフィールドを装います。
49+
これは、明白に型システムに、欲しい変種の種類を伝えるよりも、エラーが起こりにくいと思われていた一方、
50+
例えばドロップチェッカが必要とする情報など、利便なものを提供していました。
4451

4552
Iter logically contains a bunch of `&'a T`s, so this is exactly what we tell
4653
the PhantomData to simulate:

0 commit comments

Comments
 (0)