File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,19 @@ struct Iter<'a, T: 'a> {
22
22
}
23
23
```
24
24
25
+ <!--
25
26
However because `'a` is unused within the struct's body, it's *unbounded*.
26
27
Because of the troubles this has historically caused, unbounded lifetimes and
27
28
types are *forbidden* in struct definitions. Therefore we must somehow refer
28
29
to these types in the body. Correctly doing this is necessary to have
29
30
correct variance and drop checking.
31
+ -->
32
+
33
+ しかし、 ` 'a ` は構造体の本体内では使用されないため、 ` 'a ` は* 無制限* のライフタイムとなります。
34
+ これが過去に引き起こしてきた問題のために、無制限のライフタイムと無制限の型は、
35
+ 構造体の定義内では* 禁じられています* 。それ故に、なんとかして本体内にあるこれらの型を
36
+ 参照しなければなりません。正しくこれを行なうことは、正しい変性とドロップチェックを
37
+ 得るために必要です。
30
38
31
39
We do this using ` PhantomData ` , which is a special marker type. ` PhantomData `
32
40
consumes no space, but simulates a field of the given type for the purpose of
You can’t perform that action at this time.
0 commit comments