Skip to content

Commit

Permalink
rustc/session: move consts up to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Oct 15, 2018
1 parent e5eb538 commit 42ae9dc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/librustc/session/filesearch.rs
Expand Up @@ -178,22 +178,22 @@ fn find_libdir(sysroot: &Path) -> Cow<'static, str> {
// If --libdir is set during configuration to the value other than
// "lib" (i.e. non-default), this value is used (see issue #16552).

match option_env!("CFG_LIBDIR_RELATIVE") {
Some(libdir) if libdir != "lib" => return libdir.into(),
_ => if sysroot.join(PRIMARY_LIB_DIR).join(RUST_LIB_DIR).exists() {
return PRIMARY_LIB_DIR.into();
} else {
return SECONDARY_LIB_DIR.into();
}
}

#[cfg(target_pointer_width = "64")]
const PRIMARY_LIB_DIR: &'static str = "lib64";

#[cfg(target_pointer_width = "32")]
const PRIMARY_LIB_DIR: &'static str = "lib32";

const SECONDARY_LIB_DIR: &'static str = "lib";

match option_env!("CFG_LIBDIR_RELATIVE") {
Some(libdir) if libdir != "lib" => libdir.into(),
_ => if sysroot.join(PRIMARY_LIB_DIR).join(RUST_LIB_DIR).exists() {
PRIMARY_LIB_DIR.into()
} else {
SECONDARY_LIB_DIR.into()
}
}
}

// The name of rustc's own place to organize libraries.
Expand Down

0 comments on commit 42ae9dc

Please sign in to comment.