about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-09-25 18:22:21 -0700
committerGitHub <noreply@github.com>2021-09-25 18:22:21 -0700
commit04d3f93a2b5ff2f34ad4921909caf79ab19676c0 (patch)
tree74bcc3178a752e81b9c9106e3d40fe2c99d1e0cd /compiler/rustc_resolve/src
parent653dcaac2b9b647ebcf417dbc1e55341c10160b9 (diff)
parent4c239055151ca2717c1d76fc84e0825487cd807c (diff)
downloadrust-04d3f93a2b5ff2f34ad4921909caf79ab19676c0.tar.gz
rust-04d3f93a2b5ff2f34ad4921909caf79ab19676c0.zip
Rollup merge of #89224 - TaKO8Ki:change-the-order-of-suggestions, r=joshtriplett
Change the order of imports suggestions

closes #83564
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs3
-rw-r--r--compiler/rustc_resolve/src/lib.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 435c79d2daf..d6ff5a7e90b 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -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 {
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index 68db06370ff..1cbe8f41d92 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -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)]