]> git.lizzy.rs Git - rust.git/blob - src/test/ui/tuple/add-tuple-within-arguments.stderr
Rollup merge of #106499 - lyming2007:issue-105946-fix, r=estebank
[rust.git] / src / test / ui / tuple / add-tuple-within-arguments.stderr
1 error[E0061]: 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) {}
11    |    ^^^          -------------
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) {}
31    |    ^^^          ----------
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`.