File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1055,7 +1055,6 @@ pub(crate) struct UnusedParens {
10551055/// ```
10561056/// type Example = Box<dyn Fn() -> &'static dyn Send>;
10571057/// ```
1058- #[ derive( Copy , Clone ) ]
10591058enum NoBoundsException {
10601059 /// The type must be parenthesized.
10611060 None ,
@@ -1336,8 +1335,12 @@ impl EarlyLintPass for UnusedParens {
13361335 ast:: TyKind :: Ref ( _, mut_ty) | ast:: TyKind :: Ptr ( mut_ty) => {
13371336 // If this type itself appears in no-bounds position, we propagate its
13381337 // potentially tighter constraint or risk a false posive (issue 143653).
1339- let own_constraint = self . in_no_bounds_pos . get ( & ty. id ) . copied ( ) ;
1340- let constraint = own_constraint. unwrap_or ( NoBoundsException :: OneBound ) ;
1338+ let own_constraint = self . in_no_bounds_pos . get ( & ty. id ) ;
1339+ let constraint = match own_constraint {
1340+ Some ( NoBoundsException :: None ) => NoBoundsException :: None ,
1341+ Some ( NoBoundsException :: OneBound ) => NoBoundsException :: OneBound ,
1342+ None => NoBoundsException :: OneBound ,
1343+ } ;
13411344 self . in_no_bounds_pos . insert ( mut_ty. ty . id , constraint) ;
13421345 }
13431346 ast:: TyKind :: TraitObject ( bounds, _) | ast:: TyKind :: ImplTrait ( _, bounds) => {
You can’t perform that action at this time.
0 commit comments