@@ -12,7 +12,6 @@ use rand::rngs::StdRng;
1212use rand:: SeedableRng ;
1313
1414use rustc_ast:: ast:: Mutability ;
15- use rustc_const_eval:: const_eval:: CheckAlignment ;
1615use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
1716#[ allow( unused) ]
1817use rustc_data_structures:: static_assert_size;
@@ -885,28 +884,15 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
885884 const PANIC_ON_ALLOC_FAIL : bool = false ;
886885
887886 #[ inline( always) ]
888- fn enforce_alignment ( ecx : & MiriInterpCx < ' mir , ' tcx > ) -> CheckAlignment {
889- if ecx. machine . check_alignment == AlignmentCheck :: None {
890- CheckAlignment :: No
891- } else {
892- CheckAlignment :: Error
893- }
887+ fn enforce_alignment ( ecx : & MiriInterpCx < ' mir , ' tcx > ) -> bool {
888+ ecx. machine . check_alignment != AlignmentCheck :: None
894889 }
895890
896891 #[ inline( always) ]
897892 fn use_addr_for_alignment_check ( ecx : & MiriInterpCx < ' mir , ' tcx > ) -> bool {
898893 ecx. machine . check_alignment == AlignmentCheck :: Int
899894 }
900895
901- fn alignment_check_failed (
902- _ecx : & InterpCx < ' mir , ' tcx , Self > ,
903- has : Align ,
904- required : Align ,
905- _check : CheckAlignment ,
906- ) -> InterpResult < ' tcx , ( ) > {
907- throw_ub ! ( AlignmentCheckFailed { has, required } )
908- }
909-
910896 #[ inline( always) ]
911897 fn enforce_validity ( ecx : & MiriInterpCx < ' mir , ' tcx > , _layout : TyAndLayout < ' tcx > ) -> bool {
912898 ecx. machine . validate
0 commit comments