forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#71572 - lcnr:type_length, r=Dylan-DPC
test iterator chain type length blowup Adds a regression test. closes rust-lang#58952 r? @Dylan-DPC
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<_>>(); | ||
} |