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 f16ac84
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
20 changes: 20 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,20 @@
// 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

/*!
```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 tests/rustdoc-ui/doctest/comment-in-attr-134221.rs - (line 14) ... FAILED
test tests/rustdoc-ui/doctest/comment-in-attr-134221.rs - (line 8) ... FAILED

failures:

---- tests/rustdoc-ui/doctest/comment-in-attr-134221.rs - (line 14) stdout ----
error[E0635]: unknown feature `foo`
--> tests/rustdoc-ui/doctest/comment-in-attr-134221.rs:15:3
|
LL | foo,
| ^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0635`.
Couldn't compile the test.
---- tests/rustdoc-ui/doctest/comment-in-attr-134221.rs - (line 8) stdout ----
error[E0635]: unknown feature `foo`
--> tests/rustdoc-ui/doctest/comment-in-attr-134221.rs:9:3
|
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:
tests/rustdoc-ui/doctest/comment-in-attr-134221.rs - (line 14)
tests/rustdoc-ui/doctest/comment-in-attr-134221.rs - (line 8)

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

0 comments on commit f16ac84

Please sign in to comment.