Skip to content

Commit a2e0906

Browse files
committed
Removed #[rustc_error] from tests that are all // compile-pass.
I also added `// skip-codegen` to each one, to address potential concerns that this change would otherwise slow down our test suite spending time generating code for files that are really just meant to be checks of compiler diagnostics. (However, I will say: My preference is to not use `// skip-codegen` if one can avoid it. We can use all the testing of how we drive LLVM that we can get...) (Updated post rebase.)
1 parent 0332a39 commit a2e0906

File tree

190 files changed

+362
-1213
lines changed

Some content is hidden

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

190 files changed

+362
-1213
lines changed

src/test/ui/asm/asm-misplaced-option.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
// ignore-mips
2222
// ignore-mips64
2323

24-
#![feature(asm, rustc_attrs)]
25-
24+
// compile-pass
25+
// skip-codegen
26+
#![feature(asm)]
2627
#![allow(dead_code, non_upper_case_globals)]
2728

2829
#[cfg(any(target_arch = "x86",
2930
target_arch = "x86_64"))]
30-
#[rustc_error]
31-
pub fn main() { //~ ERROR compilation successful
31+
pub fn main() {
3232
// assignment not dead
3333
let mut x: isize = 0;
3434
unsafe {

src/test/ui/asm/asm-misplaced-option.stderr

-14
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,3 @@ warning: expected a clobber, found an option
1010
LL | asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile");
1111
| ^^^^^^^^^^
1212

13-
error: compilation successful
14-
--> $DIR/asm-misplaced-option.rs:31:1
15-
|
16-
LL | / pub fn main() { //~ ERROR compilation successful
17-
LL | | // assignment not dead
18-
LL | | let mut x: isize = 0;
19-
LL | | unsafe {
20-
... |
21-
LL | | assert_eq!(x, 13);
22-
LL | | }
23-
| |_^
24-
25-
error: aborting due to previous error
26-

src/test/ui/associated-types/cache/chrono-scan.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(rustc_attrs)]
11+
// compile-pass
12+
// skip-codegen
1213
#![allow(warnings)]
13-
1414
pub type ParseResult<T> = Result<T, ()>;
1515

1616
pub enum Item<'a> { Literal(&'a str),
@@ -35,5 +35,5 @@ pub fn parse<'a, I>(mut s: &str, items: I) -> ParseResult<()>
3535
Ok(())
3636
}
3737

38-
#[rustc_error]
39-
fn main() { } //~ ERROR compilation successful
38+
39+
fn main() { }

src/test/ui/associated-types/cache/chrono-scan.stderr

-8
This file was deleted.

src/test/ui/associated-types/cache/elision.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(rustc_attrs)]
11+
// compile-pass
12+
// skip-codegen
1213
#![allow(warnings)]
13-
1414
// Check that you are allowed to implement using elision but write
1515
// trait without elision (a bug in this cropped up during
1616
// bootstrapping, so this is a regression test).
@@ -30,5 +30,5 @@ impl UnicodeStr for str {
3030
}
3131
}
3232

33-
#[rustc_error]
34-
fn main() { } //~ ERROR compilation successful
33+
34+
fn main() { }

src/test/ui/associated-types/cache/elision.stderr

-8
This file was deleted.

src/test/ui/bad/bad-lint-cap3.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
#![warn(unused)]
1414
#![deny(warnings)]
15-
#![feature(rustc_attrs)]
16-
15+
// compile-pass
16+
// skip-codegen
1717
use std::option; //~ WARN
1818

19-
#[rustc_error]
20-
fn main() {} //~ ERROR: compilation successful
19+
20+
fn main() {}
2121

src/test/ui/bad/bad-lint-cap3.stderr

-8
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,3 @@ LL | #![deny(warnings)]
1111
| ^^^^^^^^
1212
= note: #[warn(unused_imports)] implied by #[warn(warnings)]
1313

14-
error: compilation successful
15-
--> $DIR/bad-lint-cap3.rs:20:1
16-
|
17-
LL | fn main() {} //~ ERROR: compilation successful
18-
| ^^^^^^^^^^^^
19-
20-
error: aborting due to previous error
21-

src/test/ui/coherence/coherence-projection-ok-orphan.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(rustc_attrs)]
11+
// compile-pass
12+
// skip-codegen
1213
#![allow(dead_code)]
13-
1414
// Here we do not get a coherence conflict because `Baz: Iterator`
1515
// does not hold and (due to the orphan rules), we can rely on that.
1616

@@ -25,5 +25,5 @@ impl Foo<i32> for Baz { }
2525

2626
impl<A:Iterator> Foo<A::Item> for A { }
2727

28-
#[rustc_error]
29-
fn main() {} //~ ERROR compilation successful
28+
29+
fn main() {}

src/test/ui/coherence/coherence-projection-ok-orphan.stderr

-8
This file was deleted.

src/test/ui/coherence/coherence-projection-ok.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(rustc_attrs)]
12-
11+
// compile-pass
12+
// skip-codegen
1313
pub trait Foo<P> {}
1414

