diff --git a/src/test/ui/const-generics/invariant.stderr b/src/test/ui/const-generics/invariant.base.stderr similarity index 94% rename from src/test/ui/const-generics/invariant.stderr rename to src/test/ui/const-generics/invariant.base.stderr index 318c885e6a6b..255900e19bb4 100644 --- a/src/test/ui/const-generics/invariant.stderr +++ b/src/test/ui/const-generics/invariant.base.stderr @@ -1,5 +1,5 @@ warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())` - --> $DIR/invariant.rs:14:1 + --> $DIR/invariant.rs:18:1 | LL | impl SadBee for for<'a> fn(&'a ()) { | ---------------------------------- first implementation here @@ -13,7 +13,7 @@ LL | impl SadBee for fn(&'static ()) { = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details error[E0308]: mismatched types - --> $DIR/invariant.rs:27:5 + --> $DIR/invariant.rs:31:5 | LL | v | ^ one type is more general than the other diff --git a/src/test/ui/const-generics/invariant.nll.stderr b/src/test/ui/const-generics/invariant.nll.stderr index ce0fad104713..f684f7fddc8f 100644 --- a/src/test/ui/const-generics/invariant.nll.stderr +++ b/src/test/ui/const-generics/invariant.nll.stderr @@ -1,5 +1,5 @@ warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())` - --> $DIR/invariant.rs:14:1 + --> $DIR/invariant.rs:18:1 | LL | impl SadBee for for<'a> fn(&'a ()) { | ---------------------------------- first implementation here @@ -13,7 +13,7 @@ LL | impl SadBee for fn(&'static ()) { = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details error[E0308]: mismatched types - --> $DIR/invariant.rs:27:5 + --> $DIR/invariant.rs:31:5 | LL | v | ^ one type is more general than the other diff --git a/src/test/ui/const-generics/invariant.rs b/src/test/ui/const-generics/invariant.rs index ee191b65c2c7..65d1ee9420c3 100644 --- a/src/test/ui/const-generics/invariant.rs +++ b/src/test/ui/const-generics/invariant.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + #![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::marker::PhantomData; diff --git a/src/test/ui/match/match-ref-mut-invariance.stderr b/src/test/ui/match/match-ref-mut-invariance.base.stderr similarity index 81% rename from src/test/ui/match/match-ref-mut-invariance.stderr rename to src/test/ui/match/match-ref-mut-invariance.base.stderr index f9271cb3d068..060c82379748 100644 --- a/src/test/ui/match/match-ref-mut-invariance.stderr +++ b/src/test/ui/match/match-ref-mut-invariance.base.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/match-ref-mut-invariance.rs:10:37 + --> $DIR/match-ref-mut-invariance.rs:14:37 | LL | match self.0 { ref mut x => x } | ^ lifetime mismatch @@ -7,12 +7,12 @@ LL | match self.0 { ref mut x => x } = note: expected mutable reference `&'a mut &'a i32` found mutable reference `&'a mut &'b i32` note: the lifetime `'a` as defined here... - --> $DIR/match-ref-mut-invariance.rs:9:12 + --> $DIR/match-ref-mut-invariance.rs:13:12 | LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { | ^^ note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/match-ref-mut-invariance.rs:8:6 + --> $DIR/match-ref-mut-invariance.rs:12:6 | LL | impl<'b> S<'b> { | ^^ diff --git a/src/test/ui/match/match-ref-mut-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-invariance.nll.stderr index 3b7e53cd5272..b98539d91b69 100644 --- a/src/test/ui/match/match-ref-mut-invariance.nll.stderr +++ b/src/test/ui/match/match-ref-mut-invariance.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/match-ref-mut-invariance.rs:10:9 + --> $DIR/match-ref-mut-invariance.rs:14:9 | LL | impl<'b> S<'b> { | -- lifetime `'b` defined here diff --git a/src/test/ui/match/match-ref-mut-invariance.rs b/src/test/ui/match/match-ref-mut-invariance.rs index 50b0ede09c22..f876a4e2498f 100644 --- a/src/test/ui/match/match-ref-mut-invariance.rs +++ b/src/test/ui/match/match-ref-mut-invariance.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + // Check that when making a ref mut binding with type `&mut T`, the // type `T` must match precisely the type `U` of the value being // matched, and in particular cannot be some supertype of `U`. Issue @@ -7,7 +11,9 @@ struct S<'b>(&'b i32); impl<'b> S<'b> { fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { - match self.0 { ref mut x => x } //~ ERROR mismatched types + match self.0 { ref mut x => x } + //[base]~^ ERROR mismatched types + //[nll]~^^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/match/match-ref-mut-let-invariance.stderr b/src/test/ui/match/match-ref-mut-let-invariance.base.stderr similarity index 78% rename from src/test/ui/match/match-ref-mut-let-invariance.stderr rename to src/test/ui/match/match-ref-mut-let-invariance.base.stderr index c021a5a91f5c..7b6dd5af539e 100644 --- a/src/test/ui/match/match-ref-mut-let-invariance.stderr +++ b/src/test/ui/match/match-ref-mut-let-invariance.base.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/match-ref-mut-let-invariance.rs:11:9 + --> $DIR/match-ref-mut-let-invariance.rs:15:9 | LL | x | ^ lifetime mismatch @@ -7,12 +7,12 @@ LL | x = note: expected mutable reference `&'a mut &'a i32` found mutable reference `&'a mut &'b i32` note: the lifetime `'a` as defined here... - --> $DIR/match-ref-mut-let-invariance.rs:9:12 + --> $DIR/match-ref-mut-let-invariance.rs:13:12 | LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { | ^^ note: ...does not necessarily outlive the lifetime `'b` as defined here - --> $DIR/match-ref-mut-let-invariance.rs:8:6 + --> $DIR/match-ref-mut-let-invariance.rs:12:6 | LL | impl<'b> S<'b> { | ^^ diff --git a/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr index f4d1cea670ba..4b8bdd157c20 100644 --- a/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr +++ b/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/match-ref-mut-let-invariance.rs:11:9 + --> $DIR/match-ref-mut-let-invariance.rs:15:9 | LL | impl<'b> S<'b> { | -- lifetime `'b` defined here diff --git a/src/test/ui/match/match-ref-mut-let-invariance.rs b/src/test/ui/match/match-ref-mut-let-invariance.rs index a62eb714a4d3..0a8daed569ff 100644 --- a/src/test/ui/match/match-ref-mut-let-invariance.rs +++ b/src/test/ui/match/match-ref-mut-let-invariance.rs @@ -1,3 +1,7 @@ +// ignore-compare-mode-nll +// revisions: base nll +// [nll]compile-flags: -Zborrowck=mir + // Check that when making a ref mut binding with type `&mut T`, the // type `T` must match precisely the type `U` of the value being // matched, and in particular cannot be some supertype of `U`. Issue @@ -8,7 +12,9 @@ struct S<'b>(&'b i32); impl<'b> S<'b> { fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { let ref mut x = self.0; - x //~ ERROR mismatched types + x + //[base]~^ ERROR mismatched types + //[nll]~^^ ERROR lifetime may not live long enough } }