diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-06-25 18:45:25 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-06-30 08:45:43 +0000 |
| commit | 65aac24a088600c5fc81c0799e5b2de6630d7535 (patch) | |
| tree | 9b99a5523449e2ca492cb46deb19884570e6b016 /compiler/rustc_hir_analysis/src/check/wfcheck.rs | |
| parent | 5ddae353fe4807c46cb953fe172f2fe7d109847b (diff) | |
| download | rust-65aac24a088600c5fc81c0799e5b2de6630d7535.tar.gz rust-65aac24a088600c5fc81c0799e5b2de6630d7535.zip | |
Avoid some eager uses of HIR spans
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/wfcheck.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/wfcheck.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 5eb49822596..6f12c84139b 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -978,7 +978,7 @@ pub(crate) fn check_associated_item( let sig = tcx.fn_sig(item.def_id).instantiate_identity(); let hir_sig = tcx.hir_node_by_def_id(item_id).fn_sig().expect("bad signature for method"); - check_fn_or_method(wfcx, sig, hir_sig.decl, item.def_id.expect_local()); + check_fn_or_method(wfcx, sig, hir_sig.decl, item_id); check_method_receiver(wfcx, hir_sig, item, self_ty) } ty::AssocKind::Type { .. } => { @@ -1655,17 +1655,18 @@ fn check_method_receiver<'tcx>( } let span = fn_sig.decl.inputs[0].span; + let loc = Some(WellFormedLoc::Param { function: method.def_id.expect_local(), param_idx: 0 }); let sig = tcx.fn_sig(method.def_id).instantiate_identity(); let sig = tcx.liberate_late_bound_regions(method.def_id, sig); - let sig = wfcx.normalize(span, None, sig); + let sig = wfcx.normalize(DUMMY_SP, loc, sig); debug!("check_method_receiver: sig={:?}", sig); - let self_ty = wfcx.normalize(span, None, self_ty); + let self_ty = wfcx.normalize(DUMMY_SP, loc, self_ty); let receiver_ty = sig.inputs()[0]; - let receiver_ty = wfcx.normalize(span, None, receiver_ty); + let receiver_ty = wfcx.normalize(DUMMY_SP, loc, receiver_ty); // If the receiver already has errors reported, consider it valid to avoid // unnecessary errors (#58712). |
