1
Fork 0

Replaced use of #[rustc_error] with // skip-codegen.

This test specifically notes that it does not want to invoke the
linker, due to the way it (IMO weakly) exercises the `#[link=...]`
attribute.

In any case, removing the the `#[rustc_error]` here uncovered an
"invalid windows subsystem" error that was previously not included in
the transcript of diagnostic output. So that's a step forward, (right?).
This commit is contained in:
Felix S. Klock II 2018-10-31 12:24:01 +01:00
parent bf544fa920
commit 0332a39f07
2 changed files with 9 additions and 15 deletions

View file

@ -40,7 +40,7 @@
// inputs are handled by each, and (2.) to ease searching for related
// occurrences in the source text.
#![feature(rustc_attrs)] // For `rustc_error`; see note below.
// skip-codegen
#![warn(unused_attributes, unknown_lints)]
#![allow(dead_code)]
#![allow(stable_features)]
@ -584,7 +584,7 @@ mod export_name {
#[export_name = "2200"] impl S { }
}
// Note that this test ends with a `#[rustc_error] fn main()`, so it
// Note that this test has a `skip-codegen`, so it
// will never invoke the linker. These are here nonetheless to point
// out that we allow them at non-crate-level (though I do not know
// whether they have the same effect here as at crate-level).
@ -835,12 +835,12 @@ mod type_length_limit {
//~| WARN crate-level attribute should be an inner attribute
}
// Since we expect for the mix of attributes used here to compile
// successfully, and we are just testing for the expected warnings of
// various (mis)uses of attributes, we use the `rustc_error` attribute
// on the `fn main()`.
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
println!("Hello World");
}

View file

@ -1303,13 +1303,7 @@ warning: unused attribute
LL | #![proc_macro_derive = "2500"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: compilation successful
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | println!("Hello World");
LL | | }
| |_^
error: invalid windows subsystem `1000`, only `windows` and `console` are allowed
error: aborting due to previous error