]> git.lizzy.rs Git - rust.git/commitdiff
Fix tests
authorWesley Wiser <wwiser@gmail.com>
Fri, 7 Sep 2018 02:57:05 +0000 (22:57 -0400)
committerWesley Wiser <wwiser@gmail.com>
Fri, 7 Sep 2018 02:57:05 +0000 (22:57 -0400)
31 files changed:
src/test/mir-opt/nll/named-lifetimes-basic.rs
src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr
src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr
src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr
src/test/ui/nll/mir_check_cast_reify.rs
src/test/ui/nll/mir_check_cast_reify.stderr
src/test/ui/nll/mir_check_cast_unsafe_fn.rs
src/test/ui/nll/mir_check_cast_unsafe_fn.stderr
src/test/ui/nll/mir_check_cast_unsize.stderr
src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs
src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
src/test/ui/regions/regions-addr-of-self.nll.stderr
src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr
src/test/ui/regions/regions-close-object-into-object-2.nll.stderr
src/test/ui/regions/regions-close-object-into-object-4.nll.stderr
src/test/ui/regions/regions-static-bound.ll.nll.stderr
src/test/ui/regions/regions-static-bound.ll.stderr
src/test/ui/regions/regions-static-bound.nll.stderr
src/test/ui/regions/regions-static-bound.rs
src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr

index ffc5603bb1670d68173307baae418846d7eb86d6..c7fa7973a2d4d608d41778e5b1abb2850fb52a03 100644 (file)
@@ -34,7 +34,7 @@ fn main() {
 // | '_#4r    | Local    | ['_#4r]
 // |
 // | Inferred Region Values
-// | '_#0r    | U0 | {bb0[0..=1], '_#0r}
+// | '_#0r    | U0 | {bb0[0..=1], '_#0r, '_#1r, '_#2r, '_#3r, '_#4r}
 // | '_#1r    | U0 | {bb0[0..=1], '_#1r}
 // | '_#2r    | U0 | {bb0[0..=1], '_#2r}
 // | '_#3r    | U0 | {bb0[0..=1], '_#3r}
index b5cba945fb11ac6f6afbfbf16a7c2842b338c017..2f632fec17e9ebee2649979208611da3a2d77f80 100644 (file)
@@ -6,5 +6,15 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
 LL |    bar(foo, x) //[transmute]~ ERROR E0495
    |    ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+  --> $DIR/project-fn-ret-contravariant.rs:48:4
+   |
+LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
+   |        -- -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
+LL |    bar(foo, x) //[transmute]~ ERROR E0495
+   |    ^^^^^^^^^^^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
 
index bb1be40980dad093b86df0ab0cc5dbafb1b4b7d5..63e1f665005cc3cfac686e8d72b6f188e7e134b1 100644 (file)
@@ -7,5 +7,16 @@ LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
 LL |    bar(foo, x) //[transmute]~ ERROR E0495
    |    ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
 
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+  --> $DIR/project-fn-ret-invariant.rs:58:13
+   |
+LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
+   |        -- -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
+...
+LL |    bar(foo, x) //[transmute]~ ERROR E0495
+   |             ^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
 
index 2568eb2ed3fc154149c727b90d0396c3be01eacb..d75de81fc1c7fad951aa779bce692990d69a86fe 100644 (file)
@@ -4,7 +4,7 @@ error: unsatisfied lifetime constraints
 LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
    |                         - let's call the lifetime of this reference `'1`
 LL |         self.x.iter().map(|a| a.0)
-   |         ^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
+   |         ^^^^^^ cast requires that `'1` must outlive `'static`
 
 error: unsatisfied lifetime constraints
   --> $DIR/static-return-lifetime-infered.rs:21:9
@@ -12,7 +12,7 @@ error: unsatisfied lifetime constraints
 LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
    |                    -- lifetime `'a` defined here
 LL |         self.x.iter().map(|a| a.0)
-   |         ^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+   |         ^^^^^^ cast requires that `'a` must outlive `'static`
 
 error: aborting due to 2 previous errors
 
index e32a4395f88e1e317721e9833191cdd5cfbbe85b..9963954c9c2d46a868b9bff6e9fe3f113214dd6f 100644 (file)
@@ -43,7 +43,8 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
 #[rustc_regions]
 fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-        //~^ ERROR
+        //~^ ERROR borrowed data escapes outside of function
+        //~| ERROR unsatisfied lifetime constraints
 
         // Only works if 'x: 'y:
         demand_y(x, y, x.get())
index 0d4793563048410014301e94fa2aa0c12fe92d89..f50864d946be9bf152caee72ad951d6f6779f87c 100644 (file)
@@ -3,7 +3,8 @@ note: External requirements
    |
 LL |       establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
    |  _______________________________________________^
-LL | |         //~^ ERROR
+LL | |         //~^ ERROR borrowed data escapes outside of function
+LL | |         //~| ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(x, y, x.get())
@@ -22,8 +23,8 @@ note: No external requirements
    |
 LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-LL | |         //~^ ERROR
-LL | |
+LL | |         //~^ ERROR borrowed data escapes outside of function
+LL | |         //~| ERROR unsatisfied lifetime constraints
 ...  |
 LL | |     });
 LL | | }
