about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-04-09 15:45:25 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-04-15 16:05:13 +1000
commitc12b4aade031e4ca4babb9cdfbe53f466ae76462 (patch)
tree77ce1583764a7464b3d4373b55d3ecd0f7007dfe
parent2b43e664964bd6eeff6d0a1787ab2ef2a04f3e94 (diff)
downloadrust-c12b4aade031e4ca4babb9cdfbe53f466ae76462.tar.gz
rust-c12b4aade031e4ca4babb9cdfbe53f466ae76462.zip
Use a dummy ident for a `lint_if_path_starts_with_module` call.
This is pretty weird code. As the `HACK` comment indicates, we push the
empty ident here only to make the path longer, so certain checks to
occur within `lint_if_path_starts_with_module`. `dummy` is a better
choice because it explicitly communicates that the actual value doesn't
matter.
-rw-r--r--compiler/rustc_resolve/src/imports.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs
index 3f3b455f4db..762e08b2be5 100644
--- a/compiler/rustc_resolve/src/imports.rs
+++ b/compiler/rustc_resolve/src/imports.rs
@@ -1012,7 +1012,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
                         // HACK(eddyb) `lint_if_path_starts_with_module` needs at least
                         // 2 segments, so the `resolve_path` above won't trigger it.
                         let mut full_path = import.module_path.clone();
-                        full_path.push(Segment::from_ident(Ident::empty()));
+                        full_path.push(Segment::from_ident(Ident::dummy()));
                         self.lint_if_path_starts_with_module(Some(finalize), &full_path, None);
                     }