Skip to content

Commit

Permalink
update tests for migrate mode by default
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Mar 11, 2019
1 parent 5dbc0f0 commit 4eebb5e
Show file tree
Hide file tree
Showing 1,358 changed files with 6,231 additions and 22,570 deletions.
8 changes: 4 additions & 4 deletions src/test/incremental/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// compile-flags: -Z query-dep-graph

#![feature(rustc_attrs)]
#![cfg_attr(rpass1, feature(nll))]
#![cfg_attr(rpass1, feature(abi_unadjusted))]

fn main() {
let mut v = vec![1];
v.push(v[0]);
//[cfail2]~^ ERROR cannot borrow
}

extern "unadjusted" fn foo() {}
//[cfail2]~^ ERROR: unadjusted ABI is an implementation detail and perma-unstable
10 changes: 6 additions & 4 deletions src/test/mir-opt/match_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ fn main() {
// goto -> bb16;
// }
// bb12: {
// StorageLive(_8);
// _8 = _2;
// switchInt(move _8) -> [false: bb6, otherwise: bb11];
// _8 = &shallow _1;
// StorageLive(_9);
// _9 = _2;
// FakeRead(ForMatchGuard, _8);
// switchInt(move _9) -> [false: bb6, otherwise: bb11];
// }
// bb13: {
// _3 = const 1i32;
Expand All @@ -77,7 +79,7 @@ fn main() {
// goto -> bb16;
// }
// bb16: {
// StorageDead(_8);
// StorageDead(_9);
// _0 = ();
// StorageDead(_2);
// StorageDead(_1);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-fail/borrowck-local-borrow.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// error-pattern:panic 1

// revisions: ast mir
// revisions: migrate mir
//[mir]compile-flags: -Z borrowck=mir

fn main() {
Expand Down
3 changes: 0 additions & 3 deletions src/test/run-pass/asm-in-moved.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// revisions: ast mir
//[mir]compile-flags: -Z borrowck=mir

#![feature(asm)]
#![allow(dead_code)]

Expand Down
3 changes: 0 additions & 3 deletions src/test/run-pass/asm-out-assign.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// revisions ast mir
//[mir]compile-flags: -Z borrowck=mir

#![feature(asm)]

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#![allow(dead_code)]
// Test taken from #45641 (https://github.com/rust-lang/rust/issues/45641)

// revisions: ast mir
//[mir]compile-flags: -Z borrowck=mir

static mut Y: u32 = 0;

unsafe fn should_ok() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// run-pass
// revisions: ast mir
//[mir]compile-flags: -Z borrowck=mir

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

Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/borrowck/two-phase-baseline.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
// compile-flags: -Z borrowck=mir -Z two-phase-borrows

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// run-pass
// revisions: lxl nll
//[lxl]compile-flags: -Z borrowck=mir -Z two-phase-borrows

#![cfg_attr(nll, feature(nll))]

fn main() {
let mut a = 0;
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/drop/dynamic-drop.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// run-pass
#![allow(unused_assignments)]
#![allow(unused_variables)]
// revisions:lexical nll
#![cfg_attr(nll, feature(nll))]

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

Expand Down
3 changes: 0 additions & 3 deletions src/test/run-pass/generator/yield-subtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#![allow(dead_code)]
#![allow(dead_code)]

// revisions:lexical nll
#![cfg_attr(nll, feature(nll))]

#![feature(generators)]

fn bar<'a>() {
Expand Down
3 changes: 0 additions & 3 deletions src/test/run-pass/impl-trait/example-calendar.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// run-pass

// revisions: normal nll
//[nll] compile-flags:-Zborrowck=mir

#![feature(fn_traits,
step_trait,
unboxed_closures,
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/issues/issue-26996.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

// This test is checking that the write to `c.0` (which has been moved out of)
// won't overwrite the state in `c2`.
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/issues/issue-27021.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

// These are variants of issue-26996.rs. In all cases we are writing
// into a record field that has been moved out of, and ensuring that
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/issues/issue-49298.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

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

// This test is checking that the space allocated for `x.1` does not
// overlap with `y`. (The reason why such a thing happened at one
Expand Down
11 changes: 6 additions & 5 deletions src/test/ui-fulldeps/dropck_tarena_cycle_checked.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
error[E0597]: `arena` does not live long enough
--> $DIR/dropck_tarena_cycle_checked.rs:116:8
--> $DIR/dropck_tarena_cycle_checked.rs:116:7
|
LL | f(&arena);
| ^^^^^ borrowed value does not live long enough
| ^^^^^^ borrowed value does not live long enough
LL | } //~^ ERROR `arena` does not live long enough
| - `arena` dropped here while still borrowed
|
= note: values in a scope are dropped in the opposite order they are created
| -
| |
| `arena` dropped here while still borrowed
| borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `arena::TypedArena`

error: aborting due to previous error

Expand Down
11 changes: 6 additions & 5 deletions src/test/ui-fulldeps/dropck_tarena_unsound_drop.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
error[E0597]: `arena` does not live long enough
--> $DIR/dropck_tarena_unsound_drop.rs:41:8
--> $DIR/dropck_tarena_unsound_drop.rs:41:7
|
LL | f(&arena);
| ^^^^^ borrowed value does not live long enough
| ^^^^^^ borrowed value does not live long enough
LL | } //~^ ERROR `arena` does not live long enough
| - `arena` dropped here while still borrowed
|
= note: values in a scope are dropped in the opposite order they are created
| -
| |
| `arena` dropped here while still borrowed
| borrow might be used here, when `arena` is dropped and runs the `Drop` code for type `arena::TypedArena`

error: aborting due to previous error

Expand Down
31 changes: 0 additions & 31 deletions src/test/ui/E0501.ast.stderr

This file was deleted.

31 changes: 0 additions & 31 deletions src/test/ui/E0501.mir.stderr

This file was deleted.

12 changes: 4 additions & 8 deletions src/test/ui/E0501.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// ignore-tidy-linelength
// revisions: ast mir
//[mir]compile-flags: -Z borrowck=mir

fn inside_closure(x: &mut i32) {
}

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

outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
//[mir]~^ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
outside_closure_2(a);
//~^ ERROR cannot borrow `*a` as immutable because previous closure requires unique access

drop(bar);
}
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/E0501.ast.nll.stderr → src/test/ui/E0501.stderr
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
--> $DIR/E0501.rs:18:23
--> $DIR/E0501.rs:14:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
LL | outside_closure_1(a);
| ^ second borrow occurs here
...
LL | drop(bar);
| --- first borrow later used here

error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
--> $DIR/E0501.rs:21:23
--> $DIR/E0501.rs:17:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
LL | outside_closure_2(a);
| ^ second borrow occurs here
...
LL | drop(bar);
Expand Down
14 changes: 0 additions & 14 deletions src/test/ui/E0506.ast.nll.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/E0506.ast.stderr

This file was deleted.

6 changes: 1 addition & 5 deletions src/test/ui/E0506.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
// revisions: ast mir
//[mir]compile-flags: -Z borrowck=mir

struct FancyNum {
num: u8,
}

fn main() {
let mut fancy_num = FancyNum { num: 5 };
let fancy_ref = &fancy_num;
fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
//[mir]~^ ERROR [E0506]
fancy_num = FancyNum { num: 6 }; //~ ERROR [E0506]

println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
}
6 changes: 3 additions & 3 deletions src/test/ui/E0506.mir.stderr → src/test/ui/E0506.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0506]: cannot assign to `fancy_num` because it is borrowed
--> $DIR/E0506.rs:11:5
--> $DIR/E0506.rs:8:5
|
LL | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
LL | fancy_num = FancyNum { num: 6 }; //~ ERROR [E0506]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
...
LL |
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
| ------------- borrow later used here

Expand Down
12 changes: 0 additions & 12 deletions src/test/ui/E0508-fail.ast.nll.stderr

This file was deleted.

12 changes: 0 additions & 12 deletions src/test/ui/E0508-fail.ast.stderr

This file was deleted.

Loading

0 comments on commit 4eebb5e

Please sign in to comment.