fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
2.2 KiB78 linesraw
1error[E0061]: this function takes 1 argument but 0 arguments were supplied
2  --> $DIR/missing-unit-argument.rs:11:33
3   |
4LL |     let _: Result<(), String> = Ok();
5   |                                 ^^-- supplied 0 arguments
6   |
7help: expected the unit value `()`; create it with empty parentheses
8   |
9LL |     let _: Result<(), String> = Ok(());
10   |                                    ^^
11
12error[E0061]: this function takes 2 arguments but 0 arguments were supplied
13  --> $DIR/missing-unit-argument.rs:12:5
14   |
15LL | fn foo(():(), ():()) {}
16   | -------------------- defined here
17...
18LL |     foo();
19   |     ^^^-- supplied 0 arguments
20   |     |
21   |     expected 2 arguments
22
23error[E0061]: this function takes 2 arguments but 1 argument was supplied
24  --> $DIR/missing-unit-argument.rs:13:5
25   |
26LL | fn foo(():(), ():()) {}
27   | -------------------- defined here
28...
29LL |     foo(());
30   |     ^^^ -- supplied 1 argument
31   |     |
32   |     expected 2 arguments
33
34error[E0061]: this function takes 1 argument but 0 arguments were supplied
35  --> $DIR/missing-unit-argument.rs:14:5
36   |
37LL | fn bar(():()) {}
38   | ------------- defined here
39...
40LL |     bar();
41   |     ^^^-- supplied 0 arguments
42   |
43help: expected the unit value `()`; create it with empty parentheses
44   |
45LL |     bar(());
46   |         ^^
47
48error[E0061]: this function takes 1 argument but 0 arguments were supplied
49  --> $DIR/missing-unit-argument.rs:15:7
50   |
51LL |     fn baz(self, (): ()) { }
52   |     -------------------- defined here
53...
54LL |     S.baz();
55   |       ^^^- supplied 0 arguments
56   |
57help: expected the unit value `()`; create it with empty parentheses
58   |
59LL |     S.baz(());
60   |           ^^
61
62error[E0061]: this function takes 1 argument but 0 arguments were supplied
63  --> $DIR/missing-unit-argument.rs:16:7
64   |
65LL |     fn generic<T>(self, _: T) { }
66   |     ------------------------- defined here
67...
68LL |     S.generic::<()>();
69   |       ^^^^^^^------ supplied 0 arguments
70   |
71help: expected the unit value `()`; create it with empty parentheses
72   |
73LL |     S.generic::<()>(());
74   |                     ^^
75
76error: aborting due to 6 previous errors
77
78For more information about this error, try `rustc --explain E0061`.