From 600faba5bc0b0b8bfef048ca9e8698e5f8c157f0 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Fri, 5 Dec 2014 13:53:38 -0500 Subject: [PATCH] libcore: Fix `Sized` bounds on overloaded function traits. - 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 4f4ec4867972e..f24eb483fd785 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -812,12 +812,12 @@ pub trait FnMut for Sized? { /// A version of the call operator that takes a by-value receiver. #[lang="fn_once"] -pub trait FnOnce for Sized? { +pub trait FnOnce { /// This is called when the call operator is used. extern "rust-call" fn call_once(self, args: Args) -> Result; } -impl FnMut for F +impl FnMut for F where F : Fn { extern "rust-call" fn call_mut(&mut self, args: A) -> R {