]> git.proxmox.com Git - rustc.git/blame - src/test/ui/overloaded-calls-nontuple.rs
New upstream version 1.49.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 }
223e47cc
LB
14}
15
c34b1796
AL
16impl FnOnce<isize> for S {
17 type Output = isize;
18 extern "rust-call" fn call_once(mut self, z: isize) -> isize { self.call_mut(z) }
19}
20
1a4d82fc
JJ
21fn main() {
22 let mut s = S {
23 x: 1,
24 y: 2,
223e47cc 25 };
1a4d82fc 26 drop(s(3)) //~ ERROR cannot use call notation
223e47cc 27}