File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -330,20 +330,19 @@ impl DeepRejectCtxt {
330330 }
331331
332332 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 ( ) {
334334 ty:: ConstKind :: Expr ( _)
335335 | ty:: ConstKind :: Param ( _)
336336 | ty:: ConstKind :: Unevaluated ( _)
337337 | ty:: ConstKind :: Error ( _) => {
338338 return true ;
339339 }
340- ty:: ConstKind :: Value ( _ ) => { }
340+ ty:: ConstKind :: Value ( impl_val ) => impl_val ,
341341 ty:: ConstKind :: Infer ( _) | ty:: ConstKind :: Bound ( ..) | ty:: ConstKind :: Placeholder ( _) => {
342342 bug ! ( "unexpected impl arg: {:?}" , impl_ct)
343343 }
344- }
344+ } ;
345345
346- let k = impl_ct. kind ( ) ;
347346 match obligation_ct. kind ( ) {
348347 ty:: ConstKind :: Param ( _) => match self . treat_obligation_params {
349348 TreatParams :: ForLookup => false ,
@@ -358,10 +357,7 @@ impl DeepRejectCtxt {
358357 ty:: ConstKind :: Expr ( _) | ty:: ConstKind :: Unevaluated ( _) | ty:: ConstKind :: Error ( _) => {
359358 true
360359 }
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,
365361
366362 ty:: ConstKind :: Infer ( _) => true ,
367363
You can’t perform that action at this time.
0 commit comments