test iterator chain type length blowup
This commit is contained in:
parent
019ab732ce
commit
7d6aef65d8
1 changed files with 31 additions and 0 deletions
31
src/test/ui/iterators/issue-58952-filter-type-length.rs
Normal file
31
src/test/ui/iterators/issue-58952-filter-type-length.rs
Normal file
|
@ -0,0 +1,31 @@
|
|||
// run-pass
|
||||
//! This snippet causes the type length to blowup exponentially,
|
||||
//! so check that we don't accidentially exceed the type length limit.
|
||||
// FIXME: Once the size of iterator adaptors is further reduced,
|
||||
// increase the complexity of this test.
|
||||
|
||||
fn main() {
|
||||
let c = 2;
|
||||
let bv = vec![2];
|
||||
let b = bv
|
||||
.iter()
|
||||
.filter(|a| **a == c);
|
||||
|
||||
let _a = vec![1, 2, 3]
|
||||
.into_iter()
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.filter(|a| b.clone().any(|b| *b == *a))
|
||||
.collect::<Vec<_>>();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue