File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/rustc_mir/src/const_eval Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
1414use rustc_middle:: ty:: { self , subst:: Subst , TyCtxt } ;
1515use rustc_span:: source_map:: Span ;
1616use rustc_target:: abi:: { Abi , LayoutOf } ;
17- use std:: convert:: { TryFrom , TryInto } ;
17+ use std:: convert:: TryInto ;
1818
1919pub fn note_on_undefined_behavior_error ( ) -> & ' static str {
2020 "The rules on what exactly is undefined behavior aren't clear, \
@@ -140,7 +140,8 @@ pub(super) fn op_to_const<'tcx>(
140140 Scalar :: Raw ( int) => {
141141 assert ! ( mplace. layout. is_zst( ) ) ;
142142 assert_eq ! (
143- u64 :: try_from( int) . unwrap( ) % mplace. layout. align. abi. bytes( ) ,
143+ int. assert_bits( ecx. tcx. data_layout. pointer_size)
144+ % u128 :: from( mplace. layout. align. abi. bytes( ) ) ,
144145 0 ,
145146 "this MPlaceTy must come from a validated constant, thus we can assume the \
146147 alignment is correct",
You can’t perform that action at this time.
0 commit comments