diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-04-26 11:50:58 +0200 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-04-26 11:52:12 +0200 |
| commit | 7d6aef65d80581b4fe726db7fcc592e87072a33d (patch) | |
| tree | f3b5335889515bfeba1ca9c000c198932795dc64 | |
| parent | 019ab732ce63a117cbb446db1488916c5c0bd2a7 (diff) | |
| download | rust-7d6aef65d80581b4fe726db7fcc592e87072a33d.tar.gz rust-7d6aef65d80581b4fe726db7fcc592e87072a33d.zip | |
test iterator chain type length blowup
| -rw-r--r-- | src/test/ui/iterators/issue-58952-filter-type-length.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/iterators/issue-58952-filter-type-length.rs b/src/test/ui/iterators/issue-58952-filter-type-length.rs new file mode 100644 index 00000000000..046e3784084 --- /dev/null +++ b/src/test/ui/iterators/issue-58952-filter-type-length.rs @@ -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<_>>(); +} |
