Skip to content

Commit

Permalink
Rollup merge of rust-lang#71572 - lcnr:type_length, r=Dylan-DPC
Browse files Browse the repository at this point in the history
test iterator chain type length blowup

Adds a regression test. closes rust-lang#58952

r? @Dylan-DPC
  • Loading branch information
Dylan-DPC authored Apr 29, 2020
2 parents d35aab9 + 7d6aef6 commit 1c01588
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/test/ui/iterators/issue-58952-filter-type-length.rs
Original file line number Diff line number Diff line change
@@ -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<_>>();
}

0 comments on commit 1c01588

Please sign in to comment.