@@ -5317,22 +5317,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
53175317 item_def_id,
53185318 } ;
53195319
5320+ let cause = traits:: ObligationCause :: misc ( sp, self . body_id ) ;
5321+ let normalized_ty = self . fulfillment_cx . borrow_mut ( ) . normalize_projection_type (
5322+ & self . infcx ,
5323+ self . param_env ,
5324+ projection_ty,
5325+ cause,
5326+ ) ;
5327+ debug ! ( "suggest_missing_await: projection_type {:?}" , normalized_ty) ;
5328+
53205329 let predicate =
53215330 ty:: Predicate :: Projection ( ty:: Binder :: bind ( ty:: ProjectionPredicate {
53225331 projection_ty,
53235332 ty : expected,
53245333 } ) ) ;
53255334 let obligation = traits:: Obligation :: new ( self . misc ( sp) , self . param_env , predicate) ;
5326- debug ! ( "suggest_missing_await: trying obligation {:?}" , obligation) ;
53275335
5328- //let try_trait_def_id = self.tcx.require_lang_item(lang_items::TryTraitLangItem, None);
5329- //let try_trait_ref = ty::TraitRef {
5330- // def_id: try_trait_def_id,
5331- // substs: self.tcx.mk_substs_trait(self.tcx.type_of(item_def_id), &[]),
5332- //};
5333- //let try_obligation = traits::Obligation::new(self.misc(sp), self.param_env, try_trait_ref.without_const().to_predicate());
5334- //let try_trait_is_implemented = self.predicate_must_hold_modulo_regions(&try_obligation);
5335- //debug!("suggest_missing_await: try trait is implemented {}", try_trait_is_implemented);
5336+ debug ! ( "suggest_missing_await: trying obligation {:?}" , obligation) ;
53365337
53375338 if self . infcx . predicate_may_hold ( & obligation) {
53385339 debug ! ( "suggest_missing_await: obligation held: {:?}" , obligation) ;
0 commit comments