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

@ -67,16 +67,16 @@ pub struct FileId(u32);
// pub struct FileId(NonMaxU32);
impl FileId {
pub const MAX_FILE_ID: u32 = 0x7fff_ffff;
pub const MAX: u32 = 0x7fff_ffff;
#[inline]
pub const fn from_raw(raw: u32) -> FileId {
assert!(raw <= Self::MAX_FILE_ID);
assert!(raw <= Self::MAX);
FileId(raw)
}
#[inline]
pub fn index(self) -> u32 {
pub const fn index(self) -> u32 {
self.0
}
}