Skip to content

Commit

Permalink
Inline LocalExpnId::from_raw and LocalExpnId::as_raw
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Feb 15, 2022
1 parent 81f12eb commit ea71420
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_span/src/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,12 @@ impl LocalExpnId {
/// The ID of the theoretical expansion that generates freshly parsed, unexpanded AST.
pub const ROOT: LocalExpnId = LocalExpnId::from_u32(0);

#[inline]
pub fn from_raw(idx: ExpnIndex) -> LocalExpnId {
LocalExpnId::from_u32(idx.as_u32())
}

#[inline]
pub fn as_raw(self) -> ExpnIndex {
ExpnIndex::from_u32(self.as_u32())
}
Expand Down

0 comments on commit ea71420

Please sign in to comment.