fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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