fork/rust

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

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

master
4.1 KiB125 linesraw
1error[E0061]: enum variant takes 1 argument but 2 arguments were supplied
2  --> $DIR/args-instead-of-tuple.rs:7:36
3   |
4LL |     let _: Result<(i32, i8), ()> = Ok(1, 2);
5   |                                    ^^
6   |
7note: tuple variant defined here
8  --> $SRC_DIR/core/src/result.rs:LL:COL
9help: wrap these arguments in parentheses to construct a tuple
10   |
11LL |     let _: Result<(i32, i8), ()> = Ok((1, 2));
12   |                                       +    +
13
14error[E0061]: enum variant takes 1 argument but 3 arguments were supplied
15  --> $DIR/args-instead-of-tuple.rs:9:46
16   |
17LL |     let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi");
18   |                                              ^^^^
19   |
20note: tuple variant defined here
21  --> $SRC_DIR/core/src/option.rs:LL:COL
22help: wrap these arguments in parentheses to construct a tuple
23   |
24LL |     let _: Option<(i32, i8, &'static str)> = Some((1, 2, "hi"));
25   |                                                   +          +
26
27error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
28  --> $DIR/args-instead-of-tuple.rs:11:25
29   |
30LL |     let _: Option<()> = Some();
31   |                         ^^^^-- an argument of type `()` is missing
32   |
33note: tuple variant defined here
34  --> $SRC_DIR/core/src/option.rs:LL:COL
35help: provide the argument
36   |
37LL |     let _: Option<()> = Some(());
38   |                             ~~~~
39
40error[E0308]: mismatched types
41  --> $DIR/args-instead-of-tuple.rs:14:34
42   |
43LL |     let _: Option<(i32,)> = Some(3);
44   |                             ---- ^ expected `(i32,)`, found integer
45   |                             |
46   |                             arguments to this enum variant are incorrect
47   |
48   = note: expected tuple `(i32,)`
49               found type `{integer}`
50note: tuple variant defined here
51  --> $SRC_DIR/core/src/option.rs:LL:COL
52help: use a trailing comma to create a tuple with one element
53   |
54LL |     let _: Option<(i32,)> = Some((3,));
55   |                                  + ++
56
57error[E0308]: mismatched types
58  --> $DIR/args-instead-of-tuple.rs:17:34
59   |
60LL |     let _: Option<(i32,)> = Some((3));
61   |                             ---- ^^^ expected `(i32,)`, found integer
62   |                             |
63   |                             arguments to this enum variant are incorrect
64   |
65   = note: expected tuple `(i32,)`
66               found type `{integer}`
67note: tuple variant defined here
68  --> $SRC_DIR/core/src/option.rs:LL:COL
69help: use a trailing comma to create a tuple with one element
70   |
71LL |     let _: Option<(i32,)> = Some((3,));
72   |                                    +
73
74error[E0061]: function takes 1 argument but 2 arguments were supplied
75  --> $DIR/args-instead-of-tuple.rs:20:5
76   |
77LL |     two_ints(1, 2);
78   |     ^^^^^^^^
79   |
80note: function defined here
81  --> $DIR/args-instead-of-tuple.rs:25:4
82   |
83LL | fn two_ints(_: (i32, i32)) {
84   |    ^^^^^^^^ -------------
85help: wrap these arguments in parentheses to construct a tuple
86   |
87LL |     two_ints((1, 2));
88   |              +    +
89
90error[E0061]: function takes 1 argument but 2 arguments were supplied
91  --> $DIR/args-instead-of-tuple.rs:22:5
92   |
93LL |     with_generic(3, 4);
94   |     ^^^^^^^^^^^^
95   |
96note: function defined here
97  --> $DIR/args-instead-of-tuple.rs:28:4
98   |
99LL | fn with_generic<T: Copy + Send>((a, b): (i32, T)) {
100   |    ^^^^^^^^^^^^                 ----------------
101help: wrap these arguments in parentheses to construct a tuple
102   |
103LL |     with_generic((3, 4));
104   |                  +    +
105
106error[E0061]: function takes 1 argument but 2 arguments were supplied
107  --> $DIR/args-instead-of-tuple.rs:31:9
108   |
109LL |         with_generic(a, b);
110   |         ^^^^^^^^^^^^
111   |
112note: function defined here
113  --> $DIR/args-instead-of-tuple.rs:28:4
114   |
115LL | fn with_generic<T: Copy + Send>((a, b): (i32, T)) {
116   |    ^^^^^^^^^^^^                 ----------------
117help: wrap these arguments in parentheses to construct a tuple
118   |
119LL |         with_generic((a, b));
120   |                      +    +
121
122error: aborting due to 8 previous errors
123
124Some errors have detailed explanations: E0061, E0308.
125For more information about an error, try `rustc --explain E0061`.