From 4cd800503f0c0ba3c26f30c98aff755be6b9be43 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 2 Aug 2024 20:10:17 +1000 Subject: [PATCH] Remove an impossible case under `EnumInfo::NotEnum` --- compiler/rustc_pattern_analysis/src/rustc/print.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/rustc_pattern_analysis/src/rustc/print.rs b/compiler/rustc_pattern_analysis/src/rustc/print.rs index b85c15d8392..d14233ee024 100644 --- a/compiler/rustc_pattern_analysis/src/rustc/print.rs +++ b/compiler/rustc_pattern_analysis/src/rustc/print.rs @@ -116,13 +116,7 @@ fn write_struct_like<'tcx>( Some((variant, name)) }), EnumInfo::NotEnum => ty.ty_adt_def().and_then(|adt_def| { - if !adt_def.is_enum() { - ty::tls::with(|tcx| { - Some((adt_def.non_enum_variant(), tcx.def_path_str(adt_def.did()))) - }) - } else { - None - } + ty::tls::with(|tcx| Some((adt_def.non_enum_variant(), tcx.def_path_str(adt_def.did())))) }), };