From c7899a027ee7b563664a2f6b2967e1f96e2e619a Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 17 Apr 2020 17:51:32 -0400 Subject: [PATCH] Remove unused abs_path method from rustc_span::source_map::FileLoader --- src/librustc_span/source_map.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/librustc_span/source_map.rs b/src/librustc_span/source_map.rs index 49e2144b3e380..d27aae0d6ed9b 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; - /// Read the contents of an UTF-8 file into memory. fn read_file(&self, path: &Path) -> io::Result; } @@ -79,14 +75,6 @@ impl FileLoader for RealFileLoader { fs::metadata(path).is_ok() } - fn abs_path(&self, path: &Path) -> Option { - 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 { fs::read_to_string(path) }