Auto merge of #100564 - nnethercote:box-ast-MacCall, r=spastorino

Box the `MacCall` in various types.

r? `@spastorino`
This commit is contained in:
bors 2022-08-20 10:26:54 +00:00
commit dd01122b5c
12 changed files with 94 additions and 94 deletions

View file

@ -1492,11 +1492,11 @@ impl<'a> Parser<'a> {
self.struct_span_err(path.span, "macros cannot use qualified paths").emit();
}
let lo = path.span;
let mac = MacCall {
let mac = P(MacCall {
path,
args: self.parse_mac_args()?,
prior_type_ascription: self.last_type_ascription,
};
});
(lo.to(self.prev_token.span), ExprKind::MacCall(mac))
} else if self.check(&token::OpenDelim(Delimiter::Brace)) &&
let Some(expr) = self.maybe_parse_struct_expr(qself.as_ref(), &path) {

View file

@ -287,7 +287,7 @@ impl<'a> Parser<'a> {
return Ok(None);
} else if macros_allowed && self.check_path() {
// MACRO INVOCATION ITEM
(Ident::empty(), ItemKind::MacCall(self.parse_item_macro(vis)?))
(Ident::empty(), ItemKind::MacCall(P(self.parse_item_macro(vis)?)))
} else {
return Ok(None);
};

View file

@ -665,7 +665,7 @@ impl<'a> Parser<'a> {
fn parse_pat_mac_invoc(&mut self, path: Path) -> PResult<'a, PatKind> {
self.bump();
let args = self.parse_mac_args()?;
let mac = MacCall { path, args, prior_type_ascription: self.last_type_ascription };
let mac = P(MacCall { path, args, prior_type_ascription: self.last_type_ascription });
Ok(PatKind::MacCall(mac))
}

View file

@ -177,7 +177,7 @@ impl<'a> Parser<'a> {
None => unreachable!(),
};
let mac = MacCall { path, args, prior_type_ascription: self.last_type_ascription };
let mac = P(MacCall { path, args, prior_type_ascription: self.last_type_ascription });
let kind = if (style == MacStmtStyle::Braces
&& self.token != token::Dot

View file

@ -598,11 +598,11 @@ impl<'a> Parser<'a> {
let path = self.parse_path_inner(PathStyle::Type, ty_generics)?;
if self.eat(&token::Not) {
// Macro invocation in type position
Ok(TyKind::MacCall(MacCall {
Ok(TyKind::MacCall(P(MacCall {
path,
args: self.parse_mac_args()?,
prior_type_ascription: self.last_type_ascription,
}))
})))
} else if allow_plus == AllowPlus::Yes && self.check_plus() {
// `Trait1 + Trait2 + 'a`
self.parse_remaining_bounds_path(Vec::new(), path, lo, true)