X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_trait_selection%2Fsrc%2Ftraits%2Ferror_reporting%2Fsuggestions.rs;h=59aef52910ee3f287b359383db57b2fcb1e31d61;hb=03a8a4ff3e7cf0633ceaf0a5fa8d347cfe49e809;hp=b35b9d62759c73267bf4d3f217616a6305b23592;hpb=b3b9383f8d1324ca2fd34a34cdd026ba40c2e935;p=rust.git diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index b35b9d62759..59aef52910e 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -133,7 +133,7 @@ fn get_from_await_ty( .cloned() .unwrap_or_else(|| { bug!( - "node_type: no type for node `{}`", + "node_type: no type for node {}", ty::tls::with(|tcx| tcx .hir() .node_to_string(await_expr.hir_id)) @@ -679,6 +679,7 @@ fn suggest_restricting_param_bound( ¶m_name, &constraint, Some(trait_pred.def_id()), + None, ) { return; } @@ -897,7 +898,7 @@ fn suggest_fn_call( return false; } - let self_ty = self.replace_bound_vars_with_fresh_vars( + let self_ty = self.instantiate_binder_with_fresh_vars( DUMMY_SP, LateBoundRegionConversionTime::FnCall, trait_pred.self_ty(), @@ -1087,6 +1088,7 @@ fn suggest_add_clone_to_arg( param.name.as_str(), "Clone", Some(clone_trait), + None, ); } err.span_suggestion_verbose( @@ -1189,7 +1191,7 @@ fn extract_callable_info( } }) else { return None; }; - let output = self.replace_bound_vars_with_fresh_vars( + let output = self.instantiate_binder_with_fresh_vars( DUMMY_SP, LateBoundRegionConversionTime::FnCall, output, @@ -1198,7 +1200,7 @@ fn extract_callable_info( .skip_binder() .iter() .map(|ty| { - self.replace_bound_vars_with_fresh_vars( + self.instantiate_binder_with_fresh_vars( DUMMY_SP, LateBoundRegionConversionTime::FnCall, inputs.rebind(*ty), @@ -3804,13 +3806,13 @@ fn hint_missing_borrow<'tcx>( err: &mut Diagnostic, ) { let found_args = match found.kind() { - ty::FnPtr(f) => infcx.replace_bound_vars_with_placeholders(*f).inputs().iter(), + ty::FnPtr(f) => infcx.instantiate_binder_with_placeholders(*f).inputs().iter(), kind => { span_bug!(span, "found was converted to a FnPtr above but is now {:?}", kind) } }; let expected_args = match expected.kind() { - ty::FnPtr(f) => infcx.replace_bound_vars_with_placeholders(*f).inputs().iter(), + ty::FnPtr(f) => infcx.instantiate_binder_with_placeholders(*f).inputs().iter(), kind => { span_bug!(span, "expected was converted to a FnPtr above but is now {:?}", kind) }