From: Ian Jackson Date: Thu, 20 Apr 2023 15:49:08 +0000 (+0100) Subject: Breaks inference X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=e26de1f788f5e2493ecd6a30c9c6e1ef14084071;p=rust-experiments.git Breaks inference --- diff --git a/src/main.rs b/src/main.rs index 3b6259c..802c5d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,11 +5,11 @@ pub trait Callable: Any { type Output; fn callable_call(self, a: Args) -> Self::Output; } -impl Callable<(A,)> for F where F: Fn(A) -> O + 'static { +impl Callable<(A,)> for fn(A) -> O { type Output = O; fn callable_call(self, (a,): (A,)) -> O { (self)(a) } } -impl Callable<(A,B)> for F where F: Fn(A,B) -> O + 'static { +impl Callable<(A,B)> for fn(A,B) -> O { type Output = O; fn callable_call(self, (a,b): (A,B)) -> O { (self)(a,b) } }