Skip to content

Commit b26fea5

Browse files
committed
don't include additional opaquecast
1 parent b2656e7 commit b26fea5

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_mir_build/src/build/matches

1 file changed

+1
-1
lines changed

compiler/rustc_mir_build/src/build/matches/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl<'pat, 'tcx> MatchPair<'pat, 'tcx> {
109109
let may_need_cast = match place {
110110
PlaceBuilder::Local { local, ref projection } => {
111111
let ty = Place::ty_from(local, projection, &cx.local_decls, cx.tcx).ty;
112-
ty != pattern.ty && ty.has_opaque_types()
112+
ty.has_opaque_types() && !pattern.ty.has_opaque_types()
113113
}
114114
_ => true,
115115
};

0 commit comments

Comments
 (0)