Skip to content

Commit 0f9c784

Browse files
committed
Auto merge of #47522 - kennytm:rollup, r=kennytm
Rollup of 21 pull requests - Successful merges: #47302, #47333, #47387, #47404, #47407, #47426, #47427, #47436, #47444, #47456, #47458, #47467, #47479, #47481, #47483, #47487, #47497, #47498, #47505, #47509, #47514 - Failed merges:
2 parents 3e49ada + 5fade39 commit 0f9c784

File tree

85 files changed

+611
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+611
-281
lines changed

RELEASES.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ Compatibility Notes
577577
a warning.
578578
- [From the pound escape, lines consisting of multiple `#`s are
579579
now visible][41785]
580-
- [It is an error to reexport private enum variants][42460]. This is
580+
- [It is an error to re-export private enum variants][42460]. This is
581581
known to break a number of crates that depend on an older version of
582582
mustache.
583583
- [On Windows, if `VCINSTALLDIR` is set incorrectly, `rustc` will try
@@ -2251,10 +2251,10 @@ Rustdoc
22512251
-------
22522252

22532253
* [Fix empty implementation section on some module pages](https://github.com/rust-lang/rust/pull/34536)
2254-
* [Fix inlined renamed reexports in import lists](https://github.com/rust-lang/rust/pull/34479)
2254+
* [Fix inlined renamed re-exports in import lists](https://github.com/rust-lang/rust/pull/34479)
22552255
* [Fix search result layout for enum variants and struct fields](https://github.com/rust-lang/rust/pull/34477)
22562256
* [Fix issues with source links to external crates](https://github.com/rust-lang/rust/pull/34387)
2257-
* [Fix redirect pages for renamed reexports](https://github.com/rust-lang/rust/pull/34245)
2257+
* [Fix redirect pages for renamed re-exports](https://github.com/rust-lang/rust/pull/34245)
22582258

22592259
Tooling
22602260
-------
@@ -4988,7 +4988,7 @@ Version 0.10 (2014-04-03)
49884988
* std: The `vec` module has been renamed to `slice`.
49894989
* std: A new vector type, `Vec<T>`, has been added in preparation for DST.
49904990
This will become the only growable vector in the future.
4991-
* std: `std::io` now has more public-reexports. Types such as `BufferedReader`
4991+
* std: `std::io` now has more public re-exports. Types such as `BufferedReader`
49924992
are now found at `std::io::BufferedReader` instead of
49934993
`std::io::buffered::BufferedReader`.
49944994
* std: `print` and `println` are no longer in the prelude, the `print!` and
@@ -5079,8 +5079,8 @@ Version 0.10 (2014-04-03)
50795079
* render standalone markdown files.
50805080
* the --test flag tests all code blocks by default.
50815081
* exported macros are displayed.
5082-
* reexported types have their documentation inlined at the location of the
5083-
first reexport.
5082+
* re-exported types have their documentation inlined at the location of the
5083+
first re-export.
50845084
* search works across crates that have been rendered to the same output
50855085
directory.
50865086

@@ -5467,7 +5467,7 @@ Version 0.7 (2013-07-03)
54675467
incl. `any`, `all`. removed.
54685468
* std: The `finalize` method of `Drop` renamed to `drop`.
54695469
* std: The `drop` method now takes `&mut self` instead of `&self`.
5470-
* std: The prelude no longer reexports any modules, only types and traits.
5470+
* std: The prelude no longer re-exports any modules, only types and traits.
54715471
* std: Prelude additions: `print`, `println`, `FromStr`, `ApproxEq`, `Equiv`,
54725472
`Iterator`, `IteratorUtil`, many numeric traits, many tuple traits.
54735473
* std: New numeric traits: `Fractional`, `Real`, `RealExt`, `Integer`, `Ratio`,

src/Cargo.lock

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ci/docker/dist-various-2/Dockerfile

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:17.10
22

33
COPY scripts/cross-apt-packages.sh /scripts/
44
RUN sh /scripts/cross-apt-packages.sh
@@ -21,9 +21,12 @@ RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7
2121
RUN add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2-testing main'
2222

2323
WORKDIR /tmp
24-
COPY dist-various-2/shared.sh dist-various-2/build-fuchsia-toolchain.sh /tmp/
25-
COPY dist-various-2/build-solaris-toolchain.sh /tmp/
24+
COPY dist-various-2/shared.sh /tmp/
25+
COPY dist-various-2/build-cloudabi-toolchain.sh /tmp/
26+
RUN /tmp/build-cloudabi-toolchain.sh x86_64-unknown-cloudabi
27+
COPY dist-various-2/build-fuchsia-toolchain.sh /tmp/
2628
RUN /tmp/build-fuchsia-toolchain.sh
29+
COPY dist-various-2/build-solaris-toolchain.sh /tmp/
2730
RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386
2831
RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc
2932

@@ -44,12 +47,20 @@ ENV \
4447
CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \
4548
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++
4649

50+
# FIXME(EdSchouten): Remove this once cc ≥1.0.4 has been merged. It can
51+
# automatically pick the right compiler path.
52+
ENV \
53+
AR_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-ar \
54+
CC_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-clang \
55+
CXX_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-clang++
56+
4757
ENV TARGETS=x86_64-unknown-fuchsia
4858
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
4959
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
5060
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
5161
ENV TARGETS=$TARGETS,x86_64-sun-solaris
5262
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
63+
ENV TARGETS=$TARGETS,x86_64-unknown-cloudabi
5364

5465
ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended
5566
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
# Copyright 2018 The Rust Project Developers. See the COPYRIGHT
3+
# file at the top-level directory of this distribution and at
4+
# http://rust-lang.org/COPYRIGHT.
5+
#
6+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
# option. This file may not be copied, modified, or distributed
10+
# except according to those terms.
11+
12+
set -eux
13+
14+
# Install prerequisites.
15+
apt-get update
16+
apt-get install -y --no-install-recommends \
17+
apt-transport-https \
18+
ca-certificates \
19+
clang-5.0 \
20+
cmake \
21+
curl \
22+
file \
23+
g++ \
24+
gdb \
25+
git \
26+
lld-5.0 \
27+
make \
28+
python \
29+
sudo \
30+
xz-utils
31+
32+
# Set up a Clang-based cross compiler toolchain.
33+
# Based on the steps described at https://nuxi.nl/cloudabi/debian/
34+
target=$1
35+
for tool in ar nm objdump ranlib size; do
36+
ln -s ../lib/llvm-5.0/bin/llvm-${tool} /usr/bin/${target}-${tool}
37+
done
38+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-cc
39+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-c++
40+
ln -s ../lib/llvm-5.0/bin/lld /usr/bin/${target}-ld
41+
ln -s ../../${target} /usr/lib/llvm-5.0/${target}
42+
43+
# FIXME(EdSchouten): Remove this once cc ≥1.0.4 has been merged. It
44+
# can make use of ${target}-cc and ${target}-c++, without incorrectly
45+
# assuming it's MSVC.
46+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang
47+
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang++
48+
49+
# Install the C++ runtime libraries from CloudABI Ports.
50+
echo deb https://nuxi.nl/distfiles/cloudabi-ports/debian/ cloudabi cloudabi > \
51+
/etc/apt/sources.list.d/cloudabi.list
52+
curl 'https://pgp.mit.edu/pks/lookup?op=get&search=0x0DA51B8531344B15' | \
53+
apt-key add -
54+
apt-get update
55+
apt-get install -y $(echo ${target} | sed -e s/_/-/g)-cxx-runtime

src/doc/rustdoc/src/the-doc-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The `#[doc]` attribute
22

33
The `#[doc]` attribute lets you control various aspects of how `rustdoc` does
4-
its job.
4+
its job.
55

66
The most basic function of `#[doc]` is to handle the actual documentation
77
text. That is, `///` is syntax sugar for `#[doc]`. This means that these two
@@ -143,7 +143,7 @@ pub mod bar {
143143
}
144144
```
145145

146-
The documentation will generate a "Reexports" section, and say `pub use bar::Bar;`, where
146+
The documentation will generate a "Re-exports" section, and say `pub use bar::Bar;`, where
147147
`Bar` is a link to its page.
148148

149149
If we change the `use` line like this:
@@ -184,7 +184,7 @@ mod bar {
184184
}
185185
```
186186

187-
Now we'll have a `Reexports` line, and `Bar` will not link to anywhere.
187+
Now we'll have a `Re-exports` line, and `Bar` will not link to anywhere.
188188

189189
## `#[doc(hidden)]`
190190

src/liballoc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//!
1616
//! This library, like libcore, is not intended for general usage, but rather as
1717
//! a building block of other libraries. The types and interfaces in this
18-
//! library are reexported through the [standard library](../std/index.html),
18+
//! library are re-exported through the [standard library](../std/index.html),
1919
//! and should not be used through this library.
2020
//!
2121
//! ## Boxed values
@@ -52,7 +52,7 @@
5252
//! ## Collections
5353
//!
5454
//! Implementations of the most common general purpose data structures are
55-
//! defined in this library. They are reexported through the
55+
//! defined in this library. They are re-exported through the
5656
//! [standard collections library](../std/collections/index.html).
5757
//!
5858
//! ## Heap interfaces

src/libcore/option.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,7 @@ impl<T> Option<T> {
407407
}
408408

409409
/// Applies a function to the contained value (if any),
410-
/// or returns a [`default`][] (if not).
411-
///
412-
/// [`default`]: ../default/trait.Default.html#tymethod.default
410+
/// or returns the provided default (if not).
413411
///
414412
/// # Examples
415413
///
@@ -430,9 +428,7 @@ impl<T> Option<T> {
430428
}
431429

432430
/// Applies a function to the contained value (if any),
433-
/// or computes a [`default`][] (if not).
434-
///
435-
/// [`default`]: ../default/trait.Default.html#tymethod.default
431+
/// or computes a default (if not).
436432
///
437433
/// # Examples
438434
///
@@ -850,7 +846,7 @@ impl<T: Default> Option<T> {
850846
/// Returns the contained value or a default
851847
///
852848
/// Consumes the `self` argument then, if [`Some`], returns the contained
853-
/// value, otherwise if [`None`], returns the default value for that
849+
/// value, otherwise if [`None`], returns the [default value] for that
854850
/// type.
855851
///
856852
/// # Examples
@@ -872,6 +868,7 @@ impl<T: Default> Option<T> {
872868
///
873869
/// [`Some`]: #variant.Some
874870
/// [`None`]: #variant.None
871+
/// [default value]: ../default/trait.Default.html#tymethod.default
875872
/// [`parse`]: ../../std/primitive.str.html#method.parse
876873
/// [`FromStr`]: ../../std/str/trait.FromStr.html
877874
#[inline]

src/libcore/prelude/v1.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
1717
#![stable(feature = "core_prelude", since = "1.4.0")]
1818

19-
// Reexported core operators
19+
// Re-exported core operators
2020
#[stable(feature = "core_prelude", since = "1.4.0")]
2121
#[doc(no_inline)]
2222
pub use marker::{Copy, Send, Sized, Sync};
2323
#[stable(feature = "core_prelude", since = "1.4.0")]
2424
#[doc(no_inline)]
2525
pub use ops::{Drop, Fn, FnMut, FnOnce};
2626

27-
// Reexported functions
27+
// Re-exported functions
2828
#[stable(feature = "core_prelude", since = "1.4.0")]
2929
#[doc(no_inline)]
3030
pub use mem::drop;
3131

32-
// Reexported types and traits
32+
// Re-exported types and traits
3333
#[stable(feature = "core_prelude", since = "1.4.0")]
3434
#[doc(no_inline)]
3535
pub use clone::Clone;
@@ -55,7 +55,7 @@ pub use option::Option::{self, Some, None};
5555
#[doc(no_inline)]
5656
pub use result::Result::{self, Ok, Err};
5757

58-
// Reexported extension traits for primitive types
58+
// Re-exported extension traits for primitive types
5959
#[stable(feature = "core_prelude", since = "1.4.0")]
6060
#[doc(no_inline)]
6161
pub use slice::SliceExt;

src/libcore/slice/mod.rs

+38-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// a lot of stuff defined here. Let's keep it clean.
2323
//
2424
// Since slices don't support inherent methods; all operations
25-
// on them are defined on traits, which are then reexported from
25+
// on them are defined on traits, which are then re-exported from
2626
// the prelude for convenience. So there are a lot of traits here.
2727
//
2828
// The layout of this file is thus:
@@ -1237,6 +1237,43 @@ macro_rules! iterator {
12371237
}
12381238
accum
12391239
}
1240+
1241+
#[inline]
1242+
#[rustc_inherit_overflow_checks]
1243+
fn position<P>(&mut self, mut predicate: P) -> Option<usize> where
1244+
Self: Sized,
1245+
P: FnMut(Self::Item) -> bool,
1246+
{
1247+
// The addition might panic on overflow
1248+
let n = self.len();
1249+
self.try_fold(0, move |i, x| {
1250+
if predicate(x) { Err(i) }
1251+
else { Ok(i + 1) }
1252+
}).err()
1253+
.map(|i| {
1254+
unsafe { assume(i < n) };
1255+
i
1256+
})
1257+
}
1258+
1259+
#[inline]
1260+
fn rposition<P>(&mut self, mut predicate: P) -> Option<usize> where
1261+
P: FnMut(Self::Item) -> bool,
1262+
Self: Sized + ExactSizeIterator + DoubleEndedIterator
1263+
{
1264+
// No need for an overflow check here, because `ExactSizeIterator`
1265+
// implies that the number of elements fits into a `usize`.
1266+
let n = self.len();
1267+
self.try_rfold(n, move |i, x| {
1268+
let i = i - 1;
1269+
if predicate(x) { Err(i) }
1270+
else { Ok(i) }
1271+
}).err()
1272+
.map(|i| {
1273+
unsafe { assume(i < n) };
1274+
i
1275+
})
1276+
}
12401277
}
12411278

12421279
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)