Remove usage of DUMMY_HIR_ID in FnCtxt::get_conversion_methods

This commit is contained in:
marmeladema 2020-04-13 17:57:39 +01:00
parent e08ad7ae58
commit d0409ead2f
2 changed files with 4 additions and 8 deletions

View file

@ -217,14 +217,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
span: Span,
expected: Ty<'tcx>,
checked_ty: Ty<'tcx>,
hir_id: hir::HirId,
) -> Vec<AssocItem> {
let mut methods = self.probe_for_return_type(
span,
probe::Mode::MethodCall,
expected,
checked_ty,
hir::DUMMY_HIR_ID,
);
let mut methods =
self.probe_for_return_type(span, probe::Mode::MethodCall, expected, checked_ty, hir_id);
methods.retain(|m| {
self.has_no_input_arg(m)
&& self

View file

@ -5000,7 +5000,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
} else if !self.check_for_cast(err, expr, found, expected) {
let is_struct_pat_shorthand_field =
self.is_hir_id_from_struct_pattern_shorthand_field(expr.hir_id, expr.span);
let methods = self.get_conversion_methods(expr.span, expected, found);
let methods = self.get_conversion_methods(expr.span, expected, found, expr.hir_id);
if let Ok(expr_text) = self.sess().source_map().span_to_snippet(expr.span) {
let mut suggestions = iter::repeat(&expr_text)
.zip(methods.iter())