From 0564de10b1d4cd7340dfd8b91af2c88782af2a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 11 Dec 2023 21:54:36 +0100 Subject: [PATCH] remove some redundant clones --- compiler/rustc_borrowck/src/diagnostics/mod.rs | 2 +- compiler/rustc_middle/src/ty/consts.rs | 2 +- compiler/rustc_resolve/src/imports.rs | 2 +- compiler/stable_mir/src/target.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 1844e766a82b3..1616b5e99bf97 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -1204,7 +1204,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { }; err.multipart_suggestion_verbose( msg, - sugg.clone(), + sugg, Applicability::MaybeIncorrect, ); for error in errors { diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs index 293df4f691d46..07804f193b72b 100644 --- a/compiler/rustc_middle/src/ty/consts.rs +++ b/compiler/rustc_middle/src/ty/consts.rs @@ -30,7 +30,7 @@ impl<'tcx> IntoKind for Const<'tcx> { type Kind = ConstKind<'tcx>; fn kind(self) -> ConstKind<'tcx> { - self.kind().clone() + self.kind() } } diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index c2306e3ea7d44..e601ceaa50cc0 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -1002,7 +1002,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { UNUSED_IMPORTS, id, import.span, - msg.to_string(), + msg, BuiltinLintDiagnostics::RedundantImportVisibility { max_vis: max_vis.to_string(def_id, self.tcx), span: import.span, diff --git a/compiler/stable_mir/src/target.rs b/compiler/stable_mir/src/target.rs index bed1dbc4c003c..41ec205cfc788 100644 --- a/compiler/stable_mir/src/target.rs +++ b/compiler/stable_mir/src/target.rs @@ -11,7 +11,7 @@ pub struct MachineInfo { impl MachineInfo { pub fn target() -> MachineInfo { - with(|cx| cx.target_info().clone()) + with(|cx| cx.target_info()) } pub fn target_endianess() -> Endian {