File tree 1 file changed +4
-8
lines changed
compiler/rustc_middle/src/ty
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -330,20 +330,19 @@ impl DeepRejectCtxt {
330
330
}
331
331
332
332
pub fn consts_may_unify ( self , obligation_ct : ty:: Const < ' _ > , impl_ct : ty:: Const < ' _ > ) -> bool {
333
- match impl_ct. kind ( ) {
333
+ let impl_val = match impl_ct. kind ( ) {
334
334
ty:: ConstKind :: Expr ( _)
335
335
| ty:: ConstKind :: Param ( _)
336
336
| ty:: ConstKind :: Unevaluated ( _)
337
337
| ty:: ConstKind :: Error ( _) => {
338
338
return true ;
339
339
}
340
- ty:: ConstKind :: Value ( _ ) => { }
340
+ ty:: ConstKind :: Value ( impl_val ) => impl_val ,
341
341
ty:: ConstKind :: Infer ( _) | ty:: ConstKind :: Bound ( ..) | ty:: ConstKind :: Placeholder ( _) => {
342
342
bug ! ( "unexpected impl arg: {:?}" , impl_ct)
343
343
}
344
- }
344
+ } ;
345
345
346
- let k = impl_ct. kind ( ) ;
347
346
match obligation_ct. kind ( ) {
348
347
ty:: ConstKind :: Param ( _) => match self . treat_obligation_params {
349
348
TreatParams :: ForLookup => false ,
@@ -358,10 +357,7 @@ impl DeepRejectCtxt {
358
357
ty:: ConstKind :: Expr ( _) | ty:: ConstKind :: Unevaluated ( _) | ty:: ConstKind :: Error ( _) => {
359
358
true
360
359
}
361
- ty:: ConstKind :: Value ( obl) => match k {
362
- ty:: ConstKind :: Value ( imp) => obl == imp,
363
- _ => true ,
364
- } ,
360
+ ty:: ConstKind :: Value ( obl_val) => obl_val == impl_val,
365
361
366
362
ty:: ConstKind :: Infer ( _) => true ,
367
363
You can’t perform that action at this time.
0 commit comments