File tree 1 file changed +13
-1
lines changed
compiler/rustc_mir_transform/src
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,23 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> {
34
34
self . tcx
35
35
}
36
36
37
+ #[ inline]
38
+ fn visit_constant ( & mut self , constant : & mut Constant < ' tcx > , _: Location ) {
39
+ // We have to use `try_normalize_erasing_regions` here, since it's
40
+ // possible that we visit impossible-to-satisfy where clauses here,
41
+ // see #91745
42
+ if let Ok ( c) = self . tcx . try_normalize_erasing_regions ( self . param_env , constant. literal ) {
43
+ constant. literal = c;
44
+ }
45
+ }
46
+
37
47
#[ inline]
38
48
fn visit_ty ( & mut self , ty : & mut Ty < ' tcx > , _: TyContext ) {
39
49
// We have to use `try_normalize_erasing_regions` here, since it's
40
50
// possible that we visit impossible-to-satisfy where clauses here,
41
51
// see #91745
42
- * ty = self . tcx . try_normalize_erasing_regions ( self . param_env , * ty) . unwrap_or ( * ty) ;
52
+ if let Ok ( t) = self . tcx . try_normalize_erasing_regions ( self . param_env , * ty) {
53
+ * ty = t;
54
+ }
43
55
}
44
56
}
You can’t perform that action at this time.
0 commit comments