@@ -37,12 +38,23 @@ error: borrowed data escapes outside of function
 LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
    |                     ------ `cell_a` is a reference that is only valid in the function body
 LL | /     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-LL | |         //~^ ERROR
+LL | |         //~^ ERROR borrowed data escapes outside of function
+LL | |         //~| ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(x, y, x.get())
 LL | |     });
    | |______^ `cell_a` escapes the function body here
 
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:29
+   |
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |           --  -- lifetime `'b` defined here
+   |           |
+   |           lifetime `'a` defined here
+LL |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
+   |                             ^^^^^^^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
 
index 0334f9ffd86fcc67872c26bb2312903e4745b755..d35b5c34a91811fefefc796833fad76fefcdabae 100644 (file)
@@ -46,7 +46,8 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
 #[rustc_regions]
 fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-        //~^ ERROR
+        //~^ ERROR borrowed data escapes outside of function
+        //~| ERROR unsatisfied lifetime constraints
         // Only works if 'x: 'y:
         demand_y(x, y, x.get())
     });
index 88743169fcbeeb1174c4e31fe56c004ff8c6d879..8a89320d10cad82684df5f9af2cef4c23f9c7fbf 100644 (file)
@@ -3,7 +3,8 @@ note: External requirements
    |
 LL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
    |  _______________________________________________^
-LL | |         //~^ ERROR
+LL | |         //~^ ERROR borrowed data escapes outside of function
+LL | |         //~| ERROR unsatisfied lifetime constraints
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(x, y, x.get())
 LL | |     });
@@ -21,9 +22,9 @@ note: No external requirements
    |
 LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR
-LL | |         // Only works if 'x: 'y:
-LL | |         demand_y(x, y, x.get())
+LL | |         //~^ ERROR borrowed data escapes outside of function
+LL | |         //~| ERROR unsatisfied lifetime constraints
+...  |
 LL | |     });
 LL | | }
    | |_^
@@ -36,11 +37,22 @@ error: borrowed data escapes outside of function
 LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
    |                     ------ `cell_a` is a reference that is only valid in the function body
 LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR
+LL | |         //~^ ERROR borrowed data escapes outside of function
+LL | |         //~| ERROR unsatisfied lifetime constraints
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(x, y, x.get())
 LL | |     });
    | |______^ `cell_a` escapes the function body here
 
-error: aborting due to previous error
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:29
+   |
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |           --  -- lifetime `'b` defined here
+   |           |
+   |           lifetime `'a` defined here
+LL |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
+   |                             ^^^^^^^ requires that `'a` must outlive `'b`
+
+error: aborting due to 2 previous errors
 
