Skip to content

Commit 364148d

Browse files
committed
unstable book: unboxed_closures
1 parent 7735f59 commit 364148d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
```

0 commit comments

Comments
 (0)