File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
compiler/rustc_hir_analysis/src/astconv Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3049,10 +3049,17 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
30493049 }
30503050 & hir:: TyKind :: OpaqueDef ( item_id, lifetimes, in_trait) => {
30513051 let opaque_ty = tcx. hir ( ) . item ( item_id) ;
3052- let def_id = item_id. owner_id . to_def_id ( ) ;
30533052
30543053 match opaque_ty. kind {
30553054 hir:: ItemKind :: OpaqueTy ( hir:: OpaqueTy { origin, .. } ) => {
3055+ let local_def_id = item_id. owner_id . def_id ;
3056+ let def_id = if in_trait
3057+ && tcx. sess . opts . unstable_opts . lower_impl_trait_in_trait_to_assoc_ty
3058+ {
3059+ tcx. associated_item_for_impl_trait_in_trait ( local_def_id) . to_def_id ( )
3060+ } else {
3061+ local_def_id. to_def_id ( )
3062+ } ;
30563063 self . impl_trait_ty_to_ty ( def_id, lifetimes, origin, in_trait)
30573064 }
30583065 ref i => bug ! ( "`impl Trait` pointed to non-opaque type?? {:#?}" , i) ,
You can’t perform that action at this time.
0 commit comments