Skip to content

Commit 248d6bf

Browse files
Rollup merge of #77037 - matthiaskrgr:cl42ppy, r=Dylan-DPC
more tiny clippy cleanups commits stand alone and can be reviewed one by one
2 parents d92d28e + d7a5c57 commit 248d6bf

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

compiler/rustc_mir/src/borrow_check/type_check/constraint_conversion.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
6262
// `self.constraints`, but we also want to be mutating
6363
// `self.member_constraints`. For now, just swap out the value
6464
// we want and replace at the end.
65-
let mut tmp =
66-
std::mem::replace(&mut self.constraints.member_constraints, Default::default());
65+
let mut tmp = std::mem::take(&mut self.constraints.member_constraints);
6766
for member_constraint in member_constraints {
6867
tmp.push_constraint(member_constraint, |r| self.to_region_vid(r));
6968
}

compiler/rustc_mir/src/transform/early_otherwise_branch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
9191
let not_equal_rvalue = Rvalue::BinaryOp(
9292
not_equal,
9393
Operand::Copy(Place::from(second_discriminant_temp)),
94-
Operand::Copy(Place::from(first_descriminant_place)),
94+
Operand::Copy(first_descriminant_place),
9595
);
9696
patch.add_statement(
9797
end_of_block_location,

compiler/rustc_typeck/src/check/writeback.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
7070
debug!("used_trait_imports({:?}) = {:?}", item_def_id, used_trait_imports);
7171
wbcx.typeck_results.used_trait_imports = used_trait_imports;
7272

73-
wbcx.typeck_results.closure_captures = mem::replace(
74-
&mut self.typeck_results.borrow_mut().closure_captures,
75-
Default::default(),
76-
);
73+
wbcx.typeck_results.closure_captures =
74+
mem::take(&mut self.typeck_results.borrow_mut().closure_captures);
7775

7876
if self.is_tainted_by_errors() {
7977
// FIXME(eddyb) keep track of `ErrorReported` from where the error was emitted.

0 commit comments

Comments
 (0)