Skip to content

Commit

Permalink
Unrolled build for rust-lang#134399
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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.
  • Loading branch information
rust-timer authored Dec 18, 2024
2 parents 057bdb3 + 3218476 commit 0bbe732
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_mir_build/src/builder/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
pub(crate) fn consume_by_copy_or_move(&self, place: Place<'tcx>) -> Operand<'tcx> {
let tcx = self.tcx;
let ty = place.ty(&self.local_decls, tcx).ty;
if !self.infcx.type_is_copy_modulo_regions(self.param_env, ty) {
Operand::Move(place)
} else {
if self.infcx.type_is_copy_modulo_regions(self.param_env, ty) {
Operand::Copy(place)
} else {
Operand::Move(place)
}
}
}

0 comments on commit 0bbe732

Please sign in to comment.