diff options
| author | Urgau <urgau@numericable.fr> | 2024-05-14 12:54:26 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-05-27 23:58:55 +0200 |
| commit | 26b873d030f5f6bcc21ea1037c6d546f28f98e52 (patch) | |
| tree | 5e48a9e0cfae86066788e6b98b190b89c2a808b0 /compiler | |
| parent | de1c122950ac14801f5b1edf25f17e5297f797fd (diff) | |
| download | rust-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.rs | 2 |
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), |
