diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-01-05 17:11:25 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-01-05 19:13:52 +0300 |
| commit | 205fb75cfa3339fcbac70e8da9c381060a8940cc (patch) | |
| tree | c2d399bcc19536542bb052964493f47435001c18 /compiler/rustc_span/src/hygiene.rs | |
| parent | deecbd80cd74454e086fa28a9066381c306e3f52 (diff) | |
| download | rust-205fb75cfa3339fcbac70e8da9c381060a8940cc.tar.gz rust-205fb75cfa3339fcbac70e8da9c381060a8940cc.zip | |
rustc_span: Remove `fn fresh_expansion`
In the past it did create a fresh expansion, but now, after surviving a number of refactorings, it does not. Now it's just a thin wrapper around `apply_mark`.
Diffstat (limited to 'compiler/rustc_span/src/hygiene.rs')
| -rw-r--r-- | compiler/rustc_span/src/hygiene.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index b717229b68d..fec05e8e0b3 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -850,21 +850,6 @@ impl fmt::Debug for SyntaxContext { } impl Span { - /// Creates a fresh expansion with given properties. - /// Expansions are normally created by macros, but in some cases expansions are created for - /// 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_id: LocalExpnId) -> Span { - HygieneData::with(|data| { - self.with_ctxt(data.apply_mark( - self.ctxt(), - expn_id.to_expn_id(), - Transparency::Transparent, - )) - }) - } - /// Reuses the span but adds information like the kind of the desugaring and features that are /// allowed inside this span. pub fn mark_with_reason( @@ -879,7 +864,7 @@ impl Span { ..ExpnData::default(ExpnKind::Desugaring(reason), self, edition, None, None) }; let expn_id = LocalExpnId::fresh(expn_data, ctx); - self.fresh_expansion(expn_id) + self.apply_mark(expn_id.to_expn_id(), Transparency::Transparent) } } |
