Skip to content

Commit

Permalink
Rollup merge of #89224 - TaKO8Ki:change-the-order-of-suggestions, r=j…
Browse files Browse the repository at this point in the history
…oshtriplett

Change the order of imports suggestions

closes #83564
  • Loading branch information
Manishearth authored Sep 26, 2021
2 parents 653dcaa + 4c23905 commit 04d3f93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,9 @@ crate fn show_candidates(
candidates.iter().map(|c| path_names_to_string(&c.path)).collect();

path_strings.sort();
let core_path_strings =
path_strings.drain_filter(|p| p.starts_with("core::")).collect::<Vec<String>>();
path_strings.extend(core_path_strings);
path_strings.dedup();

let (determiner, kind) = if candidates.len() == 1 {
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(box_patterns)]
#![feature(drain_filter)]
#![feature(bool_to_option)]
#![feature(crate_visibility_modifier)]
#![feature(format_args_capture)]
Expand Down

0 comments on commit 04d3f93

Please sign in to comment.