Skip to content

Commit 0332a39

Browse files
committed
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?).
1 parent bf544fa commit 0332a39

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
// inputs are handled by each, and (2.) to ease searching for related
4141
// occurrences in the source text.
4242

43-
#![feature(rustc_attrs)] // For `rustc_error`; see note below.
43+
// skip-codegen
4444
#![warn(unused_attributes, unknown_lints)]
4545
#![allow(dead_code)]
4646
#![allow(stable_features)]
@@ -584,7 +584,7 @@ mod export_name {
584584
#[export_name = "2200"] impl S { }
585585
}
586586

587-
// Note that this test ends with a `#[rustc_error] fn main()`, so it
587+
// Note that this test has a `skip-codegen`, so it
588588
// will never invoke the linker. These are here nonetheless to point
589589
// out that we allow them at non-crate-level (though I do not know
590590
// whether they have the same effect here as at crate-level).
@@ -835,12 +835,12 @@ mod type_length_limit {
835835
//~| WARN crate-level attribute should be an inner attribute
836836
}
837837

838-
// Since we expect for the mix of attributes used here to compile
839-
// successfully, and we are just testing for the expected warnings of
840-
// various (mis)uses of attributes, we use the `rustc_error` attribute
841-
// on the `fn main()`.
842838

843-
#[rustc_error]
844-
fn main() { //~ ERROR compilation successful
839+
840+
841+
842+
843+
844+
fn main() {
845845
println!("Hello World");
846846
}

src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -1303,13 +1303,7 @@ warning: unused attribute
13031303
LL | #![proc_macro_derive = "2500"] //~ WARN unused attribute
13041304
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13051305

1306-
error: compilation successful
1307-
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:1
1308-
|
1309-
LL | / fn main() { //~ ERROR compilation successful
1310-
LL | | println!("Hello World");
1311-
LL | | }
1312-
| |_^
1306+
error: invalid windows subsystem `1000`, only `windows` and `console` are allowed
13131307

13141308
error: aborting due to previous error
13151309

0 commit comments

Comments
 (0)