Auto merge of #94427 - cjgillot:inline-fresh-expn, r=oli-obk

Only create a single expansion for each inline integration.

The inlining integrator used to create one expansion for each span from the callee body.
This PR reverses the logic to create a single expansion for the whole call,
which is more consistent with how macro expansions work for macros.

This should remove the large memory regression in #91743.
This commit is contained in:
bors 2022-02-28 08:25:26 +00:00
commit 48132caac2
51 changed files with 502 additions and 497 deletions

View file

@ -408,8 +408,8 @@ pub trait Emitter {
"this derive macro expansion".into()
}
ExpnKind::Macro(MacroKind::Bang, _) => "this macro invocation".into(),
ExpnKind::Inlined => "the inlined copy of this code".into(),
ExpnKind::Root => "in the crate root".into(),
ExpnKind::Inlined => "this inlined function call".into(),
ExpnKind::Root => "the crate root".into(),
ExpnKind::AstPass(kind) => kind.descr().into(),
ExpnKind::Desugaring(kind) => {
format!("this {} desugaring", kind.descr()).into()