about summary refs log tree commit diff
path: root/tests/ui/rustdoc/doc_keyword.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rustdoc/doc_keyword.rs')
-rw-r--r--tests/ui/rustdoc/doc_keyword.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/rustdoc/doc_keyword.rs b/tests/ui/rustdoc/doc_keyword.rs
new file mode 100644
index 00000000000..68a8802b2f6
--- /dev/null
+++ b/tests/ui/rustdoc/doc_keyword.rs
@@ -0,0 +1,20 @@
+#![crate_type = "lib"]
+#![feature(rustdoc_internals)]
+
+#![doc(keyword = "hello")] //~ ERROR
+
+#[doc(keyword = "hell")] //~ ERROR
+mod foo {
+    fn hell() {}
+}
+
+#[doc(keyword = "hall")] //~ ERROR
+fn foo() {}
+
+
+// Regression test for the ICE described in #83512.
+trait Foo {
+    #[doc(keyword = "match")]
+    //~^ ERROR: `#[doc(keyword = "...")]` should be used on modules
+    fn quux() {}
+}