Skip to content

Rollup of 9 pull requests #45299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Oct 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
32c4b71
Link std::process::Output to Command and Child
Oct 8, 2017
8d20030
Moved details of unstable non-ascii identifiers from the Reference to…
brauliobz Oct 13, 2017
8f4ff63
Make Solaris builder compatible with Solaris 10
bgermann Oct 13, 2017
45502d2
compiletest/runtest: format ErrorKind with Display
hdhoang Oct 13, 2017
8c4a68d
Add line break after summary of process::Output
Oct 13, 2017
7439da6
fix typo in src/bootstrap/README.md
0xAX Oct 13, 2017
8e6119f
Fixed link to keywords page in the reference
brauliobz Oct 13, 2017
c729e4d
Remove terribly useless and problematic margin when searching on mobile
GuillaumeGomez Oct 14, 2017
bb9e850
std: Get rid of hash_offet in RawTable
Manishearth Oct 13, 2017
e8e7715
std: Set probe length tag on cloned hashmaps
Manishearth Oct 13, 2017
5acc185
Fix arrow display
GuillaumeGomez Oct 14, 2017
cab99a3
Fix TcpStream::connect_timeout on linux
sfackler Oct 14, 2017
430ac4b
Rollup merge of #45113 - Pirh:process_output_links, r=steveklabnik
kennytm Oct 15, 2017
b6f4cea
Rollup merge of #45250 - brauliobz:non-ascii-idents-details, r=stevek…
kennytm Oct 15, 2017
e598ac9
Rollup merge of #45255 - bgermann:master, r=alexcrichton
kennytm Oct 15, 2017
34a286b
Rollup merge of #45258 - hdhoang:master, r=alexcrichton
kennytm Oct 15, 2017
5e8d407
Rollup merge of #45263 - Manishearth:hashmap-clean, r=bluss
kennytm Oct 15, 2017
a793372
Rollup merge of #45264 - 0xAX:fix-typo-bootstrap-readm, r=kennytm
kennytm Oct 15, 2017
f55cb48
Rollup merge of #45269 - sfackler:connect-timeout-fix, r=alexcrichton
kennytm Oct 15, 2017
1effcb0
Rollup merge of #45280 - GuillaumeGomez:fix-mobile-search, r=kennytm
kennytm Oct 15, 2017
5ebad25
Rollup merge of #45289 - GuillaumeGomez:fix-doc-help, r=kennytm
kennytm Oct 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/ci/docker/cross2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,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
Expand Down
22 changes: 13 additions & 9 deletions src/ci/docker/cross2/build-solaris-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand Down
32 changes: 31 additions & 1 deletion src/doc/unstable-book/src/language-features/non-ascii-idents.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,34 @@ The `non_ascii_idents` feature adds support for non-ASCII identifiers.

const ε: f64 = 0.00001f64;
const Π: f64 = 3.14f64;
```
```

## Changes to the language reference

> **<sup>Lexer:<sup>**
> IDENTIFIER :
> &nbsp;&nbsp; &nbsp;&nbsp; XID_start XID_continue<sup>\*</sup>
> &nbsp;&nbsp; | `_` 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
4 changes: 2 additions & 2 deletions src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ r##"<!DOCTYPE html>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dt></dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dt></dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,10 @@ span.since {
.toggle-wrapper {
height: 1.5em;
}

#search {
margin-left: 0;
}
}

@media print {
Expand Down
32 changes: 16 additions & 16 deletions src/libstd/collections/hash/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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.
Expand All @@ -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),
Expand Down Expand Up @@ -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
}
Expand All @@ -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");

Expand Down
15 changes: 15 additions & 0 deletions src/libstd/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,21 @@ mod tests {
"bad error: {} {:?}", e, e.kind());
}

#[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();
Expand Down
9 changes: 9 additions & 0 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 9 additions & 4 deletions src/libstd/sys/unix/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down