Skip to content

Commit 1e435e3

Browse files
committed
Use revisions for NLL in const-generics and match
1 parent f1a7f9a commit 1e435e3

9 files changed

+30
-14
lines changed

src/test/ui/const-generics/invariant.stderr renamed to src/test/ui/const-generics/invariant.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())`
2-
--> $DIR/invariant.rs:14:1
2+
--> $DIR/invariant.rs:18:1
33
|
44
LL | impl SadBee for for<'a> fn(&'a ()) {
55
| ---------------------------------- first implementation here
@@ -13,7 +13,7 @@ LL | impl SadBee for fn(&'static ()) {
1313
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
1414

1515
error[E0308]: mismatched types
16-
--> $DIR/invariant.rs:27:5
16+
--> $DIR/invariant.rs:31:5
1717
|
1818
LL | v
1919
| ^ one type is more general than the other

src/test/ui/const-generics/invariant.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())`
2-
--> $DIR/invariant.rs:14:1
2+
--> $DIR/invariant.rs:18:1
33
|
44
LL | impl SadBee for for<'a> fn(&'a ()) {
55
| ---------------------------------- first implementation here
@@ -13,7 +13,7 @@ LL | impl SadBee for fn(&'static ()) {
1313
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
1414

1515
error[E0308]: mismatched types
16-
--> $DIR/invariant.rs:27:5
16+
--> $DIR/invariant.rs:31:5
1717
|
1818
LL | v
1919
| ^ one type is more general than the other

src/test/ui/const-generics/invariant.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// ignore-compare-mode-nll
2+
// revisions: base nll
3+
// [nll]compile-flags: -Zborrowck=mir
4+
15
#![feature(generic_const_exprs)]
26
#![allow(incomplete_features)]
37
use std::marker::PhantomData;

src/test/ui/match/match-ref-mut-invariance.stderr renamed to src/test/ui/match/match-ref-mut-invariance.base.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error[E0308]: mismatched types
2-
--> $DIR/match-ref-mut-invariance.rs:10:37
2+
--> $DIR/match-ref-mut-invariance.rs:14:37
33
|
44
LL | match self.0 { ref mut x => x }
55
| ^ lifetime mismatch
66
|
77
= note: expected mutable reference `&'a mut &'a i32`
88
found mutable reference `&'a mut &'b i32`
99
note: the lifetime `'a` as defined here...
10-
--> $DIR/match-ref-mut-invariance.rs:9:12
10+
--> $DIR/match-ref-mut-invariance.rs:13:12
1111
|
1212
LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
1313
| ^^
1414
note: ...does not necessarily outlive the lifetime `'b` as defined here
15-
--> $DIR/match-ref-mut-invariance.rs:8:6
15+
--> $DIR/match-ref-mut-invariance.rs:12:6
1616
|
1717
LL | impl<'b> S<'b> {
1818
| ^^

src/test/ui/match/match-ref-mut-invariance.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/match-ref-mut-invariance.rs:10:9
2+
--> $DIR/match-ref-mut-invariance.rs:14:9
33
|
44
LL | impl<'b> S<'b> {
55
| -- lifetime `'b` defined here

src/test/ui/match/match-ref-mut-invariance.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// ignore-compare-mode-nll
2+
// revisions: base nll
3+
// [nll]compile-flags: -Zborrowck=mir
4+
15
// Check that when making a ref mut binding with type `&mut T`, the
26
// type `T` must match precisely the type `U` of the value being
37
// matched, and in particular cannot be some supertype of `U`. Issue
@@ -7,7 +11,9 @@
711
struct S<'b>(&'b i32);
812
impl<'b> S<'b> {
913
fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
10-
match self.0 { ref mut x => x } //~ ERROR mismatched types
14+
match self.0 { ref mut x => x }
15+
//[base]~^ ERROR mismatched types
16+
//[nll]~^^ ERROR lifetime may not live long enough
1117
}
1218
}
1319

src/test/ui/match/match-ref-mut-let-invariance.stderr renamed to src/test/ui/match/match-ref-mut-let-invariance.base.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error[E0308]: mismatched types
2-
--> $DIR/match-ref-mut-let-invariance.rs:11:9
2+
--> $DIR/match-ref-mut-let-invariance.rs:15:9
33
|
44
LL | x
55
| ^ lifetime mismatch
66
|
77
= note: expected mutable reference `&'a mut &'a i32`
88
found mutable reference `&'a mut &'b i32`
99
note: the lifetime `'a` as defined here...
10-
--> $DIR/match-ref-mut-let-invariance.rs:9:12
10+
--> $DIR/match-ref-mut-let-invariance.rs:13:12
1111
|
1212
LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
1313
| ^^
1414
note: ...does not necessarily outlive the lifetime `'b` as defined here
15-
--> $DIR/match-ref-mut-let-invariance.rs:8:6
15+
--> $DIR/match-ref-mut-let-invariance.rs:12:6
1616
|
1717
LL | impl<'b> S<'b> {
1818
| ^^

src/test/ui/match/match-ref-mut-let-invariance.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/match-ref-mut-let-invariance.rs:11:9
2+
--> $DIR/match-ref-mut-let-invariance.rs:15:9
33
|
44
LL | impl<'b> S<'b> {
55
| -- lifetime `'b` defined here

src/test/ui/match/match-ref-mut-let-invariance.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// ignore-compare-mode-nll
2+
// revisions: base nll
3+
// [nll]compile-flags: -Zborrowck=mir
4+
15
// Check that when making a ref mut binding with type `&mut T`, the
26
// type `T` must match precisely the type `U` of the value being
37
// matched, and in particular cannot be some supertype of `U`. Issue
@@ -8,7 +12,9 @@ struct S<'b>(&'b i32);
812
impl<'b> S<'b> {
913
fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
1014
let ref mut x = self.0;
11-
x //~ ERROR mismatched types
15+
x
16+
//[base]~^ ERROR mismatched types
17+
//[nll]~^^ ERROR lifetime may not live long enough
1218
}
1319
}
1420

0 commit comments

Comments
 (0)