@@ -139,6 +139,7 @@ impl Constant {
139
139
. find ( |r| r. map_or ( true , |o| o != Ordering :: Equal ) )
140
140
. unwrap_or_else ( || Some ( l. len ( ) . cmp ( & r. len ( ) ) ) ) ,
141
141
( & Self :: Repeat ( ref lv, ref ls) , & Self :: Repeat ( ref rv, ref rs) ) => {
142
+ #[ allow( clippy:: match_wildcard_for_single_variants) ]
142
143
match Self :: partial_cmp ( tcx, cmp_type, lv, rv) {
143
144
Some ( Equal ) => Some ( ls. cmp ( rs) ) ,
144
145
x => x,
@@ -354,14 +355,14 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
354
355
( Some ( Constant :: Vec ( vec) ) , Some ( Constant :: Int ( index) ) ) => match vec. get ( index as usize ) {
355
356
Some ( Constant :: F32 ( x) ) => Some ( Constant :: F32 ( * x) ) ,
356
357
Some ( Constant :: F64 ( x) ) => Some ( Constant :: F64 ( * x) ) ,
357
- _ => None ,
358
+ Some ( _ ) | None => None ,
358
359
} ,
359
360
( Some ( Constant :: Vec ( vec) ) , _) => {
360
361
if !vec. is_empty ( ) && vec. iter ( ) . all ( |x| * x == vec[ 0 ] ) {
361
362
match vec. get ( 0 ) {
362
363
Some ( Constant :: F32 ( x) ) => Some ( Constant :: F32 ( * x) ) ,
363
364
Some ( Constant :: F64 ( x) ) => Some ( Constant :: F64 ( * x) ) ,
364
- _ => None ,
365
+ Some ( _ ) | None => None ,
365
366
}
366
367
} else {
367
368
None
@@ -532,7 +533,7 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
532
533
} )
533
534
. collect :: < Option < Vec < Constant > > > ( )
534
535
. map ( Constant :: Vec ) ,
535
- _ => None ,
536
+ Some ( _ ) | None => None ,
536
537
} ,
537
538
ty:: Float ( FloatTy :: F64 ) => match miri_to_const ( len) {
538
539
Some ( Constant :: Int ( len) ) => alloc
@@ -546,7 +547,7 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
546
547
} )
547
548
. collect :: < Option < Vec < Constant > > > ( )
548
549
. map ( Constant :: Vec ) ,
549
- _ => None ,
550
+ Some ( _ ) | None => None ,
550
551
} ,
551
552
// FIXME: implement other array type conversions.
552
553
_ => None ,
0 commit comments