From 2b8d3dea63f74867d512a9ff50c695512b95a6ba Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 4 Feb 2022 09:56:18 +1100 Subject: [PATCH] Remove `staticlibs` local variable. --- compiler/rustc_metadata/src/locator.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/rustc_metadata/src/locator.rs b/compiler/rustc_metadata/src/locator.rs index 69725b1377c..5c81917fc0a 100644 --- a/compiler/rustc_metadata/src/locator.rs +++ b/compiler/rustc_metadata/src/locator.rs @@ -385,7 +385,6 @@ impl<'a> CrateLocator<'a> { let mut candidates: FxHashMap<_, (FxHashMap<_, _>, FxHashMap<_, _>, FxHashMap<_, _>)> = Default::default(); - let mut staticlibs = vec![]; // First, find all possible candidate rlibs and dylibs purely based on // the name of the files themselves. We're trying to match against an @@ -414,7 +413,7 @@ impl<'a> CrateLocator<'a> { (&f[dylib_prefix.len()..(f.len() - dylib_suffix.len())], CrateFlavor::Dylib) } else { if f.starts_with(staticlib_prefix) && f.ends_with(staticlib_suffix) { - staticlibs.push(CrateMismatch { + self.crate_rejections.via_kind.push(CrateMismatch { path: spf.path.clone(), got: "static".to_string(), }); @@ -438,8 +437,6 @@ impl<'a> CrateLocator<'a> { } } - self.crate_rejections.via_kind.extend(staticlibs); - // We have now collected all known libraries into a set of candidates // keyed of the filename hash listed. For each filename, we also have a // list of rlibs/dylibs that apply. Here, we map each of these lists