Skip to content

Commit 05df25f

Browse files
committed
auto merge of #16615 : pcwalton/rust/unboxed-closures-prelude, r=huonw
Closes #16600. r? @huonw
2 parents b8e9bbf + e0a165c commit 05df25f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/libstd/prelude.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#[doc(no_inline)] pub use ops::{Drop, Deref, DerefMut};
4747
#[doc(no_inline)] pub use ops::{Shl, Shr};
4848
#[doc(no_inline)] pub use ops::{Index, IndexMut};
49+
#[doc(no_inline)] pub use ops::{Fn, FnMut, FnOnce};
4950
#[doc(no_inline)] pub use option::{Option, Some, None};
5051
#[doc(no_inline)] pub use result::{Result, Ok, Err};
5152

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
// Tests that the reexports of `FnOnce` et al from the prelude work.
12+
13+
#![feature(unboxed_closures, unboxed_closure_sugar)]
14+
15+
fn main() {
16+
let task: Box<|: int| -> int> = box |: x| x;
17+
task.call_once((0i, ));
18+
}
19+

0 commit comments

Comments
 (0)