]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-47706.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-47706.rs
1 pub struct Foo {
2     foo: Option<i32>,
3 }
4
5 impl Foo {
6     pub fn new(foo: Option<i32>, _: ()) -> Foo {
7         Foo { foo }
8     }
9
10     pub fn map(self) -> Option<Foo> {
11         self.foo.map(Foo::new)
12     }
13     //~^^ ERROR function is expected to take 1 argument, but it takes 2 arguments [E0593]
14 }
15
16 enum Qux {
17     Bar(i32),
18 }
19
20 fn foo<F>(f: F)
21 where
22     F: Fn(),
23 {
24 }
25
26 fn main() {
27     foo(Qux::Bar);
28 }
29 //~^^ ERROR function is expected to take 0 arguments, but it takes 1 argument [E0593]