Skip to content

Commit 082ecd8

Browse files
authored
Merge pull request rust-lang#20757 from Shourya742/force-fileid-invariant-to-interner
Use FileId::MAX for id assertion in PathInterner::intern
2 parents a78b257 + 6390c89 commit 082ecd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/rust-analyzer/crates/vfs/src/path_interner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl PathInterner {
2828
/// - Else, returns a newly allocated id.
2929
pub(crate) fn intern(&mut self, path: VfsPath) -> FileId {
3030
let (id, _added) = self.map.insert_full(path);
31-
assert!(id < u32::MAX as usize);
31+
assert!(id < FileId::MAX as usize);
3232
FileId(id as u32)
3333
}
3434

0 commit comments

Comments
 (0)