Encode edition within FileId in the hir layer

This commit is contained in:
Lukas Wirth 2024-07-17 17:35:40 +02:00
parent 92268627a8
commit 5264f86242
160 changed files with 1117 additions and 824 deletions

View file

@ -12,7 +12,7 @@ use cfg::CfgOptions;
use intern::Symbol;
use la_arena::{Arena, Idx, RawIdx};
use rustc_hash::{FxHashMap, FxHashSet};
use span::Edition;
use span::{Edition, EditionedFileId};
use triomphe::Arc;
use vfs::{file_set::FileSet, AbsPathBuf, AnchoredPath, FileId, VfsPath};
@ -662,6 +662,10 @@ impl CrateData {
fn add_dep(&mut self, dep: Dependency) {
self.dependencies.push(dep)
}
pub fn root_file_id(&self) -> EditionedFileId {
EditionedFileId::new(self.root_file_id, self.edition)
}
}
impl Extend<(String, String)> for Env {