Skip to content

Commit d4a005b

Browse files
committed
librustc{, codegen_ssa,infer,mir_build}: don't clone types that are copy
1 parent 5ae4500 commit d4a005b

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
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_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_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
);

0 commit comments

Comments
 (0)