Use Scalar::to_u16

This commit is contained in:
Christian Poveda 2019-12-28 08:38:31 -05:00
parent 34d8ec896d
commit b7e6135d7b
No known key found for this signature in database
GPG Key ID: 27525EF5E7420A50

View File

@ -283,8 +283,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
None => return Ok(-1),
};
// FIXME: use Scalar::to_u16
let mode: u16 = metadata.mode.to_bits(Size::from_bits(16))? as u16;
let mode: u16 = metadata.mode.to_u16()?;
let (access_sec, access_nsec) = metadata.accessed.unwrap_or((0, 0));
let (created_sec, created_nsec) = metadata.created.unwrap_or((0, 0));