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 {
3049
3049
}
3050
3050
& hir:: TyKind :: OpaqueDef ( item_id, lifetimes, in_trait) => {
3051
3051
let opaque_ty = tcx. hir ( ) . item ( item_id) ;
3052
- let def_id = item_id. owner_id . to_def_id ( ) ;
3053
3052
3054
3053
match opaque_ty. kind {
3055
3054
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
+ } ;
3056
3063
self . impl_trait_ty_to_ty ( def_id, lifetimes, origin, in_trait)
3057
3064
}
3058
3065
ref i => bug ! ( "`impl Trait` pointed to non-opaque type?? {:#?}" , i) ,
You can’t perform that action at this time.
0 commit comments