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:
@@ -1020,15 +1020,16 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
|
||||
// with exception of the derive container case which is not resolved and can get
|
||||
// its expansion data immediately.
|
||||
let expn_data = match &kind {
|
||||
InvocationKind::DeriveContainer { item, .. } => Some(ExpnData {
|
||||
parent: self.cx.current_expansion.id,
|
||||
..ExpnData::default(
|
||||
InvocationKind::DeriveContainer { item, .. } => {
|
||||
let mut expn_data = ExpnData::default(
|
||||
ExpnKind::Macro(MacroKind::Attr, sym::derive),
|
||||
item.span(),
|
||||
self.cx.sess.parse_sess.edition,
|
||||
None,
|
||||
)
|
||||
}),
|
||||
);
|
||||
expn_data.parent = self.cx.current_expansion.id;
|
||||
Some(expn_data)
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
let expn_id = ExpnId::fresh(expn_data);
|
||||
|
||||
Reference in New Issue
Block a user