diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-05-18 11:45:55 -0700 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-05-22 13:34:41 -0700 |
| commit | 1fad3b7a0535c4a4da046170d4080e0cd214ee42 (patch) | |
| tree | 347064450e71923a3aa4c0e40892fbf7850d837f | |
| parent | f99519bebb2cdd90379bb2b07a0cfdeeb5d2d469 (diff) | |
| download | rust-1fad3b7a0535c4a4da046170d4080e0cd214ee42.tar.gz rust-1fad3b7a0535c4a4da046170d4080e0cd214ee42.zip | |
Use `mk_trait_obligation_with_new_self_ty` for new suggestion
| -rw-r--r-- | src/librustc_trait_selection/traits/error_reporting/suggestions.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs index ead857ee887..db29f6f3bc6 100644 --- a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs +++ b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs @@ -1892,7 +1892,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { span: Span, ) { debug!( - "suggest_await_befor_try: obligation={:?}, span={:?}, trait_ref={:?}, trait_ref_self_ty={:?}", + "suggest_await_before_try: obligation={:?}, span={:?}, trait_ref={:?}, trait_ref_self_ty={:?}", obligation, span, trait_ref, @@ -1947,16 +1947,15 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { ); debug!( - "suggest_await_befor_try: normalized_projection_type {:?}", + "suggest_await_before_try: normalized_projection_type {:?}", self.resolve_vars_if_possible(&normalized_ty) ); - let try_obligation = self.mk_obligation_for_def_id( - trait_ref.def_id(), - normalized_ty, - obligation.cause.clone(), + let try_obligation = self.mk_trait_obligation_with_new_self_ty( obligation.param_env, + trait_ref, + normalized_ty, ); - debug!("suggest_await_befor_try: try_trait_obligation {:?}", try_obligation); + debug!("suggest_await_before_try: try_trait_obligation {:?}", try_obligation); if self.predicate_may_hold(&try_obligation) && impls_future { if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) { if snippet.ends_with('?') { |
