]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/nll/type-check-pointer-coercions.stderr
Rollup merge of #84262 - camelid:sized-ice, r=estebank
[rust.git] / src / test / ui / nll / type-check-pointer-coercions.stderr
index 39fd98f7151a000eb5f8490a71a63ad2d38ba2ef..ccb3d33ac40647fe14f45cbfcf3a6fe4e85aa11f 100644 (file)
@@ -34,6 +34,9 @@ LL |     x
    |     ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
    |
    = help: consider adding the following bound: `'b: 'a`
+   = note: requirement occurs because of a mutable pointer to &i32
+   = note: mutable pointers are invariant over their type parameter
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
   --> $DIR/type-check-pointer-coercions.rs:13:5
@@ -47,6 +50,9 @@ LL |     x
    |     ^ returning this value requires that `'a` must outlive `'b`
    |
    = help: consider adding the following bound: `'a: 'b`
+   = note: requirement occurs because of a mutable pointer to &i32
+   = note: mutable pointers are invariant over their type parameter
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 help: `'b` and `'a` must be the same: replace one with the other