about summary refs log tree commit diff
path: root/tests/rustdoc-ui
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-28 16:27:54 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-28 18:24:58 +0200
commitf3c023433f6e44be208f9e3bb74528449da730c1 (patch)
tree854df48a10630d6ecbb97d8dd4faa6602d43e711 /tests/rustdoc-ui
parent10bd61dcf2e5a7dbe95b4b0588a432a444f907a9 (diff)
downloadrust-f3c023433f6e44be208f9e3bb74528449da730c1.tar.gz
rust-f3c023433f6e44be208f9e3bb74528449da730c1.zip
Add ui test for unsupported `doc(attribute = "...")` case for attributes with namespace
Diffstat (limited to 'tests/rustdoc-ui')
-rw-r--r--tests/rustdoc-ui/doc-attribute-unsupported.rs7
-rw-r--r--tests/rustdoc-ui/doc-attribute-unsupported.stderr10
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/doc-attribute-unsupported.rs b/tests/rustdoc-ui/doc-attribute-unsupported.rs
new file mode 100644
index 00000000000..3bd153117a9
--- /dev/null
+++ b/tests/rustdoc-ui/doc-attribute-unsupported.rs
@@ -0,0 +1,7 @@
+// This is currently not supported but should be!
+
+#![feature(rustdoc_internals)]
+
+#[doc(attribute = "diagnostic::do_not_recommend")] //~ ERROR
+/// bla
+mod yup {}
diff --git a/tests/rustdoc-ui/doc-attribute-unsupported.stderr b/tests/rustdoc-ui/doc-attribute-unsupported.stderr
new file mode 100644
index 00000000000..e2480a548ac
--- /dev/null
+++ b/tests/rustdoc-ui/doc-attribute-unsupported.stderr
@@ -0,0 +1,10 @@
+error: nonexistent builtin attribute `diagnostic::do_not_recommend` used in `#[doc(attribute = "...")]`
+  --> $DIR/doc-attribute-unsupported.rs:5:19
+   |
+LL | #[doc(attribute = "diagnostic::do_not_recommend")]
+   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: only existing builtin attributes are allowed in core/std
+
+error: aborting due to 1 previous error
+