Skip to content

Commit 3e0a407

Browse files
committed
Updated new UI tests to pass with NLL compare-mode
These tests need a review to ensure that those marked as ignore-compare-mode-nll should be ignored and that this isn't a bug in NLL.
1 parent b16a306 commit 3e0a407

File tree

98 files changed

+273
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+273
-175
lines changed

src/test/ui/compile-fail-migration/associated-types-subtyping-1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-compare-mode-nll
12+
1113
#![allow(unused_variables)]
1214

1315
trait Trait<'a> {

src/test/ui/compile-fail-migration/associated-types-subtyping-1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/associated-types-subtyping-1.rs:34:37
2+
--> $DIR/associated-types-subtyping-1.rs:36:37
33
|
44
LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T)
55
| ----- ----- these two types are declared with different lifetimes...
@@ -8,7 +8,7 @@ LL | let _: <T as Trait<'b>>::Type = a; //~ ERROR E0623
88
| ^ ...but data from `y` flows into `x` here
99

1010
error[E0623]: lifetime mismatch
11-
--> $DIR/associated-types-subtyping-1.rs:43:37
11+
--> $DIR/associated-types-subtyping-1.rs:45:37
1212
|
1313
LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T)
1414
| ----- ----- these two types are declared with different lifetimes...

src/test/ui/compile-fail-migration/borrow-tuple-fields.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-compare-mode-nll
12+
1113
#![feature(box_syntax)]
1214

1315
struct Foo(Box<isize>, isize);

src/test/ui/compile-fail-migration/borrow-tuple-fields.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0505]: cannot move out of `x` because it is borrowed
2-
--> $DIR/borrow-tuple-fields.rs:20:9
2+
--> $DIR/borrow-tuple-fields.rs:22:9
33
|
44
LL | let r = &x.0;
55
| --- borrow of `x.0` occurs here
66
LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed
77
| ^ move out of `x` occurs here
88

99
error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
10-
--> $DIR/borrow-tuple-fields.rs:24:18
10+
--> $DIR/borrow-tuple-fields.rs:26:18
1111
|
1212
LL | let a = &x.0;
1313
| --- immutable borrow occurs here
@@ -18,7 +18,7 @@ LL | }
1818
| - immutable borrow ends here
1919

2020
error[E0499]: cannot borrow `x.0` as mutable more than once at a time
21-
--> $DIR/borrow-tuple-fields.rs:28:18
21+
--> $DIR/borrow-tuple-fields.rs:30:18
2222
|
2323
LL | let a = &mut x.0;
2424
| --- first mutable borrow occurs here
@@ -29,15 +29,15 @@ LL | }
2929
| - first borrow ends here
3030

3131
error[E0505]: cannot move out of `x` because it is borrowed
32-
--> $DIR/borrow-tuple-fields.rs:33:9
32+
--> $DIR/borrow-tuple-fields.rs:35:9
3333
|
3434
LL | let r = &x.0;
3535
| --- borrow of `x.0` occurs here
3636
LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed
3737
| ^ move out of `x` occurs here
3838

3939
error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
40-
--> $DIR/borrow-tuple-fields.rs:37:18
40+
--> $DIR/borrow-tuple-fields.rs:39:18
4141
|
4242
LL | let a = &x.0;
4343
| --- immutable borrow occurs here
@@ -48,7 +48,7 @@ LL | }
4848
| - immutable borrow ends here
4949

5050
error[E0499]: cannot borrow `x.0` as mutable more than once at a time
51-
--> $DIR/borrow-tuple-fields.rs:41:18
51+
--> $DIR/borrow-tuple-fields.rs:43:18
5252
|
5353
LL | let a = &mut x.0;
5454
| --- first mutable borrow occurs here

src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-compare-mode-nll
12+
1113
// Check that `&mut` objects cannot be borrowed twice, just like
1214
// other `&mut` pointers.
1315

src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0499]: cannot borrow `*x` as mutable more than once at a time
2-
--> $DIR/borrowck-borrow-mut-object-twice.rs:21:5
2+
--> $DIR/borrowck-borrow-mut-object-twice.rs:23:5
33
|
44
LL | let _y = x.f1();
55
| - first mutable borrow occurs here

src/test/ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// access to the variable, whether that mutable access be used
1313
// for direct assignment or for taking mutable ref. Issue #6801.
1414

15+
// ignore-compare-mode-nll
16+
1517
#![feature(box_syntax)]
1618

1719
fn to_fn_mut<F: FnMut()>(f: F) -> F { f }

src/test/ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0499]: cannot borrow `x` as mutable more than once at a time
2-
--> $DIR/borrowck-closures-two-mut.rs:22:24
2+
--> $DIR/borrowck-closures-two-mut.rs:24:24
33
|
44
LL | let c1 = to_fn_mut(|| x = 4);
55
| -- - previous borrow occurs due to use of `x` in closure
@@ -13,7 +13,7 @@ LL | }
1313
| - first borrow ends here
1414

1515
error[E0499]: cannot borrow `x` as mutable more than once at a time
16-
--> $DIR/borrowck-closures-two-mut.rs:32:24
16+
--> $DIR/borrowck-closures-two-mut.rs:34:24
1717
|
1818
LL | let c1 = to_fn_mut(|| set(&mut x));
1919
| -- - previous borrow occurs due to use of `x` in closure
@@ -27,7 +27,7 @@ LL | }
2727
| - first borrow ends here
2828

2929
error[E0499]: cannot borrow `x` as mutable more than once at a time
30-
--> $DIR/borrowck-closures-two-mut.rs:38:24
30+
--> $DIR/borrowck-closures-two-mut.rs:40:24
3131
|
3232
LL | let c1 = to_fn_mut(|| x = 5);
3333
| -- - previous borrow occurs due to use of `x` in closure
@@ -41,7 +41,7 @@ LL | }
4141
| - first borrow ends here
4242

4343
error[E0499]: cannot borrow `x` as mutable more than once at a time
44-
--> $DIR/borrowck-closures-two-mut.rs:44:24
44+
--> $DIR/borrowck-closures-two-mut.rs:46:24
4545
|
4646
LL | let c1 = to_fn_mut(|| x = 5);
4747
| -- - previous borrow occurs due to use of `x` in closure
@@ -56,7 +56,7 @@ LL | }
5656
| - first borrow ends here
5757

5858
error[E0499]: cannot borrow `x` as mutable more than once at a time
59-
--> $DIR/borrowck-closures-two-mut.rs:55:24
59+
--> $DIR/borrowck-closures-two-mut.rs:57:24
6060
|
6161
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
6262
| -- - previous borrow occurs due to use of `x` in closure

src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-compare-mode-nll
12+
1113
struct Foo {
1214
x: isize,
1315
}

src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0502]: cannot borrow `this.x` as mutable because it is also borrowed as immutable
2-
--> $DIR/borrowck-closures-unique-imm.rs:21:14
2+
--> $DIR/borrowck-closures-unique-imm.rs:23:14
33
|
44
LL | let p = &this.x;
55
| ------ immutable borrow occurs here

0 commit comments

Comments
 (0)