diff options
| author | bors <bors@rust-lang.org> | 2018-08-21 16:04:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-21 16:04:11 +0000 |
| commit | 9f9f2c0095cd683b94adca133f2733aa1f88bb19 (patch) | |
| tree | 633b85f8126a21ae60807bede94f1c57c5167a6a /src/libstd | |
| parent | a9d496796f091f42c8bac60c5c9ca05e6ca5dcda (diff) | |
| parent | e3887e6c8afbaafe0332e9776199bc89030e227b (diff) | |
| download | rust-9f9f2c0095cd683b94adca133f2733aa1f88bb19.tar.gz rust-9f9f2c0095cd683b94adca133f2733aa1f88bb19.zip | |
Auto merge of #53530 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests
Successful merges:
- #53030 (Updated RELEASES.md for 1.29.0)
- #53104 (expand the documentation on the `Unpin` trait)
- #53213 (Stabilize IP associated constants)
- #53296 (When closure with no arguments was expected, suggest wrapping)
- #53329 (Replace usages of ptr::offset with ptr::{add,sub}.)
- #53363 (add individual docs to `core::num::NonZero*`)
- #53370 (Stabilize macro_vis_matcher)
- #53393 (Mark libserialize functions as inline)
- #53405 (restore the page title after escaping out of a search)
- #53452 (Change target triple used to check for lldb in build-manifest)
- #53462 (Document Box::into_raw returns non-null ptr)
- #53465 (Remove LinkMeta struct)
- #53492 (update lld submodule to include RISCV patch)
- #53496 (Fix typos found by codespell.)
- #53521 (syntax: Optimize some literal parsing)
- #53540 (Moved issue-53157.rs into src/test/ui/consts/const-eval/)
- #53551 (Avoid some Place clones.)
Failed merges:
r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 4 | ||||
| -rw-r--r-- | src/libstd/future.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/buffered.rs | 2 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/memchr.rs | 2 | ||||
| -rw-r--r-- | src/libstd/net/ip.rs | 25 | ||||
| -rw-r--r-- | src/libstd/sync/once.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/net.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/pipe.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys_common/wtf8.rs | 2 |
11 files changed, 16 insertions, 31 deletions
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 2b319186a8d..768357ec8dc 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -234,10 +234,10 @@ fn can_alias_safehash_as_hash() { // make a RawBucket point to invalid memory using safe code. impl<K, V> RawBucket<K, V> { unsafe fn hash(&self) -> *mut HashUint { - self.hash_start.offset(self.idx as isize) + self.hash_start.add(self.idx) } unsafe fn pair(&self) -> *mut (K, V) { - self.pair_start.offset(self.idx as isize) as *mut (K, V) + self.pair_start.add(self.idx) as *mut (K, V) } unsafe fn hash_pair(&self) -> (*mut HashUint, *mut (K, V)) { (self.hash(), self.pair()) diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 12ea1ea9f9d..cadb5c0ba5d 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -88,7 +88,7 @@ where /// This function acquires exclusive access to the task context. /// /// Panics if no task has been set or if the task context has already been -/// retrived by a surrounding call to get_task_cx. +/// retrieved by a surrounding call to get_task_cx. pub fn get_task_cx<F, R>(f: F) -> R where F: FnOnce(&mut task::Context) -> R diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 03c97de6ec1..77bc7e946eb 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -889,7 +889,7 @@ impl<W: Write> Write for LineWriter<W> { // Find the last newline character in the buffer provided. If found then // we're going to write all the data up to that point and then flush, - // otherewise we just write the whole block to the underlying writer. + // otherwise we just write the whole block to the underlying writer. let i = match memchr::memrchr(b'\n', buf) { Some(i) => i, None => return self.inner.write(buf), diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index b0069f826ee..ade297219d2 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -270,7 +270,7 @@ #![feature(libc)] #![feature(link_args)] #![feature(linkage)] -#![feature(macro_vis_matcher)] +#![cfg_attr(stage0, feature(macro_vis_matcher))] #![feature(needs_panic_runtime)] #![feature(never_type)] #![cfg_attr(not(stage0), feature(nll))] diff --git a/src/libstd/memchr.rs b/src/libstd/memchr.rs index 240e82069ff..c28f3da98ce 100644 --- a/src/libstd/memchr.rs +++ b/src/libstd/memchr.rs @@ -57,7 +57,7 @@ pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> { #[cfg(test)] mod tests { - // test the implementations for the current plattform + // test the implementations for the current platform use super::{memchr, memrchr}; #[test] diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index 9a610cd7d6b..d45a66ef665 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -357,15 +357,12 @@ impl Ipv4Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv4Addr; /// /// let addr = Ipv4Addr::LOCALHOST; /// assert_eq!(addr, Ipv4Addr::new(127, 0, 0, 1)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const LOCALHOST: Self = Ipv4Addr::new(127, 0, 0, 1); /// An IPv4 address representing an unspecified address: 0.0.0.0 @@ -373,15 +370,12 @@ impl Ipv4Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv4Addr; /// /// let addr = Ipv4Addr::UNSPECIFIED; /// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0); /// An IPv4 address representing the broadcast address: 255.255.255.255 @@ -389,15 +383,12 @@ impl Ipv4Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv4Addr; /// /// let addr = Ipv4Addr::BROADCAST; /// assert_eq!(addr, Ipv4Addr::new(255, 255, 255, 255)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const BROADCAST: Self = Ipv4Addr::new(255, 255, 255, 255); /// Returns the four eight-bit integers that make up this address. @@ -896,15 +887,12 @@ impl Ipv6Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv6Addr; /// /// let addr = Ipv6Addr::LOCALHOST; /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const LOCALHOST: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1); /// An IPv6 address representing the unspecified address: `::` @@ -912,15 +900,12 @@ impl Ipv6Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv6Addr; /// /// let addr = Ipv6Addr::UNSPECIFIED; /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const UNSPECIFIED: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0); /// Returns the eight 16-bit segments that make up this address. diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index f6cb8beae84..f258ff073e2 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -176,7 +176,7 @@ impl Once { /// happens-before relation between the closure and code executing after the /// return). /// - /// If the given closure recusively invokes `call_once` on the same `Once` + /// If the given closure recursively invokes `call_once` on the same `Once` /// instance the exact behavior is not specified, allowed outcomes are /// a panic or a deadlock. /// diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 7a89d9857bb..1d5b0cfa94a 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -857,7 +857,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { use sync::atomic::{AtomicBool, Ordering}; // Kernel prior to 4.5 don't have copy_file_range - // We store the availability in a global to avoid unneccessary syscalls + // We store the availability in a global to avoid unnecessary syscalls static HAS_COPY_FILE_RANGE: AtomicBool = AtomicBool::new(true); unsafe fn copy_file_range( diff --git a/src/libstd/sys/unix/net.rs b/src/libstd/sys/unix/net.rs index 04d9f0b06d3..8c73fe8c612 100644 --- a/src/libstd/sys/unix/net.rs +++ b/src/libstd/sys/unix/net.rs @@ -35,7 +35,7 @@ use libc::SOCK_CLOEXEC; #[cfg(not(target_os = "linux"))] const SOCK_CLOEXEC: c_int = 0; -// Another conditional contant for name resolution: Macos et iOS use +// Another conditional constant for name resolution: Macos et iOS use // SO_NOSIGPIPE as a setsockopt flag to disable SIGPIPE emission on socket. // Other platforms do otherwise. #[cfg(target_vendor = "apple")] diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs index df1dd7401af..4b19519a57a 100644 --- a/src/libstd/sys/windows/pipe.rs +++ b/src/libstd/sys/windows/pipe.rs @@ -359,6 +359,6 @@ unsafe fn slice_to_end(v: &mut Vec<u8>) -> &mut [u8] { if v.capacity() == v.len() { v.reserve(1); } - slice::from_raw_parts_mut(v.as_mut_ptr().offset(v.len() as isize), + slice::from_raw_parts_mut(v.as_mut_ptr().add(v.len()), v.capacity() - v.len()) } diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs index 45204b56ead..8725abe7416 100644 --- a/src/libstd/sys_common/wtf8.rs +++ b/src/libstd/sys_common/wtf8.rs @@ -772,7 +772,7 @@ pub fn is_code_point_boundary(slice: &Wtf8, index: usize) -> bool { pub unsafe fn slice_unchecked(s: &Wtf8, begin: usize, end: usize) -> &Wtf8 { // memory layout of an &[u8] and &Wtf8 are the same Wtf8::from_bytes_unchecked(slice::from_raw_parts( - s.bytes.as_ptr().offset(begin as isize), + s.bytes.as_ptr().add(begin), end - begin )) } |
