Skip to content

Commit

Permalink
Make FnBox a subtrait of FnOnce.
Browse files Browse the repository at this point in the history
  • Loading branch information
qnighy authored and crlf0710 committed Apr 4, 2019
1 parent 52980d0 commit 7994197
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/liballoc/boxed.rs
Expand Up @@ -735,9 +735,7 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}
#[rustc_paren_sugar]
#[unstable(feature = "fnbox",
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
pub trait FnBox<A> {
type Output;

pub trait FnBox<A>: FnOnce<A> {
fn call_box(self: Box<Self>, args: A) -> Self::Output;
}

Expand All @@ -746,8 +744,6 @@ pub trait FnBox<A> {
impl<A, F> FnBox<A> for F
where F: FnOnce<A>
{
type Output = F::Output;

fn call_box(self: Box<F>, args: A) -> F::Output {
self.call_once(args)
}
Expand Down

0 comments on commit 7994197

Please sign in to comment.