]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/slice_filter.rs
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / tests / mir-opt / slice_filter.rs
1 fn main() {
2     let input = vec![];
3     let _variant_a_result = variant_a(&input);
4     let _variant_b_result = variant_b(&input);
5 }
6
7 pub fn variant_a(input: &[(usize, usize, usize, usize)]) -> usize {
8     input.iter().filter(|(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
9 }
10
11 pub fn variant_b(input: &[(usize, usize, usize, usize)]) -> usize {
12     input.iter().filter(|&&(a, b, c, d)| a <= c && d <= b || c <= a && b <= d).count()
13 }
14
15 // EMIT_MIR slice_filter.variant_a-{closure#0}.CopyProp.diff
16 // EMIT_MIR slice_filter.variant_a-{closure#0}.DestinationPropagation.diff
17 // EMIT_MIR slice_filter.variant_b-{closure#0}.CopyProp.diff
18 // EMIT_MIR slice_filter.variant_b-{closure#0}.DestinationPropagation.diff