From f16ac84e6a216c8f210ba4c2ad60ea211b5c1cfc Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 13 Dec 2024 16:20:00 +0100 Subject: [PATCH] Add ui regression test for #134221 --- .../doctest/comment-in-attr-134221.rs | 20 +++++++++++ .../doctest/comment-in-attr-134221.stdout | 36 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/rustdoc-ui/doctest/comment-in-attr-134221.rs create mode 100644 tests/rustdoc-ui/doctest/comment-in-attr-134221.stdout diff --git a/tests/rustdoc-ui/doctest/comment-in-attr-134221.rs b/tests/rustdoc-ui/doctest/comment-in-attr-134221.rs new file mode 100644 index 0000000000000..c55d5ef60491e --- /dev/null +++ b/tests/rustdoc-ui/doctest/comment-in-attr-134221.rs @@ -0,0 +1,20 @@ +// Regression test for . +// 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, +)] +``` +*/ diff --git a/tests/rustdoc-ui/doctest/comment-in-attr-134221.stdout b/tests/rustdoc-ui/doctest/comment-in-attr-134221.stdout new file mode 100644 index 0000000000000..283aec9253d49 --- /dev/null +++ b/tests/rustdoc-ui/doctest/comment-in-attr-134221.stdout @@ -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 +