diff options
| author | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2020-08-20 15:55:02 -0700 |
|---|---|---|
| committer | Jubilee Young <workingjubilee@gmail.com> | 2020-09-04 21:51:28 -0700 |
| commit | fe2a867125ff80dcb12df19581bd28b342b15c28 (patch) | |
| tree | 8a7f6dbfe019067d2652405855e9bfeaa9fe3ce7 | |
| parent | 74b4eea64d91d016652f991fa9c4525897b701a0 (diff) | |
| download | rust-fe2a867125ff80dcb12df19581bd28b342b15c28.tar.gz rust-fe2a867125ff80dcb12df19581bd28b342b15c28.zip | |
Be explicit that we're handling bytes
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/mod.rs b/compiler/rustc_middle/src/mir/interpret/mod.rs index afbb67555df..90f8195a50c 100644 --- a/compiler/rustc_middle/src/mir/interpret/mod.rs +++ b/compiler/rustc_middle/src/mir/interpret/mod.rs @@ -570,7 +570,7 @@ pub fn write_target_uint( #[inline] pub fn read_target_uint(endianness: Endian, mut source: &[u8]) -> Result<u128, io::Error> { - let mut buf = [0; 16]; + let mut buf = [0u8; std::mem::size_of::<u128>()]; source.read(&mut buf)?; match endianness { Endian::Little => Ok(u128::from_le_bytes(buf)), |
