blob: 483e5876615f165146e716a8f612ffacf3b32813 [file] [log] [blame]
// skip-filecheck
// compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2
// ignore-debug: standard library debug assertions add a panic that breaks this optimization
#![crate_type = "lib"]
pub fn variant_a(input: &[(usize, usize, usize, usize)]) -> usize {
input.iter().filter(|(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
}
pub fn variant_b(input: &[(usize, usize, usize, usize)]) -> usize {
input.iter().filter(|&&(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
}
// EMIT_MIR slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
// EMIT_MIR slice_filter.variant_b-{closure#0}.PreCodegen.after.mir