Rollup merge of #57725 - estebank:parens, r=michaelwoerister
Use structured suggestion to surround struct literal with parenthesis
This commit is contained in:
commit
2a830e47e1
2 changed files with 46 additions and 8 deletions
|
|
@ -29,19 +29,25 @@ error[E0423]: expected value, found struct `S`
|
|||
--> $DIR/E0423.rs:12:32
|
||||
|
|
||||
LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
|
||||
| ^ did you mean `(S { /* fields */ })`?
|
||||
| ^---------------
|
||||
| |
|
||||
| help: surround the struct literal with parenthesis: `(S { x: 1, y: 2 })`
|
||||
|
||||
error[E0423]: expected value, found struct `T`
|
||||
--> $DIR/E0423.rs:15:8
|
||||
|
|
||||
LL | if T {} == T {} { println!("Ok"); }
|
||||
| ^ did you mean `(T { /* fields */ })`?
|
||||
| ^---
|
||||
| |
|
||||
| help: surround the struct literal with parenthesis: `(T {})`
|
||||
|
||||
error[E0423]: expected value, found struct `std::ops::Range`
|
||||
--> $DIR/E0423.rs:21:14
|
||||
|
|
||||
LL | for _ in std::ops::Range { start: 0, end: 10 } {}
|
||||
| ^^^^^^^^^^^^^^^ did you mean `(std::ops::Range { /* fields */ })`?
|
||||
| ^^^^^^^^^^^^^^^----------------------
|
||||
| |
|
||||
| help: surround the struct literal with parenthesis: `(std::ops::Range { start: 0, end: 10 })`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue