2021-12-05 15:41:33 -06:00
|
|
|
// Ensure we don't suggest tuple-wrapping when we'd end up with a type error
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// we shouldn't suggest to fix these - `2` isn't a `bool`
|
|
|
|
|
|
|
|
let _: Option<(i32, bool)> = Some(1, 2);
|
|
|
|
//~^ ERROR this enum variant takes 1 argument but 2 arguments were supplied
|
|
|
|
int_bool(1, 2);
|
2023-01-04 21:02:10 -06:00
|
|
|
//~^ ERROR function takes 1 argument but 2 arguments were supplied
|
2022-01-16 16:47:33 -06:00
|
|
|
|
|
|
|
let _: Option<(i8,)> = Some();
|
|
|
|
//~^ ERROR this enum variant takes 1 argument but 0 arguments were supplied
|
2022-01-28 17:27:01 -06:00
|
|
|
|
|
|
|
let _: Option<(i32,)> = Some(5_usize);
|
|
|
|
//~^ ERROR mismatched types
|
|
|
|
|
|
|
|
let _: Option<(i32,)> = Some((5_usize));
|
|
|
|
//~^ ERROR mismatched types
|
2021-12-05 15:41:33 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn int_bool(_: (i32, bool)) {
|
|
|
|
}
|