1
Fork 0

Make ExpnData fields krate and orig_id private

These fields are only used by hygiene serialized, and should not be
accessed by anything outside of `rustc_span`.
This commit is contained in:
Aaron Hill 2021-01-03 08:56:49 -05:00
parent 18cb4ad3b9
commit 21b8f2ecde
No known key found for this signature in database
GPG key ID: B4087E510E98B164
5 changed files with 63 additions and 27 deletions

View file

@ -57,7 +57,7 @@ use rustc_session::lint::{builtin::BARE_TRAIT_OBJECTS, BuiltinLintDiagnostics, L
use rustc_session::parse::ParseSess;
use rustc_session::Session;
use rustc_span::hygiene::ExpnId;
use rustc_span::source_map::{respan, DesugaringKind, ExpnData, ExpnKind};
use rustc_span::source_map::{respan, DesugaringKind};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::Span;
@ -743,10 +743,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
span: Span,
allow_internal_unstable: Option<Lrc<[Symbol]>>,
) -> Span {
span.fresh_expansion(ExpnData {
allow_internal_unstable,
..ExpnData::default(ExpnKind::Desugaring(reason), span, self.sess.edition(), None)
})
span.mark_with_reason(allow_internal_unstable, reason, self.sess.edition())
}
fn with_anonymous_lifetime_mode<R>(