mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 18:58:41 +00:00
Encode edition within FileId in the hir layer
This commit is contained in:
parent
92268627a8
commit
5264f86242
160 changed files with 1117 additions and 824 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue