diff options
| author | bors <bors@rust-lang.org> | 2017-10-15 08:39:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-10-15 08:39:58 +0000 |
| commit | 8382f39b6b5820927ccf5380d8240a0c02311645 (patch) | |
| tree | 24c4c0fe60d8a18ca039729bfcdca85a16e8c3f6 | |
| parent | 6c0d50f9fabe78fa8497041c14ce73787a4aef87 (diff) | |
| parent | 5ebad25b0845845fc199b9c2a46592d718881a95 (diff) | |
| download | rust-8382f39b6b5820927ccf5380d8240a0c02311645.tar.gz rust-8382f39b6b5820927ccf5380d8240a0c02311645.zip | |
Auto merge of #45299 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests - Successful merges: #45113, #45250, #45255, #45258, #45263, #45264, #45269, #45280, #45289 - Failed merges:
| -rw-r--r-- | src/bootstrap/README.md | 2 | ||||
| -rw-r--r-- | src/ci/docker/cross2/Dockerfile | 12 | ||||
| -rwxr-xr-x | src/ci/docker/cross2/build-solaris-toolchain.sh | 22 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/language-features/non-ascii-idents.md | 32 | ||||
| -rw-r--r-- | src/librustdoc/html/layout.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 4 | ||||
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 32 | ||||
| -rw-r--r-- | src/libstd/net/tcp.rs | 15 | ||||
| -rw-r--r-- | src/libstd/process.rs | 9 | ||||
| -rw-r--r-- | src/libstd/sys/unix/net.rs | 13 | ||||
| -rw-r--r-- | src/tools/compiletest/src/errors.rs | 2 | ||||
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 2 |
12 files changed, 108 insertions, 41 deletions
diff --git a/src/bootstrap/README.md b/src/bootstrap/README.md index ebacc62b0fd..6eb074605fc 100644 --- a/src/bootstrap/README.md +++ b/src/bootstrap/README.md @@ -126,7 +126,7 @@ install a nightly, presumably using `rustup`. You will then want to configure your directory to use this build, like so: ``` -# configure to use local rust instead of downloding a beta. +# configure to use local rust instead of downloading a beta. # `--local-rust-root` is optional here. If elided, we will # use whatever rustc we find on your PATH. > configure --enable-rustbuild --local-rust-root=~/.cargo/ --enable-local-rebuild diff --git a/src/ci/docker/cross2/Dockerfile b/src/ci/docker/cross2/Dockerfile index 58932c51aec..cc260382f49 100644 --- a/src/ci/docker/cross2/Dockerfile +++ b/src/ci/docker/cross2/Dockerfile @@ -37,12 +37,12 @@ ENV \ AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \ CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \ CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \ - AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-ar \ - CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-gcc \ - CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-g++ \ - AR_x86_64_sun_solaris=x86_64-sun-solaris2.11-ar \ - CC_x86_64_sun_solaris=x86_64-sun-solaris2.11-gcc \ - CXX_x86_64_sun_solaris=x86_64-sun-solaris2.11-g++ + AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-ar \ + CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-gcc \ + CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-g++ \ + AR_x86_64_sun_solaris=x86_64-sun-solaris2.10-ar \ + CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \ + CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++ ENV TARGETS=x86_64-unknown-fuchsia ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia diff --git a/src/ci/docker/cross2/build-solaris-toolchain.sh b/src/ci/docker/cross2/build-solaris-toolchain.sh index ae84cc62b60..935cbe5d61b 100755 --- a/src/ci/docker/cross2/build-solaris-toolchain.sh +++ b/src/ci/docker/cross2/build-solaris-toolchain.sh @@ -25,7 +25,7 @@ cd binutils curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.xz | tar xJf - mkdir binutils-build cd binutils-build -hide_output ../binutils-$BINUTILS/configure --target=$ARCH-sun-solaris2.11 +hide_output ../binutils-$BINUTILS/configure --target=$ARCH-sun-solaris2.10 hide_output make -j10 hide_output make install @@ -58,13 +58,17 @@ for deb in *$APT_ARCH.deb; do dpkg -x $deb . done -mkdir /usr/local/$ARCH-sun-solaris2.11/usr -mv usr/include /usr/local/$ARCH-sun-solaris2.11/usr/include -mv usr/lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib -mv lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib +# Strip Solaris 11 functions that are optionally used by libbacktrace. +# This is for Solaris 10 compatibility. +$ARCH-sun-solaris2.10-strip -N dl_iterate_phdr -N strnlen lib/$LIB_ARCH/libc.so -ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/sys-include -ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/include +mkdir /usr/local/$ARCH-sun-solaris2.10/usr +mv usr/include /usr/local/$ARCH-sun-solaris2.10/usr/include +mv usr/lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.10/lib +mv lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.10/lib + +ln -s /usr/local/$ARCH-sun-solaris2.10/usr/include /usr/local/$ARCH-sun-solaris2.10/sys-include +ln -s /usr/local/$ARCH-sun-solaris2.10/usr/include /usr/local/$ARCH-sun-solaris2.10/include cd .. rm -rf solaris @@ -80,7 +84,7 @@ mkdir ../gcc-build cd ../gcc-build hide_output ../gcc-$GCC/configure \ --enable-languages=c,c++ \ - --target=$ARCH-sun-solaris2.11 \ + --target=$ARCH-sun-solaris2.10 \ --with-gnu-as \ --with-gnu-ld \ --disable-multilib \ @@ -94,7 +98,7 @@ hide_output ../gcc-$GCC/configure \ --disable-libsanitizer \ --disable-libquadmath-support \ --disable-lto \ - --with-sysroot=/usr/local/$ARCH-sun-solaris2.11 + --with-sysroot=/usr/local/$ARCH-sun-solaris2.10 hide_output make -j10 hide_output make install diff --git a/src/doc/unstable-book/src/language-features/non-ascii-idents.md b/src/doc/unstable-book/src/language-features/non-ascii-idents.md index d5600c58fd9..efb5495fe26 100644 --- a/src/doc/unstable-book/src/language-features/non-ascii-idents.md +++ b/src/doc/unstable-book/src/language-features/non-ascii-idents.md @@ -15,4 +15,34 @@ The `non_ascii_idents` feature adds support for non-ASCII identifiers. const ε: f64 = 0.00001f64; const Π: f64 = 3.14f64; -``` \ No newline at end of file +``` + +## Changes to the language reference + +> **<sup>Lexer:<sup>** +> IDENTIFIER : +> XID_start XID_continue<sup>\*</sup> +> | `_` XID_continue<sup>+</sup> + +An identifier is any nonempty Unicode string of the following form: + +Either + + * The first character has property [`XID_start`] + * The remaining characters have property [`XID_continue`] + +Or + + * The first character is `_` + * The identifier is more than one character, `_` alone is not an identifier + * The remaining characters have property [`XID_continue`] + +that does _not_ occur in the set of [strict keywords]. + +> **Note**: [`XID_start`] and [`XID_continue`] as character properties cover the +> character ranges used to form the more familiar C and Java language-family +> identifiers. + +[`XID_start`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Start%3A%5D&abb=on&g=&i= +[`XID_continue`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Continue%3A%5D&abb=on&g=&i= +[strict keywords]: ../reference/keywords.html#strict-keywords diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index d08a7bde71c..873d978b9cb 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -97,9 +97,9 @@ r##"<!DOCTYPE html> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> - <dt>⇤</dt> + <dt>↑</dt> <dd>Move up in search results</dd> - <dt>⇥</dt> + <dt>↓</dt> <dd>Move down in search results</dd> <dt>⏎</dt> <dd>Go to active search result</dd> diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 9e2798f1cf7..a132223a051 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -831,6 +831,10 @@ span.since { .toggle-wrapper { height: 1.5em; } + + #search { + margin-left: 0; + } } @media print { diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 93929637e2f..7e623a0af17 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -717,26 +717,25 @@ fn calculate_offsets(hashes_size: usize, (pairs_offset, end_of_pairs, oflo) } -// Returns a tuple of (minimum required malloc alignment, hash_offset, +// Returns a tuple of (minimum required malloc alignment, // array_size), from the start of a mallocated array. fn calculate_allocation(hash_size: usize, hash_align: usize, pairs_size: usize, pairs_align: usize) - -> (usize, usize, usize, bool) { - let hash_offset = 0; + -> (usize, usize, bool) { let (_, end_of_pairs, oflo) = calculate_offsets(hash_size, pairs_size, pairs_align); let align = cmp::max(hash_align, pairs_align); - (align, hash_offset, end_of_pairs, oflo) + (align, end_of_pairs, oflo) } #[test] fn test_offset_calculation() { - assert_eq!(calculate_allocation(128, 8, 16, 8), (8, 0, 144, false)); - assert_eq!(calculate_allocation(3, 1, 2, 1), (1, 0, 5, false)); - assert_eq!(calculate_allocation(6, 2, 12, 4), (4, 0, 20, false)); + assert_eq!(calculate_allocation(128, 8, 16, 8), (8, 144, false)); + assert_eq!(calculate_allocation(3, 1, 2, 1), (1, 5, false)); + assert_eq!(calculate_allocation(6, 2, 12, 4), (4, 20, false)); assert_eq!(calculate_offsets(128, 15, 4), (128, 143, false)); assert_eq!(calculate_offsets(3, 2, 4), (4, 6, false)); assert_eq!(calculate_offsets(6, 12, 4), (8, 20, false)); @@ -768,10 +767,10 @@ impl<K, V> RawTable<K, V> { // This is great in theory, but in practice getting the alignment // right is a little subtle. Therefore, calculating offsets has been // factored out into a different function. - let (alignment, hash_offset, size, oflo) = calculate_allocation(hashes_size, - align_of::<HashUint>(), - pairs_size, - align_of::<(K, V)>()); + let (alignment, size, oflo) = calculate_allocation(hashes_size, + align_of::<HashUint>(), + pairs_size, + align_of::<(K, V)>()); assert!(!oflo, "capacity overflow"); // One check for overflow that covers calculation and rounding of size. @@ -784,7 +783,7 @@ impl<K, V> RawTable<K, V> { let buffer = Heap.alloc(Layout::from_size_align(size, alignment).unwrap()) .unwrap_or_else(|e| Heap.oom(e)); - let hashes = buffer.offset(hash_offset as isize) as *mut HashUint; + let hashes = buffer as *mut HashUint; RawTable { capacity_mask: capacity.wrapping_sub(1), @@ -1157,6 +1156,7 @@ impl<K: Clone, V: Clone> Clone for RawTable<K, V> { } new_ht.size = self.size(); + new_ht.set_tag(self.tag()); new_ht } @@ -1183,10 +1183,10 @@ unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable<K, V> { let hashes_size = self.capacity() * size_of::<HashUint>(); let pairs_size = self.capacity() * size_of::<(K, V)>(); - let (align, _, size, oflo) = calculate_allocation(hashes_size, - align_of::<HashUint>(), - pairs_size, - align_of::<(K, V)>()); + let (align, size, oflo) = calculate_allocation(hashes_size, + align_of::<HashUint>(), + pairs_size, + align_of::<(K, V)>()); debug_assert!(!oflo, "should be impossible"); diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index b904641a336..4656cc5a7a7 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -1580,6 +1580,21 @@ mod tests { } #[test] + fn connect_timeout_unbound() { + // bind and drop a socket to track down a "probably unassigned" port + let socket = TcpListener::bind("127.0.0.1:0").unwrap(); + let addr = socket.local_addr().unwrap(); + drop(socket); + + let timeout = Duration::from_secs(1); + let e = TcpStream::connect_timeout(&addr, timeout).unwrap_err(); + assert!(e.kind() == io::ErrorKind::ConnectionRefused || + e.kind() == io::ErrorKind::TimedOut || + e.kind() == io::ErrorKind::Other, + "bad error: {} {:?}", e, e.kind()); + } + + #[test] fn connect_timeout_valid() { let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let addr = listener.local_addr().unwrap(); diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 7d8ce4154fb..f448cffd372 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -702,6 +702,15 @@ impl AsInnerMut<imp::Command> for Command { } /// The output of a finished process. +/// +/// This is returned in a Result by either the [`output`] method of a +/// [`Command`], or the [`wait_with_output`] method of a [`Child`] +/// process. +/// +/// [`Command`]: struct.Command.html +/// [`Child`]: struct.Child.html +/// [`output`]: struct.Command.html#method.output +/// [`wait_with_output`]: struct.Child.html#method.wait_with_output #[derive(PartialEq, Eq, Clone)] #[stable(feature = "process", since = "1.0.0")] pub struct Output { diff --git a/src/libstd/sys/unix/net.rs b/src/libstd/sys/unix/net.rs index c8019d1c768..e775f857f2b 100644 --- a/src/libstd/sys/unix/net.rs +++ b/src/libstd/sys/unix/net.rs @@ -176,11 +176,16 @@ impl Socket { } 0 => {} _ => { - if pollfd.revents & libc::POLLOUT == 0 { - if let Some(e) = self.take_error()? { - return Err(e); - } + // linux returns POLLOUT|POLLERR|POLLHUP for refused connections (!), so look + // for POLLHUP rather than read readiness + if pollfd.revents & libc::POLLHUP != 0 { + let e = self.take_error()? + .unwrap_or_else(|| { + io::Error::new(io::ErrorKind::Other, "no error set after POLLHUP") + }); + return Err(e); } + return Ok(()); } } diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs index b7fb3670165..251dd4d5edb 100644 --- a/src/tools/compiletest/src/errors.rs +++ b/src/tools/compiletest/src/errors.rs @@ -45,7 +45,7 @@ impl FromStr for ErrorKind { impl fmt::Display for ErrorKind { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { - ErrorKind::Help => write!(f, "help"), + ErrorKind::Help => write!(f, "help message"), ErrorKind::Error => write!(f, "error"), ErrorKind::Note => write!(f, "note"), ErrorKind::Suggestion => write!(f, "suggestion"), diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index af9061ab367..60acc20e692 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1041,7 +1041,7 @@ actual:\n\ None => { if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) { self.error( - &format!("{}:{}: unexpected {:?}: '{}'", + &format!("{}:{}: unexpected {}: '{}'", file_name, actual_error.line_num, actual_error.kind.as_ref() |
