about summary refs log tree commit diff
path: root/tests/ui/rustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-03-21 16:59:16 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-03-30 22:56:52 +0200
commitfa2824aef4541230c1cd0c39e307a789bd0820a8 (patch)
tree2aa80d4e9e1e00b8790164406abc3373a397defe /tests/ui/rustdoc
parent48f7148fcab44e030882d3c0a7a93e66a92f2ba4 (diff)
downloadrust-fa2824aef4541230c1cd0c39e307a789bd0820a8.tar.gz
rust-fa2824aef4541230c1cd0c39e307a789bd0820a8.zip
Add test to ensure doc(primitive) is not recognized anymore
Diffstat (limited to 'tests/ui/rustdoc')
-rw-r--r--tests/ui/rustdoc/doc-primitive.rs8
-rw-r--r--tests/ui/rustdoc/doc-primitive.stderr16
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/rustdoc/doc-primitive.rs b/tests/ui/rustdoc/doc-primitive.rs
new file mode 100644
index 00000000000..4336961e3b5
--- /dev/null
+++ b/tests/ui/rustdoc/doc-primitive.rs
@@ -0,0 +1,8 @@
+#![deny(invalid_doc_attributes)]
+
+#[doc(primitive = "foo")]
+//~^ ERROR unknown `doc` attribute `primitive`
+//~| WARN
+mod bar {}
+
+fn main() {}
diff --git a/tests/ui/rustdoc/doc-primitive.stderr b/tests/ui/rustdoc/doc-primitive.stderr
new file mode 100644
index 00000000000..d61eb381647
--- /dev/null
+++ b/tests/ui/rustdoc/doc-primitive.stderr
@@ -0,0 +1,16 @@
+error: unknown `doc` attribute `primitive`
+  --> $DIR/doc-primitive.rs:3:7
+   |
+LL | #[doc(primitive = "foo")]
+   |       ^^^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+note: the lint level is defined here
+  --> $DIR/doc-primitive.rs:1:9
+   |
+LL | #![deny(invalid_doc_attributes)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+