about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeSeulArtichaut <leseulartichaut@gmail.com>2020-05-27 19:32:00 +0200
committerLeSeulArtichaut <leseulartichaut@gmail.com>2020-05-28 00:45:06 +0200
commitdb684beb4e40aae70a38e22e4aa91251349bf49b (patch)
tree381acc6f376405d810dbedb2a1b044a78857cac0
parent63066c0c06de27bc84f7fbbe683b59d4cb0441db (diff)
downloadrust-db684beb4e40aae70a38e22e4aa91251349bf49b.tar.gz
rust-db684beb4e40aae70a38e22e4aa91251349bf49b.zip
Whitelist `unsafe_op_in_unsafe_fn` in rustdoc
-rw-r--r--src/librustdoc/core.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index bf59b3f2573..331ce1453e1 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -226,6 +226,11 @@ where
 {
     let warnings_lint_name = lint::builtin::WARNINGS.name;
 
+    // Whitelist feature-gated lints to avoid feature errors when trying to
+    // allow all lints.
+    // FIXME(LeSeulArtichaut): handle feature-gated lints properly.
+    let unsafe_op_in_unsafe_fn_name = rustc_lint::builtin::UNSAFE_OP_IN_UNSAFE_FN.name;
+
     whitelisted_lints.push(warnings_lint_name.to_owned());
     whitelisted_lints.extend(lint_opts.iter().map(|(lint, _)| lint).cloned());
 
@@ -236,7 +241,13 @@ where
     };
 
     let lint_opts = lints()
-        .filter_map(|lint| if lint.name == warnings_lint_name { None } else { filter_call(lint) })
+        .filter_map(|lint| {
+            if lint.name == warnings_lint_name || lint.name == unsafe_op_in_unsafe_fn_name {
+                None
+            } else {
+                filter_call(lint)
+            }
+        })
         .chain(lint_opts.into_iter())
         .collect::<Vec<_>>();