Skip to content

Commit c1443e2

Browse files
committed
Add regression test for -Zcrate-attr in rustdoc --test
1 parent e914a1a commit c1443e2

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This test verifies that unstable options like `-Zcrate-attr` are respected when `--test` is
2+
// passed.
3+
//
4+
// <https://github.com/rust-lang/rust/issues/143930>
5+
//
6+
// NOTE: If any of these command line arguments or features get stabilized, please replace with
7+
// another unstable one.
8+
9+
//@ check-pass
10+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
11+
//@ compile-flags: --test -Zcrate-attr=feature(register_tool) -Zcrate-attr=register_tool(rapx)
12+
13+
#[rapx::tag]
14+
fn f() {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
running 0 tests
3+
4+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
running 0 tests
3+
4+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
5+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0658]: `#[used(linker)]` is currently unstable
2+
--> $DIR/unstable-opts-147276.rs:15:1
3+
|
4+
LL | #[used(linker)]
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #93798 <https://github.com/rust-lang/rust/issues/93798> for more information
8+
= help: add `#![feature(used_with_arg)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error: aborting due to 1 previous error
12+
13+
For more information about this error, try `rustc --explain E0658`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// This test verifies that unstable options like `-Zcrate-attr` are respected when `--test` is
2+
// passed.
3+
//
4+
// <https://github.com/rust-lang/rust/issues/147276>
5+
//
6+
// NOTE: If any of these command line arguments or features get stabilized, please replace with
7+
// another unstable one.
8+
9+
//@ revisions: normal crate_attr
10+
//@ compile-flags: --test
11+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
12+
//@[crate_attr] check-pass
13+
//@[crate_attr] compile-flags: -Zcrate-attr=feature(used_with_arg)
14+
15+
#[used(linker)]
16+
//[normal]~^ ERROR `#[used(linker)]` is currently unstable
17+
static REPRO: isize = 1;

0 commit comments

Comments
 (0)