@@ -12,7 +12,7 @@ use log::trace;
1212
1313use rustc_data_structures:: fx:: FxHashMap ;
1414use rustc_middle:: ty:: TyCtxt ;
15- use rustc_target:: abi:: { Align , Size } ;
15+ use rustc_target:: abi:: { Align , Size , HasDataLayout as _ } ;
1616
1717use crate :: shims:: os_str:: bytes_to_os_str;
1818use crate :: * ;
@@ -753,7 +753,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
753753 // We cap the number of read bytes to the largest value that we are able to fit in both the
754754 // host's and target's `isize`. This saves us from having to handle overflows later.
755755 let count = count
756- . min ( u64:: try_from ( this. target_isize_max ( ) ) . unwrap ( ) )
756+ . min ( u64:: try_from ( this. data_layout ( ) . target_isize_max ( ) ) . unwrap ( ) )
757757 . min ( u64:: try_from ( isize:: MAX ) . unwrap ( ) ) ;
758758 let communicate = this. machine . communicate ( ) ;
759759
@@ -807,7 +807,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
807807 // We cap the number of written bytes to the largest value that we are able to fit in both the
808808 // host's and target's `isize`. This saves us from having to handle overflows later.
809809 let count = count
810- . min ( u64:: try_from ( this. target_isize_max ( ) ) . unwrap ( ) )
810+ . min ( u64:: try_from ( this. data_layout ( ) . target_isize_max ( ) ) . unwrap ( ) )
811811 . min ( u64:: try_from ( isize:: MAX ) . unwrap ( ) ) ;
812812 let communicate = this. machine . communicate ( ) ;
813813
0 commit comments