Skip to content

Commit 600faba

Browse files
committed
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?`.
1 parent 4573da6 commit 600faba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/ops.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -812,12 +812,12 @@ pub trait FnMut<Args,Result> for Sized? {
812812

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

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

0 commit comments

Comments
 (0)