use matches! macro in more places
This commit is contained in:
parent
e6e956dade
commit
bcc15bba95
13 changed files with 52 additions and 75 deletions
|
@ -384,13 +384,8 @@ impl<'a> IntoDiagnostic<'a> for NonExhaustivePatternsTypeNotEmpty<'_, '_, '_> {
|
|||
diag.span_note(span, fluent::mir_build_def_note);
|
||||
}
|
||||
|
||||
let is_variant_list_non_exhaustive = match self.ty.kind() {
|
||||
ty::Adt(def, _) if def.is_variant_list_non_exhaustive() && !def.did().is_local() => {
|
||||
true
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
|
||||
let is_variant_list_non_exhaustive = matches!(self.ty.kind(),
|
||||
ty::Adt(def, _) if def.is_variant_list_non_exhaustive() && !def.did().is_local());
|
||||
if is_variant_list_non_exhaustive {
|
||||
diag.note(fluent::mir_build_non_exhaustive_type_note);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue