Skip to content

Commit ab3fb8b

Browse files
authored
Rollup merge of #69429 - matthiaskrgr:clippy_, r=estebank
remove redundant clones and import
2 parents 7603c2c + 1892ff7 commit ab3fb8b

File tree

9 files changed

+9
-10
lines changed

9 files changed

+9
-10
lines changed

src/librustc/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ impl<'tcx> GlobalCtxt<'tcx> {
15261526
ty::tls::with_related_context(tcx, |icx| {
15271527
let new_icx = ty::tls::ImplicitCtxt {
15281528
tcx,
1529-
query: icx.query.clone(),
1529+
query: icx.query,
15301530
diagnostics: icx.diagnostics,
15311531
layout_depth: icx.layout_depth,
15321532
task_deps: icx.task_deps,

src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<TraitRef<'tcx>> {
14471447
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&TraitRef<'tcx>> {
14481448
fn to_predicate(&self) -> Predicate<'tcx> {
14491449
ty::Predicate::Trait(
1450-
ty::Binder::dummy(ty::TraitPredicate { trait_ref: self.value.clone() }),
1450+
ty::Binder::dummy(ty::TraitPredicate { trait_ref: *self.value }),
14511451
self.constness,
14521452
)
14531453
}

src/librustc/ty/query/job.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<'tcx> QueryLatch<'tcx> {
173173
return CycleError { usage, cycle };
174174
}
175175

176-
current_job = info.job.parent.clone();
176+
current_job = info.job.parent;
177177
}
178178

179179
panic!("did not find a cycle")

src/librustc_codegen_ssa/mir/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
3131
_ => {
3232
let val = self.eval_mir_constant(constant)?;
3333
let ty = self.monomorphize(&constant.literal.ty);
34-
Ok(OperandRef::from_const(bx, val.clone(), ty))
34+
Ok(OperandRef::from_const(bx, val, ty))
3535
}
3636
}
3737
}

src/librustc_data_structures/obligation_forest/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl<O: ForestObligation> ObligationForest<O> {
314314
return Ok(());
315315
}
316316

317-
match self.active_cache.entry(obligation.as_cache_key().clone()) {
317+
match self.active_cache.entry(obligation.as_cache_key()) {
318318
Entry::Occupied(o) => {
319319
let node = &mut self.nodes[*o.get()];
320320
if let Some(parent_index) = parent {
@@ -385,7 +385,7 @@ impl<O: ForestObligation> ObligationForest<O> {
385385
self.error_cache
386386
.entry(node.obligation_tree_id)
387387
.or_default()
388-
.insert(node.obligation.as_cache_key().clone());
388+
.insert(node.obligation.as_cache_key());
389389
}
390390

391391
/// Performs a pass through the obligation list. This must

src/librustc_infer/infer/lexical_region_resolve/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
848848
for upper_bound in &upper_bounds {
849849
if let ty::RePlaceholder(p) = upper_bound.region {
850850
if node_universe.cannot_name(p.universe) {
851-
let origin = self.var_infos[node_idx].origin.clone();
851+
let origin = self.var_infos[node_idx].origin;
852852
errors.push(RegionResolutionError::UpperBoundUniverseConflict(
853853
node_idx,
854854
origin,

src/librustc_macros/src/hash_stable.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use proc_macro2::{self, Ident};
22
use quote::quote;
33
use syn::{self, parse_quote, Meta, NestedMeta};
4-
use synstructure;
54

65
struct Attributes {
76
ignore: bool,

src/librustc_mir_build/build/expr/into.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
376376
TerminatorKind::Yield {
377377
value,
378378
resume,
379-
resume_arg: destination.clone(),
379+
resume_arg: *destination,
380380
drop: cleanup,
381381
},
382382
);

src/librustc_mir_build/build/matches/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
649649
}
650650
}
651651
PatKind::Or { ref pats } => {
652-
self.visit_bindings(&pats[0], pattern_user_ty.clone(), f);
652+
self.visit_bindings(&pats[0], pattern_user_ty, f);
653653
}
654654
}
655655
}

0 commit comments

Comments
 (0)