Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundant clones and import #69429

Merged
merged 3 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ impl<'tcx> GlobalCtxt<'tcx> {
ty::tls::with_related_context(tcx, |icx| {
let new_icx = ty::tls::ImplicitCtxt {
tcx,
query: icx.query.clone(),
query: icx.query,
diagnostics: icx.diagnostics,
layout_depth: icx.layout_depth,
task_deps: icx.task_deps,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<TraitRef<'tcx>> {
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&TraitRef<'tcx>> {
fn to_predicate(&self) -> Predicate<'tcx> {
ty::Predicate::Trait(
ty::Binder::dummy(ty::TraitPredicate { trait_ref: self.value.clone() }),
ty::Binder::dummy(ty::TraitPredicate { trait_ref: *self.value }),
self.constness,
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/query/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl<'tcx> QueryLatch<'tcx> {
return CycleError { usage, cycle };
}

current_job = info.job.parent.clone();
current_job = info.job.parent;
}

panic!("did not find a cycle")
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/mir/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
_ => {
let val = self.eval_mir_constant(constant)?;
let ty = self.monomorphize(&constant.literal.ty);
Ok(OperandRef::from_const(bx, val.clone(), ty))
Ok(OperandRef::from_const(bx, val, ty))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_data_structures/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl<O: ForestObligation> ObligationForest<O> {
return Ok(());
}

match self.active_cache.entry(obligation.as_cache_key().clone()) {
match self.active_cache.entry(obligation.as_cache_key()) {
Entry::Occupied(o) => {
let node = &mut self.nodes[*o.get()];
if let Some(parent_index) = parent {
Expand Down Expand Up @@ -385,7 +385,7 @@ impl<O: ForestObligation> ObligationForest<O> {
self.error_cache
.entry(node.obligation_tree_id)
.or_default()
.insert(node.obligation.as_cache_key().clone());
.insert(node.obligation.as_cache_key());
}

/// Performs a pass through the obligation list. This must
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_infer/infer/lexical_region_resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
for upper_bound in &upper_bounds {
if let ty::RePlaceholder(p) = upper_bound.region {
if node_universe.cannot_name(p.universe) {
let origin = self.var_infos[node_idx].origin.clone();
let origin = self.var_infos[node_idx].origin;
errors.push(RegionResolutionError::UpperBoundUniverseConflict(
node_idx,
origin,
Expand Down
1 change: 0 additions & 1 deletion src/librustc_macros/src/hash_stable.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use proc_macro2::{self, Ident};
use quote::quote;
use syn::{self, parse_quote, Meta, NestedMeta};
use synstructure;

struct Attributes {
ignore: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir_build/build/expr/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
TerminatorKind::Yield {
value,
resume,
resume_arg: destination.clone(),
resume_arg: *destination,
drop: cleanup,
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir_build/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}
}
PatKind::Or { ref pats } => {
self.visit_bindings(&pats[0], pattern_user_ty.clone(), f);
self.visit_bindings(&pats[0], pattern_user_ty, f);
}
}
}
Expand Down