File tree Expand file tree Collapse file tree 3 files changed +47
-1
lines changed
branches/snap-stage3/src/test Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 0b48001c28329392b26961eaf1c3ed293a352d6f
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 9b322a6a90420759724471ca018b90603e8b1497
4
+ refs/heads/snap-stage3: bfa5320527b838e1b735a2999acbe1f55b034205
5
5
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 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
+ #![ feature( unboxed_closures, overloaded_calls) ]
12
+
13
+ #[ inline]
14
+ pub fn has_closures ( ) -> uint {
15
+ let x = 1 u;
16
+ let mut f = move |& mut : | x;
17
+ let y = 1 u;
18
+ let g = |: | y;
19
+ f ( ) + g ( )
20
+ }
21
+
22
+ pub fn has_generic_closures < T : Add < T , T > + Copy > ( x : T , y : T ) -> T {
23
+ let mut f = move |& mut : | x;
24
+ let g = |: | y;
25
+ f ( ) + g ( )
26
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 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
+ // Test that unboxed closures work with cross-crate inlining
12
+ // Acts as a regression test for #16790, #18378 and #18543
13
+
14
+ // aux-build:unboxed-closures-cross-crate.rs
15
+ extern crate "unboxed-closures-cross-crate" as ubcc;
16
+
17
+ fn main ( ) {
18
+ assert_eq ! ( ubcc:: has_closures( ) , 2 u) ;
19
+ assert_eq ! ( ubcc:: has_generic_closures( 2 u, 3 u) , 5 u) ;
20
+ }
You can’t perform that action at this time.
0 commit comments