diff options
Diffstat (limited to 'compiler/rustc_ty_utils/src/instance.rs')
-rw-r--r-- | compiler/rustc_ty_utils/src/instance.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 6436713b3..c6f2b16ca 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -202,8 +202,14 @@ fn resolve_associated_item<'tcx>( )), substs: generator_data.substs, }), + traits::ImplSource::Future(future_data) => Some(Instance { + def: ty::InstanceDef::Item(ty::WithOptConstParam::unknown( + future_data.generator_def_id, + )), + substs: future_data.substs, + }), traits::ImplSource::Closure(closure_data) => { - let trait_closure_kind = tcx.fn_trait_kind_from_lang_item(trait_id).unwrap(); + let trait_closure_kind = tcx.fn_trait_kind_from_def_id(trait_id).unwrap(); Instance::resolve_closure( tcx, closure_data.closure_def_id, @@ -264,8 +270,6 @@ fn resolve_associated_item<'tcx>( traits::ImplSource::AutoImpl(..) | traits::ImplSource::Param(..) | traits::ImplSource::TraitAlias(..) - | traits::ImplSource::DiscriminantKind(..) - | traits::ImplSource::Pointee(..) | traits::ImplSource::TraitUpcasting(_) | traits::ImplSource::ConstDestruct(_) => None, }) |