1
Fork 0

use matches! macro in more places

This commit is contained in:
Matthias Krüger 2023-04-15 20:49:54 +02:00
parent e6e956dade
commit bcc15bba95
13 changed files with 52 additions and 75 deletions

View file

@ -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 {