Skip to content

Commit 89f3ae7

Browse files
committed
Add regression test for -Zcrate-attr in rustdoc --test
1 parent ba663c6 commit 89f3ae7

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This is a regression test for unstable options with `--test` option.
2+
//
3+
// <https://github.com/rust-lang/rust/issues/143930>
4+
5+
//@ check-pass
6+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
7+
//@ compile-flags: --test -Zcrate-attr=feature(register_tool) -Zcrate-attr=register_tool(rapx)
8+
9+
#[rapx::tag]
10+
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:11: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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This test verify that `-Zcrate-attr` is respected with `--test` is passed.
2+
//
3+
// <https://github.com/rust-lang/rust/issues/147276>
4+
5+
//@ revisions: normal crate_attr
6+
//@ compile-flags: --test
7+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
8+
//@[crate_attr] check-pass
9+
//@[crate_attr] compile-flags: -Zcrate-attr=feature(used_with_arg)
10+
11+
#[used(linker)]
12+
//[normal]~^ ERROR `#[used(linker)]` is currently unstable
13+
static REPRO: isize = 1;

0 commit comments

Comments
 (0)