mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
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.
|
||||
fn parse_item_implementation(
|
||||
&mut self,
|
||||
attrs: Vec<Attribute>,
|
||||
mut attrs: Vec<Attribute>,
|
||||
macros_allowed: bool,
|
||||
attributes_allowed: bool,
|
||||
) -> PResult<'a, Option<P<Item>>> {
|
||||
maybe_whole!(self, NtItem, |item| {
|
||||
let mut item = item.into_inner();
|
||||
let mut attrs = attrs;
|
||||
let mut item = item;
|
||||
mem::swap(&mut item.attrs, &mut attrs);
|
||||
item.attrs.extend(attrs);
|
||||
Some(P(item))
|
||||
Some(item)
|
||||
});
|
||||
|
||||
let lo = self.token.span;
|
||||
|
Loading…
Reference in New Issue
Block a user