1515
pub trait Bar {
@@ -24,5 +24,5 @@ impl Bar for i32 {
2424
type Output = u32;
2525
}
2626

27-
#[rustc_error]
28-
fn main() {} //~ ERROR compilation successful
27+
28+
fn main() {}

src/test/ui/coherence/coherence-projection-ok.stderr

-8
This file was deleted.

src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// `MyType: !MyTrait` along with other "fundamental" wrappers.
1313

1414
// aux-build:coherence_copy_like_lib.rs
15-
16-
#![feature(rustc_attrs)]
15+
// compile-pass
16+
// skip-codgen
1717
#![allow(dead_code)]
1818

1919
extern crate coherence_copy_like_lib as lib;
@@ -30,5 +30,5 @@ impl<T: lib::MyCopy> MyTrait for T { }
3030
// Huzzah.
3131
impl MyTrait for lib::MyFundamentalStruct<MyType> { }
3232

33-
#[rustc_error]
34-
fn main() { } //~ ERROR compilation successful
33+
34+
fn main() { }

src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.stderr

-8
This file was deleted.

src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// `MyType: !MyTrait` along with other "fundamental" wrappers.
1313

1414
// aux-build:coherence_copy_like_lib.rs
15-
16-
#![feature(rustc_attrs)]
15+
// compile-pass
16+
// skip-codegen
1717
#![allow(dead_code)]
1818

1919
extern crate coherence_copy_like_lib as lib;
@@ -30,5 +30,5 @@ impl<T: lib::MyCopy> MyTrait for T { }
3030
// Huzzah.
3131
impl<'a> MyTrait for lib::MyFundamentalStruct<&'a MyType> { }
3232

33-
#[rustc_error]
34-
fn main() { } //~ ERROR compilation successful
33+
34+
fn main() { }

src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.stderr

-8
This file was deleted.

src/test/ui/coherence/coherence_local.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// `MyType: !MyTrait` along with other "fundamental" wrappers.
1313

1414
// aux-build:coherence_copy_like_lib.rs
15-
16-
#![feature(rustc_attrs)]
15+
// compile-pass
16+
// skip-codegen
1717
#![allow(dead_code)]
1818

1919
extern crate coherence_copy_like_lib as lib;
@@ -29,5 +29,5 @@ impl lib::MyCopy for Box<MyType> { }
2929
impl lib::MyCopy for lib::MyFundamentalStruct<MyType> { }
3030
impl lib::MyCopy for lib::MyFundamentalStruct<Box<MyType>> { }
3131

32-
#[rustc_error]
33-
fn main() { } //~ ERROR compilation successful
32+
33+
fn main() { }

src/test/ui/coherence/coherence_local.stderr

-8
This file was deleted.

src/test/ui/coherence/coherence_local_ref.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// `MyType: !MyTrait` along with other "fundamental" wrappers.
1313

1414
// aux-build:coherence_copy_like_lib.rs
15-
16-
#![feature(rustc_attrs)]
15+
// compile-pass
16+
// skip-codegen
1717
#![allow(dead_code)]
1818

1919
extern crate coherence_copy_like_lib as lib;
@@ -23,5 +23,5 @@ struct MyType { x: i32 }
2323
// naturally, legal
2424
impl lib::MyCopy for MyType { }
2525

26-
#[rustc_error]
27-
fn main() { } //~ ERROR compilation successful
26+
27+
fn main() { }

src/test/ui/coherence/coherence_local_ref.stderr

-8
This file was deleted.

src/test/ui/conditional-compilation/cfg_attr_path.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(rustc_attrs)]
11+
// compile-pass
12+
// skip-codegen
1213
#![allow(dead_code)]
1314
#![deny(unused_attributes)] // c.f #35584
14-
1515
mod auxiliary {
1616
#[cfg_attr(any(), path = "nonexistent_file.rs")] pub mod namespaced_enums;
1717
#[cfg_attr(all(), path = "namespaced_enums.rs")] pub mod nonexistent_file;
1818
}
1919

20-
#[rustc_error]
21-
fn main() { //~ ERROR compilation successful
20+
21+
fn main() {
2222
let _ = auxiliary::namespaced_enums::Foo::A;
2323
let _ = auxiliary::nonexistent_file::Foo::A;
2424
}

src/test/ui/conditional-compilation/cfg_attr_path.stderr

-11
This file was deleted.

src/test/ui/consts/const-fn-stability-calls-3.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
// Test use of const fn from another crate without a feature gate.
1212

13-
#![feature(rustc_attrs)]
13+
// compile-pass
14+
// skip-codegen
1415
#![allow(unused_variables)]
15-
1616
// aux-build:const_fn_lib.rs
1717

1818
extern crate const_fn_lib;
1919

2020
use const_fn_lib::foo;
2121

22-
#[rustc_error]
23-
fn main() { //~ ERROR compilation successful
22+
23+
fn main() {
2424
let x = foo(); // use outside a constant is ok
2525
}

src/test/ui/consts/const-fn-stability-calls-3.stderr

-10
This file was deleted.

src/test/ui/expanded-cfg.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
11-
#![feature(custom_attribute, rustc_attrs)]
12-
10+
// skip-codegen
11+
// compile-pass
12+
#![feature(custom_attribute)]
1313
macro_rules! mac {
1414
{} => {
1515
#[cfg(attr)]
@@ -28,5 +28,5 @@ macro_rules! mac {
2828

2929
mac! {}
3030

31-
#[rustc_error]
32-
fn main() {} //~ ERROR compilation successful
31+
32+
fn main() {}

src/test/ui/expanded-cfg.stderr

-8
This file was deleted.

0 commit comments

Comments
 (0)