Skip to content

Commit

Permalink
Rollup merge of #86043 - klensy:attr-clone, r=jyn514
Browse files Browse the repository at this point in the history
don't clone attrs
  • Loading branch information
JohnTitor authored Jun 6, 2021
2 parents 1886123 + 56a2a2a commit 2f0a855
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ impl AttrAnnotatedTokenStream {
AttrAnnotatedTokenTree::Attributes(data) => {
let mut outer_attrs = Vec::new();
let mut inner_attrs = Vec::new();
let attrs: Vec<_> = data.attrs.clone().into();
for attr in attrs {
for attr in &data.attrs {
match attr.style {
crate::AttrStyle::Outer => {
assert!(
Expand Down Expand Up @@ -264,7 +263,7 @@ impl AttrAnnotatedTokenStream {
// so we never reach this code.

let mut builder = TokenStreamBuilder::new();
for inner_attr in &inner_attrs {
for inner_attr in inner_attrs {
builder.push(inner_attr.tokens().to_tokenstream());
}
builder.push(delim_tokens.clone());
Expand Down

0 comments on commit 2f0a855

Please sign in to comment.