From 5da99deef384034ba2d9b0e13fb0ddc85eac3638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 3 Nov 2023 13:20:11 +0100 Subject: [PATCH] clone less --- compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs | 2 +- compiler/rustc_mir_build/src/build/matches/mod.rs | 2 +- src/bootstrap/src/core/builder.rs | 2 +- src/librustdoc/html/markdown.rs | 4 ++-- src/librustdoc/passes/lint/html_tags.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs index ebb9e6f42d987..6424d1c793112 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -880,7 +880,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> { (pair, r) }) .unzip(); - self.record_late_bound_vars(hir_id, binders.clone()); + self.record_late_bound_vars(hir_id, binders); // Even if there are no lifetimes defined here, we still wrap it in a binder // scope. If there happens to be a nested poly trait ref (an error), that // will be `Concatenating` anyways, so we don't have to worry about the depth diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs index c3e1b55e46321..a43aae6f44942 100644 --- a/compiler/rustc_mir_build/src/build/matches/mod.rs +++ b/compiler/rustc_mir_build/src/build/matches/mod.rs @@ -856,7 +856,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } PatKind::InlineConstant { ref subpattern, .. } => { - self.visit_primary_bindings(subpattern, pattern_user_ty.clone(), f) + self.visit_primary_bindings(subpattern, pattern_user_ty, f) } PatKind::Leaf { ref subpatterns } => { diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 85b9b12c242c9..4dcd320223c75 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -1410,7 +1410,7 @@ impl<'a> Builder<'a> { } // #[cfg(bootstrap)] - let use_new_check_cfg_syntax = self.local_rebuild; + let use_new_check_cfg_syntax = self.local_rebuild || cmd == "clippy"; // Enable compile-time checking of `cfg` names, values and Cargo `features`. // diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index aa728c26afcf0..2807dfed07237 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -1750,7 +1750,7 @@ pub(crate) fn markdown_links<'md, R>( } // do not actually include braces in the span let range = (open_brace + 1)..close_brace; - MarkdownLinkRange::Destination(range.clone()) + MarkdownLinkRange::Destination(range) }; let span_for_offset_forward = |span: Range, open: u8, close: u8| { @@ -1786,7 +1786,7 @@ pub(crate) fn markdown_links<'md, R>( } // do not actually include braces in the span let range = (open_brace + 1)..close_brace; - MarkdownLinkRange::Destination(range.clone()) + MarkdownLinkRange::Destination(range) }; let mut broken_link_callback = |link: BrokenLink<'md>| Some((link.reference, "".into())); diff --git a/src/librustdoc/passes/lint/html_tags.rs b/src/librustdoc/passes/lint/html_tags.rs index 79fc599e1763e..ed0fa495e4c30 100644 --- a/src/librustdoc/passes/lint/html_tags.rs +++ b/src/librustdoc/passes/lint/html_tags.rs @@ -29,7 +29,7 @@ pub(crate) fn visit_item(cx: &DocContext<'_>, item: &Item) { crate::lint::INVALID_HTML_TAGS, hir_id, sp, - msg.to_string(), + msg, |lint| { use rustc_lint_defs::Applicability; // If a tag looks like ``, it might actually be a generic.