File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> {
3636
3737 #[ inline]
3838 fn visit_ty ( & mut self , ty : & mut Ty < ' tcx > , _: TyContext ) {
39- * ty = self . tcx . normalize_erasing_regions ( self . param_env , ty) ;
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+ * ty = self . tcx . try_normalize_erasing_regions ( self . param_env , * ty) . unwrap_or ( ty) ;
4043 }
4144}
Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ pub trait Foo {
4+ type Bar ;
5+ }
6+
7+ pub trait Broken {
8+ type Assoc ;
9+ fn broken ( & self ) where Self :: Assoc : Foo ;
10+ }
11+
12+ impl < T > Broken for T {
13+ type Assoc = ( ) ;
14+ fn broken ( & self ) where Self :: Assoc : Foo {
15+ let _x: <Self :: Assoc as Foo >:: Bar ;
16+ }
17+ }
18+
19+ fn main ( ) {
20+ let _m: & dyn Broken < Assoc =( ) > = & ( ) ;
21+ }
You can’t perform that action at this time.
0 commit comments