Skip to content

Commit 8382f39

Browse files
committed
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:
2 parents 6c0d50f + 5ebad25 commit 8382f39

File tree

12 files changed

+108
-41
lines changed

12 files changed

+108
-41
lines changed

src/bootstrap/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ install a nightly, presumably using `rustup`. You will then want to
126126
configure your directory to use this build, like so:
127127

128128
```
129-
# configure to use local rust instead of downloding a beta.
129+
# configure to use local rust instead of downloading a beta.
130130
# `--local-rust-root` is optional here. If elided, we will
131131
# use whatever rustc we find on your PATH.
132132
> configure --enable-rustbuild --local-rust-root=~/.cargo/ --enable-local-rebuild

src/ci/docker/cross2/Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ ENV \
3737
AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \
3838
CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \
3939
CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \
40-
AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-ar \
41-
CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-gcc \
42-
CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-g++ \
43-
AR_x86_64_sun_solaris=x86_64-sun-solaris2.11-ar \
44-
CC_x86_64_sun_solaris=x86_64-sun-solaris2.11-gcc \
45-
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.11-g++
40+
AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-ar \
41+
CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-gcc \
42+
CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-g++ \
43+
AR_x86_64_sun_solaris=x86_64-sun-solaris2.10-ar \
44+
CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \
45+
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++
4646

4747
ENV TARGETS=x86_64-unknown-fuchsia
4848
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia

src/ci/docker/cross2/build-solaris-toolchain.sh

+13-9
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cd binutils
2525
curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.xz | tar xJf -
2626
mkdir binutils-build
2727
cd binutils-build
28-
hide_output ../binutils-$BINUTILS/configure --target=$ARCH-sun-solaris2.11
28+
hide_output ../binutils-$BINUTILS/configure --target=$ARCH-sun-solaris2.10
2929
hide_output make -j10
3030
hide_output make install
3131

@@ -58,13 +58,17 @@ for deb in *$APT_ARCH.deb; do
5858
dpkg -x $deb .
5959
done
6060

61-
mkdir /usr/local/$ARCH-sun-solaris2.11/usr
62-
mv usr/include /usr/local/$ARCH-sun-solaris2.11/usr/include
63-
mv usr/lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib
64-
mv lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib
61+
# Strip Solaris 11 functions that are optionally used by libbacktrace.
62+
# This is for Solaris 10 compatibility.
63+
$ARCH-sun-solaris2.10-strip -N dl_iterate_phdr -N strnlen lib/$LIB_ARCH/libc.so
6564

66-
ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/sys-include
67-
ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/include
65+
mkdir /usr/local/$ARCH-sun-solaris2.10/usr
66+
mv usr/include /usr/local/$ARCH-sun-solaris2.10/usr/include
67+
mv usr/lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.10/lib
68+
mv lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.10/lib
69+
70+
ln -s /usr/local/$ARCH-sun-solaris2.10/usr/include /usr/local/$ARCH-sun-solaris2.10/sys-include
71+
ln -s /usr/local/$ARCH-sun-solaris2.10/usr/include /usr/local/$ARCH-sun-solaris2.10/include
6872

6973
cd ..
7074
rm -rf solaris
@@ -80,7 +84,7 @@ mkdir ../gcc-build
8084
cd ../gcc-build
8185
hide_output ../gcc-$GCC/configure \
8286
--enable-languages=c,c++ \
83-
--target=$ARCH-sun-solaris2.11 \
87+
--target=$ARCH-sun-solaris2.10 \
8488
--with-gnu-as \
8589
--with-gnu-ld \
8690
--disable-multilib \
@@ -94,7 +98,7 @@ hide_output ../gcc-$GCC/configure \
9498
--disable-libsanitizer \
9599
--disable-libquadmath-support \
96100
--disable-lto \
97-
--with-sysroot=/usr/local/$ARCH-sun-solaris2.11
101+
--with-sysroot=/usr/local/$ARCH-sun-solaris2.10
98102

99103
hide_output make -j10
100104
hide_output make install

src/doc/unstable-book/src/language-features/non-ascii-idents.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,34 @@ The `non_ascii_idents` feature adds support for non-ASCII identifiers.
1515

1616
const ε: f64 = 0.00001f64;
1717
const Π: f64 = 3.14f64;
18-
```
18+
```
19+
20+
## Changes to the language reference
21+
22+
> **<sup>Lexer:<sup>**
23+
> IDENTIFIER :
24+
> &nbsp;&nbsp; &nbsp;&nbsp; XID_start XID_continue<sup>\*</sup>
25+
> &nbsp;&nbsp; | `_` XID_continue<sup>+</sup>
26+
27+
An identifier is any nonempty Unicode string of the following form:
28+
29+
Either
30+
31+
* The first character has property [`XID_start`]
32+
* The remaining characters have property [`XID_continue`]
33+
34+
Or
35+
36+
* The first character is `_`
37+
* The identifier is more than one character, `_` alone is not an identifier
38+
* The remaining characters have property [`XID_continue`]
39+
40+
that does _not_ occur in the set of [strict keywords].
41+
42+
> **Note**: [`XID_start`] and [`XID_continue`] as character properties cover the
43+
> character ranges used to form the more familiar C and Java language-family
44+
> identifiers.
45+
46+
[`XID_start`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Start%3A%5D&abb=on&g=&i=
47+
[`XID_continue`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Continue%3A%5D&abb=on&g=&i=
48+
[strict keywords]: ../reference/keywords.html#strict-keywords

src/librustdoc/html/layout.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ r##"<!DOCTYPE html>
9797
<dd>Show this help dialog</dd>
9898
<dt>S</dt>
9999
<dd>Focus the search field</dd>
100-
<dt>&larrb;</dt>
100+
<dt></dt>
101101
<dd>Move up in search results</dd>
102-
<dt>&rarrb;</dt>
102+
<dt></dt>
103103
<dd>Move down in search results</dd>
104104
<dt>&#9166;</dt>
105105
<dd>Go to active search result</dd>

src/librustdoc/html/static/rustdoc.css

+4
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,10 @@ span.since {
831831
.toggle-wrapper {
832832
height: 1.5em;
833833
}
834+
835+
#search {
836+
margin-left: 0;
837+
}
834838
}
835839

836840
@media print {

src/libstd/collections/hash/table.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -717,26 +717,25 @@ fn calculate_offsets(hashes_size: usize,
717717
(pairs_offset, end_of_pairs, oflo)
718718
}
719719

720-
// Returns a tuple of (minimum required malloc alignment, hash_offset,
720+
// Returns a tuple of (minimum required malloc alignment,
721721
// array_size), from the start of a mallocated array.
722722
fn calculate_allocation(hash_size: usize,
723723
hash_align: usize,
724724
pairs_size: usize,
725725
pairs_align: usize)
726-
-> (usize, usize, usize, bool) {
727-
let hash_offset = 0;
726+
-> (usize, usize, bool) {
728727
let (_, end_of_pairs, oflo) = calculate_offsets(hash_size, pairs_size, pairs_align);
729728

730729
let align = cmp::max(hash_align, pairs_align);
731730

732-
(align, hash_offset, end_of_pairs, oflo)
731+
(align, end_of_pairs, oflo)
733732
}
734733

735734
#[test]
736735
fn test_offset_calculation() {
737-
assert_eq!(calculate_allocation(128, 8, 16, 8), (8, 0, 144, false));
738-
assert_eq!(calculate_allocation(3, 1, 2, 1), (1, 0, 5, false));
739-
assert_eq!(calculate_allocation(6, 2, 12, 4), (4, 0, 20, false));
736+
assert_eq!(calculate_allocation(128, 8, 16, 8), (8, 144, false));
737+
assert_eq!(calculate_allocation(3, 1, 2, 1), (1, 5, false));
738+
assert_eq!(calculate_allocation(6, 2, 12, 4), (4, 20, false));
740739
assert_eq!(calculate_offsets(128, 15, 4), (128, 143, false));
741740
assert_eq!(calculate_offsets(3, 2, 4), (4, 6, false));
742741
assert_eq!(calculate_offsets(6, 12, 4), (8, 20, false));
@@ -768,10 +767,10 @@ impl<K, V> RawTable<K, V> {
768767
// This is great in theory, but in practice getting the alignment
769768
// right is a little subtle. Therefore, calculating offsets has been
770769
// factored out into a different function.
771-
let (alignment, hash_offset, size, oflo) = calculate_allocation(hashes_size,
772-
align_of::<HashUint>(),
773-
pairs_size,
774-
align_of::<(K, V)>());
770+
let (alignment, size, oflo) = calculate_allocation(hashes_size,
771+
align_of::<HashUint>(),
772+
pairs_size,
773+
align_of::<(K, V)>());
775774
assert!(!oflo, "capacity overflow");
776775

777776
// One check for overflow that covers calculation and rounding of size.
@@ -784,7 +783,7 @@ impl<K, V> RawTable<K, V> {
784783
let buffer = Heap.alloc(Layout::from_size_align(size, alignment).unwrap())
785784
.unwrap_or_else(|e| Heap.oom(e));
786785

787-
let hashes = buffer.offset(hash_offset as isize) as *mut HashUint;
786+
let hashes = buffer as *mut HashUint;
788787

789788
RawTable {
790789
capacity_mask: capacity.wrapping_sub(1),
@@ -1157,6 +1156,7 @@ impl<K: Clone, V: Clone> Clone for RawTable<K, V> {
11571156
}
11581157

11591158
new_ht.size = self.size();
1159+
new_ht.set_tag(self.tag());
11601160

11611161
new_ht
11621162
}
@@ -1183,10 +1183,10 @@ unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable<K, V> {
11831183

11841184
let hashes_size = self.capacity() * size_of::<HashUint>();
11851185
let pairs_size = self.capacity() * size_of::<(K, V)>();
1186-
let (align, _, size, oflo) = calculate_allocation(hashes_size,
1187-
align_of::<HashUint>(),
1188-
pairs_size,
1189-
align_of::<(K, V)>());
1186+
let (align, size, oflo) = calculate_allocation(hashes_size,
1187+
align_of::<HashUint>(),
1188+
pairs_size,
1189+
align_of::<(K, V)>());
11901190

11911191
debug_assert!(!oflo, "should be impossible");
11921192

src/libstd/net/tcp.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,21 @@ mod tests {
15791579
"bad error: {} {:?}", e, e.kind());
15801580
}
15811581

1582+
#[test]
1583+
fn connect_timeout_unbound() {
1584+
// bind and drop a socket to track down a "probably unassigned" port
1585+
let socket = TcpListener::bind("127.0.0.1:0").unwrap();
1586+
let addr = socket.local_addr().unwrap();
1587+
drop(socket);
1588+
1589+
let timeout = Duration::from_secs(1);
1590+
let e = TcpStream::connect_timeout(&addr, timeout).unwrap_err();
1591+
assert!(e.kind() == io::ErrorKind::ConnectionRefused ||
1592+
e.kind() == io::ErrorKind::TimedOut ||
1593+
e.kind() == io::ErrorKind::Other,
1594+
"bad error: {} {:?}", e, e.kind());
1595+
}
1596+
15821597
#[test]
15831598
fn connect_timeout_valid() {
15841599
let listener = TcpListener::bind("127.0.0.1:0").unwrap();

src/libstd/process.rs

+9
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,15 @@ impl AsInnerMut<imp::Command> for Command {
702702
}
703703

704704
/// The output of a finished process.
705+
///
706+
/// This is returned in a Result by either the [`output`] method of a
707+
/// [`Command`], or the [`wait_with_output`] method of a [`Child`]
708+
/// process.
709+
///
710+
/// [`Command`]: struct.Command.html
711+
/// [`Child`]: struct.Child.html
712+
/// [`output`]: struct.Command.html#method.output
713+
/// [`wait_with_output`]: struct.Child.html#method.wait_with_output
705714
#[derive(PartialEq, Eq, Clone)]
706715
#[stable(feature = "process", since = "1.0.0")]
707716
pub struct Output {

src/libstd/sys/unix/net.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,16 @@ impl Socket {
176176
}
177177
0 => {}
178178
_ => {
179-
if pollfd.revents & libc::POLLOUT == 0 {
180-
if let Some(e) = self.take_error()? {
181-
return Err(e);
182-
}
179+
// linux returns POLLOUT|POLLERR|POLLHUP for refused connections (!), so look
180+
// for POLLHUP rather than read readiness
181+
if pollfd.revents & libc::POLLHUP != 0 {
182+
let e = self.take_error()?
183+
.unwrap_or_else(|| {
184+
io::Error::new(io::ErrorKind::Other, "no error set after POLLHUP")
185+
});
186+
return Err(e);
183187
}
188+
184189
return Ok(());
185190
}
186191
}

src/tools/compiletest/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl FromStr for ErrorKind {
4545
impl fmt::Display for ErrorKind {
4646
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4747
match *self {
48-
ErrorKind::Help => write!(f, "help"),
48+
ErrorKind::Help => write!(f, "help message"),
4949
ErrorKind::Error => write!(f, "error"),
5050
ErrorKind::Note => write!(f, "note"),
5151
ErrorKind::Suggestion => write!(f, "suggestion"),

src/tools/compiletest/src/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ actual:\n\
10411041
None => {
10421042
if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
10431043
self.error(
1044-
&format!("{}:{}: unexpected {:?}: '{}'",
1044+
&format!("{}:{}: unexpected {}: '{}'",
10451045
file_name,
10461046
actual_error.line_num,
10471047
actual_error.kind.as_ref()

0 commit comments

Comments
 (0)