1 // Tests that a suggestion is issued for type mismatch errors when a
2 // 1-tuple is expected and a parenthesized expression of non-tuple
6 struct S { _s: (String,) }
10 //~^ ERROR: mismatched types [E0308]
11 //~| HELP: use a trailing comma to create a tuple with one element
14 //~^ ERROR: mismatched types [E0308]
15 //~| HELP: use a trailing comma to create a tuple with one element
17 let _s = S { _s: ("abc".to_string()) };
18 //~^ ERROR: mismatched types [E0308]
19 //~| HELP: use a trailing comma to create a tuple with one element
21 // Do not issue the suggestion if the found type is already a tuple.
24 //~^ ERROR: mismatched types [E0308]