]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_resolve/src/build_reduced_graph.rs
Rollup merge of #103439 - Nilstrieb:help-me-with-my-macro, r=estebank
[rust.git] / compiler / rustc_resolve / src / build_reduced_graph.rs
index 423c57275333a2c355020942ecfb383816b8f24b..e7e419c9b4238207d0c75fc8fc1931d779395765 100644 (file)
@@ -469,9 +469,11 @@ fn build_reduced_graph_for_use_tree(
                         }
 
                         // Replace `use foo::{ self };` with `use foo;`
+                        let self_span = source.ident.span;
                         source = module_path.pop().unwrap();
                         if rename.is_none() {
-                            ident = source.ident;
+                            // Keep the span of `self`, but the name of `foo`
+                            ident = Ident { name: source.ident.name, span: self_span };
                         }
                     }
                 } else {