]> git.proxmox.com Git - rustc.git/blame - src/test/ui/run-pass/functions-closures/parallel-codegen-closures.rs
New upstream version 1.30.0+dfsg1
[rustc.git] / src / test / ui / run-pass / functions-closures / parallel-codegen-closures.rs
CommitLineData
62682a34
SL
1// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
b7449926
XL
11// run-pass
12#![allow(stable_features)]
13
62682a34
SL
14// Tests parallel codegen - this can fail if the symbol for the anonymous
15// closure in `sum` pollutes the second codegen unit from the first.
16
c1a9b12d 17// ignore-bitrig
62682a34
SL
18// compile-flags: -C codegen_units=2
19
62682a34
SL
20#![feature(iter_arith)]
21
22mod a {
23 fn foo() {
24 let x = ["a", "bob", "c"];
25 let len: usize = x.iter().map(|s| s.len()).sum();
26 }
27}
28
29mod b {
30 fn bar() {
31 let x = ["a", "bob", "c"];
32 let len: usize = x.iter().map(|s| s.len()).sum();
33 }
34}
35
36fn main() {
37}