]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/overloaded/overloaded-calls-simple.rs
3 #![feature(lang_items, unboxed_closures, fn_traits)]
5 use std
::ops
::{Fn, FnMut, FnOnce}
;
12 impl FnMut
<(i32,)> for S1
{
13 extern "rust-call" fn call_mut(&mut self, (z
,): (i32,)) -> i32 {
18 impl FnOnce
<(i32,)> for S1
{
20 extern "rust-call" fn call_once(mut self, args
: (i32,)) -> i32 {
30 impl Fn
<(i32,)> for S2
{
31 extern "rust-call" fn call(&self, (z
,): (i32,)) -> i32 {
36 impl FnMut
<(i32,)> for S2
{
37 extern "rust-call" fn call_mut(&mut self, args
: (i32,)) -> i32 { self.call(args) }
40 impl FnOnce
<(i32,)> for S2
{
42 extern "rust-call" fn call_once(self, args
: (i32,)) -> i32 { self.call(args) }
50 impl FnOnce
<(i32,i32)> for S3
{
52 extern "rust-call" fn call_once(self, (z
,zz
): (i32,i32)) -> i32 {
53 self.x
* self.y
* z
* zz
69 let ans
= s
.call((3,));