diff --git a/fish-rust/src/common.rs b/fish-rust/src/common.rs index 440856b49..b7e8739ba 100644 --- a/fish-rust/src/common.rs +++ b/fish-rust/src/common.rs @@ -1433,9 +1433,9 @@ fn can_be_encoded(wc: char) -> bool { /// Call read, blocking and repeating on EINTR. Exits on EAGAIN. /// \return the number of bytes read, or 0 on EOF. On EAGAIN, returns -1 if nothing was read. -pub fn read_blocked(fd: RawFd, mut buf: &mut [u8]) -> isize { +pub fn read_blocked(fd: RawFd, buf: &mut [u8]) -> isize { loop { - let res = unsafe { libc::read(fd, std::ptr::addr_of_mut!(buf).cast(), buf.len()) }; + let res = unsafe { libc::read(fd, buf.as_mut_ptr().cast(), buf.len()) }; if res < 0 && errno::errno().0 == EINTR { continue; } diff --git a/tests/checks/math.fish b/tests/checks/math.fish index 066a4a837..d191971ea 100644 --- a/tests/checks/math.fish +++ b/tests/checks/math.fish @@ -335,3 +335,6 @@ math 0x0_2.0_0_0P0_2 # CHECK: 8 math -0x8p-0_3 # CHECK: -1 + +echo 5 + 6 | math +# CHECK: 11