]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/args-instead-of-tuple-errors.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / args-instead-of-tuple-errors.rs
1 // Ensure we don't suggest tuple-wrapping when we'd end up with a type error
2
3 fn main() {
4     // we shouldn't suggest to fix these - `2` isn't a `bool`
5
6     let _: Option<(i32, bool)> = Some(1, 2);
7     //~^ ERROR this enum variant takes 1 argument but 2 arguments were supplied
8     int_bool(1, 2);
9     //~^ ERROR function takes 1 argument but 2 arguments were supplied
10
11     let _: Option<(i8,)> = Some();
12     //~^ ERROR this enum variant takes 1 argument but 0 arguments were supplied
13
14     let _: Option<(i32,)> = Some(5_usize);
15     //~^ ERROR mismatched types
16
17     let _: Option<(i32,)> = Some((5_usize));
18     //~^ ERROR mismatched types
19 }
20
21 fn int_bool(_: (i32, bool)) {
22 }