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 {
1055
1055
/// ```
1056
1056
/// type Example = Box<dyn Fn() -> &'static dyn Send>;
1057
1057
/// ```
1058
- #[ derive( Copy , Clone ) ]
1059
1058
enum NoBoundsException {
1060
1059
/// The type must be parenthesized.
1061
1060
None ,
@@ -1336,8 +1335,12 @@ impl EarlyLintPass for UnusedParens {
1336
1335
ast:: TyKind :: Ref ( _, mut_ty) | ast:: TyKind :: Ptr ( mut_ty) => {
1337
1336
// If this type itself appears in no-bounds position, we propagate its
1338
1337
// 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
+ } ;
1341
1344
self . in_no_bounds_pos . insert ( mut_ty. ty . id , constraint) ;
1342
1345
}
1343
1346
ast:: TyKind :: TraitObject ( bounds, _) | ast:: TyKind :: ImplTrait ( _, bounds) => {
You can’t perform that action at this time.
0 commit comments