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 @@ -1062,7 +1062,6 @@ pub(crate) struct UnusedParens {
10621062/// ```
10631063/// type Example = Box<dyn Fn() -> &'static dyn Send>;
10641064/// ```
1065- #[ derive( Copy , Clone ) ]
10661065enum NoBoundsException {
10671066 /// The type must be parenthesized.
10681067 None ,
@@ -1343,8 +1342,12 @@ impl EarlyLintPass for UnusedParens {
13431342 ast:: TyKind :: Ref ( _, mut_ty) | ast:: TyKind :: Ptr ( mut_ty) => {
13441343 // If this type itself appears in no-bounds position, we propagate its
13451344 // potentially tighter constraint or risk a false posive (issue 143653).
1346- let own_constraint = self . in_no_bounds_pos . get ( & ty. id ) . copied ( ) ;
1347- let constraint = own_constraint. unwrap_or ( NoBoundsException :: OneBound ) ;
1345+ let own_constraint = self . in_no_bounds_pos . get ( & ty. id ) ;
1346+ let constraint = match own_constraint {
1347+ Some ( NoBoundsException :: None ) => NoBoundsException :: None ,
1348+ Some ( NoBoundsException :: OneBound ) => NoBoundsException :: OneBound ,
1349+ None => NoBoundsException :: OneBound ,
1350+ } ;
13481351 self . in_no_bounds_pos . insert ( mut_ty. ty . id , constraint) ;
13491352 }
13501353 ast:: TyKind :: TraitObject ( bounds, _) | ast:: TyKind :: ImplTrait ( _, bounds) => {
You can’t perform that action at this time.
0 commit comments