Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 114cd00

Browse files
committed
normalize Future::Ouput
1 parent 2e2aac4 commit 114cd00

File tree

1 file changed

+10
-9
lines changed
  • src/librustc_typeck/check

1 file changed

+10
-9
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)