@@ -167,6 +167,7 @@ pub struct DeepRejectCtxt {
167
167
}
168
168
169
169
impl DeepRejectCtxt {
170
+ #[ inline]
170
171
pub fn args_may_unify < ' tcx > (
171
172
self ,
172
173
obligation_args : GenericArgsRef < ' tcx > ,
@@ -329,21 +330,22 @@ impl DeepRejectCtxt {
329
330
}
330
331
}
331
332
333
+ #[ inline( always) ]
332
334
pub fn consts_may_unify ( self , obligation_ct : ty:: Const < ' _ > , impl_ct : ty:: Const < ' _ > ) -> bool {
333
- match impl_ct. kind ( ) {
335
+ let k = impl_ct. kind ( ) ;
336
+ let impl_val = match k {
334
337
ty:: ConstKind :: Expr ( _)
335
338
| ty:: ConstKind :: Param ( _)
336
339
| ty:: ConstKind :: Unevaluated ( _)
337
340
| ty:: ConstKind :: Error ( _) => {
338
341
return true ;
339
342
}
340
- ty:: ConstKind :: Value ( _ ) => { }
343
+ ty:: ConstKind :: Value ( impl_val ) => impl_val ,
341
344
ty:: ConstKind :: Infer ( _) | ty:: ConstKind :: Bound ( ..) | ty:: ConstKind :: Placeholder ( _) => {
342
345
bug ! ( "unexpected impl arg: {:?}" , impl_ct)
343
346
}
344
- }
347
+ } ;
345
348
346
- let k = impl_ct. kind ( ) ;
347
349
match obligation_ct. kind ( ) {
348
350
ty:: ConstKind :: Param ( _) => match self . treat_obligation_params {
349
351
TreatParams :: ForLookup => false ,
@@ -358,10 +360,7 @@ impl DeepRejectCtxt {
358
360
ty:: ConstKind :: Expr ( _) | ty:: ConstKind :: Unevaluated ( _) | ty:: ConstKind :: Error ( _) => {
359
361
true
360
362
}
361
- ty:: ConstKind :: Value ( obl) => match k {
362
- ty:: ConstKind :: Value ( imp) => obl == imp,
363
- _ => true ,
364
- } ,
363
+ ty:: ConstKind :: Value ( obl_val) => obl_val == impl_val,
365
364
366
365
ty:: ConstKind :: Infer ( _) => true ,
367
366
0 commit comments