about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-02-10 21:45:24 +0100
committerGitHub <noreply@github.com>2019-02-10 21:45:24 +0100
commit9ccfb74a8ac8618fd3836107a70476ef53196b45 (patch)
tree6c05e1950d5b32f2de77a76c6ff3c46865214239 /src/librustc_codegen_llvm
parent53e9a654e1ee3ee4b32aec1e65ef370c81908c78 (diff)
parentadb33008f703320727d5022640e9a09cdc4fa8a6 (diff)
downloadrust-9ccfb74a8ac8618fd3836107a70476ef53196b45.tar.gz
rust-9ccfb74a8ac8618fd3836107a70476ef53196b45.zip
Rollup merge of #58346 - RalfJung:rpath-pop, r=Mark-Simulacrum
rpath computation: explain why we pop()

I was quite confused by this code until I got a debug log of what is going on.
Diffstat (limited to 'src/librustc_codegen_llvm')
-rw-r--r--src/librustc_codegen_llvm/back/rpath.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/back/rpath.rs b/src/librustc_codegen_llvm/back/rpath.rs
index aeff23dec41..a5c828e089f 100644
--- a/src/librustc_codegen_llvm/back/rpath.rs
+++ b/src/librustc_codegen_llvm/back/rpath.rs
@@ -101,9 +101,9 @@ fn get_rpath_relative_to_output(config: &mut RPathConfig, lib: &Path) -> String
 
     let cwd = env::current_dir().unwrap();
     let mut lib = fs::canonicalize(&cwd.join(lib)).unwrap_or_else(|_| cwd.join(lib));
-    lib.pop();
+    lib.pop(); // strip filename
     let mut output = cwd.join(&config.out_filename);
-    output.pop();
+    output.pop(); // strip filename
     let output = fs::canonicalize(&output).unwrap_or(output);
     let relative = path_relative_from(&lib, &output).unwrap_or_else(||
         panic!("couldn't create relative path from {:?} to {:?}", output, lib));