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