Inline LocalExpnId::from_raw and LocalExpnId::as_raw

This commit is contained in:
Tomasz Miąsko 2022-02-15 00:00:00 +00:00
parent 81f12eb7ef
commit ea71420761

View File

@ -172,10 +172,12 @@ impl LocalExpnId {
/// The ID of the theoretical expansion that generates freshly parsed, unexpanded AST. /// The ID of the theoretical expansion that generates freshly parsed, unexpanded AST.
pub const ROOT: LocalExpnId = LocalExpnId::from_u32(0); pub const ROOT: LocalExpnId = LocalExpnId::from_u32(0);
#[inline]
pub fn from_raw(idx: ExpnIndex) -> LocalExpnId { pub fn from_raw(idx: ExpnIndex) -> LocalExpnId {
LocalExpnId::from_u32(idx.as_u32()) LocalExpnId::from_u32(idx.as_u32())
} }
#[inline]
pub fn as_raw(self) -> ExpnIndex { pub fn as_raw(self) -> ExpnIndex {
ExpnIndex::from_u32(self.as_u32()) ExpnIndex::from_u32(self.as_u32())
} }