diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-24 21:37:01 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-03-04 00:04:01 +0000 |
| commit | 09e584671b439dc8a9d57cc900cc26668a69ddea (patch) | |
| tree | 38763c999f24e795c21a0ccd88a763ba64cccbcf /compiler/rustc_resolve/src | |
| parent | 06072468fe8de249a39d2fcc42cea51db2649a80 (diff) | |
| download | rust-09e584671b439dc8a9d57cc900cc26668a69ddea.tar.gz rust-09e584671b439dc8a9d57cc900cc26668a69ddea.zip | |
Also note struct access, and fix macro expansion from foreign crates
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index c86305e23d1..47b21f86641 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -431,8 +431,10 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { // Try to get the span of the identifier within the path's syntax context // (if that's different). - if let Some(within_macro_span) = base_error.span.within_macro(span) { - err.span_label(within_macro_span, "within this macro"); + if let Some(within_macro_span) = + base_error.span.within_macro(span, self.r.tcx.sess.source_map()) + { + err.span_label(within_macro_span, "due to this macro variable"); } self.detect_missing_binding_available_from_pattern(&mut err, path, following_seg); |
