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
This commit is contained in:
Jacob Pratt
2025-05-29 04:49:42 +02:00
committed by GitHub
+8
View File
@@ -131,6 +131,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
///
/// [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 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
///
/// [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 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
///
/// [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 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
///
/// [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: