Rollup merge of #68769 - Centril:unwrap, r=petrochenkov
parser: avoid re-wrapping NtItem r? @petrochenkov
This commit is contained in:
commit
011fb23c58
@ -70,16 +70,15 @@ impl<'a> Parser<'a> {
|
|||||||
/// Parses one of the items allowed by the flags.
|
/// Parses one of the items allowed by the flags.
|
||||||
fn parse_item_implementation(
|
fn parse_item_implementation(
|
||||||
&mut self,
|
&mut self,
|
||||||
attrs: Vec<Attribute>,
|
mut attrs: Vec<Attribute>,
|
||||||
macros_allowed: bool,
|
macros_allowed: bool,
|
||||||
attributes_allowed: bool,
|
attributes_allowed: bool,
|
||||||
) -> PResult<'a, Option<P<Item>>> {
|
) -> PResult<'a, Option<P<Item>>> {
|
||||||
maybe_whole!(self, NtItem, |item| {
|
maybe_whole!(self, NtItem, |item| {
|
||||||
let mut item = item.into_inner();
|
let mut item = item;
|
||||||
let mut attrs = attrs;
|
|
||||||
mem::swap(&mut item.attrs, &mut attrs);
|
mem::swap(&mut item.attrs, &mut attrs);
|
||||||
item.attrs.extend(attrs);
|
item.attrs.extend(attrs);
|
||||||
Some(P(item))
|
Some(item)
|
||||||
});
|
});
|
||||||
|
|
||||||
let lo = self.token.span;
|
let lo = self.token.span;
|
||||||
|
Loading…
Reference in New Issue
Block a user