]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/iter-fold-closure-no-iterator.rs
Suggest defining type parameter when appropriate
[rust.git] / src / test / codegen / iter-fold-closure-no-iterator.rs
1 //! Check that fold closures aren't generic in the iterator type.
2 // compile-flags: -C opt-level=0
3
4 fn main() {
5     (0i32..10).by_ref().count();
6 }
7
8 // `count` calls `fold`, which calls `try_fold` -- that `fold` closure should
9 // not be generic in the iterator type, only in the item type.
10 // CHECK-NOT: {{^define.*Iterator::fold::.*closure.*Range}}