Skip to content

Commit 7e4f45a

Browse files
authored
Rollup merge of #134399 - spastorino:invert-if-condition, r=jieyouxu
Do not do if ! else, use unnegated cond and swap the branches instead I'm tidying up my ergonomic ref counting PR and I'm going to make some small, simple and unrelated changes outside that PR, so the main PR sticks more straight to the point.
2 parents f3faaf5 + 3218476 commit 7e4f45a

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_mir_build/src/builder

1 file changed

+3
-3
lines changed

compiler/rustc_mir_build/src/builder/misc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
5656
pub(crate) fn consume_by_copy_or_move(&self, place: Place<'tcx>) -> Operand<'tcx> {
5757
let tcx = self.tcx;
5858
let ty = place.ty(&self.local_decls, tcx).ty;
59-
if !self.infcx.type_is_copy_modulo_regions(self.param_env, ty) {
60-
Operand::Move(place)
61-
} else {
59+
if self.infcx.type_is_copy_modulo_regions(self.param_env, ty) {
6260
Operand::Copy(place)
61+
} else {
62+
Operand::Move(place)
6363
}
6464
}
6565
}

0 commit comments

Comments
 (0)