Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions compiler/rustc_mir/src/transform/early_otherwise_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,6 @@ impl<'a, 'tcx> Helper<'a, 'tcx> {
return None;
}

// check that the value being matched on is the same. The
if this_bb_discr_info.targets_with_values.iter().find(|x| x.0 == value).is_none() {
Comment on lines -256 to -257
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this check duplicated? The check above does not look at targets_with_values at all.

trace!("NO: values being matched on are not the same");
return None;
}

// only allow optimization if the left and right of the tuple being matched are the same variants.
// so the following should not optimize
// ```rust
Expand Down