]>
Commit | Line | Data |
---|---|---|
5099ac24 | 1 | error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied |
923072b8 | 2 | --> $DIR/args-instead-of-tuple.rs:7:36 |
5099ac24 FG |
3 | | |
4 | LL | let _: Result<(i32, i8), ()> = Ok(1, 2); | |
923072b8 | 5 | | ^^ |
5099ac24 | 6 | | |
923072b8 FG |
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 | | ^^ | |
064997fb | 12 | help: wrap these arguments in parentheses to construct a tuple |
5099ac24 FG |
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 | |
923072b8 | 18 | --> $DIR/args-instead-of-tuple.rs:9:46 |
5099ac24 FG |
19 | | |
20 | LL | let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi"); | |
923072b8 FG |
21 | | ^^^^ |
22 | | | |
23 | note: tuple variant defined here | |
24 | --> $SRC_DIR/core/src/option.rs:LL:COL | |
5099ac24 | 25 | | |
923072b8 FG |
26 | LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), |
27 | | ^^^^ | |
064997fb | 28 | help: wrap these arguments in parentheses to construct a tuple |
5099ac24 FG |
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 | |
923072b8 | 34 | --> $DIR/args-instead-of-tuple.rs:11:25 |
5099ac24 FG |
35 | | |
36 | LL | let _: Option<()> = Some(); | |
923072b8 FG |
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(()); | |
f2b60f7d | 47 | | ~~~~ |
5099ac24 FG |
48 | |
49 | error[E0308]: mismatched types | |
923072b8 | 50 | --> $DIR/args-instead-of-tuple.rs:14:34 |
5099ac24 FG |
51 | | |
52 | LL | let _: Option<(i32,)> = Some(3); | |
923072b8 FG |
53 | | ---- ^ expected tuple, found integer |
54 | | | | |
55 | | arguments to this enum variant are incorrect | |
5099ac24 FG |
56 | | |
57 | = note: expected tuple `(i32,)` | |
58 | found type `{integer}` | |
923072b8 FG |
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 | | ^^^^ | |
5099ac24 FG |
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 | |
923072b8 | 70 | --> $DIR/args-instead-of-tuple.rs:17:34 |
5099ac24 FG |
71 | | |
72 | LL | let _: Option<(i32,)> = Some((3)); | |
923072b8 FG |
73 | | ---- ^^^ expected tuple, found integer |
74 | | | | |
75 | | arguments to this enum variant are incorrect | |
5099ac24 FG |
76 | | |
77 | = note: expected tuple `(i32,)` | |
78 | found type `{integer}` | |
923072b8 FG |
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 | | ^^^^ | |
5099ac24 FG |
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 | |
923072b8 | 90 | --> $DIR/args-instead-of-tuple.rs:20:5 |
5099ac24 FG |
91 | | |
92 | LL | two_ints(1, 2); | |
923072b8 | 93 | | ^^^^^^^^ |
5099ac24 FG |
94 | | |
95 | note: function defined here | |
923072b8 | 96 | --> $DIR/args-instead-of-tuple.rs:25:4 |
5099ac24 FG |
97 | | |
98 | LL | fn two_ints(_: (i32, i32)) { | |
99 | | ^^^^^^^^ ------------- | |
064997fb | 100 | help: wrap these arguments in parentheses to construct a tuple |
5099ac24 FG |
101 | | |
102 | LL | two_ints((1, 2)); | |
103 | | + + | |
104 | ||
105 | error[E0061]: this function takes 1 argument but 2 arguments were supplied | |
923072b8 | 106 | --> $DIR/args-instead-of-tuple.rs:22:5 |
5099ac24 FG |
107 | | |
108 | LL | with_generic(3, 4); | |
923072b8 | 109 | | ^^^^^^^^^^^^ |
5099ac24 FG |
110 | | |
111 | note: function defined here | |
923072b8 | 112 | --> $DIR/args-instead-of-tuple.rs:28:4 |
5099ac24 FG |
113 | | |
114 | LL | fn with_generic<T: Copy + Send>((a, b): (i32, T)) { | |
115 | | ^^^^^^^^^^^^ ---------------- | |
064997fb | 116 | help: wrap these arguments in parentheses to construct a tuple |
5099ac24 FG |
117 | | |
118 | LL | with_generic((3, 4)); | |
119 | | + + | |
120 | ||
121 | error[E0061]: this function takes 1 argument but 2 arguments were supplied | |
923072b8 | 122 | --> $DIR/args-instead-of-tuple.rs:31:9 |
5099ac24 FG |
123 | | |
124 | LL | with_generic(a, b); | |
923072b8 | 125 | | ^^^^^^^^^^^^ |
5099ac24 FG |
126 | | |
127 | note: function defined here | |
923072b8 | 128 | --> $DIR/args-instead-of-tuple.rs:28:4 |
5099ac24 FG |
129 | | |
130 | LL | fn with_generic<T: Copy + Send>((a, b): (i32, T)) { | |
131 | | ^^^^^^^^^^^^ ---------------- | |
064997fb | 132 | help: wrap these arguments in parentheses to construct a tuple |
5099ac24 FG |
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`. |