File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/doc/unstable-book/src/language-features Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ # ` unboxed_closures `
2
+
3
+ The tracking issue for this feature is [ #29625 ]
4
+
5
+ See Also: [ ` fn_traits ` ] ( library-features/fn-traits.md )
6
+
7
+ [ #29625 ] : https://github.com/rust-lang/rust/issues/29625
8
+
9
+ ----
10
+
11
+ The ` unboxed_closures ` feature allows you to write functions using the ` "rust-call" ` ABI,
12
+ required for implmenting the [ ` Fn* ` ] family of traits. ` "rust-call" ` functions must have
13
+ exactly one (non self) argument, a tuple representing the argument list.
14
+
15
+ [ `Fn*` ] : https://doc.rust-lang.org/std/ops/trait.Fn.html
16
+
17
+ ``` rust
18
+ #![feature(unboxed_closures)]
19
+
20
+ extern " rust-call" fn add_args (args : (u32 , u32 )) {
21
+ args . 0 + args . 1
22
+ }
23
+
24
+ fn main () {}
25
+ ```
You can’t perform that action at this time.
0 commit comments