Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6d6240e

Browse files
committedSep 29, 2017
Immovable types prototype where the Move trait is builtin
1 parent a379780 commit 6d6240e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1133
-155
lines changed
 

‎src/liballoc/boxed.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ pub trait FnBox<A> {
717717
fn call_box(self: Box<Self>, args: A) -> Self::Output;
718718
}
719719

720+
#[cfg(stage0)]
720721
#[unstable(feature = "fnbox",
721722
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
722723
impl<A, F> FnBox<A> for F
@@ -729,6 +730,21 @@ impl<A, F> FnBox<A> for F
729730
}
730731
}
731732

733+
#[cfg(not(stage0))]
734+
#[unstable(feature = "fnbox",
735+
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
736+
impl<A, F> FnBox<A> for F
737+
where F: FnOnce<A>,
738+
<F as FnOnce<A>>::Output: marker::Move,
739+
740+
{
741+
type Output = F::Output;
742+
743+
fn call_box(self: Box<F>, args: A) -> F::Output {
744+
self.call_once(args)
745+
}
746+
}
747+
732748
#[unstable(feature = "fnbox",
733749
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
734750
impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + 'a> {

‎src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
#![feature(slice_rsplit)]
115115
#![feature(specialization)]
116116
#![feature(staged_api)]
117+
#![cfg_attr(not(stage0), feature(immovable_types))]
117118
#![feature(str_internals)]
118119
#![feature(trusted_len)]
119120
#![feature(unboxed_closures)]

0 commit comments

Comments
 (0)
Please sign in to comment.