]> git.lizzy.rs Git - rust.git/commitdiff
libcore: Fix `Sized` bounds on overloaded function traits.
authorAndrew Paseltiner <apaseltiner@gmail.com>
Fri, 5 Dec 2014 18:53:38 +0000 (13:53 -0500)
committerAndrew Paseltiner <apaseltiner@gmail.com>
Fri, 5 Dec 2014 19:04:57 +0000 (14:04 -0500)
- 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?`.

src/libcore/ops.rs

index 4f4ec4867972eeceaa147f2a8c827f73b4c82467..f24eb483fd78571521114df6e8b774df4d4ac764 100644 (file)
@@ -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 {