]> git.lizzy.rs Git - rust.git/blob - tests/ui/functions-closures/parallel-codegen-closures.rs
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / 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 }