diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-20544.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-20544.rs b/src/test/ui/issues/issue-20544.rs new file mode 100644 index 000000000..0f4d314f1 --- /dev/null +++ b/src/test/ui/issues/issue-20544.rs @@ -0,0 +1,18 @@ +// run-pass +#![feature(unboxed_closures)] +#![feature(fn_traits)] + +struct Fun<F>(F); + +impl<F, T> FnOnce<(T,)> for Fun<F> where F: Fn(T) -> T { + type Output = T; + + extern "rust-call" fn call_once(self, (t,): (T,)) -> T { + (self.0)(t) + } +} + +fn main() { + let fun = Fun(|i: isize| i * 2); + println!("{}", fun(3)); +} |