Remove Session::sysroot().

Instead of maybe storing its own sysroot and maybe deferring to the one
in `Session::opts`, just clone the latter when necessary so one is
always directly available. This removes the need for the getter.
This commit is contained in:
Nicholas Nethercote
2018-11-22 15:49:48 +11:00
parent 0238bcc60d
commit 2640da7d13
5 changed files with 12 additions and 22 deletions

View File

@@ -1024,11 +1024,10 @@ fn link_args(cmd: &mut dyn Linker,
// where extern libraries might live, based on the
// addl_lib_search_paths
if sess.opts.cg.rpath {
let sysroot = sess.sysroot();
let target_triple = sess.opts.target_triple.triple();
let mut get_install_prefix_lib_path = || {
let install_prefix = option_env!("CFG_PREFIX").expect("CFG_PREFIX");
let tlib = filesearch::relative_target_lib_path(sysroot, target_triple);
let tlib = filesearch::relative_target_lib_path(&sess.sysroot, target_triple);
let mut path = PathBuf::from(install_prefix);
path.push(&tlib);