Skip to content

Commit 1ef636d

Browse files
committed
Update other targets for BorrowedCursor unstable API changes
1 parent 3825099 commit 1ef636d

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

library/std/src/sys/fd/hermit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl FileDesc {
3434
)
3535
})?;
3636
// SAFETY: Exactly `result` bytes have been filled.
37-
unsafe { buf.advance_unchecked(result as usize) };
37+
unsafe { buf.advance(result as usize) };
3838
Ok(())
3939
}
4040

library/std/src/sys/fd/wasi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl WasiFd {
5959
}];
6060
match wasi::fd_read(self.as_raw_fd() as wasi::Fd, &bufs) {
6161
Ok(n) => {
62-
buf.advance_unchecked(n);
62+
buf.advance(n);
6363
Ok(())
6464
}
6565
Err(e) => Err(err2io(e)),

library/std/src/sys/fs/solid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ impl File {
401401

402402
// Safety: `num_bytes_read` bytes were written to the unfilled
403403
// portion of the buffer
404-
cursor.advance_unchecked(num_bytes_read);
404+
cursor.advance(num_bytes_read);
405405

406406
Ok(())
407407
}

library/std/src/sys/net/connection/socket/hermit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl Socket {
143143
)
144144
})?;
145145
unsafe {
146-
buf.advance_unchecked(ret as usize);
146+
buf.advance(ret as usize);
147147
}
148148
Ok(())
149149
}

library/std/src/sys/net/connection/socket/solid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl Socket {
191191
netc::recv(self.as_raw_fd(), buf.as_mut().as_mut_ptr().cast(), buf.capacity(), flags)
192192
})?;
193193
unsafe {
194-
buf.advance_unchecked(ret as usize);
194+
buf.advance(ret as usize);
195195
}
196196
Ok(())
197197
}

library/std/src/sys/net/connection/socket/wasip2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl Socket {
167167
)
168168
})?;
169169
unsafe {
170-
buf.advance_unchecked(ret as usize);
170+
buf.advance(ret as usize);
171171
}
172172
Ok(())
173173
}

library/std/src/sys/net/connection/socket/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl Socket {
244244
}
245245
}
246246
_ => {
247-
unsafe { buf.advance_unchecked(result as usize) };
247+
unsafe { buf.advance(result as usize) };
248248
Ok(())
249249
}
250250
}

library/std/src/sys/pal/sgx/abi/usercalls/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn read_buf(fd: Fd, mut buf: BorrowedCursor<'_>) -> IoResult<()> {
4646
let mut userbuf = alloc::User::<[u8]>::uninitialized(buf.capacity());
4747
let len = raw::read(fd, userbuf.as_mut_ptr().cast(), userbuf.len()).from_sgx_result()?;
4848
userbuf[..len].copy_to_enclave(&mut buf.as_mut()[..len]);
49-
buf.advance_unchecked(len);
49+
buf.advance(len);
5050
Ok(())
5151
}
5252
}

library/std/src/sys/pal/windows/handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Handle {
121121
Ok(read) => {
122122
// Safety: `read` bytes were written to the initialized portion of the buffer
123123
unsafe {
124-
cursor.advance_unchecked(read);
124+
cursor.advance(read);
125125
}
126126
Ok(())
127127
}
@@ -144,7 +144,7 @@ impl Handle {
144144

145145
// SAFETY: `read` bytes were written to the initialized portion of the buffer
146146
unsafe {
147-
cursor.advance_unchecked(read);
147+
cursor.advance(read);
148148
}
149149
Ok(())
150150
}

library/std/src/sys/pal/windows/pipe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl AnonPipe {
259259
Err(e) => Err(e),
260260
Ok(n) => {
261261
unsafe {
262-
buf.advance_unchecked(n);
262+
buf.advance(n);
263263
}
264264
Ok(())
265265
}

0 commit comments

Comments
 (0)