]> git.lizzy.rs Git - rust.git/blob - src/test/ui/functions-closures/parallel-codegen-closures.rs
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
[rust.git] / src / test / ui / functions-closures / parallel-codegen-closures.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(unused_variables)]
4 #![allow(stable_features)]
5
6 // Tests parallel codegen - this can fail if the symbol for the anonymous
7 // closure in `sum` pollutes the second codegen unit from the first.
8
9 // compile-flags: -C codegen_units=2
10
11 #![feature(iter_arith)]
12
13 mod a {
14     fn foo() {
15         let x = ["a", "bob", "c"];
16         let len: usize = x.iter().map(|s| s.len()).sum();
17     }
18 }
19
20 mod b {
21     fn bar() {
22         let x = ["a", "bob", "c"];
23         let len: usize = x.iter().map(|s| s.len()).sum();
24     }
25 }
26
27 fn main() {
28 }