Skip to content

Commit

Permalink
Removed #[rustc_error] from tests that are all // compile-pass.
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
pnkfelix committed Nov 7, 2018
1 parent 0332a39 commit a2e0906
Show file tree
Hide file tree
Showing 190 changed files with 362 additions and 1,213 deletions.
8 changes: 4 additions & 4 deletions src/test/ui/asm/asm-misplaced-option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
// ignore-mips
// ignore-mips64

#![feature(asm, rustc_attrs)]

// compile-pass
// skip-codegen
#![feature(asm)]
#![allow(dead_code, non_upper_case_globals)]

#[cfg(any(target_arch = "x86",
target_arch = "x86_64"))]
#[rustc_error]
pub fn main() { //~ ERROR compilation successful
pub fn main() {
// assignment not dead
let mut x: isize = 0;
unsafe {
Expand Down
14 changes: 0 additions & 14 deletions src/test/ui/asm/asm-misplaced-option.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,3 @@ warning: expected a clobber, found an option
LL | asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile");
| ^^^^^^^^^^

error: compilation successful
--> $DIR/asm-misplaced-option.rs:31:1
|
LL | / pub fn main() { //~ ERROR compilation successful
LL | | // assignment not dead
LL | | let mut x: isize = 0;
LL | | unsafe {
... |
LL | | assert_eq!(x, 13);
LL | | }
| |_^

error: aborting due to previous error

8 changes: 4 additions & 4 deletions src/test/ui/associated-types/cache/chrono-scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]

pub type ParseResult<T> = Result<T, ()>;

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

#[rustc_error]
fn main() { } //~ ERROR compilation successful

fn main() { }
8 changes: 0 additions & 8 deletions src/test/ui/associated-types/cache/chrono-scan.stderr

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/ui/associated-types/cache/elision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]

// Check that you are allowed to implement using elision but write
// trait without elision (a bug in this cropped up during
// bootstrapping, so this is a regression test).
Expand All @@ -30,5 +30,5 @@ impl UnicodeStr for str {
}
}

#[rustc_error]
fn main() { } //~ ERROR compilation successful

fn main() { }
8 changes: 0 additions & 8 deletions src/test/ui/associated-types/cache/elision.stderr

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/ui/bad/bad-lint-cap3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

#![warn(unused)]
#![deny(warnings)]
#![feature(rustc_attrs)]

// compile-pass
// skip-codegen
use std::option; //~ WARN

#[rustc_error]
fn main() {} //~ ERROR: compilation successful

fn main() {}

8 changes: 0 additions & 8 deletions src/test/ui/bad/bad-lint-cap3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,3 @@ LL | #![deny(warnings)]
| ^^^^^^^^
= note: #[warn(unused_imports)] implied by #[warn(warnings)]

error: compilation successful
--> $DIR/bad-lint-cap3.rs:20:1
|
LL | fn main() {} //~ ERROR: compilation successful
| ^^^^^^^^^^^^

error: aborting due to previous error

8 changes: 4 additions & 4 deletions src/test/ui/coherence/coherence-projection-ok-orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]

// Here we do not get a coherence conflict because `Baz: Iterator`
// does not hold and (due to the orphan rules), we can rely on that.

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

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

#[rustc_error]
fn main() {} //~ ERROR compilation successful

fn main() {}
8 changes: 0 additions & 8 deletions src/test/ui/coherence/coherence-projection-ok-orphan.stderr

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/ui/coherence/coherence-projection-ok.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rustc_attrs)]

// compile-pass
// skip-codegen
pub trait Foo<P> {}

pub trait Bar {
Expand All @@ -24,5 +24,5 @@ impl Bar for i32 {
type Output = u32;
}

#[rustc_error]
fn main() {} //~ ERROR compilation successful

fn main() {}
8 changes: 0 additions & 8 deletions src/test/ui/coherence/coherence-projection-ok.stderr

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.

// aux-build:coherence_copy_like_lib.rs

#![feature(rustc_attrs)]
// compile-pass
// skip-codgen
#![allow(dead_code)]

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

#[rustc_error]
fn main() { } //~ ERROR compilation successful

fn main() { }

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.

// aux-build:coherence_copy_like_lib.rs

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]

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

#[rustc_error]
fn main() { } //~ ERROR compilation successful

fn main() { }

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/ui/coherence/coherence_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.

// aux-build:coherence_copy_like_lib.rs

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]

extern crate coherence_copy_like_lib as lib;
Expand All @@ -29,5 +29,5 @@ impl lib::MyCopy for Box<MyType> { }
impl lib::MyCopy for lib::MyFundamentalStruct<MyType> { }
impl lib::MyCopy for lib::MyFundamentalStruct<Box<MyType>> { }

#[rustc_error]
fn main() { } //~ ERROR compilation successful

fn main() { }
8 changes: 0 additions & 8 deletions src/test/ui/coherence/coherence_local.stderr

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/ui/coherence/coherence_local_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.

// aux-build:coherence_copy_like_lib.rs

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]

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

#[rustc_error]
fn main() { } //~ ERROR compilation successful

fn main() { }
8 changes: 0 additions & 8 deletions src/test/ui/coherence/coherence_local_ref.stderr

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/ui/conditional-compilation/cfg_attr_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
#![deny(unused_attributes)] // c.f #35584

mod auxiliary {
#[cfg_attr(any(), path = "nonexistent_file.rs")] pub mod namespaced_enums;
#[cfg_attr(all(), path = "namespaced_enums.rs")] pub mod nonexistent_file;
}

#[rustc_error]
fn main() { //~ ERROR compilation successful

fn main() {
let _ = auxiliary::namespaced_enums::Foo::A;
let _ = auxiliary::nonexistent_file::Foo::A;
}
11 changes: 0 additions & 11 deletions src/test/ui/conditional-compilation/cfg_attr_path.stderr

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/ui/consts/const-fn-stability-calls-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

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

#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(unused_variables)]

// aux-build:const_fn_lib.rs

extern crate const_fn_lib;

use const_fn_lib::foo;

#[rustc_error]
fn main() { //~ ERROR compilation successful

fn main() {
let x = foo(); // use outside a constant is ok
}
10 changes: 0 additions & 10 deletions src/test/ui/consts/const-fn-stability-calls-3.stderr

This file was deleted.

10 changes: 5 additions & 5 deletions src/test/ui/expanded-cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(custom_attribute, rustc_attrs)]

// skip-codegen
// compile-pass
#![feature(custom_attribute)]
macro_rules! mac {
{} => {
#[cfg(attr)]
Expand All @@ -28,5 +28,5 @@ macro_rules! mac {

mac! {}

#[rustc_error]
fn main() {} //~ ERROR compilation successful

fn main() {}
8 changes: 0 additions & 8 deletions src/test/ui/expanded-cfg.stderr

This file was deleted.

Loading

0 comments on commit a2e0906

Please sign in to comment.