1
Fork 0

don't clone types that are copy (clippy::clone_on_copy)

This commit is contained in:
Matthias Krüger 2020-12-11 17:49:00 +01:00
parent 82fe5c1662
commit db6c50998c
4 changed files with 6 additions and 6 deletions

View file

@ -217,7 +217,7 @@ impl<'a, 'tcx> Helper<'a, 'tcx> {
// go through each target, finding a discriminant read, and a switch // go through each target, finding a discriminant read, and a switch
let results = discr.targets_with_values.iter().map(|(value, target)| { let results = discr.targets_with_values.iter().map(|(value, target)| {
self.find_discriminant_switch_pairing(&discr, target.clone(), value.clone()) self.find_discriminant_switch_pairing(&discr, *target, *value)
}); });
// if the optimization did not apply for one of the targets, then abort // if the optimization did not apply for one of the targets, then abort

View file

@ -447,7 +447,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
); );
nested.push(Obligation::new( nested.push(Obligation::new(
obligation.cause.clone(), obligation.cause.clone(),
obligation.param_env.clone(), obligation.param_env,
normalized_super_trait, normalized_super_trait,
)); ));
} }
@ -485,7 +485,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
); );
nested.push(Obligation::new( nested.push(Obligation::new(
obligation.cause.clone(), obligation.cause.clone(),
obligation.param_env.clone(), obligation.param_env,
normalized_bound, normalized_bound,
)); ));
} }

View file

@ -303,7 +303,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// upvar_capture_map only stores the UpvarCapture (CaptureKind), // upvar_capture_map only stores the UpvarCapture (CaptureKind),
// so we create a fake capture info with no expression. // so we create a fake capture info with no expression.
let fake_capture_info = let fake_capture_info =
ty::CaptureInfo { expr_id: None, capture_kind: capture_kind.clone() }; ty::CaptureInfo { expr_id: None, capture_kind: *capture_kind };
determine_capture_info(fake_capture_info, capture_info).capture_kind determine_capture_info(fake_capture_info, capture_info).capture_kind
} else { } else {
capture_info.capture_kind capture_info.capture_kind

View file

@ -162,7 +162,7 @@ pub fn check(build: &mut Build) {
build build
.config .config
.target_config .target_config
.entry(target.clone()) .entry(*target)
.or_insert(Target::from_triple(&target.triple)); .or_insert(Target::from_triple(&target.triple));
if target.contains("-none-") || target.contains("nvptx") { if target.contains("-none-") || target.contains("nvptx") {
@ -176,7 +176,7 @@ pub fn check(build: &mut Build) {
// If this is a native target (host is also musl) and no musl-root is given, // If this is a native target (host is also musl) and no musl-root is given,
// fall back to the system toolchain in /usr before giving up // fall back to the system toolchain in /usr before giving up
if build.musl_root(*target).is_none() && build.config.build == *target { if build.musl_root(*target).is_none() && build.config.build == *target {
let target = build.config.target_config.entry(target.clone()).or_default(); let target = build.config.target_config.entry(*target).or_default();
target.musl_root = Some("/usr".into()); target.musl_root = Some("/usr".into());
} }
match build.musl_libdir(*target) { match build.musl_libdir(*target) {