Skip to content

Commit 6f2d023

Browse files
committed
Fold rustfix tests back into the UI test suite
1 parent a563027 commit 6f2d023

29 files changed

+223
-80
lines changed

src/bootstrap/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl<'a> Builder<'a> {
326326
test::TheBook, test::UnstableBook, test::RustcBook,
327327
test::Rustfmt, test::Miri, test::Clippy, test::RustdocJS, test::RustdocTheme,
328328
// Run run-make last, since these won't pass without make on Windows
329-
test::RunMake, test::RustdocUi, test::Rustfix),
329+
test::RunMake, test::RustdocUi),
330330
Kind::Bench => describe!(test::Crate, test::CrateLibrustc),
331331
Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook,
332332
doc::Standalone, doc::Std, doc::Test, doc::WhitelistedRustc, doc::Rustc,

src/bootstrap/test.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -716,12 +716,6 @@ default_test!(RunFail {
716716
suite: "run-fail"
717717
});
718718

719-
default_test!(Rustfix {
720-
path: "src/test/rustfix",
721-
mode: "rustfix",
722-
suite: "rustfix"
723-
});
724-
725719
default_test!(RunPassValgrind {
726720
path: "src/test/run-pass-valgrind",
727721
mode: "run-pass-valgrind",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// run-rustfix
12+
13+
// Point at the captured immutable outer variable
14+
15+
fn foo(mut f: Box<FnMut()>) {
16+
f();
17+
}
18+
19+
fn main() {
20+
let mut y = true;
21+
foo(Box::new(move || y = false) as Box<_>); //~ ERROR cannot assign to captured outer variable
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// run-rustfix
12+
13+
// Point at the captured immutable outer variable
14+
15+
fn foo(mut f: Box<FnMut()>) {
16+
f();
17+
}
18+
19+
fn main() {
20+
let y = true;
21+
foo(Box::new(move || y = false) as Box<_>); //~ ERROR cannot assign to captured outer variable
22+
}

src/test/ui/suggestions/closure-immutable-outer-variable.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0594]: cannot assign to immutable item `y`
2-
--> $DIR/closure-immutable-outer-variable.rs:19:26
2+
--> $DIR/closure-immutable-outer-variable.rs:21:26
33
|
44
LL | foo(Box::new(move || y = false) as Box<_>); //~ ERROR cannot assign to captured outer variable
55
| ^^^^^^^^^ cannot mutate

src/test/ui/suggestions/closure-immutable-outer-variable.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+
// run-rustfix
12+
1113
// Point at the captured immutable outer variable
1214

1315
fn foo(mut f: Box<FnMut()>) {

src/test/ui/suggestions/closure-immutable-outer-variable.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0594]: cannot assign to captured outer variable in an `FnMut` closure
2-
--> $DIR/closure-immutable-outer-variable.rs:19:26
2+
--> $DIR/closure-immutable-outer-variable.rs:21:26
33
|
44
LL | let y = true;
55
| - help: consider making `y` mutable: `mut y`
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// run-rustfix
12+
13+
#[no_mangle] pub static RAH: usize = 5;
14+
//~^ ERROR const items should never be #[no_mangle]
15+
16+
fn main() {}

src/test/ui/suggestions/issue-45562.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+
// run-rustfix
12+
1113
#[no_mangle] pub const RAH: usize = 5;
1214
//~^ ERROR const items should never be #[no_mangle]
1315

src/test/ui/suggestions/issue-45562.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: const items should never be #[no_mangle]
2-
--> $DIR/issue-45562.rs:11:14
2+
--> $DIR/issue-45562.rs:13:14
33
|
44
LL | #[no_mangle] pub const RAH: usize = 5;
55
| ---------^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)