diff options
| author | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-05-21 14:27:58 -0400 | 
|---|---|---|
| committer | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-05-22 15:21:26 -0400 | 
| commit | 1e435e332efcd9230255c6fba960c7db23d641d2 (patch) | |
| tree | 39da1469c3a0163ee0cb4e5827255ee2dcfbcfa4 | |
| parent | f1a7f9ab40ba4fe063cfedbd67e8828a880c5ffc (diff) | |
| download | rust-1e435e332efcd9230255c6fba960c7db23d641d2.tar.gz rust-1e435e332efcd9230255c6fba960c7db23d641d2.zip  | |
Use revisions for NLL in const-generics and match
| -rw-r--r-- | src/test/ui/const-generics/invariant.base.stderr (renamed from src/test/ui/const-generics/invariant.stderr) | 4 | ||||
| -rw-r--r-- | src/test/ui/const-generics/invariant.nll.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/const-generics/invariant.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/match/match-ref-mut-invariance.base.stderr (renamed from src/test/ui/match/match-ref-mut-invariance.stderr) | 6 | ||||
| -rw-r--r-- | src/test/ui/match/match-ref-mut-invariance.nll.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/match/match-ref-mut-invariance.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/match/match-ref-mut-let-invariance.base.stderr (renamed from src/test/ui/match/match-ref-mut-let-invariance.stderr) | 6 | ||||
| -rw-r--r-- | src/test/ui/match/match-ref-mut-let-invariance.nll.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/match/match-ref-mut-let-invariance.rs | 8 | 
9 files changed, 30 insertions, 14 deletions
diff --git a/src/test/ui/const-generics/invariant.stderr b/src/test/ui/const-generics/invariant.base.stderr index 318c885e6a6..255900e19bb 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 ce0fad10471..f684f7fddc8 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 ee191b65c2c..65d1ee9420c 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 index f9271cb3d06..060c8237974 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 3b7e53cd527..b98539d91b6 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 50b0ede09c2..f876a4e2498 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 index c021a5a91f5..7b6dd5af539 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 f4d1cea670b..4b8bdd157c2 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 a62eb714a4d..0a8daed569f 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 } }  | 
