summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-02-24 21:37:01 +0000
committerMichael Goulet <michael@errs.io>2025-03-04 00:04:01 +0000
commit09e584671b439dc8a9d57cc900cc26668a69ddea (patch)
tree38763c999f24e795c21a0ccd88a763ba64cccbcf /compiler/rustc_resolve/src
parent06072468fe8de249a39d2fcc42cea51db2649a80 (diff)
downloadrust-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.rs6
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);