use std::c_str::ToCStr;
use std::cmp;
+use std::io::fs::PathExtensions;
use std::io;
use std::mem;
use std::ptr;
// libraries corresponds to the crate id and hash criteria that this
// search is being performed for.
let mut libraries = Vec::new();
- for (_hash, (rlibs, dylibs)) in candidates.move_iter() {
+ for (_hash, (rlibs, dylibs)) in candidates.into_iter() {
let mut metadata = None;
let rlib = self.extract_one(rlibs, "rlib", &mut metadata);
let dylib = self.extract_one(dylibs, "dylib", &mut metadata);
// libraries or not.
match libraries.len() {
0 => None,
- 1 => Some(libraries.move_iter().next().unwrap()),
+ 1 => Some(libraries.into_iter().next().unwrap()),
_ => {
self.sess.span_err(self.span,
format!("multiple matching crates for `{}`",
if m.len() == 0 {
return None
} else if m.len() == 1 {
- return Some(m.move_iter().next().unwrap())
+ return Some(m.into_iter().next().unwrap())
}
}
- for lib in m.move_iter() {
+ for lib in m.into_iter() {
info!("{} reading metadata from: {}", flavor, lib.display());
let metadata = match get_metadata_section(self.os, &lib) {
Ok(blob) => {
// dynamic libraries
fn dylibname(&self) -> Option<(&'static str, &'static str)> {
match self.os {
- abi::OsWin32 => Some((WIN32_DLL_PREFIX, WIN32_DLL_SUFFIX)),
+ abi::OsWindows => Some((WIN32_DLL_PREFIX, WIN32_DLL_SUFFIX)),
abi::OsMacos => Some((MACOS_DLL_PREFIX, MACOS_DLL_SUFFIX)),
abi::OsLinux => Some((LINUX_DLL_PREFIX, LINUX_DLL_SUFFIX)),
abi::OsAndroid => Some((ANDROID_DLL_PREFIX, ANDROID_DLL_SUFFIX)),
let mut dylibs = HashSet::new();
for loc in locs {
if loc.filename_str().unwrap().ends_with(".rlib") {
- rlibs.insert(loc.clone());
+ rlibs.insert(fs::realpath(&loc).unwrap());
} else {
- dylibs.insert(loc.clone());
+ dylibs.insert(fs::realpath(&loc).unwrap());
}
}
match os {
abi::OsMacos => Some("__DATA,__note.rustc"),
abi::OsiOS => Some("__DATA,__note.rustc"),
- abi::OsWin32 => Some(".note.rustc"),
+ abi::OsWindows => Some(".note.rustc"),
abi::OsLinux => Some(".note.rustc"),
abi::OsAndroid => Some(".note.rustc"),
abi::OsFreebsd => Some(".note.rustc"),
match os {
abi::OsMacos => "__note.rustc",
abi::OsiOS => unreachable!(),
- abi::OsWin32 => ".note.rustc",
+ abi::OsWindows => ".note.rustc",
abi::OsLinux => ".note.rustc",
abi::OsAndroid => ".note.rustc",
abi::OsFreebsd => ".note.rustc",