]>
Commit | Line | Data |
---|---|---|
064997fb FG |
1 | error[E0061]: this function takes 3 arguments but 4 arguments were supplied |
2 | --> $DIR/add-tuple-within-arguments.rs:6:5 | |
3 | | | |
4 | LL | foo("hi", 1, 2, "hi"); | |
5 | | ^^^ | |
6 | | | |
7 | note: function defined here | |
8 | --> $DIR/add-tuple-within-arguments.rs:1:4 | |
9 | | | |
10 | LL | fn foo(s: &str, a: (i32, i32), s2: &str) {} | |
f2b60f7d | 11 | | ^^^ ------------- |
064997fb FG |
12 | help: wrap these arguments in parentheses to construct a tuple |
13 | | | |
14 | LL | foo("hi", (1, 2), "hi"); | |
15 | | + + | |
16 | ||
17 | error[E0308]: mismatched types | |
18 | --> $DIR/add-tuple-within-arguments.rs:8:15 | |
19 | | | |
20 | LL | bar("hi", "hi", "hi"); | |
21 | | --- ^^^^ expected tuple, found `&str` | |
22 | | | | |
23 | | arguments to this function are incorrect | |
24 | | | |
25 | = note: expected tuple `(&str,)` | |
26 | found reference `&'static str` | |
27 | note: function defined here | |
28 | --> $DIR/add-tuple-within-arguments.rs:3:4 | |
29 | | | |
30 | LL | fn bar(s: &str, a: (&str,), s2: &str) {} | |
f2b60f7d | 31 | | ^^^ ---------- |
064997fb FG |
32 | help: use a trailing comma to create a tuple with one element |
33 | | | |
34 | LL | bar("hi", ("hi",), "hi"); | |
35 | | + ++ | |
36 | ||
37 | error: aborting due to 2 previous errors | |
38 | ||
39 | Some errors have detailed explanations: E0061, E0308. | |
40 | For more information about an error, try `rustc --explain E0061`. |