Skip to content

Commit 07cd382

Browse files
committed
Small clippy::correctness fixes
Nothing was really incorrect before, but it did get nicer.
1 parent 0a0968b commit 07cd382

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
302302
.iter()
303303
.flatten()
304304
.map(|r| r.impl_blocks.len() as isize - avg as isize)
305-
.map(|v| v.abs() as usize)
305+
.map(|v| v.unsigned_abs())
306306
.sum::<usize>();
307307
s / connected_regions.len()
308308
},

compiler/rustc_hir_typeck/src/generator_interior/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ pub fn resolve_interior<'a, 'tcx>(
313313
// Extract type components to build the witness type.
314314
let type_list = fcx.tcx.mk_type_list_from_iter(type_causes.iter().map(|cause| cause.ty));
315315
let bound_vars = fcx.tcx.mk_bound_variable_kinds(&bound_vars);
316-
let witness =
317-
fcx.tcx.mk_generator_witness(ty::Binder::bind_with_vars(type_list, bound_vars.clone()));
316+
let witness = fcx.tcx.mk_generator_witness(ty::Binder::bind_with_vars(type_list, bound_vars));
318317

319318
drop(typeck_results);
320319
// Store the generator types and spans into the typeck results for this generator.

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,16 +1755,15 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
17551755
fn probe_for_similar_candidate(&mut self) -> Result<Option<ty::AssocItem>, MethodError<'tcx>> {
17561756
debug!("probing for method names similar to {:?}", self.method_name);
17571757

1758-
let steps = self.steps.clone();
17591758
self.probe(|_| {
17601759
let mut pcx = ProbeContext::new(
17611760
self.fcx,
17621761
self.span,
17631762
self.mode,
17641763
self.method_name,
17651764
self.return_type,
1766-
&self.orig_steps_var_values,
1767-
steps,
1765+
self.orig_steps_var_values,
1766+
self.steps,
17681767
self.scope_expr_id,
17691768
);
17701769
pcx.allow_similar_names = true;

0 commit comments

Comments
 (0)