diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr similarity index 90% rename from src/test/ui/associated-type-bounds/implied-region-constraints.stderr rename to src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr index c338e38d28f..b4437069cd7 100644 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.stderr +++ b/src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/implied-region-constraints.rs:17:64 + --> $DIR/implied-region-constraints.rs:21:64 | LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>) | ------------- this type is declared with multiple lifetimes... @@ -8,7 +8,7 @@ LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; | ^^^^^ ...but data with one lifetime flows into the other here error[E0623]: lifetime mismatch - --> $DIR/implied-region-constraints.rs:38:72 + --> $DIR/implied-region-constraints.rs:43:72 | LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>) | -------------- this type is declared with multiple lifetimes... diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr b/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr index cddce8777ea..bf9fecf06a4 100644 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr +++ b/src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/implied-region-constraints.rs:17:56 + --> $DIR/implied-region-constraints.rs:21:56 | LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>) | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/implied-region-constraints.rs:38:64 + --> $DIR/implied-region-constraints.rs:43:64 | LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>) | -- -- lifetime `'b` defined here diff --git a/src/test/ui/associated-type-bounds/implied-region-constraints.rs b/src/test/ui/associated-type-bounds/implied-region-constraints.rs index ccad947f7f0..a41c7643430 100644 --- a/src/test/ui/associated-type-bounds/implied-region-constraints.rs +++ b/src/test/ui/associated-type-bounds/implied-region-constraints.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + #![feature(associated_type_bounds)] trait Tr1 { type As1; } @@ -15,7 +19,8 @@ where { // This should fail because `T: 'b` is not implied from `WF(St<'a, 'b, T>)`. let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; - //~^ ERROR lifetime mismatch [E0623] + //[base]~^ ERROR lifetime mismatch [E0623] + //[nll]~^^ ERROR lifetime may not live long enough } enum En7<'a, 'b, T> // `::As2: 'a` is implied. @@ -36,7 +41,8 @@ where En7::V0(x) => { // Also fails for the same reason as above: let _failure_proves_not_implied_outlives_region_b: &'b T = &x; - //~^ ERROR lifetime mismatch [E0623] + //[base]~^ ERROR lifetime mismatch [E0623] + //[nll]~^^ ERROR lifetime may not live long enough }, En7::V1(_) => {}, } diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr similarity index 87% rename from src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr rename to src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr index b25a7ab3dc6..c3efe16e251 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:16:52 + --> $DIR/expect-fn-supply-fn.rs:20:52 | LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^^^^^^^^^^^ lifetime mismatch @@ -7,18 +7,18 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); = note: expected fn pointer `fn(&u32)` found fn pointer `fn(&'x u32)` note: the anonymous lifetime #1 defined here... - --> $DIR/expect-fn-supply-fn.rs:16:48 + --> $DIR/expect-fn-supply-fn.rs:20:48 | LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^^^^^^^^^^^^^^^^^^^^^^ note: ...does not necessarily outlive the lifetime `'x` as defined here - --> $DIR/expect-fn-supply-fn.rs:13:36 + --> $DIR/expect-fn-supply-fn.rs:17:36 | LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | ^^ error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:16:52 + --> $DIR/expect-fn-supply-fn.rs:20:52 | LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^^^^^^^^^^^ lifetime mismatch @@ -26,18 +26,18 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); = note: expected fn pointer `fn(&u32)` found fn pointer `fn(&'x u32)` note: the lifetime `'x` as defined here... - --> $DIR/expect-fn-supply-fn.rs:13:36 + --> $DIR/expect-fn-supply-fn.rs:17:36 | LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | ^^ note: ...does not necessarily outlive the anonymous lifetime #1 defined here - --> $DIR/expect-fn-supply-fn.rs:16:48 + --> $DIR/expect-fn-supply-fn.rs:20:48 | LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:32:52 + --> $DIR/expect-fn-supply-fn.rs:38:52 | LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); | ^^^^^^^^ one type is more general than the other @@ -46,7 +46,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); found fn pointer `for<'r> fn(&'r u32)` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:39:53 + --> $DIR/expect-fn-supply-fn.rs:45:53 | LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); | ^^^^^^^^^^^ one type is more general than the other @@ -55,7 +55,7 @@ LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); found fn pointer `fn(&'x u32)` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:48:53 + --> $DIR/expect-fn-supply-fn.rs:54:53 | LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { | ^^^^^^^ one type is more general than the other diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr index 26f47eb684d..52e2898d2bb 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/expect-fn-supply-fn.rs:16:49 + --> $DIR/expect-fn-supply-fn.rs:20:49 | LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | -- lifetime `'x` defined here @@ -11,7 +11,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | requires that `'1` must outlive `'x` error: lifetime may not live long enough - --> $DIR/expect-fn-supply-fn.rs:16:49 + --> $DIR/expect-fn-supply-fn.rs:20:49 | LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | -- lifetime `'x` defined here @@ -20,7 +20,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^ requires that `'x` must outlive `'static` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:32:49 + --> $DIR/expect-fn-supply-fn.rs:38:49 | LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); | ^ one type is more general than the other @@ -29,7 +29,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); found fn pointer `fn(&u32)` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:39:50 + --> $DIR/expect-fn-supply-fn.rs:45:50 | LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); | ^ one type is more general than the other @@ -38,7 +38,7 @@ LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); found fn pointer `for<'r> fn(&'r u32)` error[E0308]: mismatched types - --> $DIR/expect-fn-supply-fn.rs:48:50 + --> $DIR/expect-fn-supply-fn.rs:54:50 | LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { | ^ one type is more general than the other diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs index c81c40c18b4..1715f56ff63 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn with_closure_expecting_fn_with_free_region(_: F) where F: for<'a> FnOnce(fn(&'a u32), &i32), @@ -14,8 +18,10 @@ fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { // Here, the type given for `'x` "obscures" a region from the // expected signature that is bound at closure level. with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); - //~^ ERROR mismatched types - //~| ERROR mismatched types + //[base]~^ ERROR mismatched types + //[base]~| ERROR mismatched types + //[nll]~^^^ ERROR lifetime may not live long enough + //[nll]~| ERROR lifetime may not live long enough } fn expect_free_supply_free_from_closure() { diff --git a/src/test/ui/error-codes/E0490.stderr b/src/test/ui/error-codes/E0490.base.stderr similarity index 85% rename from src/test/ui/error-codes/E0490.stderr rename to src/test/ui/error-codes/E0490.base.stderr index 96e99bd88a4..5cb62e19ccf 100644 --- a/src/test/ui/error-codes/E0490.stderr +++ b/src/test/ui/error-codes/E0490.base.stderr @@ -1,72 +1,72 @@ error[E0490]: a value of type `&'b ()` is borrowed for too long - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ | note: the type is valid for the lifetime `'a` as defined here - --> $DIR/E0490.rs:1:6 + --> $DIR/E0490.rs:5:6 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: but the borrow lasts for the lifetime `'b` as defined here - --> $DIR/E0490.rs:1:10 + --> $DIR/E0490.rs:5:10 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ | note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/E0490.rs:1:10 + --> $DIR/E0490.rs:5:10 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that the type `&'b ()` is not borrowed for too long - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/E0490.rs:1:6 + --> $DIR/E0490.rs:5:6 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that reference does not outlive borrowed content - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ | note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/E0490.rs:1:10 + --> $DIR/E0490.rs:5:10 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that the expression is assignable - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ = note: expected `&'a &()` found `&'a &'b ()` note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/E0490.rs:1:6 + --> $DIR/E0490.rs:5:6 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that the reference type `&'a &()` does not outlive the data it points at - --> $DIR/E0490.rs:2:12 + --> $DIR/E0490.rs:6:12 | LL | let x: &'a _ = &y; | ^^^^^ diff --git a/src/test/ui/error-codes/E0490.nll.stderr b/src/test/ui/error-codes/E0490.nll.stderr index a1c33bbcd5f..80bf076e2bd 100644 --- a/src/test/ui/error-codes/E0490.nll.stderr +++ b/src/test/ui/error-codes/E0490.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/E0490.rs:2:12 + --> $DIR/E0490.rs:6:12 | LL | fn f<'a, 'b>(y: &'b ()) { | -- -- lifetime `'b` defined here @@ -11,7 +11,7 @@ LL | let x: &'a _ = &y; = help: consider adding the following bound: `'b: 'a` error[E0597]: `y` does not live long enough - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | fn f<'a, 'b>(y: &'b ()) { | -- lifetime `'a` defined here diff --git a/src/test/ui/error-codes/E0490.rs b/src/test/ui/error-codes/E0490.rs index 36bafa2bd86..304548215dc 100644 --- a/src/test/ui/error-codes/E0490.rs +++ b/src/test/ui/error-codes/E0490.rs @@ -1,8 +1,14 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn f<'a, 'b>(y: &'b ()) { let x: &'a _ = &y; - //~^ E0490 - //~| E0495 - //~| E0495 + //[base]~^ E0490 + //[base]~| E0495 + //[base]~| E0495 + //[nll]~^^^^ lifetime may not live long enough + //[nll]~| E0597 } fn main() {} diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr similarity index 88% rename from src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr rename to src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr index 93ab5dceee9..6f0ea1af057 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/implied-bounds-unnorm-associated-type.rs:14:5 + --> $DIR/implied-bounds-unnorm-associated-type.rs:18:5 | LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { | ------- ---------- diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr index 8096f08385c..a7a91f3e685 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/implied-bounds-unnorm-associated-type.rs:14:5 + --> $DIR/implied-bounds-unnorm-associated-type.rs:18:5 | LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs index 2e5ac7d7398..30bd042009b 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + // check-fail // See issue #91068. Types in the substs of an associated type can't be implied // to be WF, since they don't actually have to be constructed. @@ -11,7 +15,9 @@ impl Trait for T { } fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { - s //~ ERROR lifetime mismatch [E0623] + s + //[base]~^ ERROR lifetime mismatch [E0623] + //[nll]~^^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr similarity index 90% rename from src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr rename to src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr index 2307572cc3f..a01560e70e3 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr @@ -1,5 +1,5 @@ error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/dyn-trait.rs:20:16 + --> $DIR/dyn-trait.rs:24:16 | LL | fn with_dyn_debug_static<'a>(x: Box) { | ------------------- this data with lifetime `'a`... @@ -7,7 +7,7 @@ LL | static_val(x); | ^ ...is used here... | note: ...and is required to live as long as `'static` here - --> $DIR/dyn-trait.rs:20:5 + --> $DIR/dyn-trait.rs:24:5 | LL | static_val(x); | ^^^^^^^^^^ diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr index 88c260b18cb..762698c4fc1 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of function - --> $DIR/dyn-trait.rs:20:5 + --> $DIR/dyn-trait.rs:24:5 | LL | fn with_dyn_debug_static<'a>(x: Box) { | -- - `x` is a reference that is only valid in the function body diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs index 89210fdf137..a103034a537 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + // Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a, // 'b> MyTrait<'a> for &'b i32`. @@ -17,7 +21,9 @@ fn static_val(_: T) { } fn with_dyn_debug_static<'a>(x: Box) { - static_val(x); //~ ERROR E0759 + static_val(x); + //[base]~^ ERROR E0759 + //[nll]~^^ ERROR borrowed data escapes outside of function } fn not_static_val(_: T) { diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.base.stderr similarity index 87% rename from src/test/ui/kindck/kindck-impl-type-params.stderr rename to src/test/ui/kindck/kindck-impl-type-params.base.stderr index f227ac2477e..2fa8993b71a 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params.base.stderr @@ -1,11 +1,11 @@ error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:18:13 + --> $DIR/kindck-impl-type-params.rs:20:13 | LL | let a = &t as &dyn Gettable; | ^^ `T` cannot be sent between threads safely | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -16,13 +16,13 @@ LL | fn f(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:18:13 + --> $DIR/kindck-impl-type-params.rs:20:13 | LL | let a = &t as &dyn Gettable; | ^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -33,13 +33,13 @@ LL | fn f(val: T) { | +++++++++++++++++++ error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:25:31 + --> $DIR/kindck-impl-type-params.rs:27:31 | LL | let a: &dyn Gettable = &t; | ^^ `T` cannot be sent between threads safely | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -50,13 +50,13 @@ LL | fn g(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:25:31 + --> $DIR/kindck-impl-type-params.rs:27:31 | LL | let a: &dyn Gettable = &t; | ^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -67,7 +67,7 @@ LL | fn g(val: T) { | +++++++++++++++++++ error[E0477]: the type `&'a isize` does not fulfill the required lifetime - --> $DIR/kindck-impl-type-params.rs:32:13 + --> $DIR/kindck-impl-type-params.rs:34:13 | LL | let a = &t as &dyn Gettable<&'a isize>; | ^^ @@ -75,28 +75,28 @@ LL | let a = &t as &dyn Gettable<&'a isize>; = note: type must satisfy the static lifetime error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:38:13 + --> $DIR/kindck-impl-type-params.rs:40:13 | LL | let a = t as Box>; | ^ the trait `Copy` is not implemented for `String` | = help: the trait `Gettable` is implemented for `S` note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` error[E0277]: the trait bound `Foo: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:46:37 + --> $DIR/kindck-impl-type-params.rs:48:37 | LL | let a: Box> = t; | ^ the trait `Copy` is not implemented for `Foo` | = help: the trait `Gettable` is implemented for `S` note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ diff --git a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr b/src/test/ui/kindck/kindck-impl-type-params.nll.stderr index 1772d353fe4..c6f5e17fb69 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params.nll.stderr @@ -1,11 +1,11 @@ error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:18:13 + --> $DIR/kindck-impl-type-params.rs:20:13 | LL | let a = &t as &dyn Gettable; | ^^ `T` cannot be sent between threads safely | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -16,13 +16,13 @@ LL | fn f(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:18:13 + --> $DIR/kindck-impl-type-params.rs:20:13 | LL | let a = &t as &dyn Gettable; | ^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -33,13 +33,13 @@ LL | fn f(val: T) { | +++++++++++++++++++ error[E0277]: `T` cannot be sent between threads safely - --> $DIR/kindck-impl-type-params.rs:25:31 + --> $DIR/kindck-impl-type-params.rs:27:31 | LL | let a: &dyn Gettable = &t; | ^^ `T` cannot be sent between threads safely | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -50,13 +50,13 @@ LL | fn g(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:25:31 + --> $DIR/kindck-impl-type-params.rs:27:31 | LL | let a: &dyn Gettable = &t; | ^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ @@ -67,28 +67,28 @@ LL | fn g(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:38:13 + --> $DIR/kindck-impl-type-params.rs:40:13 | LL | let a = t as Box>; | ^ the trait `Copy` is not implemented for `String` | = help: the trait `Gettable` is implemented for `S` note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ = note: required for the cast to the object type `dyn Gettable` error[E0277]: the trait bound `Foo: Copy` is not satisfied - --> $DIR/kindck-impl-type-params.rs:46:37 + --> $DIR/kindck-impl-type-params.rs:48:37 | LL | let a: Box> = t; | ^ the trait `Copy` is not implemented for `Foo` | = help: the trait `Gettable` is implemented for `S` note: required because of the requirements on the impl of `Gettable` for `S` - --> $DIR/kindck-impl-type-params.rs:14:32 + --> $DIR/kindck-impl-type-params.rs:16:32 | LL | impl Gettable for S {} | ^^^^^^^^^^^ ^^^^ diff --git a/src/test/ui/kindck/kindck-impl-type-params.rs b/src/test/ui/kindck/kindck-impl-type-params.rs index 5622d65cb17..1a563872585 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.rs +++ b/src/test/ui/kindck/kindck-impl-type-params.rs @@ -1,8 +1,10 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + // Issue #14061: tests the interaction between generic implementation // parameter bounds and trait objects. - - use std::marker; struct S(marker::PhantomData); @@ -30,7 +32,7 @@ fn g(val: T) { fn foo<'a>() { let t: S<&'a isize> = S(marker::PhantomData); let a = &t as &dyn Gettable<&'a isize>; - //~^ ERROR does not fulfill + //[base]~^ ERROR does not fulfill } fn foo2<'a>() { diff --git a/src/test/ui/kindck/kindck-send-object1.stderr b/src/test/ui/kindck/kindck-send-object1.base.stderr similarity index 89% rename from src/test/ui/kindck/kindck-send-object1.stderr rename to src/test/ui/kindck/kindck-send-object1.base.stderr index 58397b7f597..5976c7119c7 100644 --- a/src/test/ui/kindck/kindck-send-object1.stderr +++ b/src/test/ui/kindck/kindck-send-object1.base.stderr @@ -1,5 +1,5 @@ error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely - --> $DIR/kindck-send-object1.rs:10:5 + --> $DIR/kindck-send-object1.rs:14:5 | LL | assert_send::<&'a dyn Dummy>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely @@ -7,25 +7,25 @@ LL | assert_send::<&'a dyn Dummy>(); = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)` = note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)` note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:5:18 + --> $DIR/kindck-send-object1.rs:9:18 | LL | fn assert_send() { } | ^^^^ required by this bound in `assert_send` error[E0477]: the type `&'a (dyn Dummy + Sync + 'a)` does not fulfill the required lifetime - --> $DIR/kindck-send-object1.rs:14:5 + --> $DIR/kindck-send-object1.rs:18:5 | LL | assert_send::<&'a (dyn Dummy + Sync)>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: type must satisfy the static lifetime as required by this binding - --> $DIR/kindck-send-object1.rs:5:23 + --> $DIR/kindck-send-object1.rs:9:23 | LL | fn assert_send() { } | ^^^^^^^ error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely - --> $DIR/kindck-send-object1.rs:29:5 + --> $DIR/kindck-send-object1.rs:33:5 | LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely @@ -34,7 +34,7 @@ LL | assert_send::>(); = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>` = note: required because it appears within the type `Box<(dyn Dummy + 'a)>` note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:5:18 + --> $DIR/kindck-send-object1.rs:9:18 | LL | fn assert_send() { } | ^^^^ required by this bound in `assert_send` diff --git a/src/test/ui/kindck/kindck-send-object1.nll.stderr b/src/test/ui/kindck/kindck-send-object1.nll.stderr index fa190449b64..f34374dcc54 100644 --- a/src/test/ui/kindck/kindck-send-object1.nll.stderr +++ b/src/test/ui/kindck/kindck-send-object1.nll.stderr @@ -1,5 +1,5 @@ error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely - --> $DIR/kindck-send-object1.rs:10:5 + --> $DIR/kindck-send-object1.rs:14:5 | LL | assert_send::<&'a dyn Dummy>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely @@ -7,13 +7,13 @@ LL | assert_send::<&'a dyn Dummy>(); = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)` = note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)` note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:5:18 + --> $DIR/kindck-send-object1.rs:9:18 | LL | fn assert_send() { } | ^^^^ required by this bound in `assert_send` error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely - --> $DIR/kindck-send-object1.rs:29:5 + --> $DIR/kindck-send-object1.rs:33:5 | LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely @@ -22,7 +22,7 @@ LL | assert_send::>(); = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>` = note: required because it appears within the type `Box<(dyn Dummy + 'a)>` note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:5:18 + --> $DIR/kindck-send-object1.rs:9:18 | LL | fn assert_send() { } | ^^^^ required by this bound in `assert_send` diff --git a/src/test/ui/kindck/kindck-send-object1.rs b/src/test/ui/kindck/kindck-send-object1.rs index 0e198395c26..26894dc2ce4 100644 --- a/src/test/ui/kindck/kindck-send-object1.rs +++ b/src/test/ui/kindck/kindck-send-object1.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + // Test which object types are considered sendable. This test // is broken into two parts because some errors occur in distinct // phases in the compiler. See kindck-send-object2.rs as well! @@ -12,7 +16,7 @@ fn test51<'a>() { } fn test52<'a>() { assert_send::<&'a (dyn Dummy + Sync)>(); - //~^ ERROR does not fulfill the required lifetime + //[base]~^ ERROR does not fulfill the required lifetime } // ...unless they are properly bounded diff --git a/src/test/ui/lub-glb/old-lub-glb-object.stderr b/src/test/ui/lub-glb/old-lub-glb-object.base.stderr similarity index 89% rename from src/test/ui/lub-glb/old-lub-glb-object.stderr rename to src/test/ui/lub-glb/old-lub-glb-object.base.stderr index 6eabe5eaeee..da98483906f 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-object.base.stderr @@ -1,11 +1,13 @@ error[E0308]: mismatched types - --> $DIR/old-lub-glb-object.rs:7:13 + --> $DIR/old-lub-glb-object.rs:11:13 | LL | let z = match 22 { | _____________^ LL | | LL | | 0 => x, LL | | _ => y, +LL | | +LL | | LL | | }; | |_____^ one type is more general than the other | diff --git a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr b/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr index 355f0754ab1..8f19133be44 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/old-lub-glb-object.rs:10:14 + --> $DIR/old-lub-glb-object.rs:14:14 | LL | _ => y, | ^ one type is more general than the other @@ -8,7 +8,7 @@ LL | _ => y, found trait object `dyn for<'a> Foo<&'a u8, &'a u8>` error[E0308]: mismatched types - --> $DIR/old-lub-glb-object.rs:10:14 + --> $DIR/old-lub-glb-object.rs:14:14 | LL | _ => y, | ^ one type is more general than the other diff --git a/src/test/ui/lub-glb/old-lub-glb-object.rs b/src/test/ui/lub-glb/old-lub-glb-object.rs index 39d351c2355..b4dbb0caae6 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.rs +++ b/src/test/ui/lub-glb/old-lub-glb-object.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + // Test that we give a note when the old LUB/GLB algorithm would have // succeeded but the new code (which is stricter) gives an error. @@ -5,9 +9,11 @@ trait Foo {} fn foo(x: &dyn for<'a, 'b> Foo<&'a u8, &'b u8>, y: &dyn for<'a> Foo<&'a u8, &'a u8>) { let z = match 22 { - //~^ ERROR mismatched types + //[base]~^ ERROR mismatched types 0 => x, _ => y, + //[nll]~^ ERROR mismatched types + //[nll]~| ERROR mismatched types }; } diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr similarity index 86% rename from src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr rename to src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr index f34ac35c757..dfc6ef567f0 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.base.stderr @@ -1,5 +1,5 @@ error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:3:14 + --> $DIR/closure-arg-type-mismatch.rs:7:14 | LL | a.iter().map(|_: (u32, u32)| 45); | ^^^ ------------------ found signature of `fn((u32, u32)) -> _` @@ -13,7 +13,7 @@ LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:4:14 + --> $DIR/closure-arg-type-mismatch.rs:8:14 | LL | a.iter().map(|_: &(u16, u16)| 45); | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _` @@ -27,7 +27,7 @@ LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:5:14 + --> $DIR/closure-arg-type-mismatch.rs:9:14 | LL | a.iter().map(|_: (u16, u16)| 45); | ^^^ ------------------ found signature of `fn((u16, u16)) -> _` @@ -41,7 +41,7 @@ LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0308]: mismatched types - --> $DIR/closure-arg-type-mismatch.rs:10:5 + --> $DIR/closure-arg-type-mismatch.rs:14:5 | LL | baz(f); | ^^^ lifetime mismatch @@ -49,18 +49,18 @@ LL | baz(f); = note: expected type `for<'r> Fn<(*mut &'r u32,)>` found type `Fn<(*mut &'a u32,)>` note: the required lifetime does not necessarily outlive the lifetime `'a` as defined here - --> $DIR/closure-arg-type-mismatch.rs:9:10 + --> $DIR/closure-arg-type-mismatch.rs:13:10 | LL | fn _test<'a>(f: fn(*mut &'a u32)) { | ^^ note: the lifetime requirement is introduced here - --> $DIR/closure-arg-type-mismatch.rs:8:11 + --> $DIR/closure-arg-type-mismatch.rs:12:11 | LL | fn baz(_: F) {} | ^^^^^^^^^^^^^ error: implementation of `FnOnce` is not general enough - --> $DIR/closure-arg-type-mismatch.rs:10:5 + --> $DIR/closure-arg-type-mismatch.rs:14:5 | LL | baz(f); | ^^^ implementation of `FnOnce` is not general enough @@ -69,7 +69,7 @@ LL | baz(f); = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>` error[E0308]: mismatched types - --> $DIR/closure-arg-type-mismatch.rs:10:5 + --> $DIR/closure-arg-type-mismatch.rs:14:5 | LL | baz(f); | ^^^ lifetime mismatch @@ -77,18 +77,18 @@ LL | baz(f); = note: expected type `for<'r> Fn<(*mut &'r u32,)>` found type `Fn<(*mut &'a u32,)>` note: the lifetime `'a` as defined here doesn't meet the lifetime requirements - --> $DIR/closure-arg-type-mismatch.rs:9:10 + --> $DIR/closure-arg-type-mismatch.rs:13:10 | LL | fn _test<'a>(f: fn(*mut &'a u32)) { | ^^ note: the lifetime requirement is introduced here - --> $DIR/closure-arg-type-mismatch.rs:8:11 + --> $DIR/closure-arg-type-mismatch.rs:12:11 | LL | fn baz(_: F) {} | ^^^^^^^^^^^^^ error: implementation of `FnOnce` is not general enough - --> $DIR/closure-arg-type-mismatch.rs:10:5 + --> $DIR/closure-arg-type-mismatch.rs:14:5 | LL | baz(f); | ^^^ implementation of `FnOnce` is not general enough diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr index 1f46229cb5a..314000e8848 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr @@ -1,5 +1,5 @@ error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:3:14 + --> $DIR/closure-arg-type-mismatch.rs:7:14 | LL | a.iter().map(|_: (u32, u32)| 45); | ^^^ ------------------ found signature of `fn((u32, u32)) -> _` @@ -13,7 +13,7 @@ LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:4:14 + --> $DIR/closure-arg-type-mismatch.rs:8:14 | LL | a.iter().map(|_: &(u16, u16)| 45); | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _` @@ -27,7 +27,7 @@ LL | F: FnMut(Self::Item) -> B, | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments - --> $DIR/closure-arg-type-mismatch.rs:5:14 + --> $DIR/closure-arg-type-mismatch.rs:9:14 | LL | a.iter().map(|_: (u16, u16)| 45); | ^^^ ------------------ found signature of `fn((u16, u16)) -> _` diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs index 2d485d14a8d..da8011cc92b 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn main() { let a = [(1u32, 2u32)]; a.iter().map(|_: (u32, u32)| 45); //~ ERROR type mismatch @@ -8,8 +12,8 @@ fn main() { fn baz(_: F) {} fn _test<'a>(f: fn(*mut &'a u32)) { baz(f); - //~^ ERROR implementation of `FnOnce` is not general enough - //~| ERROR implementation of `FnOnce` is not general enough - //~| ERROR mismatched types - //~| ERROR mismatched types + //[base]~^ ERROR implementation of `FnOnce` is not general enough + //[base]~| ERROR implementation of `FnOnce` is not general enough + //[base]~| ERROR mismatched types + //[base]~| ERROR mismatched types } diff --git a/src/test/ui/mismatched_types/closure-mismatch.stderr b/src/test/ui/mismatched_types/closure-mismatch.base.stderr similarity index 82% rename from src/test/ui/mismatched_types/closure-mismatch.stderr rename to src/test/ui/mismatched_types/closure-mismatch.base.stderr index c41bece3c19..7c81ebdf490 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-mismatch.base.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/closure-mismatch.rs:8:5 + --> $DIR/closure-mismatch.rs:12:5 | LL | baz(|_| ()); | ^^^ lifetime mismatch @@ -7,12 +7,12 @@ LL | baz(|_| ()); = note: expected type `for<'r> Fn<(&'r (),)>` found type `Fn<(&(),)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/closure-mismatch.rs:8:9 + --> $DIR/closure-mismatch.rs:12:9 | LL | baz(|_| ()); | ^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/closure-mismatch.rs:5:11 + --> $DIR/closure-mismatch.rs:9:11 | LL | fn baz(_: T) {} | ^^^ diff --git a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr b/src/test/ui/mismatched_types/closure-mismatch.nll.stderr index bd36fab9288..9508fc8a9be 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr +++ b/src/test/ui/mismatched_types/closure-mismatch.nll.stderr @@ -1,5 +1,5 @@ error: implementation of `FnOnce` is not general enough - --> $DIR/closure-mismatch.rs:8:5 + --> $DIR/closure-mismatch.rs:12:5 | LL | baz(|_| ()); | ^^^^^^^^^^^ implementation of `FnOnce` is not general enough @@ -8,7 +8,7 @@ LL | baz(|_| ()); = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2` error[E0308]: mismatched types - --> $DIR/closure-mismatch.rs:8:5 + --> $DIR/closure-mismatch.rs:12:5 | LL | baz(|_| ()); | ^^^^^^^^^^^ one type is more general than the other @@ -16,12 +16,12 @@ LL | baz(|_| ()); = note: expected type `for<'r> Fn<(&'r (),)>` found type `Fn<(&(),)>` note: this closure does not fulfill the lifetime requirements - --> $DIR/closure-mismatch.rs:8:9 + --> $DIR/closure-mismatch.rs:12:9 | LL | baz(|_| ()); | ^^^^^^ note: the lifetime requirement is introduced here - --> $DIR/closure-mismatch.rs:5:11 + --> $DIR/closure-mismatch.rs:9:11 | LL | fn baz(_: T) {} | ^^^ diff --git a/src/test/ui/mismatched_types/closure-mismatch.rs b/src/test/ui/mismatched_types/closure-mismatch.rs index d2b78b4b7db..5bf3aef9bb0 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.rs +++ b/src/test/ui/mismatched_types/closure-mismatch.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait Foo {} impl Foo for T {} @@ -5,5 +9,8 @@ impl Foo for T {} fn baz(_: T) {} fn main() { - baz(|_| ()); //~ ERROR mismatched types + baz(|_| ()); + //[base]~^ ERROR mismatched types + //[nll]~^^ ERROR implementation of `FnOnce` is not general enough + //[nll]~| ERROR mismatched types } diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.stderr b/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr similarity index 83% rename from src/test/ui/traits/object/supertrait-lifetime-bound.stderr rename to src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr index c3d7f8cd0c1..8d1ef324c81 100644 --- a/src/test/ui/traits/object/supertrait-lifetime-bound.stderr +++ b/src/test/ui/traits/object/supertrait-lifetime-bound.base.stderr @@ -1,11 +1,11 @@ error[E0477]: the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime - --> $DIR/supertrait-lifetime-bound.rs:10:5 + --> $DIR/supertrait-lifetime-bound.rs:14:5 | LL | test1::, _>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: type must satisfy the static lifetime as required by this binding - --> $DIR/supertrait-lifetime-bound.rs:5:22 + --> $DIR/supertrait-lifetime-bound.rs:9:22 | LL | fn test1, S>() { } | ^^^^^^ diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr b/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr index ed2f8624357..271c6a10998 100644 --- a/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr +++ b/src/test/ui/traits/object/supertrait-lifetime-bound.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/supertrait-lifetime-bound.rs:10:5 + --> $DIR/supertrait-lifetime-bound.rs:14:5 | LL | fn test2<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/traits/object/supertrait-lifetime-bound.rs b/src/test/ui/traits/object/supertrait-lifetime-bound.rs index 5349771693a..a57151853e0 100644 --- a/src/test/ui/traits/object/supertrait-lifetime-bound.rs +++ b/src/test/ui/traits/object/supertrait-lifetime-bound.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + trait Foo: 'static { } trait Bar: Foo { } @@ -8,7 +12,8 @@ fn test2<'a>() { // Here: the type `dyn Bar<&'a u32>` references `'a`, // and so it does not outlive `'static`. test1::, _>(); - //~^ ERROR the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime + //[base]~^ ERROR the type `(dyn Bar<&'a u32> + 'static)` does not fulfill the required lifetime + //[nll]~^^ ERROR lifetime may not live long enough } fn main() { }