1
Fork 0

Rename RealFileName::Named to LocalPath and Devirtualized to Remapped

This commit is contained in:
Andy Wang 2021-04-03 16:59:31 +01:00
parent d66506d353
commit 6720a37042
No known key found for this signature in database
GPG key ID: 181B49F9F38F3374
13 changed files with 82 additions and 132 deletions

View file

@ -16,8 +16,7 @@ impl<'a> SpanUtils<'a> {
pub fn make_filename_string(&self, file: &SourceFile) -> String {
match &file.name {
FileName::Real(name) if !file.name_was_remapped => {
let path = name.local_path();
FileName::Real(RealFileName::LocalPath(path)) => {
if path.is_absolute() {
self.sess
.source_map()
@ -30,8 +29,11 @@ impl<'a> SpanUtils<'a> {
self.sess.working_dir.0.join(&path).display().to_string()
}
}
// If the file name is already remapped, we assume the user
// If the file name was remapped, we assume the user
// configured it the way they wanted to, so use that directly
FileName::Real(RealFileName::Remapped { local_path: _, virtual_name }) => {
virtual_name.display().to_string()
}
filename => filename.to_string(),
}
}