1
Fork 0

Use LocalExpnId where possible.

This commit is contained in:
Camille GILLOT 2021-06-25 20:43:04 +02:00
parent 6e78d6c9d6
commit 078dd37f88
19 changed files with 169 additions and 147 deletions

View file

@ -198,19 +198,6 @@ impl ExpnId {
ExpnId { krate: LOCAL_CRATE, local_id: ExpnIndex::from_u32(0) }
}
pub fn fresh_empty() -> ExpnId {
LocalExpnId::fresh_empty().to_expn_id()
}
pub fn fresh(expn_data: ExpnData, ctx: impl HashStableContext) -> ExpnId {
LocalExpnId::fresh(expn_data, ctx).to_expn_id()
}
#[inline]
pub fn set_expn_data(self, expn_data: ExpnData, ctx: impl HashStableContext) {
self.expect_local().set_expn_data(expn_data, ctx)
}
#[inline]
pub fn expn_hash(self) -> ExpnHash {
HygieneData::with(|data| data.expn_hash(self))
@ -819,7 +806,7 @@ impl Span {
transparency: Transparency,
ctx: impl HashStableContext,
) -> Span {
let expn_id = ExpnId::fresh(expn_data, ctx);
let expn_id = LocalExpnId::fresh(expn_data, ctx).to_expn_id();
HygieneData::with(|data| {
self.with_ctxt(data.apply_mark(SyntaxContext::root(), expn_id, transparency))
})