Skip to content

Commit 4eebb5e

Browse files
committed
update tests for migrate mode by default
1 parent 5dbc0f0 commit 4eebb5e

File tree

1,358 files changed

+6231
-22570
lines changed

Some content is hidden

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

1,358 files changed

+6231
-22570
lines changed

src/test/incremental/feature_gate.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// compile-flags: -Z query-dep-graph
55

66
#![feature(rustc_attrs)]
7-
#![cfg_attr(rpass1, feature(nll))]
7+
#![cfg_attr(rpass1, feature(abi_unadjusted))]
88

99
fn main() {
10-
let mut v = vec![1];
11-
v.push(v[0]);
12-
//[cfail2]~^ ERROR cannot borrow
1310
}
11+
12+
extern "unadjusted" fn foo() {}
13+
//[cfail2]~^ ERROR: unadjusted ABI is an implementation detail and perma-unstable

src/test/mir-opt/match_test.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ fn main() {
6060
// goto -> bb16;
6161
// }
6262
// bb12: {
63-
// StorageLive(_8);
64-
// _8 = _2;
65-
// switchInt(move _8) -> [false: bb6, otherwise: bb11];
63+
// _8 = &shallow _1;
64+
// StorageLive(_9);
65+
// _9 = _2;
66+
// FakeRead(ForMatchGuard, _8);
67+
// switchInt(move _9) -> [false: bb6, otherwise: bb11];
6668
// }
6769
// bb13: {
6870
// _3 = const 1i32;
@@ -77,7 +79,7 @@ fn main() {
7779
// goto -> bb16;
7880
// }
7981
// bb16: {
80-
// StorageDead(_8);
82+
// StorageDead(_9);
8183
// _0 = ();
8284
// StorageDead(_2);
8385
// StorageDead(_1);

src/test/run-fail/borrowck-local-borrow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// error-pattern:panic 1
22

3-
// revisions: ast mir
3+
// revisions: migrate mir
44
//[mir]compile-flags: -Z borrowck=mir
55

66
fn main() {

src/test/run-pass/asm-in-moved.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// revisions: ast mir
2-
//[mir]compile-flags: -Z borrowck=mir
3-
41
#![feature(asm)]
52
#![allow(dead_code)]
63

src/test/run-pass/asm-out-assign.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// revisions ast mir
2-
//[mir]compile-flags: -Z borrowck=mir
3-
41
#![feature(asm)]
52

63
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]

src/test/run-pass/borrowck/borrowck-assignment-to-static-mut.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#![allow(dead_code)]
33
// Test taken from #45641 (https://github.com/rust-lang/rust/issues/45641)
44

5-
// revisions: ast mir
6-
//[mir]compile-flags: -Z borrowck=mir
7-
85
static mut Y: u32 = 0;
96

107
unsafe fn should_ok() {

src/test/run-pass/borrowck/borrowck-unsafe-static-mutable-borrows.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// run-pass
2-
// revisions: ast mir
3-
//[mir]compile-flags: -Z borrowck=mir
42

53
// Test file taken from issue 45129 (https://github.com/rust-lang/rust/issues/45129)
64

src/test/run-pass/borrowck/two-phase-baseline.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
// compile-flags: -Z borrowck=mir -Z two-phase-borrows
32

43
// This is the "goto example" for why we want two phase borrows.
54

src/test/run-pass/borrowck/two-phase-control-flow-split-before-activation.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
// run-pass
2-
// revisions: lxl nll
3-
//[lxl]compile-flags: -Z borrowck=mir -Z two-phase-borrows
4-
5-
#![cfg_attr(nll, feature(nll))]
62

73
fn main() {
84
let mut a = 0;

src/test/run-pass/drop/dynamic-drop.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// run-pass
22
#![allow(unused_assignments)]
33
#![allow(unused_variables)]
4-
// revisions:lexical nll
5-
#![cfg_attr(nll, feature(nll))]
64

75
// ignore-wasm32-bare compiled with panic=abort by default
86

src/test/run-pass/generator/yield-subtype.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#![allow(dead_code)]
33
#![allow(dead_code)]
44

5-
// revisions:lexical nll
6-
#![cfg_attr(nll, feature(nll))]
7-
85
#![feature(generators)]
96

107
fn bar<'a>() {

src/test/run-pass/impl-trait/example-calendar.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// run-pass
22

3-
// revisions: normal nll
4-
//[nll] compile-flags:-Zborrowck=mir
5-
63
#![feature(fn_traits,
74
step_trait,
85
unboxed_closures,

src/test/run-pass/issues/issue-26996.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
// This test is bogus (i.e., should be compile-fail) during the period
44
// where #54986 is implemented and #54987 is *not* implemented. For
5-
// now: just ignore it under nll
5+
// now: just ignore it
66
//
7-
// ignore-compare-mode-nll
7+
// ignore-test
88

99
// This test is checking that the write to `c.0` (which has been moved out of)
1010
// won't overwrite the state in `c2`.

src/test/run-pass/issues/issue-27021.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
// This test is bogus (i.e., should be compile-fail) during the period
44
// where #54986 is implemented and #54987 is *not* implemented. For
5-
// now: just ignore it under nll
5+
// now: just ignore it
66
//
7-
// ignore-compare-mode-nll
7+
// ignore-test
88

99
// These are variants of issue-26996.rs. In all cases we are writing
1010
// into a record field that has been moved out of, and ensuring that

src/test/run-pass/issues/issue-49298.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
// This test is bogus (i.e., should be compile-fail) during the period
66
// where #54986 is implemented and #54987 is *not* implemented. For
7-
// now: just ignore it under nll
7+
// now: just ignore it
88
//
9-
// ignore-compare-mode-nll
9+
// ignore-test
1010

1111
// This test is checking that the space allocated for `x.1` does not
1212
// overlap with `y`. (The reason why such a thing happened at one

src/test/ui-fulldeps/dropck_tarena_cycle_checked.stderr

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
error[E0597]: `arena` does not live long enough
2-
--> $DIR/dropck_tarena_cycle_checked.rs:116:8
2+
--> $DIR/dropck_tarena_cycle_checked.rs:116:7
33
|
44
LL | f(&arena);
5-
| ^^^^^ borrowed value does not live long enough
5+
| ^^^^^^ borrowed value does not live long enough
66
LL | } //~^ ERROR `arena` does not live long enough
7-
| - `arena` dropped here while still borrowed
8-
|
9-
= note: values in a scope are dropped in the opposite order they are created
7+
| -
8+
| |
9+
| `arena` dropped here while still borrowed
10+
| borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `arena::TypedArena`
1011

1112
error: aborting due to previous error
1213

src/test/ui-fulldeps/dropck_tarena_unsound_drop.stderr

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
error[E0597]: `arena` does not live long enough
2-
--> $DIR/dropck_tarena_unsound_drop.rs:41:8
2+
--> $DIR/dropck_tarena_unsound_drop.rs:41:7
33
|
44
LL | f(&arena);
5-
| ^^^^^ borrowed value does not live long enough
5+
| ^^^^^^ borrowed value does not live long enough
66
LL | } //~^ ERROR `arena` does not live long enough
7-
| - `arena` dropped here while still borrowed
8-
|
9-
= note: values in a scope are dropped in the opposite order they are created
7+
| -
8+
| |
9+
| `arena` dropped here while still borrowed
10+
| borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `arena::TypedArena`
1011

1112
error: aborting due to previous error
1213

src/test/ui/E0501.ast.stderr

-31
This file was deleted.

src/test/ui/E0501.mir.stderr

-31
This file was deleted.

src/test/ui/E0501.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// ignore-tidy-linelength
2-
// revisions: ast mir
3-
//[mir]compile-flags: -Z borrowck=mir
4-
51
fn inside_closure(x: &mut i32) {
62
}
73

@@ -15,11 +11,11 @@ fn foo(a: &mut i32) {
1511
let bar = || {
1612
inside_closure(a)
1713
};
18-
outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
19-
//[mir]~^ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
14+
outside_closure_1(a);
15+
//~^ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
2016

21-
outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
22-
//[mir]~^ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
17+
outside_closure_2(a);
18+
//~^ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
2319

2420
drop(bar);
2521
}

src/test/ui/E0501.ast.nll.stderr src/test/ui/E0501.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
2-
--> $DIR/E0501.rs:18:23
2+
--> $DIR/E0501.rs:14:23
33
|
44
LL | let bar = || {
55
| -- closure construction occurs here
66
LL | inside_closure(a)
77
| - first borrow occurs due to use of `a` in closure
88
LL | };
9-
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
9+
LL | outside_closure_1(a);
1010
| ^ second borrow occurs here
1111
...
1212
LL | drop(bar);
1313
| --- first borrow later used here
1414

1515
error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
16-
--> $DIR/E0501.rs:21:23
16+
--> $DIR/E0501.rs:17:23
1717
|
1818
LL | let bar = || {
1919
| -- closure construction occurs here
2020
LL | inside_closure(a)
2121
| - first borrow occurs due to use of `a` in closure
2222
...
23-
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
23+
LL | outside_closure_2(a);
2424
| ^ second borrow occurs here
2525
...
2626
LL | drop(bar);

src/test/ui/E0506.ast.nll.stderr

-14
This file was deleted.

src/test/ui/E0506.ast.stderr

-11
This file was deleted.

src/test/ui/E0506.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
// revisions: ast mir
2-
//[mir]compile-flags: -Z borrowck=mir
3-
41
struct FancyNum {
52
num: u8,
63
}
74

85
fn main() {
96
let mut fancy_num = FancyNum { num: 5 };
107
let fancy_ref = &fancy_num;
11-
fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
12-
//[mir]~^ ERROR [E0506]
8+
fancy_num = FancyNum { num: 6 }; //~ ERROR [E0506]
139

1410
println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
1511
}

src/test/ui/E0506.mir.stderr src/test/ui/E0506.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0506]: cannot assign to `fancy_num` because it is borrowed
2-
--> $DIR/E0506.rs:11:5
2+
--> $DIR/E0506.rs:8:5
33
|
44
LL | let fancy_ref = &fancy_num;
55
| ---------- borrow of `fancy_num` occurs here
6-
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
6+
LL | fancy_num = FancyNum { num: 6 }; //~ ERROR [E0506]
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
8-
...
8+
LL |
99
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
1010
| ------------- borrow later used here
1111

src/test/ui/E0508-fail.ast.nll.stderr

-12
This file was deleted.

src/test/ui/E0508-fail.ast.stderr

-12
This file was deleted.

0 commit comments

Comments
 (0)