about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-27 03:26:11 +0200
committerGitHub <noreply@github.com>2020-04-27 03:26:11 +0200
commit89aff5f33e1b28093e881e812b670672f724d8aa (patch)
treef2cabd45e81258b93803fd846729cad6603e95ab /src
parent9d0025263a55f1bcb80ebdc0d83d1e64cdf05e5a (diff)
parentc7899a027ee7b563664a2f6b2967e1f96e2e619a (diff)
Rollup merge of #71263 - shlevy:FileLoader-remove-abs_path, r=Xanewok
Remove unused abs_path method from rustc_span::source_map::FileLoader
Diffstat (limited to 'src')
-rw-r--r--src/librustc_span/source_map.rs12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/librustc_span/source_map.rs b/src/librustc_span/source_map.rs
index 49e2144b3e3..d27aae0d6ed 100644
--- a/src/librustc_span/source_map.rs
+++ b/src/librustc_span/source_map.rs
@@ -20,7 +20,6 @@ use std::path::{Path, PathBuf};
 use std::sync::atomic::Ordering;
 
 use log::debug;
-use std::env;
 use std::fs;
 use std::io;
 
@@ -64,9 +63,6 @@ pub trait FileLoader {
     /// Query the existence of a file.
     fn file_exists(&self, path: &Path) -> bool;
 
-    /// Returns an absolute path to a file, if possible.
-    fn abs_path(&self, path: &Path) -> Option<PathBuf>;
-
     /// Read the contents of an UTF-8 file into memory.
     fn read_file(&self, path: &Path) -> io::Result<String>;
 }
@@ -79,14 +75,6 @@ impl FileLoader for RealFileLoader {
         fs::metadata(path).is_ok()
     }
 
-    fn abs_path(&self, path: &Path) -> Option<PathBuf> {
-        if path.is_absolute() {
-            Some(path.to_path_buf())
-        } else {
-            env::current_dir().ok().map(|cwd| cwd.join(path))
-        }
-    }
-
     fn read_file(&self, path: &Path) -> io::Result<String> {
         fs::read_to_string(path)
     }