Skip to content

Commit 1fd9506

Browse files
committed
---
yaml --- r: 236020 b: refs/heads/stable c: c3c9d91 h: refs/heads/master v: v3
1 parent 8e27be8 commit 1fd9506

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
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 74b398b93d647237acbc1c738e55e47ec13ea7b2
32+
refs/heads/stable: c3c9d9140530a9709449fd32e830bf88f567845c
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/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)