Only deny doc_keyword in std and set it as "allow" by default
This commit is contained in:
parent
0105e4a54b
commit
50eb3a89f8
4 changed files with 10 additions and 3 deletions
|
@ -270,7 +270,7 @@ impl EarlyLintPass for LintPassImpl {
|
|||
|
||||
declare_tool_lint! {
|
||||
pub rustc::EXISTING_DOC_KEYWORD,
|
||||
Deny,
|
||||
Allow,
|
||||
"Check that documented keywords in std and core actually exist",
|
||||
report_in_external_macro: true
|
||||
}
|
||||
|
|
|
@ -212,6 +212,7 @@
|
|||
all(target_vendor = "fortanix", target_env = "sgx"),
|
||||
feature(slice_index_methods, coerce_unsized, sgx_platform)
|
||||
)]
|
||||
#![deny(rustc::existing_doc_keyword)]
|
||||
#![cfg_attr(all(test, target_vendor = "fortanix", target_env = "sgx"), feature(fixed_size_array))]
|
||||
// std is implemented with unstable features, many of which are internal
|
||||
// compiler details that will never be stable
|
||||
|
|
|
@ -5,5 +5,7 @@
|
|||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#![deny(rustc::existing_doc_keyword)]
|
||||
|
||||
#[doc(keyword = "tadam")] //~ ERROR
|
||||
mod tadam {}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
error: Found non-existing keyword `tadam` used in `#[doc(keyword = "...")]`
|
||||
--> $DIR/existing_doc_keyword.rs:8:1
|
||||
--> $DIR/existing_doc_keyword.rs:10:1
|
||||
|
|
||||
LL | #[doc(keyword = "tadam")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[deny(rustc::existing_doc_keyword)]` on by default
|
||||
note: the lint level is defined here
|
||||
--> $DIR/existing_doc_keyword.rs:8:9
|
||||
|
|
||||
LL | #![deny(rustc::existing_doc_keyword)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: only existing keywords are allowed in core/std
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
Loading…
Add table
Reference in a new issue