Skip to content

Commit 89aff5f

Browse files
authored
Rollup merge of #71263 - shlevy:FileLoader-remove-abs_path, r=Xanewok
Remove unused abs_path method from rustc_span::source_map::FileLoader
2 parents 9d00252 + c7899a0 commit 89aff5f

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/librustc_span/source_map.rs

-12
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use std::path::{Path, PathBuf};
2020
use std::sync::atomic::Ordering;
2121

2222
use log::debug;
23-
use std::env;
2423
use std::fs;
2524
use std::io;
2625

@@ -64,9 +63,6 @@ pub trait FileLoader {
6463
/// Query the existence of a file.
6564
fn file_exists(&self, path: &Path) -> bool;
6665

67-
/// Returns an absolute path to a file, if possible.
68-
fn abs_path(&self, path: &Path) -> Option<PathBuf>;
69-
7066
/// Read the contents of an UTF-8 file into memory.
7167
fn read_file(&self, path: &Path) -> io::Result<String>;
7268
}
@@ -79,14 +75,6 @@ impl FileLoader for RealFileLoader {
7975
fs::metadata(path).is_ok()
8076
}
8177

82-
fn abs_path(&self, path: &Path) -> Option<PathBuf> {
83-
if path.is_absolute() {
84-
Some(path.to_path_buf())
85-
} else {
86-
env::current_dir().ok().map(|cwd| cwd.join(path))
87-
}
88-
}
89-
9078
fn read_file(&self, path: &Path) -> io::Result<String> {
9179
fs::read_to_string(path)
9280
}

0 commit comments

Comments
 (0)