File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -278,10 +278,9 @@ impl UnusedParens {
278
278
msg : & str ,
279
279
followed_by_block : bool ) {
280
280
if let ast:: ExprKind :: Paren ( ref inner) = value. node {
281
- let necessary = followed_by_block && if let ast:: ExprKind :: Ret ( _) = inner. node {
282
- true
283
- } else {
284
- parser:: contains_exterior_struct_lit ( & inner)
281
+ let necessary = followed_by_block && match inner. node {
282
+ ast:: ExprKind :: Ret ( _) | ast:: ExprKind :: Break ( ..) => true ,
283
+ _ => parser:: contains_exterior_struct_lit ( & inner) ,
285
284
} ;
286
285
if !necessary {
287
286
let expr_text = if let Ok ( snippet) = cx. sess ( ) . source_map ( )
Original file line number Diff line number Diff line change @@ -23,4 +23,13 @@ fn main() {
23
23
// We want to suggest the properly-balanced expression `1 / (2 + 3)`, not
24
24
// the malformed `1 / (2 + 3`
25
25
let _a = ( 1 / ( 2 + 3 ) ) ;
26
+ f ( ) ;
27
+ }
28
+
29
+ fn f ( ) -> bool {
30
+ loop {
31
+ if ( break { return true } ) {
32
+ }
33
+ }
34
+ false
26
35
}
You can’t perform that action at this time.
0 commit comments