Skip to content
/ rust Public
forked from rust-lang/rust

Commit c12b4aa

Browse files
committed
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.
1 parent 2b43e66 commit c12b4aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_resolve/src/imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
10121012
// HACK(eddyb) `lint_if_path_starts_with_module` needs at least
10131013
// 2 segments, so the `resolve_path` above won't trigger it.
10141014
let mut full_path = import.module_path.clone();
1015-
full_path.push(Segment::from_ident(Ident::empty()));
1015+
full_path.push(Segment::from_ident(Ident::dummy()));
10161016
self.lint_if_path_starts_with_module(Some(finalize), &full_path, None);
10171017
}
10181018

0 commit comments

Comments
 (0)