@@ -5317,22 +5317,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
5317
5317
item_def_id,
5318
5318
} ;
5319
5319
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
+
5320
5329
let predicate =
5321
5330
ty:: Predicate :: Projection ( ty:: Binder :: bind ( ty:: ProjectionPredicate {
5322
5331
projection_ty,
5323
5332
ty : expected,
5324
5333
} ) ) ;
5325
5334
let obligation = traits:: Obligation :: new ( self . misc ( sp) , self . param_env , predicate) ;
5326
- debug ! ( "suggest_missing_await: trying obligation {:?}" , obligation) ;
5327
5335
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) ;
5336
5337
5337
5338
if self . infcx . predicate_may_hold ( & obligation) {
5338
5339
debug ! ( "suggest_missing_await: obligation held: {:?}" , obligation) ;
0 commit comments