From 81287e4984069ed527163a981ba7b863a2b4ebf1 Mon Sep 17 00:00:00 2001 From: JP Sugarbroad Date: Wed, 28 Oct 2015 11:07:11 -0700 Subject: [PATCH] Do not resolve symlinks when finding crates. The resolved path may not end in '.rlib', causing us to try to read the archive as an object file. --- src/librustc/metadata/loader.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 77092d0802fb3..63f8923c8e9b1 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -435,11 +435,11 @@ impl<'a> Context<'a> { let slot = candidates.entry(hash_str) .or_insert_with(|| (HashMap::new(), HashMap::new())); let (ref mut rlibs, ref mut dylibs) = *slot; - fs::canonicalize(path).map(|p| { + fs::canonicalize(path).map(|_| { if rlib { - rlibs.insert(p, kind); + rlibs.insert(path.to_path_buf(), kind); } else { - dylibs.insert(p, kind); + dylibs.insert(path.to_path_buf(), kind); } FileMatches }).unwrap_or(FileDoesntMatch)