Skip to content

Commit

Permalink
readability improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
x17jiri committed Feb 17, 2024
1 parent 7df3859 commit 4ab1024
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
discr: &mir::Operand<'tcx>,
) -> Option<mir::ExpectKind> {
// First do a quick test if there are any `expect` intrinsics in the BB.

let Some(discr) = discr.place() else {
return None;
};

if let Some(ref blocks) = self.blocks_with_expect {
if !blocks.contains(bb) {
return None;
Expand All @@ -331,6 +326,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
return None;
}

let Some(discr) = discr.place() else {
return None;
};

// There are `expect` intrinsics in the BB, so we need to do the full analysis.

// Groups of variables which have the same value
Expand Down

0 comments on commit 4ab1024

Please sign in to comment.