@@ -327,7 +327,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
327327 return Err ( ConstEvalErrKind :: ConstMakeGlobalWithOffset ( ptr) ) . into ( ) ;
328328 }
329329
330- if matches ! ( self . tcx. try_get_global_alloc( alloc_id) , Some ( _ ) ) {
330+ if self . tcx . try_get_global_alloc ( alloc_id) . is_some ( ) {
331331 // This points to something outside the current interpreter.
332332 return Err ( ConstEvalErrKind :: ConstMakeGlobalPtrIsNonHeap ( ptr) ) . into ( ) ;
333333 }
@@ -981,7 +981,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
981981 msg : CheckInAllocMsg ,
982982 ) -> InterpResult < ' tcx , ( Size , Align ) > {
983983 let info = self . get_alloc_info ( id) ;
984- if matches ! ( info. kind, AllocKind :: Dead ) {
984+ if info. kind == AllocKind :: Dead {
985985 throw_ub ! ( PointerUseAfterFree ( id, msg) )
986986 }
987987 interp_ok ( ( info. size , info. align ) )
@@ -1072,7 +1072,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
10721072 // Recurse, if there is data here.
10731073 // Do this *before* invoking the callback, as the callback might mutate the
10741074 // allocation and e.g. replace all provenance by wildcards!
1075- if matches ! ( info. kind, AllocKind :: LiveData ) {
1075+ if info. kind == AllocKind :: LiveData {
10761076 let alloc = self . get_alloc_raw ( id) ?;
10771077 for prov in alloc. provenance ( ) . provenances ( ) {
10781078 if let Some ( id) = prov. get_alloc_id ( ) {
@@ -1605,7 +1605,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
16051605 match self . ptr_try_get_alloc_id ( ptr, 0 ) {
16061606 Ok ( ( alloc_id, offset, _) ) => {
16071607 let info = self . get_alloc_info ( alloc_id) ;
1608- if matches ! ( info. kind, AllocKind :: TypeId ) {
1608+ if info. kind == AllocKind :: TypeId {
16091609 // We *could* actually precisely answer this question since here,
16101610 // the offset *is* the integer value. But the entire point of making
16111611 // this a pointer is not to leak the integer value, so we say everything
0 commit comments