about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorklensy <klensy@users.noreply.github.com>2024-10-07 22:22:51 +0300
committerklensy <klensy@users.noreply.github.com>2024-10-28 18:05:08 +0300
commit746b675c5aabc7a61443f16a37223720657544d2 (patch)
tree63d9413addb96e2884e62e2a7deb01baab84fc37 /compiler/rustc_parse/src/parser
parent0bff99403c03b891995976587e3c92cbf04ded4c (diff)
downloadrust-746b675c5aabc7a61443f16a37223720657544d2.tar.gz
rust-746b675c5aabc7a61443f16a37223720657544d2.zip
fix clippy::clone_on_ref_ptr for compiler
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs3
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()