Skip to content

Commit 7aef56d

Browse files
committed
Call out possibility of invariant result
1 parent 9c0bcb5 commit 7aef56d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/core/src/marker/variance.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ phantom_lifetime! {
131131
///
132132
/// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance
133133
///
134+
/// Note: If `'a` is otherwise contravariant or invariant, the resulting type is invariant.
135+
///
134136
/// ## Layout
135137
///
136138
/// For all `'a`, the following are guaranteed:
@@ -146,6 +148,8 @@ phantom_lifetime! {
146148
///
147149
/// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance
148150
///
151+
/// Note: If `'a` is otherwise covariant or invariant, the resulting type is invariant.
152+
///
149153
/// ## Layout
150154
///
151155
/// For all `'a`, the following are guaranteed:
@@ -180,6 +184,8 @@ phantom_type! {
180184
///
181185
/// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance
182186
///
187+
/// Note: If `T` is otherwise contravariant or invariant, the resulting type is invariant.
188+
///
183189
/// ## Layout
184190
///
185191
/// For all `T`, the following are guaranteed:
@@ -196,6 +202,8 @@ phantom_type! {
196202
///
197203
/// [1]: https://doc.rust-lang.org/stable/reference/subtyping.html#variance
198204
///
205+
/// Note: If `T` is otherwise covariant or invariant, the resulting type is invariant.
206+
///
199207
/// ## Layout
200208
///
201209
/// For all `T`, the following are guaranteed:

0 commit comments

Comments
 (0)