Skip to content

Commit 2f0a855

Browse files
authored
Rollup merge of #86043 - klensy:attr-clone, r=jyn514
don't clone attrs
2 parents 1886123 + 56a2a2a commit 2f0a855

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_ast/src/tokenstream.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ impl AttrAnnotatedTokenStream {
218218
AttrAnnotatedTokenTree::Attributes(data) => {
219219
let mut outer_attrs = Vec::new();
220220
let mut inner_attrs = Vec::new();
221-
let attrs: Vec<_> = data.attrs.clone().into();
222-
for attr in attrs {
221+
for attr in &data.attrs {
223222
match attr.style {
224223
crate::AttrStyle::Outer => {
225224
assert!(
@@ -264,7 +263,7 @@ impl AttrAnnotatedTokenStream {
264263
// so we never reach this code.
265264

266265
let mut builder = TokenStreamBuilder::new();
267-
for inner_attr in &inner_attrs {
266+
for inner_attr in inner_attrs {
268267
builder.push(inner_attr.tokens().to_tokenstream());
269268
}
270269
builder.push(delim_tokens.clone());

0 commit comments

Comments
 (0)