We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d612081 commit 121dac5Copy full SHA for 121dac5
compiler/rustc_metadata/src/locator.rs
@@ -495,13 +495,11 @@ impl<'a> CrateLocator<'a> {
495
0 => Ok(None),
496
1 => Ok(Some(libraries.into_iter().next().unwrap().1)),
497
_ => {
498
- let mut libraries: Vec<_> = libraries.into_values().collect();
499
-
500
- libraries.sort_by_cached_key(|lib| lib.source.paths().next().unwrap().clone());
501
- let candidates = libraries
502
- .iter()
+ let mut candidates: Vec<PathBuf> = libraries
+ .into_values()
503
.map(|lib| lib.source.paths().next().unwrap().clone())
504
- .collect::<Vec<_>>();
+ .collect();
+ candidates.sort();
505
506
Err(CrateError::MultipleCandidates(
507
self.crate_name,
0 commit comments