about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_lint/src/internal.rs2
-rw-r--r--library/std/src/lib.rs1
-rw-r--r--src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs2
-rw-r--r--src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr8
4 files changed, 10 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs
index b2265727032..af5972c6c81 100644
--- a/compiler/rustc_lint/src/internal.rs
+++ b/compiler/rustc_lint/src/internal.rs
@@ -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
 }
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 83eb847697d..6c240cb4c3e 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -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
diff --git a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs
index 2b4a65b4a4c..053712a4b4e 100644
--- a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs
+++ b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs
@@ -5,5 +5,7 @@
 
 #![crate_type = "lib"]
 
+#![deny(rustc::existing_doc_keyword)]
+
 #[doc(keyword = "tadam")] //~ ERROR
 mod tadam {}
diff --git a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
index 6fc288ae434..bac44f338b7 100644
--- a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
+++ b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
@@ -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