about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2018-11-22 15:49:48 +1100
committerNicholas Nethercote <nnethercote@mozilla.com>2018-12-12 10:36:15 +1100
commit2640da7d13a1051dddcf93c06f9ae90508fce6fb (patch)
treed0cec63297afc90780020789f4fb654cf21d47ab /src/librustc_codegen_llvm/back
parent0238bcc60d943878244ef7221d338f13a35e2a45 (diff)
downloadrust-2640da7d13a1051dddcf93c06f9ae90508fce6fb.tar.gz
rust-2640da7d13a1051dddcf93c06f9ae90508fce6fb.zip
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.
Diffstat (limited to 'src/librustc_codegen_llvm/back')
-rw-r--r--src/librustc_codegen_llvm/back/link.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/back/link.rs b/src/librustc_codegen_llvm/back/link.rs
index 9e100a1427f..20a7bf9a1a9 100644
--- a/src/librustc_codegen_llvm/back/link.rs
+++ b/src/librustc_codegen_llvm/back/link.rs
@@ -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);