File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -278,10 +278,9 @@ impl UnusedParens {
278278 msg : & str ,
279279 followed_by_block : bool ) {
280280 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) ,
285284 } ;
286285 if !necessary {
287286 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() {
2323 // We want to suggest the properly-balanced expression `1 / (2 + 3)`, not
2424 // the malformed `1 / (2 + 3`
2525 let _a = ( 1 / ( 2 + 3 ) ) ;
26+ f ( ) ;
27+ }
28+
29+ fn f ( ) -> bool {
30+ loop {
31+ if ( break { return true } ) {
32+ }
33+ }
34+ false
2635}
You can’t perform that action at this time.
0 commit comments