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

Minor refactor for rustc_resolve diagnostics match #74213

Merged
merged 1 commit into from
Jul 12, 2020
Merged
Changes from all commits
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
4 changes: 1 addition & 3 deletions src/librustc_resolve/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> {
let ident_span = path.last().map_or(span, |ident| ident.ident.span);
let ns = source.namespace();
let is_expected = &|res| source.is_expected(res);
let is_enum_variant = &|res| {
if let Res::Def(DefKind::Variant, _) = res { true } else { false }
};
let is_enum_variant = &|res| matches!(res, Res::Def(DefKind::Variant, _));

// Make the base error.
let expected = source.descr_expected();
Expand Down