index fda9743fb6b9beeea309f181b46a5a38c4ad8355..d1976b40df41496b4454d97f4d7cdc19933347b1 100644 (file)
@@ -17,7 +17,7 @@ LL | |     });
                i32,
                extern "rust-call" fn((T,))
            ]
-   = note: number of external vids: 3
+   = note: number of external vids: 2
    = note: where T: '_#1r
 
 note: No external requirements
index 93f10b96c222097c9ea52ab7fad7551258cb8a25..332ec7a7da28cc570f78189fa3581666dceb3909 100644 (file)
@@ -44,8 +44,8 @@ fn bar<'a>(x: &'a u32) -> &'static u32 {
     // The MIR type checker must therefore relate `'?0` to `'?1` and `'?2`
     // as part of checking the `ReifyFnPointer`.
     let f: fn(_) -> _ = foo;
+    //~^ ERROR unsatisfied lifetime constraints
     f(x)
-    //~^ ERROR
 }
 
 fn main() {}
index fdb71b17287d9a8b57f243dd93310c4cf448cdbc..fa5c4100c91e48e54166b6d940f6b34aa9ca4fdd 100644 (file)
@@ -1,11 +1,11 @@
 error: unsatisfied lifetime constraints
-  --> $DIR/mir_check_cast_reify.rs:47:5
+  --> $DIR/mir_check_cast_reify.rs:46:25
    |
 LL | fn bar<'a>(x: &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
 ...
-LL |     f(x)
-   |     ^^^^ returning this value requires that `'a` must outlive `'static`
+LL |     let f: fn(_) -> _ = foo;
+   |                         ^^^ cast requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
index 71dcfc8886cc55ee3ad6ece3a7d130abe1ef3181..937ab31c3158646b8d82c08a31bd03c200fb0d91 100644 (file)
@@ -16,8 +16,8 @@ fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
     // Here the NLL checker must relate the types in `f` to the types
     // in `g`. These are related via the `UnsafeFnPointer` cast.
     let g: unsafe fn(_) -> _ = f;
+    //~^ ERROR unsatisfied lifetime constraints
     unsafe { g(input) }
-    //~^ ERROR
 }
 
 fn main() {}
index c14fb93a525e5bd4ef7de01384362c218561fbbb..82ff71c0551571d72933b4afccdac11586c6c448 100644 (file)
@@ -1,11 +1,11 @@
 error: unsatisfied lifetime constraints
-  --> $DIR/mir_check_cast_unsafe_fn.rs:19:14
+  --> $DIR/mir_check_cast_unsafe_fn.rs:18:32
    |
 LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
    |        -- lifetime `'a` defined here
 ...
-LL |     unsafe { g(input) }
-   |              ^^^^^^^^ returning this value requires that `'a` must outlive `'static`
+LL |     let g: unsafe fn(_) -> _ = f;
+   |                                ^ cast requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
index 526dfb6013386b222d020be4eb648aafe7100a97..77a2e8311f052c8c5e812692fb989e49cc75933e 100644 (file)
@@ -4,7 +4,7 @@ error: unsatisfied lifetime constraints
 LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
    |        -- lifetime `'a` defined here
 LL |     x
-   |     ^ returning this value requires that `'a` must outlive `'static`
+   |     ^ cast requires that `'a` must outlive `'static`
 
 error: aborting due to previous error
 
index 61e9794b76e2e88fccbbcc49d221283586acf12c..9b7fe466696f8b0f0ace1bf1401b29953ef0a80b 100644 (file)
@@ -10,7 +10,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
                i32,
                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where <T as std::iter::Iterator>::Item: '_#2r
 
 note: No external requirements
@@ -50,7 +50,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
                i32,
                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where <T as std::iter::Iterator>::Item: '_#2r
 
 note: No external requirements
@@ -82,7 +82,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
                i32,
                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where <T as std::iter::Iterator>::Item: '_#3r
 
 note: No external requirements
