diff options
| author | Jubilee <workingjubilee@gmail.com> | 2024-10-29 03:11:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 03:11:39 -0700 |
| commit | 5d0f52efa4b774ffa066d0f40a22242dc7fbbfba (patch) | |
| tree | 862aa592e7c55bc4188a2a9a1d3c10bf8c083289 /compiler/rustc_parse/src/parser/diagnostics.rs | |
| parent | 2df8dbb1b37168c59eca2884502a1b79892858a9 (diff) | |
| parent | 746b675c5aabc7a61443f16a37223720657544d2 (diff) | |
| download | rust-5d0f52efa4b774ffa066d0f40a22242dc7fbbfba.tar.gz rust-5d0f52efa4b774ffa066d0f40a22242dc7fbbfba.zip | |
Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot
compiler: apply clippy::clone_on_ref_ptr for CI Apply lint https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr for compiler, also see https://github.com/rust-lang/rust/pull/131225#discussion_r1790109443. Some Arc's can be misplaced with Lrc's, sorry. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/enable.20more.20clippy.20lints.20for.20compiler.20.28and.5Cor.20std.29
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index a9384501547..a1fe5508970 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -14,6 +14,7 @@ use rustc_ast::{ }; use rustc_ast_pretty::pprust; use rustc_data_structures::fx::FxHashSet; +use rustc_data_structures::sync::Lrc; use rustc_errors::{ Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, PErr, PResult, Subdiagnostic, Suggestions, pluralize, @@ -2437,7 +2438,7 @@ impl<'a> Parser<'a> { let mut labels = vec![]; while let TokenKind::Interpolated(nt) = &tok.kind { let tokens = nt.tokens(); - labels.push(nt.clone()); + labels.push(Lrc::clone(nt)); if let Some(tokens) = tokens && let tokens = tokens.to_attr_token_stream() && let tokens = tokens.0.deref() |
