diff options
| author | bors <bors@rust-lang.org> | 2014-10-02 23:42:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-02 23:42:31 +0000 |
| commit | d0af3feebb57bc58c52de69ab51f92dc7082500b (patch) | |
| tree | d39de6be5866c0f0f37f9f3219b8217c873d8b52 /src/libnative | |
| parent | b2d4eb186e99b66051be9089f836c66a558dd995 (diff) | |
| parent | d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7 (diff) | |
| download | rust-d0af3feebb57bc58c52de69ab51f92dc7082500b.tar.gz rust-d0af3feebb57bc58c52de69ab51f92dc7082500b.zip | |
auto merge of #17715 : aturon/rust/revert-slice-ops-libs, r=alexcrichton
This PR reverts https://github.com/rust-lang/rust/pull/17620, which caused a significant regression for slices. As discussed with @alexcrichton, all of the public-facing changes of the earlier PR need to be rolled back, and it's not clear that we should move the libraries over to this new notation yet anyway (especially given its feature-gated status). Closes #17710
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/net.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/pipe_windows.rs | 2 | ||||
| -rw-r--r-- | src/libnative/lib.rs | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index aa2b1a6f14e..419748b75c3 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -1012,7 +1012,7 @@ pub fn write<T>(fd: sock_t, // Also as with read(), we use MSG_DONTWAIT to guard ourselves // against unforeseen circumstances. let _guard = lock(); - let ptr = buf[written..].as_ptr(); + let ptr = buf.slice_from(written).as_ptr(); let len = buf.len() - written; match retry(|| write(deadline.is_some(), ptr, len)) { -1 if util::wouldblock() => {} diff --git a/src/libnative/io/pipe_windows.rs b/src/libnative/io/pipe_windows.rs index 5475de6d7e1..2de9cd9a41c 100644 --- a/src/libnative/io/pipe_windows.rs +++ b/src/libnative/io/pipe_windows.rs @@ -448,7 +448,7 @@ impl rtio::RtioPipe for UnixStream { } let ret = unsafe { libc::WriteFile(self.handle(), - buf[offset..].as_ptr() as libc::LPVOID, + buf.slice_from(offset).as_ptr() as libc::LPVOID, (buf.len() - offset) as libc::DWORD, &mut bytes_written, &mut overlapped) diff --git a/src/libnative/lib.rs b/src/libnative/lib.rs index 5def99d8ef3..267ff3d2a81 100644 --- a/src/libnative/lib.rs +++ b/src/libnative/lib.rs @@ -57,8 +57,7 @@ #![deny(unused_result, unused_must_use)] #![allow(non_camel_case_types, deprecated)] -#![allow(unknown_features)] -#![feature(default_type_params, lang_items, slicing_syntax)] +#![feature(default_type_params, lang_items)] // NB this crate explicitly does *not* allow glob imports, please seriously // consider whether they're needed before adding that feature here (the |