@@ -124,7 +124,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
                i32,
                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where <T as std::iter::Iterator>::Item: '_#3r
 
 note: No external requirements
index 918cf53cf36fa6c176b4dd104fc8d9c6246c2898..24f4bea1ba2f8cb99f112ec470fcbf4707833026 100644 (file)
@@ -10,7 +10,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where T: '_#2r
    = note: where '_#1r: '_#2r
 
@@ -63,7 +63,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where T: '_#3r
    = note: where '_#2r: '_#3r
 
@@ -117,7 +117,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where T: '_#3r
    = note: where '_#2r: '_#3r
 
@@ -171,7 +171,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where T: '_#3r
    = note: where '_#2r: '_#3r
 
index ab1ad42f2a97ee83c9b285e487d22cc8fac751b4..df4f619b7763b07321f639381db3aecfeeec9ad9 100644 (file)
@@ -10,7 +10,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where '_#1r: '_#2r
 
 note: No external requirements
@@ -54,7 +54,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where '_#2r: '_#3r
 
 note: No external requirements
@@ -99,7 +99,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where '_#2r: '_#3r
 
 note: No external requirements
@@ -144,7 +144,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where '_#2r: '_#3r
 
 note: No external requirements
@@ -177,7 +177,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where '_#1r: '_#2r
 
 note: No external requirements
index 72c1a631396be00d66611a10161594a483b571b3..b492525352442c6967e27037b7a4a8d17b5e6594 100644 (file)
@@ -46,7 +46,7 @@ fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
     T: Anything<'b, 'c>,
 {
     with_signature(cell, t, |cell, t| require(cell, t));
-    //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
+    //~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
 }
 
 #[rustc_regions]
@@ -56,7 +56,7 @@ fn no_relationships_early<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
     'a: 'a,
 {
     with_signature(cell, t, |cell, t| require(cell, t));
-    //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+    //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
 }
 
 #[rustc_regions]
@@ -76,7 +76,7 @@ fn projection_outlives<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
     // can do better here with a more involved verification step.
 
     with_signature(cell, t, |cell, t| require(cell, t));
-    //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+    //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
 }
 
 #[rustc_regions]
@@ -103,7 +103,7 @@ fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
     T: Anything<'b, 'b>,
 {
     with_signature(cell, t, |cell, t| require(cell, t));
-    //~^ ERROR
+    //~^ ERROR unsatisfied lifetime constraints
 }
 
 #[rustc_regions]
index 9cabd29b12dc4fa86250d62068af071472d81d4a..176e45ae09872fa2786dc56ad591b55315294eeb 100644 (file)
@@ -11,7 +11,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 6
+   = note: number of external vids: 5
    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r
 
 note: No external requirements
@@ -22,7 +22,7 @@ LL | | where
 LL | |     T: Anything<'b, 'c>,
 LL | | {
 LL | |     with_signature(cell, t, |cell, t| require(cell, t));
-LL | |     //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
+LL | |     //~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
 LL | | }
    | |_^
    |
@@ -32,13 +32,13 @@ LL | | }
                T
            ]
 
-error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
   --> $DIR/projection-two-region-trait-bound-closure.rs:48:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
+   = help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
 
 note: External requirements
   --> $DIR/projection-two-region-trait-bound-closure.rs:58:29
@@ -54,7 +54,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
            ]
-   = note: number of external vids: 6
+   = note: number of external vids: 5
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 note: No external requirements
@@ -65,7 +65,7 @@ LL | | where
 LL | |     T: Anything<'b, 'c>,
 LL | |     'a: 'a,
 ...  |
-LL | |     //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+LL | |     //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
 LL | | }
    | |_^
    |
@@ -76,13 +76,13 @@ LL | | }
                T
            ]
 
-error[E0309]: the associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
   --> $DIR/projection-two-region-trait-bound-closure.rs:58:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: consider adding an explicit lifetime bound `<T as Anything<'_#7r, '_#8r>>::AssocType: ReEarlyBound(0, 'a)`...
