@@ -733,22 +733,21 @@ impl const PartialEq for TypeId {
733
733
return crate :: intrinsics:: type_id_eq ( * self , * other) ;
734
734
#[ cfg( not( miri) ) ]
735
735
{
736
- const fn ct ( a : & TypeId , b : & TypeId ) -> bool {
737
- crate :: intrinsics:: type_id_eq ( * a, * b)
738
- }
739
-
740
- #[ inline]
741
- fn rt ( a : & TypeId , b : & TypeId ) -> bool {
742
- a. data == b. data
743
- }
744
-
745
- // Ideally we would just invoke `type_id_eq` unconditionally here,
746
- // but since we do not MIR inline intrinsics, because backends
747
- // may want to override them (and miri does!), MIR opts do not
748
- // clean up this call sufficiently for LLVM to turn repeated calls
749
- // of `TypeId` comparisons against one specific `TypeId` into
750
- // a lookup table.
751
- core:: intrinsics:: const_eval_select ( ( self , other) , ct, rt)
736
+ let this = self ;
737
+ crate :: intrinsics:: const_eval_select!(
738
+ @capture { this: & TypeId , other: & TypeId } -> bool :
739
+ if const {
740
+ crate :: intrinsics:: type_id_eq( * this, * other)
741
+ } else {
742
+ // Ideally we would just invoke `type_id_eq` unconditionally here,
743
+ // but since we do not MIR inline intrinsics, because backends
744
+ // may want to override them (and miri does!), MIR opts do not
745
+ // clean up this call sufficiently for LLVM to turn repeated calls
746
+ // of `TypeId` comparisons against one specific `TypeId` into
747
+ // a lookup table.
748
+ this. data == other. data
749
+ }
750
+ )
752
751
}
753
752
}
754
753
}
0 commit comments