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 {
1062
1062
/// ```
1063
1063
/// type Example = Box<dyn Fn() -> &'static dyn Send>;
1064
1064
/// ```
1065
- #[ derive( Copy , Clone ) ]
1066
1065
enum NoBoundsException {
1067
1066
/// The type must be parenthesized.
1068
1067
None ,
@@ -1343,8 +1342,12 @@ impl EarlyLintPass for UnusedParens {
1343
1342
ast:: TyKind :: Ref ( _, mut_ty) | ast:: TyKind :: Ptr ( mut_ty) => {
1344
1343
// If this type itself appears in no-bounds position, we propagate its
1345
1344
// 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
+ } ;
1348
1351
self . in_no_bounds_pos . insert ( mut_ty. ty . id , constraint) ;
1349
1352
}
1350
1353
ast:: TyKind :: TraitObject ( bounds, _) | ast:: TyKind :: ImplTrait ( _, bounds) => {
You can’t perform that action at this time.
0 commit comments