diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-05-29 04:49:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-29 04:49:42 +0200 |
| commit | 1c46b4a4a9f5a3adfc2d6522caca435e78d2da33 (patch) | |
| tree | 84834821bb91725bb7021b5ad64b63c8c7ef4fea | |
| parent | 6bf4224f6873e870215acc34656619e8f9f86d32 (diff) | |
| parent | 7aef56d9b938a0df077c346007921497c092fdc9 (diff) | |
| download | rust-1c46b4a4a9f5a3adfc2d6522caca435e78d2da33.tar.gz rust-1c46b4a4a9f5a3adfc2d6522caca435e78d2da33.zip | |
Rollup merge of #141612 - jhpratt:phantom-docs, r=tgross35
Call out possibility of invariant result in variance markers ref https://github.com/rust-lang/rust/issues/135806#issuecomment-2766191535
| -rw-r--r-- | library/core/src/marker/variance.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/core/src/marker/variance.rs b/library/core/src/marker/variance.rs index 235f8a3bb79..f9638fea225 100644 --- a/library/core/src/marker/variance.rs +++ b/library/core/src/marker/variance.rs @@ -131,6 +131,8 @@ phantom_lifetime! { /// /// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance /// + /// Note: If `'a` is otherwise contravariant or invariant, the resulting type is invariant. + /// /// ## Layout /// /// For all `'a`, the following are guaranteed: @@ -146,6 +148,8 @@ phantom_lifetime! { /// /// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance /// + /// Note: If `'a` is otherwise covariant or invariant, the resulting type is invariant. + /// /// ## Layout /// /// For all `'a`, the following are guaranteed: @@ -180,6 +184,8 @@ phantom_type! { /// /// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance /// + /// Note: If `T` is otherwise contravariant or invariant, the resulting type is invariant. + /// /// ## Layout /// /// For all `T`, the following are guaranteed: @@ -196,6 +202,8 @@ phantom_type! { /// /// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance /// + /// Note: If `T` is otherwise covariant or invariant, the resulting type is invariant. + /// /// ## Layout /// /// For all `T`, the following are guaranteed: |
