]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/args-instead-of-tuple-errors.stderr
Auto merge of #106853 - TimNN:undo-remap, r=oli-obk
[rust.git] / tests / ui / suggestions / args-instead-of-tuple-errors.stderr
1 error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
2   --> $DIR/args-instead-of-tuple-errors.rs:6:34
3    |
4 LL |     let _: Option<(i32, bool)> = Some(1, 2);
5    |                                  ^^^^    - argument of type `{integer}` unexpected
6    |
7 note: expected tuple, found integer
8   --> $DIR/args-instead-of-tuple-errors.rs:6:39
9    |
10 LL |     let _: Option<(i32, bool)> = Some(1, 2);
11    |                                       ^
12    = note: expected tuple `(i32, bool)`
13                found type `{integer}`
14 help: the type constructed contains `{integer}` due to the type of the argument passed
15   --> $DIR/args-instead-of-tuple-errors.rs:6:34
16    |
17 LL |     let _: Option<(i32, bool)> = Some(1, 2);
18    |                                  ^^^^^-^^^^
19    |                                       |
20    |                                       this argument influences the type of `Some`
21 note: tuple variant defined here
22   --> $SRC_DIR/core/src/option.rs:LL:COL
23 help: remove the extra argument
24    |
25 LL |     let _: Option<(i32, bool)> = Some(/* (i32, bool) */);
26    |                                      ~~~~~~~~~~~~~~~~~~~
27
28 error[E0061]: this function takes 1 argument but 2 arguments were supplied
29   --> $DIR/args-instead-of-tuple-errors.rs:8:5
30    |
31 LL |     int_bool(1, 2);
32    |     ^^^^^^^^    - argument of type `{integer}` unexpected
33    |
34 note: expected tuple, found integer
35   --> $DIR/args-instead-of-tuple-errors.rs:8:14
36    |
37 LL |     int_bool(1, 2);
38    |              ^
39    = note: expected tuple `(i32, bool)`
40                found type `{integer}`
41 note: function defined here
42   --> $DIR/args-instead-of-tuple-errors.rs:21:4
43    |
44 LL | fn int_bool(_: (i32, bool)) {
45    |    ^^^^^^^^ --------------
46 help: remove the extra argument
47    |
48 LL |     int_bool(/* (i32, bool) */);
49    |             ~~~~~~~~~~~~~~~~~~~
50
51 error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
52   --> $DIR/args-instead-of-tuple-errors.rs:11:28
53    |
54 LL |     let _: Option<(i8,)> = Some();
55    |                            ^^^^-- an argument of type `(i8,)` is missing
56    |
57 note: tuple variant defined here
58   --> $SRC_DIR/core/src/option.rs:LL:COL
59 help: provide the argument
60    |
61 LL |     let _: Option<(i8,)> = Some(/* (i8,) */);
62    |                                ~~~~~~~~~~~~~
63
64 error[E0308]: mismatched types
65   --> $DIR/args-instead-of-tuple-errors.rs:14:34
66    |
67 LL |     let _: Option<(i32,)> = Some(5_usize);
68    |                             ---- ^^^^^^^ expected tuple, found `usize`
69    |                             |
70    |                             arguments to this enum variant are incorrect
71    |
72    = note: expected tuple `(i32,)`
73                found type `usize`
74 help: the type constructed contains `usize` due to the type of the argument passed
75   --> $DIR/args-instead-of-tuple-errors.rs:14:29
76    |
77 LL |     let _: Option<(i32,)> = Some(5_usize);
78    |                             ^^^^^-------^
79    |                                  |
80    |                                  this argument influences the type of `Some`
81 note: tuple variant defined here
82   --> $SRC_DIR/core/src/option.rs:LL:COL
83
84 error[E0308]: mismatched types
85   --> $DIR/args-instead-of-tuple-errors.rs:17:34
86    |
87 LL |     let _: Option<(i32,)> = Some((5_usize));
88    |                             ---- ^^^^^^^^^ expected tuple, found `usize`
89    |                             |
90    |                             arguments to this enum variant are incorrect
91    |
92    = note: expected tuple `(i32,)`
93                found type `usize`
94 help: the type constructed contains `usize` due to the type of the argument passed
95   --> $DIR/args-instead-of-tuple-errors.rs:17:29
96    |
97 LL |     let _: Option<(i32,)> = Some((5_usize));
98    |                             ^^^^^---------^
99    |                                  |
100    |                                  this argument influences the type of `Some`
101 note: tuple variant defined here
102   --> $SRC_DIR/core/src/option.rs:LL:COL
103
104 error: aborting due to 5 previous errors
105
106 Some errors have detailed explanations: E0061, E0308.
107 For more information about an error, try `rustc --explain E0061`.