diff options
| author | bors <bors@rust-lang.org> | 2014-08-20 08:00:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-20 08:00:56 +0000 |
| commit | 05df25f13e53e87c9b96382df2d05ac732d5e7c8 (patch) | |
| tree | 7c652351f850a71c062c974caf1d5c59a7c7f03b | |
| parent | b8e9bbf79361ff8249b29acc671301b98706a982 (diff) | |
| parent | e0a165ca1365112b79028750ccbee7f10f1abe0d (diff) | |
| download | rust-05df25f13e53e87c9b96382df2d05ac732d5e7c8.tar.gz rust-05df25f13e53e87c9b96382df2d05ac732d5e7c8.zip | |
auto merge of #16615 : pcwalton/rust/unboxed-closures-prelude, r=huonw
Closes #16600. r? @huonw
| -rw-r--r-- | src/libstd/prelude.rs | 1 | ||||
| -rw-r--r-- | src/test/run-pass/unboxed-closures-prelude.rs | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index eb6dcc1f1a5..48ddfeaf5ff 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -46,6 +46,7 @@ #[doc(no_inline)] pub use ops::{Drop, Deref, DerefMut}; #[doc(no_inline)] pub use ops::{Shl, Shr}; #[doc(no_inline)] pub use ops::{Index, IndexMut}; +#[doc(no_inline)] pub use ops::{Fn, FnMut, FnOnce}; #[doc(no_inline)] pub use option::{Option, Some, None}; #[doc(no_inline)] pub use result::{Result, Ok, Err}; diff --git a/src/test/run-pass/unboxed-closures-prelude.rs b/src/test/run-pass/unboxed-closures-prelude.rs new file mode 100644 index 00000000000..4226ed427e7 --- /dev/null +++ b/src/test/run-pass/unboxed-closures-prelude.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Tests that the reexports of `FnOnce` et al from the prelude work. + +#![feature(unboxed_closures, unboxed_closure_sugar)] + +fn main() { + let task: Box<|: int| -> int> = box |: x| x; + task.call_once((0i, )); +} + |
