diff options
| author | Ralf Jung <post@ralfj.de> | 2020-03-21 17:28:46 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-03-25 15:53:52 +0100 |
| commit | f16b4910150f841d57c92aed6fa089f387da0d92 (patch) | |
| tree | a99ad81d1dbafc5943487d2990998cb5a729fb59 /src | |
| parent | d7e2650db200dcb918b5346e137ee6c1e4bc614a (diff) | |
| download | rust-f16b4910150f841d57c92aed6fa089f387da0d92.tar.gz rust-f16b4910150f841d57c92aed6fa089f387da0d92.zip | |
remove unnecessary cast
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/interpret/operand.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 9c2175dc0e4..f6be92174ad 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -341,7 +341,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { // Turn the wide MPlace into a string (must already be dereferenced!) pub fn read_str(&self, mplace: MPlaceTy<'tcx, M::PointerTag>) -> InterpResult<'tcx, &str> { let len = mplace.len(self)?; - let bytes = self.memory.read_bytes(mplace.ptr, Size::from_bytes(u64::from(len)))?; + let bytes = self.memory.read_bytes(mplace.ptr, Size::from_bytes(len))?; let str = ::std::str::from_utf8(bytes) .map_err(|err| err_ub_format!("this string is not valid UTF-8: {}", err))?; Ok(str) |
