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