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;
14
14
use rustc_middle:: ty:: { self , subst:: Subst , TyCtxt } ;
15
15
use rustc_span:: source_map:: Span ;
16
16
use rustc_target:: abi:: { Abi , LayoutOf } ;
17
- use std:: convert:: { TryFrom , TryInto } ;
17
+ use std:: convert:: TryInto ;
18
18
19
19
pub fn note_on_undefined_behavior_error ( ) -> & ' static str {
20
20
"The rules on what exactly is undefined behavior aren't clear, \
@@ -140,7 +140,8 @@ pub(super) fn op_to_const<'tcx>(
140
140
Scalar :: Raw ( int) => {
141
141
assert ! ( mplace. layout. is_zst( ) ) ;
142
142
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( ) ) ,
144
145
0 ,
145
146
"this MPlaceTy must come from a validated constant, thus we can assume the \
146
147
alignment is correct",
You can’t perform that action at this time.
0 commit comments