File tree 1 file changed +9
-1
lines changed
compiler/rustc_hir_analysis/src/astconv
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3049,10 +3049,18 @@ 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
+ // If this is an RPITIT and we are using the new RPITIT lowering scheme, we
3057
+ // generate the def_id of an associated type for the trait and return as
3058
+ // type a projection.
3059
+ let def_id = if in_trait && tcx. lower_impl_trait_in_trait_to_assoc_ty ( ) {
3060
+ tcx. associated_item_for_impl_trait_in_trait ( local_def_id) . to_def_id ( )
3061
+ } else {
3062
+ local_def_id. to_def_id ( )
3063
+ } ;
3056
3064
self . impl_trait_ty_to_ty ( def_id, lifetimes, origin, in_trait)
3057
3065
}
3058
3066
ref i => bug ! ( "`impl Trait` pointed to non-opaque type?? {:#?}" , i) ,
You can’t perform that action at this time.
0 commit comments