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