Remove all matching on ty.kind() outside cx
This commit is contained in:
@@ -53,12 +53,11 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
|
||||
}
|
||||
// If the type is opaque and it is revealed anywhere in the column, we take the revealed
|
||||
// version. Otherwise we could encounter constructors for the revealed type and crash.
|
||||
let is_opaque = |ty: Ty<'tcx>| matches!(ty.kind(), ty::Alias(ty::Opaque, ..));
|
||||
let first_ty = self.patterns[0].ty();
|
||||
if is_opaque(first_ty) {
|
||||
if MatchCheckCtxt::is_opaque(first_ty) {
|
||||
for pat in &self.patterns {
|
||||
let ty = pat.ty();
|
||||
if !is_opaque(ty) {
|
||||
if !MatchCheckCtxt::is_opaque(ty) {
|
||||
return Some(ty);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user