about summary refs log tree commit diff
path: root/src/test/codegen/iter-fold-closure-no-iterator.rs
blob: fbeafd5f395827b8774b5bd1695f4e2560a1d015 (plain)
1
2
3
4
5
6
7
8
9
10
//! Check that fold closures aren't generic in the iterator type.
// compile-flags: -C opt-level=0

fn main() {
    (0i32..10).by_ref().count();
}

// `count` calls `fold`, which calls `try_fold` -- that `fold` closure should
// not be generic in the iterator type, only in the item type.
// CHECK-NOT: {{^define.*Iterator::fold::.*closure.*Range}}