Skip to content

Commit 84f120f

Browse files
committed
---
yaml --- r: 178454 b: refs/heads/try c: 5b66c6d h: refs/heads/master v: v3
1 parent 2b5ac27 commit 84f120f

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 336c8d2e9c6b276b162bdb3edd43706372e6eddd
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 474b324eda10440d6568ef872a7307d38e7de95b
5-
refs/heads/try: 326443105b897171424c6efde15198cd7a25bc61
5+
refs/heads/try: 5b66c6dfa4a6b258d83f8eaf566e53814c7f812e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
11+
trait Boo { }
12+
13+
impl Boo for [i8; 1] { }
14+
impl Boo for [i8; 2] { }
15+
impl Boo for [i8; 3] { }
16+
impl Boo for [i8; 4] { }
17+
18+
pub fn foo(box_1: fn () -> Box<[i8; 1]>,
19+
box_2: fn () -> Box<[i8; 20]>,
20+
box_3: fn () -> Box<[i8; 300]>,
21+
box_4: fn () -> Box<[i8; 4000]>,
22+
) {
23+
println!("Hello World 1");
24+
let _: Box<[i8]> = match 3 {
25+
1 => box_1(),
26+
2 => box_2(),
27+
3 => box_3(),
28+
_ => box_4(),
29+
};
30+
println!("Hello World 2");
31+
}
32+
33+
pub fn main() {
34+
fn box_1() -> Box<[i8; 1]> { Box::new( [1i8] ) }
35+
fn box_2() -> Box<[i8; 20]> { Box::new( [1i8; 20] ) }
36+
fn box_3() -> Box<[i8; 300]> { Box::new( [1i8; 300] ) }
37+
fn box_4() -> Box<[i8; 4000]> { Box::new( [1i8; 4000] ) }
38+
39+
foo(box_1, box_2, box_3, box_4);
40+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
11+
pub fn foo(box_1: fn () -> Box<[i8; 1]>,
12+
box_2: fn () -> Box<[i8; 20]>,
13+
box_3: fn () -> Box<[i8; 300]>,
14+
box_4: fn () -> Box<[i8; 4000]>,
15+
) {
16+
println!("Hello World 1");
17+
let _: Box<[i8]> = match 3 {
18+
1 => box_1(),
19+
2 => box_2(),
20+
3 => box_3(),
21+
_ => box_4(),
22+
};
23+
println!("Hello World 2");
24+
}
25+
26+
pub fn main() {
27+
fn box_1() -> Box<[i8; 1]> { Box::new( [1i8] ) }
28+
fn box_2() -> Box<[i8; 20]> { Box::new( [1i8; 20] ) }
29+
fn box_3() -> Box<[i8; 300]> { Box::new( [1i8; 300] ) }
30+
fn box_4() -> Box<[i8; 4000]> { Box::new( [1i8; 4000] ) }
31+
32+
foo(box_1, box_2, box_3, box_4);
33+
}

0 commit comments

Comments
 (0)