+   = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
 
 note: External requirements
   --> $DIR/projection-two-region-trait-bound-closure.rs:78:29
@@ -98,7 +98,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
            ]
-   = note: number of external vids: 6
+   = note: number of external vids: 5
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 note: No external requirements
@@ -109,7 +109,7 @@ LL | | where
 LL | |     T: Anything<'b, 'c>,
 LL | |     T::AssocType: 'a,
 ...  |
-LL | |     //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+LL | |     //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
 LL | | }
    | |_^
    |
@@ -120,13 +120,13 @@ LL | | }
                T
            ]
 
-error[E0309]: the associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
+error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
   --> $DIR/projection-two-region-trait-bound-closure.rs:78:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: consider adding an explicit lifetime bound `<T as Anything<'_#7r, '_#8r>>::AssocType: ReEarlyBound(0, 'a)`...
+   = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
 
 note: External requirements
   --> $DIR/projection-two-region-trait-bound-closure.rs:88:29
@@ -142,7 +142,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
            ]
-   = note: number of external vids: 6
+   = note: number of external vids: 5
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 note: No external requirements
@@ -178,7 +178,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
            ]
-   = note: number of external vids: 6
+   = note: number of external vids: 5
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 note: No external requirements
@@ -212,7 +212,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
 
 note: No external requirements
@@ -223,7 +223,7 @@ LL | | where
 LL | |     T: Anything<'b, 'b>,
 LL | | {
 LL | |     with_signature(cell, t, |cell, t| require(cell, t));
-LL | |     //~^ ERROR
+LL | |     //~^ ERROR unsatisfied lifetime constraints
 LL | | }
    | |_^
    |
@@ -256,7 +256,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#2r)>>::AssocType: '_#3r
 
 note: No external requirements
@@ -289,7 +289,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
 
 note: No external requirements
index 6050e627c71fdb813f3207e71da4a14fb9085294..1f5edf08957d6d64f7e3a1ab4aaa2afa67acdfa2 100644 (file)
@@ -9,7 +9,7 @@ LL |     twice(cell, value, |a, b| invoke(a, b));
                i16,
                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
            ]
-   = note: number of external vids: 3
+   = note: number of external vids: 2
    = note: where T: '_#1r
 
 note: No external requirements
@@ -36,7 +36,7 @@ LL |     twice(cell, value, |a, b| invoke(a, b));
                i16,
                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where T: '_#1r
 
 note: No external requirements
index 5215f6a52771198b0a8e6a859110bce9f37326f8..9e69ae051732c260db94b5e91372ad33fa74ec1a 100644 (file)
@@ -10,7 +10,7 @@ LL |     with_signature(x, |y| y)
                i32,
                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where T: '_#2r
 
 note: No external requirements
index 7129ec397de75c3d3476391b099e22bb44e756d3..1b9baf61305d99cc2514617b5fded3941f775f59 100644 (file)
@@ -16,7 +16,7 @@ LL | |     })
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T))
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where T: '_#1r
 
 note: No external requirements
@@ -69,7 +69,7 @@ LL | |     })
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
            ]
-   = note: number of external vids: 4
+   = note: number of external vids: 3
    = note: where T: '_#2r
 
 note: No external requirements
@@ -106,7 +106,7 @@ LL | |     })
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where T: '_#2r
 
 note: No external requirements
@@ -156,7 +156,7 @@ LL | |     })
                i32,
                extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
            ]
-   = note: number of external vids: 5
+   = note: number of external vids: 4
    = note: where T: '_#3r
 
 note: No external requirements
index 18578a1813445c8f3abb7ecb013fd13c53c7e2a7..a85822e48fa6a777ede73b7825d734a20cd2face 100644 (file)
@@ -1,10 +1,10 @@
 error: unsatisfied lifetime constraints
