Skip to content

Commit

Permalink
Whitelist unsafe_op_in_unsafe_fn in rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSeulArtichaut committed May 27, 2020
1 parent 63066c0 commit db684be
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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<_>>();

Expand Down

0 comments on commit db684be

Please sign in to comment.