diff options
Diffstat (limited to 'compiler/rustc_span')
| -rw-r--r-- | compiler/rustc_span/src/hygiene.rs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index 8265eb23c3d..5fae46d5fd8 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -874,19 +874,13 @@ impl Span { /// other compiler-generated code to set per-span properties like allowed unstable features. /// The returned span belongs to the created expansion and has the new properties, /// but its location is inherited from the current span. - pub fn fresh_expansion(self, expn_data: ExpnData, ctx: impl HashStableContext) -> Span { - self.fresh_expansion_with_transparency(expn_data, Transparency::Transparent, ctx) - } - - pub fn fresh_expansion_with_transparency( - self, - expn_data: ExpnData, - transparency: Transparency, - ctx: impl HashStableContext, - ) -> Span { - let expn_id = LocalExpnId::fresh(expn_data, ctx).to_expn_id(); + pub fn fresh_expansion(self, expn_id: LocalExpnId) -> Span { HygieneData::with(|data| { - self.with_ctxt(data.apply_mark(SyntaxContext::root(), expn_id, transparency)) + self.with_ctxt(data.apply_mark( + SyntaxContext::root(), + expn_id.to_expn_id(), + Transparency::Transparent, + )) }) } @@ -903,7 +897,8 @@ impl Span { allow_internal_unstable, ..ExpnData::default(ExpnKind::Desugaring(reason), self, edition, None, None) }; - self.fresh_expansion(expn_data, ctx) + let expn_id = LocalExpnId::fresh(expn_data, ctx); + self.fresh_expansion(expn_id) } } |
