Skip to content

Commit

Permalink
libcore: Fix Sized bounds on overloaded function traits.
Browse files Browse the repository at this point in the history
- Remove the `for Sized?` bound on `core::ops::FnOnce`, as it takes
  `self` by value and can never be implemented by an unsized type.
- Add a missing `Sized?` bound to the blanket `core::ops::FnMut` impl,
  as both `Fn` and `FnMut` are `for Sized?`.
  • Loading branch information
apasel422 committed Dec 5, 2014
1 parent 4573da6 commit 600faba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/ops.rs
Expand Up @@ -812,12 +812,12 @@ pub trait FnMut<Args,Result> for Sized? {

/// A version of the call operator that takes a by-value receiver.
#[lang="fn_once"]
pub trait FnOnce<Args,Result> for Sized? {
pub trait FnOnce<Args,Result> {
/// This is called when the call operator is used.
extern "rust-call" fn call_once(self, args: Args) -> Result;
}

impl<F,A,R> FnMut<A,R> for F
impl<Sized? F,A,R> FnMut<A,R> for F
where F : Fn<A,R>
{
extern "rust-call" fn call_mut(&mut self, args: A) -> R {
Expand Down

9 comments on commit 600faba

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging apasel422/rust/sized_fn_once = 600faba into auto

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apasel422/rust/sized_fn_once = 600faba merged ok, testing candidate = 25aa8523

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging apasel422/rust/sized_fn_once = 600faba into auto

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apasel422/rust/sized_fn_once = 600faba merged ok, testing candidate = 4c692d3

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 600faba Dec 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 4c692d3

Please sign in to comment.