Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RFC 2585: unsafe blocks in unsafe fn #71862

Merged
merged 16 commits into from
May 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
nikomatsakis marked this conversation as resolved.
Show resolved Hide resolved
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