Skip to content

Commit db684be

Browse files
Whitelist unsafe_op_in_unsafe_fn in rustdoc
1 parent 63066c0 commit db684be

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/librustdoc/core.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ where
226226
{
227227
let warnings_lint_name = lint::builtin::WARNINGS.name;
228228

229+
// Whitelist feature-gated lints to avoid feature errors when trying to
230+
// allow all lints.
231+
// FIXME(LeSeulArtichaut): handle feature-gated lints properly.
232+
let unsafe_op_in_unsafe_fn_name = rustc_lint::builtin::UNSAFE_OP_IN_UNSAFE_FN.name;
233+
229234
whitelisted_lints.push(warnings_lint_name.to_owned());
230235
whitelisted_lints.extend(lint_opts.iter().map(|(lint, _)| lint).cloned());
231236

@@ -236,7 +241,13 @@ where
236241
};
237242

238243
let lint_opts = lints()
239-
.filter_map(|lint| if lint.name == warnings_lint_name { None } else { filter_call(lint) })
244+
.filter_map(|lint| {
245+
if lint.name == warnings_lint_name || lint.name == unsafe_op_in_unsafe_fn_name {
246+
None
247+
} else {
248+
filter_call(lint)
249+
}
250+
})
240251
.chain(lint_opts.into_iter())
241252
.collect::<Vec<_>>();
242253

0 commit comments

Comments
 (0)