Skip to content

Commit a0b4038

Browse files
Add ui regression test for #134221
1 parent de16ed3 commit a0b4038

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/134221>.
2+
// It checks that even if there are comments in the attributes, the attributes
3+
// will still be generated correctly (and therefore fail in this test).
4+
5+
//@ compile-flags:--test --test-args --test-threads=1
6+
//@ failure-status: 101
7+
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
8+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
9+
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
10+
11+
/*!
12+
```rust
13+
#![feature(
14+
foo, //
15+
)]
16+
```
17+
18+
```rust
19+
#![feature(
20+
foo,
21+
)]
22+
```
23+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
running 2 tests
3+
test $DIR/doctest/comment-in-attr-134221.rs - (line 11) ... FAILED
4+
test $DIR/doctest/comment-in-attr-134221.rs - (line 17) ... FAILED
5+
6+
failures:
7+
8+
---- $DIR/doctest/comment-in-attr-134221.rs - (line 11) stdout ----
9+
error[E0635]: unknown feature `foo`
10+
--> $DIR/doctest/comment-in-attr-134221.rs:$LINE:$COL
11+
|
12+
LL | foo, //
13+
| ^^^
14+
15+
error: aborting due to 1 previous error
16+
17+
For more information about this error, try `rustc --explain E0635`.
18+
Couldn't compile the test.
19+
---- $DIR/doctest/comment-in-attr-134221.rs - (line 17) stdout ----
20+
error[E0635]: unknown feature `foo`
21+
--> $DIR/doctest/comment-in-attr-134221.rs:$LINE:$COL
22+
|
23+
LL | foo,
24+
| ^^^
25+
26+
error: aborting due to 1 previous error
27+
28+
For more information about this error, try `rustc --explain E0635`.
29+
Couldn't compile the test.
30+
31+
failures:
32+
$DIR/doctest/comment-in-attr-134221.rs - (line 11)
33+
$DIR/doctest/comment-in-attr-134221.rs - (line 17)
34+
35+
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
36+

0 commit comments

Comments
 (0)