diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-29 19:39:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-29 19:39:30 +0200 |
| commit | 843ffb8e8a37b4ddd134d97eb456556469d041a9 (patch) | |
| tree | 827a3a646b83fa376d1554b1351b9e5e630d8e26 /src | |
| parent | d9761daa575a202c3d119eb3a74632412bef37f7 (diff) | |
| parent | 7d6aef65d80581b4fe726db7fcc592e87072a33d (diff) | |
| download | rust-843ffb8e8a37b4ddd134d97eb456556469d041a9.tar.gz rust-843ffb8e8a37b4ddd134d97eb456556469d041a9.zip | |
Rollup merge of #71572 - lcnr:type_length, r=Dylan-DPC
test iterator chain type length blowup Adds a regression test. closes #58952 r? @Dylan-DPC
Diffstat (limited to 'src')
| -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<_>>(); +} |
