Skip to content

Commit

Permalink
Rollup merge of rust-lang#68769 - Centril:unwrap, r=petrochenkov
Browse files Browse the repository at this point in the history
parser: avoid re-wrapping NtItem

r? @petrochenkov
  • Loading branch information
Centril authored Feb 2, 2020
2 parents 5951cd3 + d154bef commit 011fb23
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/librustc_parse/parser/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 011fb23

Please sign in to comment.