Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/lib.rs')
| -rw-r--r-- | crates/span/src/lib.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/crates/span/src/lib.rs b/crates/span/src/lib.rs index 8ca7bc2d38..bbaf1b2a6d 100644 --- a/crates/span/src/lib.rs +++ b/crates/span/src/lib.rs @@ -86,15 +86,6 @@ impl<Ctx: Copy> SpanData<Ctx> { } } -impl Span { - #[deprecated = "dummy spans will panic if surfaced incorrectly, as such they should be replaced appropriately"] - pub const DUMMY: Self = Self { - range: TextRange::empty(TextSize::new(0)), - anchor: SpanAnchor { file_id: FileId::BOGUS, ast_id: ROOT_ERASED_FILE_AST_ID }, - ctx: SyntaxContextId::ROOT, - }; -} - impl fmt::Display for Span { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(&self.anchor.file_id.index(), f)?; @@ -178,6 +169,8 @@ impl salsa::InternKey for MacroCallId { } impl MacroCallId { + pub const MAX_ID: u32 = 0x7fff_ffff; + pub fn as_file(self) -> HirFileId { MacroFileId { macro_call_id: self }.into() } @@ -218,7 +211,7 @@ impl From<MacroFileId> for HirFileId { fn from(MacroFileId { macro_call_id: MacroCallId(id) }: MacroFileId) -> Self { _ = Self::ASSERT_MAX_FILE_ID_IS_SAME; let id = id.as_u32(); - assert!(id <= Self::MAX_HIR_FILE_ID, "MacroCallId index {} is too large", id); + assert!(id <= Self::MAX_HIR_FILE_ID, "MacroCallId index {id} is too large"); HirFileId(id | Self::MACRO_FILE_TAG_MASK) } } |