From 26b873d030f5f6bcc21ea1037c6d546f28f98e52 Mon Sep 17 00:00:00 2001 From: Urgau Date: Tue, 14 May 2024 12:54:26 +0200 Subject: non_local_defs: use span of the impl def and not the impl block --- compiler/rustc_lint/src/non_local_def.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/rustc_lint/src/non_local_def.rs b/compiler/rustc_lint/src/non_local_def.rs index dc65db5e9ec..d4d3afcce3b 100644 --- a/compiler/rustc_lint/src/non_local_def.rs +++ b/compiler/rustc_lint/src/non_local_def.rs @@ -219,7 +219,7 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions { cx.emit_span_lint( NON_LOCAL_DEFINITIONS, - item.span, + item.span.shrink_to_lo().to(impl_.self_ty.span), NonLocalDefinitionsDiag::Impl { depth: self.body_depth, body_kind_descr: cx.tcx.def_kind_descr(parent_def_kind, parent), -- cgit 1.4.1-3-g733a5