X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Frustc_resolve%2Fsrc%2Fbuild_reduced_graph.rs;h=e7e419c9b4238207d0c75fc8fc1931d779395765;hb=9f3786b2b1f3450c796041175f08a7cae7da42f3;hp=423c57275333a2c355020942ecfb383816b8f24b;hpb=a5efeb3ea766e41068f3c8b6c61b7bb73b8bcf5d;p=rust.git diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 423c5727533..e7e419c9b42 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -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 {