Skip to content

Commit 353d637

Browse files
committed
change the order of path suggestions
1 parent cfff31b commit 353d637

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_resolve/src/diagnostics.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,12 @@ crate fn show_candidates(
17071707
candidates.iter().map(|c| path_names_to_string(&c.path)).collect();
17081708

17091709
path_strings.sort();
1710+
let core_path_strings =
1711+
path_strings.iter().filter(|p| p.starts_with("core::")).cloned().collect::<Vec<String>>();
1712+
if !core_path_strings.is_empty() {
1713+
path_strings.retain(|p| !p.starts_with("core::"));
1714+
}
1715+
path_strings.extend(core_path_strings);
17101716
path_strings.dedup();
17111717

17121718
let (determiner, kind) = if candidates.len() == 1 {

0 commit comments

Comments
 (0)