Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/hygiene.rs')
-rw-r--r--crates/span/src/hygiene.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/span/src/hygiene.rs b/crates/span/src/hygiene.rs
index 70b0447569..2d9757b5ae 100644
--- a/crates/span/src/hygiene.rs
+++ b/crates/span/src/hygiene.rs
@@ -460,6 +460,13 @@ impl SyntaxContext {
pub const unsafe fn from_u32(u32: u32) -> Self {
Self(u32)
}
+
+ /// Alternative to [`from_u32`] that is safe to call.
+ ///
+ /// The split exists to keep API parity.
+ pub const fn from_u32_safe(u32: u32) -> Self {
+ Self(u32)
+ }
}
/// A property of a macro expansion that determines how identifiers