File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -1313,13 +1313,6 @@ impl EarlyLintPass for UnusedParens {
13131313 let last = i == bounds. len ( ) - 1 ;
13141314
13151315 if let ast:: GenericBound :: Trait ( poly_trait_ref) = & bounds[ i] {
1316- let parenthesized = cx
1317- . sess ( )
1318- . source_map ( )
1319- . span_to_snippet ( poly_trait_ref. span )
1320- . map ( |snip| snip. starts_with ( '(' ) && snip. ends_with ( ')' ) )
1321- . unwrap_or ( false ) ;
1322-
13231316 let fn_with_explicit_ret_ty = if let [ .., segment] =
13241317 & * poly_trait_ref. trait_ref . path . segments
13251318 && let Some ( args) = segment. args . as_ref ( )
@@ -1351,7 +1344,9 @@ impl EarlyLintPass for UnusedParens {
13511344 . map ( |s| s. ident . name == kw:: PathRoot )
13521345 . unwrap_or ( false ) ;
13531346
1354- if parenthesized && ( last || !fn_with_explicit_ret_ty) && !dyn2015_exception
1347+ if poly_trait_ref. parens
1348+ && ( last || !fn_with_explicit_ret_ty)
1349+ && !dyn2015_exception
13551350 {
13561351 let s = poly_trait_ref. span ;
13571352 let spans = ( !s. from_expansion ( ) ) . then ( || {
You can’t perform that action at this time.
0 commit comments