Skip to content

Commit

Permalink
Add ui regression test for #134221
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 13, 2024
1 parent de16ed3 commit a0b4038
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/rustdoc-ui/doctest/comment-in-attr-134221.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Regression test for <https://github.com/rust-lang/rust/issues/134221>.
// It checks that even if there are comments in the attributes, the attributes
// will still be generated correctly (and therefore fail in this test).

//@ compile-flags:--test --test-args --test-threads=1
//@ failure-status: 101
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"

/*!
```rust
#![feature(
foo, //
)]
```
```rust
#![feature(
foo,
)]
```
*/
36 changes: 36 additions & 0 deletions tests/rustdoc-ui/doctest/comment-in-attr-134221.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

running 2 tests
test $DIR/doctest/comment-in-attr-134221.rs - (line 11) ... FAILED
test $DIR/doctest/comment-in-attr-134221.rs - (line 17) ... FAILED

failures:

---- $DIR/doctest/comment-in-attr-134221.rs - (line 11) stdout ----
error[E0635]: unknown feature `foo`
--> $DIR/doctest/comment-in-attr-134221.rs:$LINE:$COL
|
LL | foo, //
| ^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0635`.
Couldn't compile the test.
---- $DIR/doctest/comment-in-attr-134221.rs - (line 17) stdout ----
error[E0635]: unknown feature `foo`
--> $DIR/doctest/comment-in-attr-134221.rs:$LINE:$COL
|
LL | foo,
| ^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0635`.
Couldn't compile the test.

failures:
$DIR/doctest/comment-in-attr-134221.rs - (line 11)
$DIR/doctest/comment-in-attr-134221.rs - (line 17)

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

0 comments on commit a0b4038

Please sign in to comment.