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