diff --git a/src/test/ui/nll/issue-50716.stderr b/src/test/ui/nll/issue-50716.base.stderr similarity index 88% rename from src/test/ui/nll/issue-50716.stderr rename to src/test/ui/nll/issue-50716.base.stderr index be68d252f32..0dcf0648142 100644 --- a/src/test/ui/nll/issue-50716.stderr +++ b/src/test/ui/nll/issue-50716.base.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-50716.rs:14:9 + --> $DIR/issue-50716.rs:18:9 | LL | let _x = *s; | ^^ lifetime mismatch @@ -7,7 +7,7 @@ LL | let _x = *s; = note: expected type `<<&'a T as A>::X as Sized>` found type `<<&'static T as A>::X as Sized>` note: the lifetime `'a` as defined here... - --> $DIR/issue-50716.rs:9:8 + --> $DIR/issue-50716.rs:13:8 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) | ^^ diff --git a/src/test/ui/nll/issue-50716.nll.stderr b/src/test/ui/nll/issue-50716.nll.stderr index 38dd1b5f6fe..a8f4d694ba7 100644 --- a/src/test/ui/nll/issue-50716.nll.stderr +++ b/src/test/ui/nll/issue-50716.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-50716.rs:14:14 + --> $DIR/issue-50716.rs:18:14 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/issue-50716.rs b/src/test/ui/nll/issue-50716.rs index c2fc345fa2b..bd44d3eff9f 100644 --- a/src/test/ui/nll/issue-50716.rs +++ b/src/test/ui/nll/issue-50716.rs @@ -2,6 +2,10 @@ // Regression test for the issue #50716: NLL ignores lifetimes bounds // derived from `Sized` requirements +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait A { type X: ?Sized; } diff --git a/src/test/ui/nll/issue-52742.stderr b/src/test/ui/nll/issue-52742.base.stderr similarity index 85% rename from src/test/ui/nll/issue-52742.stderr rename to src/test/ui/nll/issue-52742.base.stderr index 67bac14b6e4..259f378f70b 100644 --- a/src/test/ui/nll/issue-52742.stderr +++ b/src/test/ui/nll/issue-52742.base.stderr @@ -1,16 +1,16 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-52742.rs:12:18 + --> $DIR/issue-52742.rs:17:18 | LL | self.y = b.z | ^^^ | note: ...the reference is valid for the lifetime `'_` as defined here... - --> $DIR/issue-52742.rs:10:10 + --> $DIR/issue-52742.rs:15:10 | LL | impl Foo<'_, '_> { | ^^ note: ...but the borrowed content is only valid for the anonymous lifetime defined here - --> $DIR/issue-52742.rs:11:31 + --> $DIR/issue-52742.rs:16:31 | LL | fn take_bar(&mut self, b: Bar<'_>) { | ^^^^^^^ diff --git a/src/test/ui/nll/issue-52742.nll.stderr b/src/test/ui/nll/issue-52742.nll.stderr index 0f6d6cd4fa1..6828418a78e 100644 --- a/src/test/ui/nll/issue-52742.nll.stderr +++ b/src/test/ui/nll/issue-52742.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-52742.rs:12:9 + --> $DIR/issue-52742.rs:17:9 | LL | fn take_bar(&mut self, b: Bar<'_>) { | --------- -- let's call this `'1` diff --git a/src/test/ui/nll/issue-52742.rs b/src/test/ui/nll/issue-52742.rs index d3e201b8ae8..5ec5770c5c2 100644 --- a/src/test/ui/nll/issue-52742.rs +++ b/src/test/ui/nll/issue-52742.rs @@ -1,3 +1,8 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + + struct Foo<'a, 'b> { x: &'a u32, y: &'b u32, diff --git a/src/test/ui/nll/issue-55394.stderr b/src/test/ui/nll/issue-55394.base.stderr similarity index 83% rename from src/test/ui/nll/issue-55394.stderr rename to src/test/ui/nll/issue-55394.base.stderr index 197f8dfa2ab..cc87954732c 100644 --- a/src/test/ui/nll/issue-55394.stderr +++ b/src/test/ui/nll/issue-55394.base.stderr @@ -1,26 +1,26 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements - --> $DIR/issue-55394.rs:9:9 + --> $DIR/issue-55394.rs:13:9 | LL | Foo { bar } | ^^^ | note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/issue-55394.rs:8:17 + --> $DIR/issue-55394.rs:12:17 | LL | fn new(bar: &mut Bar) -> Self { | ^^^^^^^^ note: ...so that reference does not outlive borrowed content - --> $DIR/issue-55394.rs:9:15 + --> $DIR/issue-55394.rs:13:15 | LL | Foo { bar } | ^^^ note: but, the lifetime must be valid for the lifetime `'_` as defined here... - --> $DIR/issue-55394.rs:7:10 + --> $DIR/issue-55394.rs:11:10 | LL | impl Foo<'_> { | ^^ note: ...so that the types are compatible - --> $DIR/issue-55394.rs:9:9 + --> $DIR/issue-55394.rs:13:9 | LL | Foo { bar } | ^^^^^^^^^^^ diff --git a/src/test/ui/nll/issue-55394.nll.stderr b/src/test/ui/nll/issue-55394.nll.stderr index 24b8c84b4a9..c166c458c50 100644 --- a/src/test/ui/nll/issue-55394.nll.stderr +++ b/src/test/ui/nll/issue-55394.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-55394.rs:9:9 + --> $DIR/issue-55394.rs:13:9 | LL | fn new(bar: &mut Bar) -> Self { | - ---- return type is Foo<'2> diff --git a/src/test/ui/nll/issue-55394.rs b/src/test/ui/nll/issue-55394.rs index f813d1c915c..9c4fcdf6419 100644 --- a/src/test/ui/nll/issue-55394.rs +++ b/src/test/ui/nll/issue-55394.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + struct Bar; struct Foo<'s> { diff --git a/src/test/ui/nll/issue-55401.stderr b/src/test/ui/nll/issue-55401.base.stderr similarity index 89% rename from src/test/ui/nll/issue-55401.stderr rename to src/test/ui/nll/issue-55401.base.stderr index 55c51d532e7..d4e9f2b4154 100644 --- a/src/test/ui/nll/issue-55401.stderr +++ b/src/test/ui/nll/issue-55401.base.stderr @@ -1,12 +1,12 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-55401.rs:3:5 + --> $DIR/issue-55401.rs:7:5 | LL | *y | ^^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/issue-55401.rs:1:47 + --> $DIR/issue-55401.rs:5:47 | LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { | ^^ diff --git a/src/test/ui/nll/issue-55401.nll.stderr b/src/test/ui/nll/issue-55401.nll.stderr index 4f797f26a1a..1318dc67657 100644 --- a/src/test/ui/nll/issue-55401.nll.stderr +++ b/src/test/ui/nll/issue-55401.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-55401.rs:3:5 + --> $DIR/issue-55401.rs:7:5 | LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/issue-55401.rs b/src/test/ui/nll/issue-55401.rs index fc45824e903..10f38c53dfd 100644 --- a/src/test/ui/nll/issue-55401.rs +++ b/src/test/ui/nll/issue-55401.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { let (ref y, _z): (&'a u32, u32) = (&22, 44); *y //~ ERROR diff --git a/src/test/ui/nll/lub-if.stderr b/src/test/ui/nll/lub-if.base.stderr similarity index 88% rename from src/test/ui/nll/lub-if.stderr rename to src/test/ui/nll/lub-if.base.stderr index a12c48582c7..ea9f5d4b2b1 100644 --- a/src/test/ui/nll/lub-if.stderr +++ b/src/test/ui/nll/lub-if.base.stderr @@ -1,25 +1,25 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-if.rs:28:9 + --> $DIR/lub-if.rs:32:9 | LL | s | ^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-if.rs:23:17 + --> $DIR/lub-if.rs:27:17 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | ^^ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-if.rs:35:9 + --> $DIR/lub-if.rs:41:9 | LL | s | ^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-if.rs:32:17 + --> $DIR/lub-if.rs:38:17 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | ^^ diff --git a/src/test/ui/nll/lub-if.nll.stderr b/src/test/ui/nll/lub-if.nll.stderr index 832688f5162..2fd6e69628d 100644 --- a/src/test/ui/nll/lub-if.nll.stderr +++ b/src/test/ui/nll/lub-if.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lub-if.rs:28:9 + --> $DIR/lub-if.rs:32:9 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | s | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/lub-if.rs:35:9 + --> $DIR/lub-if.rs:41:9 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/lub-if.rs b/src/test/ui/nll/lub-if.rs index 132b83810ea..18561d63935 100644 --- a/src/test/ui/nll/lub-if.rs +++ b/src/test/ui/nll/lub-if.rs @@ -2,6 +2,10 @@ // of the various arms, particularly in the case where regions are // involved. +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + pub fn opt_str0<'a>(maybestr: &'a Option) -> &'a str { if maybestr.is_none() { "(none)" @@ -25,14 +29,18 @@ pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { "(none)" } else { let s: &'a str = maybestr.as_ref().unwrap(); - s //~ ERROR E0312 + s + //[base]~^ ERROR E0312 + //[nll]~^^ ERROR lifetime may not live long enough } } pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { if maybestr.is_some() { let s: &'a str = maybestr.as_ref().unwrap(); - s //~ ERROR E0312 + s + //[base]~^ ERROR E0312 + //[nll]~^^ ERROR lifetime may not live long enough } else { "(none)" } diff --git a/src/test/ui/nll/lub-match.stderr b/src/test/ui/nll/lub-match.base.stderr similarity index 87% rename from src/test/ui/nll/lub-match.stderr rename to src/test/ui/nll/lub-match.base.stderr index 04d50f5ebf4..38952133160 100644 --- a/src/test/ui/nll/lub-match.stderr +++ b/src/test/ui/nll/lub-match.base.stderr @@ -1,25 +1,25 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-match.rs:30:13 + --> $DIR/lub-match.rs:34:13 | LL | s | ^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-match.rs:25:17 + --> $DIR/lub-match.rs:29:17 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | ^^ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/lub-match.rs:39:13 + --> $DIR/lub-match.rs:45:13 | LL | s | ^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/lub-match.rs:35:17 + --> $DIR/lub-match.rs:41:17 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | ^^ diff --git a/src/test/ui/nll/lub-match.nll.stderr b/src/test/ui/nll/lub-match.nll.stderr index 3a344a77d2c..c78d0cb641d 100644 --- a/src/test/ui/nll/lub-match.nll.stderr +++ b/src/test/ui/nll/lub-match.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lub-match.rs:30:13 + --> $DIR/lub-match.rs:34:13 | LL | pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | s | ^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/lub-match.rs:39:13 + --> $DIR/lub-match.rs:45:13 | LL | pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/lub-match.rs b/src/test/ui/nll/lub-match.rs index 1cd4a02a3ef..084d8b95f58 100644 --- a/src/test/ui/nll/lub-match.rs +++ b/src/test/ui/nll/lub-match.rs @@ -2,6 +2,10 @@ // of the various arms, particularly in the case where regions are // involved. +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + pub fn opt_str0<'a>(maybestr: &'a Option) -> &'a str { match *maybestr { Some(ref s) => { @@ -27,7 +31,9 @@ pub fn opt_str2<'a>(maybestr: &'a Option) -> &'static str { None => "(none)", Some(ref s) => { let s: &'a str = s; - s //~ ERROR E0312 + s + //[base]~^ ERROR E0312 + //[nll]~^^ ERROR lifetime may not live long enough } } } @@ -36,7 +42,9 @@ pub fn opt_str3<'a>(maybestr: &'a Option) -> &'static str { match *maybestr { Some(ref s) => { let s: &'a str = s; - s //~ ERROR E0312 + s + //[base]~^ ERROR E0312 + //[nll]~^^ ERROR lifetime may not live long enough } None => "(none)", } diff --git a/src/test/ui/nll/type-alias-free-regions.stderr b/src/test/ui/nll/type-alias-free-regions.base.stderr similarity index 79% rename from src/test/ui/nll/type-alias-free-regions.stderr rename to src/test/ui/nll/type-alias-free-regions.base.stderr index 71f5f8fb176..010535fec6d 100644 --- a/src/test/ui/nll/type-alias-free-regions.stderr +++ b/src/test/ui/nll/type-alias-free-regions.base.stderr @@ -1,28 +1,28 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements - --> $DIR/type-alias-free-regions.rs:17:9 + --> $DIR/type-alias-free-regions.rs:21:9 | LL | C { f: b } | ^ | note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/type-alias-free-regions.rs:16:24 + --> $DIR/type-alias-free-regions.rs:20:24 | LL | fn from_box(b: Box) -> Self { | ^ note: ...so that the expression is assignable - --> $DIR/type-alias-free-regions.rs:17:16 + --> $DIR/type-alias-free-regions.rs:21:16 | LL | C { f: b } | ^ = note: expected `Box>` found `Box>` note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/type-alias-free-regions.rs:15:6 + --> $DIR/type-alias-free-regions.rs:19:6 | LL | impl<'a> FromBox<'a> for C<'a> { | ^^ note: ...so that the types are compatible - --> $DIR/type-alias-free-regions.rs:17:9 + --> $DIR/type-alias-free-regions.rs:21:9 | LL | C { f: b } | ^^^^^^^^^^ @@ -30,30 +30,30 @@ LL | C { f: b } found `C<'_>` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/type-alias-free-regions.rs:27:16 + --> $DIR/type-alias-free-regions.rs:31:16 | LL | C { f: Box::new(b.0) } | ^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/type-alias-free-regions.rs:26:23 + --> $DIR/type-alias-free-regions.rs:30:23 | LL | fn from_tuple(b: (B,)) -> Self { | ^ note: ...so that the expression is assignable - --> $DIR/type-alias-free-regions.rs:27:25 + --> $DIR/type-alias-free-regions.rs:31:25 | LL | C { f: Box::new(b.0) } | ^^^ = note: expected `Box<&isize>` found `Box<&isize>` note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/type-alias-free-regions.rs:25:6 + --> $DIR/type-alias-free-regions.rs:29:6 | LL | impl<'a> FromTuple<'a> for C<'a> { | ^^ note: ...so that the types are compatible - --> $DIR/type-alias-free-regions.rs:27:9 + --> $DIR/type-alias-free-regions.rs:31:9 | LL | C { f: Box::new(b.0) } | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/nll/type-alias-free-regions.nll.stderr b/src/test/ui/nll/type-alias-free-regions.nll.stderr index 45fd5a2f1d6..6b746602d7f 100644 --- a/src/test/ui/nll/type-alias-free-regions.nll.stderr +++ b/src/test/ui/nll/type-alias-free-regions.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/type-alias-free-regions.rs:17:9 + --> $DIR/type-alias-free-regions.rs:21:9 | LL | impl<'a> FromBox<'a> for C<'a> { | -- lifetime `'a` defined here @@ -9,7 +9,7 @@ LL | C { f: b } | ^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/type-alias-free-regions.rs:27:9 + --> $DIR/type-alias-free-regions.rs:31:9 | LL | impl<'a> FromTuple<'a> for C<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/type-alias-free-regions.rs b/src/test/ui/nll/type-alias-free-regions.rs index fd5566f35d5..59ef0344937 100644 --- a/src/test/ui/nll/type-alias-free-regions.rs +++ b/src/test/ui/nll/type-alias-free-regions.rs @@ -1,6 +1,10 @@ // Test that we don't assume that type aliases have the same type parameters // as the type they alias and then panic when we see this. +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + type A<'a> = &'a isize; type B<'a> = Box>; diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr similarity index 90% rename from src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr index 4a6378b84f1..ba17994b437 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.base.stderr @@ -1,5 +1,5 @@ error[E0759]: `fn` parameter has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/constant-in-expr-inherent-1.rs:8:5 + --> $DIR/constant-in-expr-inherent-1.rs:12:5 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | ------- this data with lifetime `'a`... diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr index c39301588ac..0399d5f893d 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-inherent-1.rs:8:5 + --> $DIR/constant-in-expr-inherent-1.rs:12:5 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs index e3a8a5f58df..0bd316aa84c 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + struct Foo<'a> { x: &'a u32 } impl<'a> Foo<'a> { diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr similarity index 83% rename from src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr index d33c4584214..61efa879fc0 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.base.stderr @@ -1,12 +1,12 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/constant-in-expr-normalize.rs:18:5 + --> $DIR/constant-in-expr-normalize.rs:22:5 | LL | <() as Foo<'a>>::C | ^^^^^^^^^^^^^^^^^^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/constant-in-expr-normalize.rs:17:8 + --> $DIR/constant-in-expr-normalize.rs:21:8 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | ^^ diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr index 541a2cfaf29..4c1e6bee2aa 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-normalize.rs:18:5 + --> $DIR/constant-in-expr-normalize.rs:22:5 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs index b7095430d8b..262f0ae318f 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait Mirror { type Me; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr similarity index 82% rename from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr index 3ec3a2af8ca..93f7156e557 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.base.stderr @@ -1,12 +1,12 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/constant-in-expr-trait-item-1.rs:10:5 + --> $DIR/constant-in-expr-trait-item-1.rs:14:5 | LL | <() as Foo<'a>>::C | ^^^^^^^^^^^^^^^^^^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/constant-in-expr-trait-item-1.rs:9:8 + --> $DIR/constant-in-expr-trait-item-1.rs:13:8 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | ^^ diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr index ea0fcb6d634..990d0ae385f 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-1.rs:10:5 + --> $DIR/constant-in-expr-trait-item-1.rs:14:5 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs index e0400b2cc02..512edb501c4 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr similarity index 82% rename from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr index b36bc3bdd9c..f43ade38937 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.base.stderr @@ -1,12 +1,12 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/constant-in-expr-trait-item-2.rs:10:5 + --> $DIR/constant-in-expr-trait-item-2.rs:14:5 | LL | >::C | ^^^^^^^^^^^^^^^^^ | = note: ...the reference is valid for the static lifetime... note: ...but the borrowed content is only valid for the lifetime `'a` as defined here - --> $DIR/constant-in-expr-trait-item-2.rs:9:8 + --> $DIR/constant-in-expr-trait-item-2.rs:13:8 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | ^^ diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr index ff549f1d88b..8c0430f1e09 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-2.rs:10:5 + --> $DIR/constant-in-expr-trait-item-2.rs:14:5 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs index 73c4e577b05..b3dfbd984eb 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr similarity index 78% rename from src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr rename to src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr index 806492b71f4..e9393aa05ab 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.base.stderr @@ -1,16 +1,16 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements - --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + --> $DIR/constant-in-expr-trait-item-3.rs:14:5 | LL | T::C | ^^^^ | note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/constant-in-expr-trait-item-3.rs:9:8 + --> $DIR/constant-in-expr-trait-item-3.rs:13:8 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | ^^ note: ...so that the types are compatible - --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + --> $DIR/constant-in-expr-trait-item-3.rs:14:5 | LL | T::C | ^^^^ @@ -18,7 +18,7 @@ LL | T::C found `Foo<'a>` = note: but, the lifetime must be valid for the static lifetime... note: ...so that reference does not outlive borrowed content - --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + --> $DIR/constant-in-expr-trait-item-3.rs:14:5 | LL | T::C | ^^^^ diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr index 7f160d8e398..cbcaf042f05 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + --> $DIR/constant-in-expr-trait-item-3.rs:14:5 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs index 567e31ef936..6e78d94c2f6 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/rfc1623.stderr b/src/test/ui/rfc1623.base.stderr similarity index 93% rename from src/test/ui/rfc1623.stderr rename to src/test/ui/rfc1623.base.stderr index 16829b5caa0..6d389a1317a 100644 --- a/src/test/ui/rfc1623.stderr +++ b/src/test/ui/rfc1623.base.stderr @@ -1,5 +1,5 @@ error: implementation of `FnOnce` is not general enough - --> $DIR/rfc1623.rs:28:8 + --> $DIR/rfc1623.rs:36:8 | LL | f: &id, | ^^^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/rfc1623.nll.stderr b/src/test/ui/rfc1623.nll.stderr index 86513b6064d..f85b6ff8ff7 100644 --- a/src/test/ui/rfc1623.nll.stderr +++ b/src/test/ui/rfc1623.nll.stderr @@ -1,11 +1,12 @@ error[E0308]: mismatched types - --> $DIR/rfc1623.rs:25:35 + --> $DIR/rfc1623.rs:29:35 | LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { | ___________________________________^ -LL | | foo: &Foo { bools: &[false, true] }, -LL | | bar: &Bar { bools: &[true, true] }, -LL | | f: &id, +LL | | +LL | | +LL | | +... | LL | | LL | | }; | |_^ one type is more general than the other @@ -14,13 +15,14 @@ LL | | }; found type `Fn<(&Foo<'_>,)>` error[E0308]: mismatched types - --> $DIR/rfc1623.rs:25:35 + --> $DIR/rfc1623.rs:29:35 | LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { | ___________________________________^ -LL | | foo: &Foo { bools: &[false, true] }, -LL | | bar: &Bar { bools: &[true, true] }, -LL | | f: &id, +LL | | +LL | | +LL | | +... | LL | | LL | | }; | |_^ one type is more general than the other @@ -29,13 +31,14 @@ LL | | }; found type `Fn<(&Foo<'_>,)>` error: implementation of `FnOnce` is not general enough - --> $DIR/rfc1623.rs:25:35 + --> $DIR/rfc1623.rs:29:35 | LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { | ___________________________________^ -LL | | foo: &Foo { bools: &[false, true] }, -LL | | bar: &Bar { bools: &[true, true] }, -LL | | f: &id, +LL | | +LL | | +LL | | +... | LL | | LL | | }; | |_^ implementation of `FnOnce` is not general enough @@ -44,13 +47,14 @@ LL | | }; = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2` error: implementation of `FnOnce` is not general enough - --> $DIR/rfc1623.rs:25:35 + --> $DIR/rfc1623.rs:29:35 | LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { | ___________________________________^ -LL | | foo: &Foo { bools: &[false, true] }, -LL | | bar: &Bar { bools: &[true, true] }, -LL | | f: &id, +LL | | +LL | | +LL | | +... | LL | | LL | | }; | |_^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/rfc1623.rs b/src/test/ui/rfc1623.rs index 32e00f9cb76..0e9d2140324 100644 --- a/src/test/ui/rfc1623.rs +++ b/src/test/ui/rfc1623.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + #![allow(dead_code)] fn non_elidable<'a, 'b>(a: &'a u8, b: &'b u8) -> &'a u8 { @@ -23,10 +27,14 @@ fn id(t: T) -> T { } static SOME_STRUCT: &SomeStruct = &SomeStruct { + //[nll]~^ ERROR mismatched types + //[nll]~| ERROR mismatched types + //[nll]~| ERROR implementation of `FnOnce` is not general enough + //[nll]~| ERROR implementation of `FnOnce` is not general enough foo: &Foo { bools: &[false, true] }, bar: &Bar { bools: &[true, true] }, f: &id, - //~^ ERROR implementation of `FnOnce` is not general enough + //[base]~^ ERROR implementation of `FnOnce` is not general enough }; // very simple test for a 'static static with default lifetime