File tree 1 file changed +12
-11
lines changed
compiler/rustc_trait_selection/src/traits/select
1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -2362,17 +2362,18 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
2362
2362
}
2363
2363
2364
2364
ty:: Alias ( ty:: Opaque , ty:: AliasTy { def_id, args, .. } ) => {
2365
- if self . infcx . can_define_opaque_ty ( def_id) {
2366
- unreachable ! ( )
2367
- } else {
2368
- // We can resolve the `impl Trait` to its concrete type,
2369
- // which enforces a DAG between the functions requiring
2370
- // the auto trait bounds in question.
2371
- match self . tcx ( ) . type_of_opaque ( def_id) {
2372
- Ok ( ty) => t. rebind ( vec ! [ ty. instantiate( self . tcx( ) , args) ] ) ,
2373
- Err ( _) => {
2374
- return Err ( SelectionError :: OpaqueTypeAutoTraitLeakageUnknown ( def_id) ) ;
2375
- }
2365
+ // FIXME(new-solver): because we're still using the global cache
2366
+ // when defining opaque types, we can reach here, but shouldn't.
2367
+ // The test `type-alias-impl-trait/reveal_local.rs` is an
2368
+ // example.
2369
+
2370
+ // We can resolve the `impl Trait` to its concrete type,
2371
+ // which enforces a DAG between the functions requiring
2372
+ // the auto trait bounds in question.
2373
+ match self . tcx ( ) . type_of_opaque ( def_id) {
2374
+ Ok ( ty) => t. rebind ( vec ! [ ty. instantiate( self . tcx( ) , args) ] ) ,
2375
+ Err ( _) => {
2376
+ return Err ( SelectionError :: OpaqueTypeAutoTraitLeakageUnknown ( def_id) ) ;
2376
2377
}
2377
2378
}
2378
2379
}
You can’t perform that action at this time.
0 commit comments