Add test for EXISTING_DOC_KEYWORD internal lint

This commit is contained in:
Guillaume Gomez 2020-12-03 14:05:58 +01:00
parent 56c64f871e
commit 0105e4a54b
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,9 @@
// compile-flags: -Z unstable-options
#![feature(rustc_private)]
#![feature(doc_keyword)]
#![crate_type = "lib"]
#[doc(keyword = "tadam")] //~ ERROR
mod tadam {}

View File

@ -0,0 +1,11 @@
error: Found non-existing keyword `tadam` used in `#[doc(keyword = "...")]`
--> $DIR/existing_doc_keyword.rs:8:1
|
LL | #[doc(keyword = "tadam")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(rustc::existing_doc_keyword)]` on by default
= help: only existing keywords are allowed in core/std
error: aborting due to previous error