Skip to content

Commit 4cd8005

Browse files
committed
Remove an impossible case under EnumInfo::NotEnum
1 parent 74f76ae commit 4cd8005

File tree

1 file changed

+1
-7
lines changed
  • compiler/rustc_pattern_analysis/src/rustc

1 file changed

+1
-7
lines changed

compiler/rustc_pattern_analysis/src/rustc/print.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,7 @@ fn write_struct_like<'tcx>(
116116
Some((variant, name))
117117
}),
118118
EnumInfo::NotEnum => ty.ty_adt_def().and_then(|adt_def| {
119-
if !adt_def.is_enum() {
120-
ty::tls::with(|tcx| {
121-
Some((adt_def.non_enum_variant(), tcx.def_path_str(adt_def.did())))
122-
})
123-
} else {
124-
None
125-
}
119+
ty::tls::with(|tcx| Some((adt_def.non_enum_variant(), tcx.def_path_str(adt_def.did()))))
126120
}),
127121
};
128122

0 commit comments

Comments
 (0)