Skip to content

Commit d0409ea

Browse files
committed
Remove usage of DUMMY_HIR_ID in FnCtxt::get_conversion_methods
1 parent e08ad7a commit d0409ea

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/librustc_typeck/check/demand.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
217217
span: Span,
218218
expected: Ty<'tcx>,
219219
checked_ty: Ty<'tcx>,
220+
hir_id: hir::HirId,
220221
) -> Vec<AssocItem> {
221-
let mut methods = self.probe_for_return_type(
222-
span,
223-
probe::Mode::MethodCall,
224-
expected,
225-
checked_ty,
226-
hir::DUMMY_HIR_ID,
227-
);
222+
let mut methods =
223+
self.probe_for_return_type(span, probe::Mode::MethodCall, expected, checked_ty, hir_id);
228224
methods.retain(|m| {
229225
self.has_no_input_arg(m)
230226
&& self

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5000,7 +5000,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
50005000
} else if !self.check_for_cast(err, expr, found, expected) {
50015001
let is_struct_pat_shorthand_field =
50025002
self.is_hir_id_from_struct_pattern_shorthand_field(expr.hir_id, expr.span);
5003-
let methods = self.get_conversion_methods(expr.span, expected, found);
5003+
let methods = self.get_conversion_methods(expr.span, expected, found, expr.hir_id);
50045004
if let Ok(expr_text) = self.sess().source_map().span_to_snippet(expr.span) {
50055005
let mut suggestions = iter::repeat(&expr_text)
50065006
.zip(methods.iter())

0 commit comments

Comments
 (0)