]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / traits / trait-upcasting / type-checking-test-3.stderr
index 641e5c97c10fb3f427fb91bb444466bd2dea6185..5ad151b50924de38c2100687666d6615ca7b5df5 100644 (file)
@@ -1,33 +1,18 @@
-error[E0308]: mismatched types
-  --> $DIR/type-checking-test-3.rs:13:13
-   |
-LL |     let _ = x as &dyn Bar<'a>; // Error
-   |             ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Bar<'a>`
-              found trait object `dyn Bar<'static>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/type-checking-test-3.rs:12:16
+error: lifetime may not live long enough
+  --> $DIR/type-checking-test-3.rs:12:13
    |
 LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
-   |                ^^
-   = note: ...does not necessarily outlive the static lifetime
+   |                -- lifetime `'a` defined here
+LL |     let _ = x as &dyn Bar<'a>; // Error
+   |             ^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
-error[E0308]: mismatched types
-  --> $DIR/type-checking-test-3.rs:18:13
-   |
-LL |     let _ = x as &dyn Bar<'static>; // Error
-   |             ^ lifetime mismatch
-   |
-   = note: expected trait object `dyn Bar<'static>`
-              found trait object `dyn Bar<'a>`
-note: the lifetime `'a` as defined here...
-  --> $DIR/type-checking-test-3.rs:17:16
+error: lifetime may not live long enough
+  --> $DIR/type-checking-test-3.rs:17:13
    |
 LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) {
-   |                ^^
-   = note: ...does not necessarily outlive the static lifetime
+   |                -- lifetime `'a` defined here
+LL |     let _ = x as &dyn Bar<'static>; // Error
+   |             ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0308`.