Skip to content

Commit f16b491

Browse files
committed
remove unnecessary cast
1 parent d7e2650 commit f16b491

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/interpret/operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
341341
// Turn the wide MPlace into a string (must already be dereferenced!)
342342
pub fn read_str(&self, mplace: MPlaceTy<'tcx, M::PointerTag>) -> InterpResult<'tcx, &str> {
343343
let len = mplace.len(self)?;
344-
let bytes = self.memory.read_bytes(mplace.ptr, Size::from_bytes(u64::from(len)))?;
344+
let bytes = self.memory.read_bytes(mplace.ptr, Size::from_bytes(len))?;
345345
let str = ::std::str::from_utf8(bytes)
346346
.map_err(|err| err_ub_format!("this string is not valid UTF-8: {}", err))?;
347347
Ok(str)

0 commit comments

Comments
 (0)