Skip to content

Commit ebed883

Browse files
committed
---
yaml --- r: 224437 b: refs/heads/beta c: c3c9d91 h: refs/heads/master i: 224435: 37391db v: v3
1 parent 5555d42 commit ebed883

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 74b398b93d647237acbc1c738e55e47ec13ea7b2
26+
refs/heads/beta: c3c9d9140530a9709449fd32e830bf88f567845c
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/lifetimes.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,15 +447,9 @@ The variance of `*const` and `*mut` is basically arbitrary as they're not at all
447447
type or memory safe, so their variance is determined in analogy to & and &mut
448448
respectively.
449449

450-
451-
452-
453-
## PhantomData
454-
455450
This is all well and good for the types the standard library provides, but
456-
how is variance determined for type that *you* define? A struct is, informally
457-
speaking, covariant over all its fields (and an enum over its variants). This
458-
basically means that it inherits the variance of its fields. If a struct `Foo`
451+
how is variance determined for type that *you* define? A struct informally
452+
speaking inherits the variance of its fields. If a struct `Foo`
459453
has a generic argument `A` that is used in a field `a`, then Foo's variance
460454
over `A` is exactly `a`'s variance. However this is complicated if `A` is used
461455
in multiple fields.
@@ -478,6 +472,17 @@ struct Foo<'a, 'b, A, B, C, D, E, F, G, H> {
478472
}
479473
```
480474

475+
476+
477+
478+
## Dropck
479+
480+
TODO
481+
482+
483+
## PhantomData
484+
485+
481486
However when working with unsafe code, we can often end up in a situation where
482487
types or lifetimes are logically associated with a struct, but not actually
483488
part of a field. This most commonly occurs with lifetimes. For instance, the `Iter`
@@ -511,6 +516,8 @@ pub struct Iter<'a, T: 'a> {
511516
}
512517
```
513518

519+
However PhantomData is also necessary to signal important information to
520+
*dropck*. (TODO)
514521

515522

516523

0 commit comments

Comments
 (0)