-  --> $DIR/regions-addr-of-self.rs:17:37
+  --> $DIR/regions-addr-of-self.rs:17:13
    |
 LL |     pub fn chase_cat(&mut self) {
    |                      - let's call the lifetime of this reference `'1`
 LL |         let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
-   |                                     ^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
+   |             ^ requires that `'1` must outlive `'static`
 
 error: aborting due to previous error
 
index d20cf12f4161a170c3d6772925c75f7a45b3f75e..9d6301af0fbea65c32c08dce7aff48d8437f63da 100644 (file)
@@ -1,10 +1,22 @@
 error: unsatisfied lifetime constraints
-  --> $DIR/regions-addr-of-upvar-self.rs:20:41
+  --> $DIR/regions-addr-of-upvar-self.rs:20:17
    |
 LL |         let _f = || {
    |                  -- lifetime `'1` represents this closure's body
 LL |             let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
-   |                                         ^^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
+   |                 ^ requires that `'1` must outlive `'static`
+   |
+   = note: closure implements `FnMut`, so references to captured variables can't escape the closure
+
+error: unsatisfied lifetime constraints
+  --> $DIR/regions-addr-of-upvar-self.rs:20:17
+   |
+LL |     pub fn chase_cat(&mut self) {
+   |                      --------- lifetime `'2` appears in the type of `self`
+LL |         let _f = || {
+   |                  -- lifetime `'1` represents this closure's body
+LL |             let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
+   |                 ^ requires that `'1` must outlive `'2`
    |
    = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
@@ -29,6 +41,6 @@ LL |     }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0597`.
index c073e3728e70571c7febf98ccfdf2e5160a6a311..e619431ddbbc35b9330883ef56c1a31e3f5d4ba5 100644 (file)
@@ -1,10 +1,10 @@
 error: unsatisfied lifetime constraints
-  --> $DIR/regions-close-object-into-object-2.rs:20:5
+  --> $DIR/regions-close-object-into-object-2.rs:20:11
    |
 LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> {
    |      -- lifetime `'a` defined here
 LL |     box B(&*v) as Box<X> //~ ERROR cannot infer
-   |     ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
+   |           ^^^ cast requires that `'a` must outlive `'static`
 
 error[E0597]: `*v` does not live long enough
   --> $DIR/regions-close-object-into-object-2.rs:20:11
index 4b47b951d77173fcaba3511fd4e900fb0a38fb40..1de1cdc9807f92feba3e0eb59ca66e4b91aa758e 100644 (file)
@@ -6,14 +6,6 @@ LL |     box B(&*v) as Box<X> //~ ERROR cannot infer
    |
    = help: consider adding an explicit lifetime bound `U: 'static`...
 
-error: unsatisfied lifetime constraints
-  --> $DIR/regions-close-object-into-object-4.rs:20:5
-   |
-LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
-   |      -- lifetime `'a` defined here
-LL |     box B(&*v) as Box<X> //~ ERROR cannot infer
-   |     ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
-
 error[E0310]: the parameter type `U` may not live long enough
   --> $DIR/regions-close-object-into-object-4.rs:20:9
    |
@@ -22,6 +14,14 @@ LL |     box B(&*v) as Box<X> //~ ERROR cannot infer
    |
    = help: consider adding an explicit lifetime bound `U: 'static`...
 
+error: unsatisfied lifetime constraints
+  --> $DIR/regions-close-object-into-object-4.rs:20:11
+   |
+LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
+   |      -- lifetime `'a` defined here
+LL |     box B(&*v) as Box<X> //~ ERROR cannot infer
+   |           ^^^ cast requires that `'a` must outlive `'static`
+
 error[E0597]: `*v` does not live long enough
   --> $DIR/regions-close-object-into-object-4.rs:20:11
    |
index 462fbe8ee19bd19585653f6400157c16c330b8c3..dc3a32cec6ac7b700d1eaa8821243451c253c61b 100644 (file)
@@ -15,7 +15,7 @@ LL |     static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of
    |     ^^^^^^^^^^^^^ lifetime `'static` required
 
 error[E0621]: explicit lifetime required in the type of `v`
-  --> $DIR/regions-static-bound.rs:26:5
+  --> $DIR/regions-static-bound.rs:27:5
    |
 LL | fn error(u: &(), v: &()) {
    |                     --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
@@ -23,6 +23,27 @@ LL | fn error(u: &(), v: &()) {
 LL |     static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
    |     ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
 
-error: aborting due to 3 previous errors
+error: unsatisfied lifetime constraints
+  --> $DIR/regions-static-bound.rs:24:5
+   |
+LL | fn error(u: &(), v: &()) {
+   |             -       - let's call the lifetime of this reference `'2`
+   |             |
+   |             let's call the lifetime of this reference `'1`
+LL |     static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: unsatisfied lifetime constraints
+  --> $DIR/regions-static-bound.rs:27:5
+   |
+LL | fn error(u: &(), v: &()) {
+   |             -       - let's call the lifetime of this reference `'1`
+   |             |
+   |             let's call the lifetime of this reference `'2`
+...
+LL |     static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
+   |     ^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0621`.
index cf291279210c9e6c829ee149170df50f65a22f35..16add00eb41e13c73f7e6b440a02d1799f21a7b1 100644 (file)
@@ -20,7 +20,7 @@ LL |     static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of
    |     ^^^^^^^^^ lifetime `'static` required
 
 error[E0621]: explicit lifetime required in the type of `v`
-  --> $DIR/regions-static-bound.rs:26:5
+  --> $DIR/regions-static-bound.rs:27:5
    |
 LL | fn error(u: &(), v: &()) {
    |                     --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
index 462fbe8ee19bd19585653f6400157c16c330b8c3..dc3a32cec6ac7b700d1eaa8821243451c253c61b 100644 (file)
@@ -15,7 +15,7 @@ LL |     static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of
    |     ^^^^^^^^^^^^^ lifetime `'static` required
 
 error[E0621]: explicit lifetime required in the type of `v`
-  --> $DIR/regions-static-bound.rs:26:5
+  --> $DIR/regions-static-bound.rs:27:5
    |
 LL | fn error(u: &(), v: &()) {
    |                     --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
@@ -23,6 +23,27 @@ LL | fn error(u: &(), v: &()) {
 LL |     static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
    |     ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
 
-error: aborting due to 3 previous errors
+error: unsatisfied lifetime constraints
+  --> $DIR/regions-static-bound.rs:24:5
+   |
+LL | fn error(u: &(), v: &()) {
+   |             -       - let's call the lifetime of this reference `'2`
+   |             |
+   |             let's call the lifetime of this reference `'1`
+LL |     static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: unsatisfied lifetime constraints
+  --> $DIR/regions-static-bound.rs:27:5
+   |
+LL | fn error(u: &(), v: &()) {
+   |             -       - let's call the lifetime of this reference `'1`
+   |             |
+   |             let's call the lifetime of this reference `'2`
+...
+LL |     static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
+   |     ^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0621`.
index c5dc6000e839c270172a53a56472e9a3cb3165a6..34baf5ffff0a73755431ed6404ecebddb22d47ae 100644 (file)
@@ -23,8 +23,10 @@ fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
 fn error(u: &(), v: &()) {
     static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
     //[nll]~^ ERROR explicit lifetime required in the type of `u` [E0621]
+    //[nll]~| ERROR unsatisfied lifetime constraints
     static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
     //[nll]~^ ERROR explicit lifetime required in the type of `v` [E0621]
+    //[nll]~| ERROR unsatisfied lifetime constraints
 }
 
 fn main() {}
index 7adb195b7d0225d68304b023191927b6d3b760e6..745c65c54df4a1497dd17a1234f76db758c526f9 100644 (file)
@@ -5,7 +5,7 @@ LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
    |                - let's call the lifetime of this reference `'1`
 LL |     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
-   |     ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
+   |     ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
 
 error: aborting due to previous error