]> git.proxmox.com Git - rustc.git/blame - src/test/ui/overloaded-calls-nontuple.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / overloaded-calls-nontuple.rs
CommitLineData
476ff2be 1#![feature(fn_traits, unboxed_closures)]
223e47cc 2
1a4d82fc 3use std::ops::FnMut;
223e47cc
LB
4
5struct S {
1a4d82fc
JJ
6 x: isize,
7 y: isize,
223e47cc
LB
8}
9
85aaf69f 10impl FnMut<isize> for S {
1a4d82fc
JJ
11 extern "rust-call" fn call_mut(&mut self, z: isize) -> isize {
12 self.x + self.y + z
13 }
fc512014 14 //~^^^ ERROR A function with the "rust-call" ABI must take a single non-self argument
223e47cc
LB
15}
16
c34b1796
AL
17impl FnOnce<isize> for S {
18 type Output = isize;
19 extern "rust-call" fn call_once(mut self, z: isize) -> isize { self.call_mut(z) }
fc512014 20 //~^ ERROR A function with the "rust-call" ABI must take a single non-self argument
c34b1796
AL
21}
22
1a4d82fc
JJ
23fn main() {
24 let mut s = S {
25 x: 1,
26 y: 2,
223e47cc 27 };
1a4d82fc 28 drop(s(3)) //~ ERROR cannot use call notation
223e47cc 29}