Split payload of FileName::Real to track both real and virutalized paths.
Such splits arise from metadata refs into libstd. This way, we can (in a follow on commit) continue to emit the virtual name into things like the like the StableSourceFileId that ends up in incremetnal build artifacts, while still using the devirtualized file path when we want to access the file. Note that this commit is intended to be a refactoring; the actual fix to the bug in question is in a follow-on commit.
This commit is contained in:
parent
905d738b1a
commit
da09fd3db0
14 changed files with 103 additions and 39 deletions
|
@ -473,7 +473,7 @@ pub fn run(
|
|||
} = options;
|
||||
|
||||
let src_root = match krate.src {
|
||||
FileName::Real(ref p) => match p.parent() {
|
||||
FileName::Real(ref p) => match p.local_path().parent() {
|
||||
Some(p) => p.to_path_buf(),
|
||||
None => PathBuf::new(),
|
||||
},
|
||||
|
@ -1621,9 +1621,10 @@ impl Context {
|
|||
|
||||
// We can safely ignore synthetic `SourceFile`s.
|
||||
let file = match item.source.filename {
|
||||
FileName::Real(ref path) => path,
|
||||
FileName::Real(ref path) => path.local_path().to_path_buf(),
|
||||
_ => return None,
|
||||
};
|
||||
let file = &file;
|
||||
|
||||
let (krate, path) = if item.source.cnum == LOCAL_CRATE {
|
||||
if let Some(path) = self.shared.local_sources.get(file) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue