about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-05-14 12:54:26 +0200
committerUrgau <urgau@numericable.fr>2024-05-27 23:58:55 +0200
commit26b873d030f5f6bcc21ea1037c6d546f28f98e52 (patch)
tree5e48a9e0cfae86066788e6b98b190b89c2a808b0 /compiler
parentde1c122950ac14801f5b1edf25f17e5297f797fd (diff)
downloadrust-26b873d030f5f6bcc21ea1037c6d546f28f98e52.tar.gz
rust-26b873d030f5f6bcc21ea1037c6d546f28f98e52.zip
non_local_defs: use span of the impl def and not the impl block
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_lint/src/non_local_def.rs2
1 files changed, 1 insertions, 1 deletions
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),