Skip to content

Commit bcd79c2

Browse files
committed
fix clippy::{clone_on_copy, useless_conversion}
1 parent d666f6b commit bcd79c2

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Diff for: compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ impl<'cx, 'tcx> BorrowckInferCtxt<'cx, 'tcx> {
528528
where
529529
F: Fn() -> RegionCtxt,
530530
{
531-
let next_region = self.infcx.next_nll_region_var(origin.clone());
531+
let next_region = self.infcx.next_nll_region_var(origin);
532532
let vid = next_region.as_var();
533533

534534
if cfg!(debug_assertions) && !self.inside_canonicalization_ctxt() {

Diff for: compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,8 @@ pub(super) fn implied_predicates_with_filter(
645645
};
646646

647647
// Combine the two lists to form the complete set of superbounds:
648-
let implied_bounds = &*tcx
649-
.arena
650-
.alloc_from_iter(superbounds.predicates().into_iter().chain(where_bounds_that_match));
648+
let implied_bounds =
649+
&*tcx.arena.alloc_from_iter(superbounds.predicates().chain(where_bounds_that_match));
651650
debug!(?implied_bounds);
652651

653652
// Now require that immediate supertraits are converted,

Diff for: compiler/rustc_query_impl/src/profiling_support.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub(crate) fn alloc_self_profile_query_strings_for_query_cache<'tcx, C>(
231231
// locked while doing so. Instead we copy out the
232232
// `(query_key, dep_node_index)` pairs and release the lock again.
233233
let mut query_keys_and_indices = Vec::new();
234-
query_cache.iter(&mut |k, _, i| query_keys_and_indices.push((k.clone(), i)));
234+
query_cache.iter(&mut |k, _, i| query_keys_and_indices.push((*k, i)));
235235

236236
// Now actually allocate the strings. If allocating the strings
237237
// generates new entries in the query cache, we'll miss them but

0 commit comments

Comments
 (0)