Auto merge of #41086 - frewsxcv:rollup, r=frewsxcv

Rollup of 19 pull requests

- Successful merges: #40608, #40870, #40949, #40977, #40981, #40988, #40992, #40997, #40999, #41007, #41014, #41019, #41035, #41043, #41049, #41062, #41066, #41076, #41085
- Failed merges:
This commit is contained in:
bors
2017-04-05 16:47:45 +00:00
66 changed files with 522 additions and 245 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ matrix:
os: osx
osx_image: xcode8.2
install: &osx_install_sccache >
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-apple-darwin &&
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-apple-darwin &&
chmod +x /usr/local/bin/sccache &&
travis_retry curl -o /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
chmod +x /usr/local/bin/stamp
+2 -2
View File
@@ -115,8 +115,8 @@ install:
- set PATH=C:\Python27;%PATH%
# Download and install sccache
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-pc-windows-msvc
- mv 2017-03-24-sccache-x86_64-pc-windows-msvc sccache.exe
- appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-pc-windows-msvc
- mv 2017-04-04-sccache-x86_64-pc-windows-msvc sccache.exe
- set PATH=%PATH%;%CD%
# Download and install ninja
+1 -1
View File
@@ -74,7 +74,7 @@ RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static
RUN curl -O http://ftp.nl.debian.org/debian/dists/jessie/main/installer-armhf/current/images/device-tree/vexpress-v2p-ca15-tc1.dtb
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -62,7 +62,7 @@ RUN ./build-toolchains.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/aarch64-unknown-linux-gnueabi/bin
+1 -1
View File
@@ -32,7 +32,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV TARGETS=arm-linux-androideabi
+1 -1
View File
@@ -62,7 +62,7 @@ RUN ./build-toolchains.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabi/bin
+1 -1
View File
@@ -62,7 +62,7 @@ RUN ./build-toolchains.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabihf/bin
+1 -1
View File
@@ -62,7 +62,7 @@ RUN ./build-toolchains.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/armv7-unknown-linux-gnueabihf/bin
+1 -1
View File
@@ -29,7 +29,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV \
@@ -26,7 +26,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV RUST_CONFIGURE_ARGS \
+1 -1
View File
@@ -25,7 +25,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV \
+1 -1
View File
@@ -82,7 +82,7 @@ RUN curl -Lo /rustroot/dumb-init \
ENTRYPOINT ["/rustroot/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV HOSTS=i686-unknown-linux-gnu
+1 -1
View File
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -63,7 +63,7 @@ RUN ./build-powerpc-toolchain.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/powerpc-unknown-linux-gnu/bin
@@ -63,7 +63,7 @@ RUN ./build-powerpc64-toolchain.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/powerpc64-unknown-linux-gnu/bin
@@ -63,7 +63,7 @@ COPY shared.sh build-powerpc64le-toolchain.sh /tmp/
RUN ./build-powerpc64le-toolchain.sh
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV \
+1 -1
View File
@@ -63,7 +63,7 @@ RUN ./build-s390x-toolchain.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/s390x-ibm-linux-gnu/bin
+1 -1
View File
@@ -25,7 +25,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV \
+1 -1
View File
@@ -82,7 +82,7 @@ RUN curl -Lo /rustroot/dumb-init \
ENTRYPOINT ["/rustroot/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV HOSTS=x86_64-unknown-linux-gnu
+1 -1
View File
@@ -26,7 +26,7 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV RUST_CONFIGURE_ARGS \
+1 -1
View File
@@ -62,7 +62,7 @@ RUN ./build-netbsd-toolchain.sh
USER root
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
ENV PATH=$PATH:/x-tools/x86_64-unknown-netbsd/bin
+1 -1
View File
@@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
lib32stdc++6
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
@@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+1 -1
View File
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-24-sccache-x86_64-unknown-linux-musl && \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-04-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
-1
View File
@@ -209,5 +209,4 @@
- [windows_handle](windows-handle.md)
- [windows_net](windows-net.md)
- [windows_stdio](windows-stdio.md)
- [windows_subsystem](windows-subsystem.md)
- [zero_one](zero-one.md)
@@ -1,10 +0,0 @@
# `windows_subsystem`
The tracking issue for this feature is: [#37499]
[#37499]: https://github.com/rust-lang/rust/issues/37499
------------------------
+2 -2
View File
@@ -697,8 +697,8 @@ pub fn split_off(&mut self, at: usize) -> LinkedList<T> {
/// Returns a place for insertion at the front of the list.
///
/// Using this method with placement syntax is equivalent to [`push_front`]
/// (#method.push_front), but may be more efficient.
/// Using this method with placement syntax is equivalent to
/// [`push_front`](#method.push_front), but may be more efficient.
///
/// # Examples
///
+3 -2
View File
@@ -678,8 +678,9 @@ pub unsafe fn set_len(&mut self, len: usize) {
self.len = len;
}
/// Removes an element from anywhere in the vector and return it, replacing
/// it with the last element.
/// Removes an element from the vector and returns it.
///
/// The removed element is replaced by the last element of the vector.
///
/// This does not preserve ordering, but is O(1).
///
+9 -9
View File
@@ -635,7 +635,7 @@ pub fn shrink_to_fit(&mut self) {
}
}
/// Shortens a `VecDeque`, dropping excess elements from the back.
/// Shortens the `VecDeque`, dropping excess elements from the back.
///
/// If `len` is greater than the `VecDeque`'s current length, this has no
/// effect.
@@ -941,7 +941,7 @@ pub fn contains(&self, x: &T) -> bool
a.contains(x) || b.contains(x)
}
/// Provides a reference to the front element, or `None` if the sequence is
/// Provides a reference to the front element, or `None` if the `VecDeque` is
/// empty.
///
/// # Examples
@@ -966,7 +966,7 @@ pub fn front(&self) -> Option<&T> {
}
/// Provides a mutable reference to the front element, or `None` if the
/// sequence is empty.
/// `VecDeque` is empty.
///
/// # Examples
///
@@ -993,7 +993,7 @@ pub fn front_mut(&mut self) -> Option<&mut T> {
}
}
/// Provides a reference to the back element, or `None` if the sequence is
/// Provides a reference to the back element, or `None` if the `VecDeque` is
/// empty.
///
/// # Examples
@@ -1018,7 +1018,7 @@ pub fn back(&self) -> Option<&T> {
}
/// Provides a mutable reference to the back element, or `None` if the
/// sequence is empty.
/// `VecDeque` is empty.
///
/// # Examples
///
@@ -1046,7 +1046,7 @@ pub fn back_mut(&mut self) -> Option<&mut T> {
}
}
/// Removes the first element and returns it, or `None` if the sequence is
/// Removes the first element and returns it, or `None` if the `VecDeque` is
/// empty.
///
/// # Examples
@@ -1073,7 +1073,7 @@ pub fn pop_front(&mut self) -> Option<T> {
}
}
/// Inserts an element first in the sequence.
/// Prepends an element to the `VecDeque`.
///
/// # Examples
///
@@ -1096,7 +1096,7 @@ pub fn push_front(&mut self, value: T) {
}
}
/// Appends an element to the back of a buffer
/// Appends an element to the back of the `VecDeque`.
///
/// # Examples
///
@@ -1117,7 +1117,7 @@ pub fn push_back(&mut self, value: T) {
unsafe { self.buffer_write(head, value) }
}
/// Removes the last element from a buffer and returns it, or `None` if
/// Removes the last element from the `VecDeque` and returns it, or `None` if
/// it is empty.
///
/// # Examples
+57 -39
View File
@@ -61,16 +61,18 @@
/// `std::sync::atomic` types via the `compare_exchange` method by passing
/// [`Ordering::SeqCst`](../../std/sync/atomic/enum.Ordering.html)
/// as both the `success` and `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
/// `std::sync::atomic` types via the `compare_exchange` method by passing
/// [`Ordering::Acquire`](../../std/sync/atomic/enum.Ordering.html)
/// as both the `success` and `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_acq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -79,8 +81,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_rel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -89,16 +92,18 @@
/// as the `success` and
/// [`Ordering::Acquire`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_acqrel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
/// `std::sync::atomic` types via the `compare_exchange` method by passing
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as both the `success` and `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -107,8 +112,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -117,8 +123,9 @@
/// as the `success` and
/// [`Ordering::Acquire`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_failacq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -127,8 +134,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_acq_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -137,8 +145,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange).
/// [`AtomicBool::compare_exchange`][compare_exchange].
///
/// [compare_exchange]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange
pub fn atomic_cxchg_acqrel_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
@@ -146,16 +155,18 @@
/// `std::sync::atomic` types via the `compare_exchange_weak` method by passing
/// [`Ordering::SeqCst`](../../std/sync/atomic/enum.Ordering.html)
/// as both the `success` and `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
/// `std::sync::atomic` types via the `compare_exchange_weak` method by passing
/// [`Ordering::Acquire`](../../std/sync/atomic/enum.Ordering.html)
/// as both the `success` and `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_acq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -164,8 +175,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_rel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -174,16 +186,18 @@
/// as the `success` and
/// [`Ordering::Acquire`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_acqrel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
/// `std::sync::atomic` types via the `compare_exchange_weak` method by passing
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as both the `success` and `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -192,8 +206,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -202,8 +217,9 @@
/// as the `success` and
/// [`Ordering::Acquire`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_failacq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -212,8 +228,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_acq_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Stores a value if the current value is the same as the `old` value.
/// The stabilized version of this intrinsic is available on the
@@ -222,8 +239,9 @@
/// as the `success` and
/// [`Ordering::Relaxed`](../../std/sync/atomic/enum.Ordering.html)
/// as the `failure` parameters. For example,
/// [`AtomicBool::compare_exchange_weak`]
/// (../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak).
/// [`AtomicBool::compare_exchange_weak`][cew].
///
/// [cew]: ../../std/sync/atomic/struct.AtomicBool.html#method.compare_exchange_weak
pub fn atomic_cxchgweak_acqrel_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
/// Loads the current value of the pointer.
@@ -1253,17 +1271,17 @@ pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
#[cfg(not(stage0))]
pub fn unchecked_shr<T>(x: T, y: T) -> T;
/// Returns (a + b) mod 2^N, where N is the width of T in bits.
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.
/// The stabilized versions of this intrinsic are available on the integer
/// primitives via the `wrapping_add` method. For example,
/// [`std::u32::wrapping_add`](../../std/primitive.u32.html#method.wrapping_add)
pub fn overflowing_add<T>(a: T, b: T) -> T;
/// Returns (a - b) mod 2^N, where N is the width of T in bits.
/// Returns (a - b) mod 2<sup>N</sup>, where N is the width of T in bits.
/// The stabilized versions of this intrinsic are available on the integer
/// primitives via the `wrapping_sub` method. For example,
/// [`std::u32::wrapping_sub`](../../std/primitive.u32.html#method.wrapping_sub)
pub fn overflowing_sub<T>(a: T, b: T) -> T;
/// Returns (a * b) mod 2^N, where N is the width of T in bits.
/// Returns (a * b) mod 2<sup>N</sup>, where N is the width of T in bits.
/// The stabilized versions of this intrinsic are available on the integer
/// primitives via the `wrapping_mul` method. For example,
/// [`std::u32::wrapping_mul`](../../std/primitive.u32.html#method.wrapping_mul)
+7 -6
View File
@@ -10,12 +10,12 @@
//! Bit fiddling on positive IEEE 754 floats. Negative numbers aren't and needn't be handled.
//! Normal floating point numbers have a canonical representation as (frac, exp) such that the
//! value is 2^exp * (1 + sum(frac[N-i] / 2^i)) where N is the number of bits. Subnormals are
//! slightly different and weird, but the same principle applies.
//! value is 2<sup>exp</sup> * (1 + sum(frac[N-i] / 2<sup>i</sup>)) where N is the number of bits.
//! Subnormals are slightly different and weird, but the same principle applies.
//!
//! Here, however, we represent them as (sig, k) with f positive, such that the value is f * 2^e.
//! Besides making the "hidden bit" explicit, this changes the exponent by the so-called
//! mantissa shift.
//! Here, however, we represent them as (sig, k) with f positive, such that the value is f *
//! 2<sup>e</sup>. Besides making the "hidden bit" explicit, this changes the exponent by the
//! so-called mantissa shift.
//!
//! Put another way, normally floats are written as (1) but here they are written as (2):
//!
@@ -94,7 +94,8 @@ fn integer_decode2(self) -> (u64, i16, i8) {
/// represented, the other code in this module makes sure to never let that happen.
fn from_int(x: u64) -> Self;
/// Get the value 10^e from a pre-computed table. Panics for e >= ceil_log5_of_max_sig().
/// Get the value 10<sup>e</sup> from a pre-computed table. Panics for e >=
/// ceil_log5_of_max_sig().
fn short_fast_pow10(e: usize) -> Self;
// FIXME Everything that follows should be associated constants, but taking the value of an
+21 -3
View File
@@ -894,9 +894,15 @@ impl<A> ExactSizeIterator for Item<A> {}
impl<A> FusedIterator for Item<A> {}
unsafe impl<A> TrustedLen for Item<A> {}
/// An iterator over a reference of the contained item in an [`Option`].
/// An iterator over a reference to the [`Some`] variant of an [`Option`].
///
/// The iterator yields one value if the [`Option`] is a [`Some`], otherwise none.
///
/// This `struct` is created by the [`Option::iter`] function.
///
/// [`Option`]: enum.Option.html
/// [`Some`]: enum.Option.html#variant.Some
/// [`Option::iter`]: enum.Option.html#method.iter
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)]
pub struct Iter<'a, A: 'a> { inner: Item<&'a A> }
@@ -933,9 +939,15 @@ fn clone(&self) -> Iter<'a, A> {
}
}
/// An iterator over a mutable reference of the contained item in an [`Option`].
/// An iterator over a mutable reference to the [`Some`] variant of an [`Option`].
///
/// The iterator yields one value if the [`Option`] is a [`Some`], otherwise none.
///
/// This `struct` is created by the [`Option::iter_mut`] function.
///
/// [`Option`]: enum.Option.html
/// [`Some`]: enum.Option.html#variant.Some
/// [`Option::iter_mut`]: enum.Option.html#method.iter_mut
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)]
pub struct IterMut<'a, A: 'a> { inner: Item<&'a mut A> }
@@ -964,9 +976,15 @@ impl<'a, A> FusedIterator for IterMut<'a, A> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<'a, A> TrustedLen for IterMut<'a, A> {}
/// An iterator over the item contained inside an [`Option`].
/// An iterator over the value in [`Some`] variant of an [`Option`].
///
/// The iterator yields one value if the [`Option`] is a [`Some`], otherwise none.
///
/// This `struct` is created by the [`Option::into_iter`] function.
///
/// [`Option`]: enum.Option.html
/// [`Some`]: enum.Option.html#variant.Some
/// [`Option::into_iter`]: enum.Option.html#method.into_iter
#[derive(Clone, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct IntoIter<A> { inner: Item<A> }
+23 -11
View File
@@ -152,11 +152,16 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Section: Creating a string
*/
/// Errors which can occur when attempting to interpret a sequence of `u8`
/// Errors which can occur when attempting to interpret a sequence of [`u8`]
/// as a string.
///
/// As such, the `from_utf8` family of functions and methods for both `String`s
/// and `&str`s make use of this error, for example.
/// [`u8`]: ../../std/primitive.u8.html
///
/// As such, the `from_utf8` family of functions and methods for both [`String`]s
/// and [`&str`]s make use of this error, for example.
///
/// [`String`]: ../../std/string/struct.String.html#method.from_utf8
/// [`&str`]: ../../std/str/fn.from_utf8.html
#[derive(Copy, Eq, PartialEq, Clone, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Utf8Error {
@@ -210,11 +215,15 @@ pub fn error_len(&self) -> Option<usize> {
/// Converts a slice of bytes to a string slice.
///
/// A string slice (`&str`) is made of bytes (`u8`), and a byte slice (`&[u8]`)
/// is made of bytes, so this function converts between the two. Not all byte
/// slices are valid string slices, however: `&str` requires that it is valid
/// UTF-8. `from_utf8()` checks to ensure that the bytes are valid UTF-8, and
/// then does the conversion.
/// A string slice ([`&str`]) is made of bytes ([`u8`]), and a byte slice
/// ([`&[u8]`][byteslice]) is made of bytes, so this function converts between
/// the two. Not all byte slices are valid string slices, however: [`&str`] requires
/// that it is valid UTF-8. `from_utf8()` checks to ensure that the bytes are valid
/// UTF-8, and then does the conversion.
///
/// [`&str`]: ../../std/primitive.str.html
/// [`u8`]: ../../std/primitive.u8.html
/// [byteslice]: ../../std/primitive.slice.html
///
/// If you are sure that the byte slice is valid UTF-8, and you don't want to
/// incur the overhead of the validity check, there is an unsafe version of
@@ -228,9 +237,12 @@ pub fn error_len(&self) -> Option<usize> {
///
/// [string]: ../../std/string/struct.String.html#method.from_utf8
///
/// Because you can stack-allocate a `[u8; N]`, and you can take a `&[u8]` of
/// it, this function is one way to have a stack-allocated string. There is
/// an example of this in the examples section below.
/// Because you can stack-allocate a `[u8; N]`, and you can take a
/// [`&[u8]`][byteslice] of it, this function is one way to have a
/// stack-allocated string. There is an example of this in the
/// examples section below.
///
/// [byteslice]: ../../std/primitive.slice.html
///
/// # Errors
///
+1 -1
View File
@@ -267,7 +267,7 @@ pub fn checked_mul(self, count: u64, dl: &TargetDataLayout) -> Option<Size> {
/// Alignment of a type in bytes, both ABI-mandated and preferred.
/// Since alignments are always powers of 2, we can pack both in one byte,
/// giving each a nibble (4 bits) for a maximum alignment of 2^15 = 32768.
/// giving each a nibble (4 bits) for a maximum alignment of 2<sup>15</sup> = 32768.
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
pub struct Align {
raw: u8
+3 -4
View File
@@ -1358,10 +1358,9 @@ pub fn build_output_filenames(input: &Input,
.values()
.filter(|a| a.is_none())
.count();
let ofile = if unnamed_output_types > 1 &&
sess.opts.output_types.contains_key(&OutputType::Exe) {
sess.warn("ignoring specified output filename for 'link' output because multiple \
outputs were requested");
let ofile = if unnamed_output_types > 1 {
sess.warn("due to multiple output types requested, the explicitly specified \
output file name will be adapted for each output type");
None
} else {
Some(out_file.clone())
+15 -11
View File
@@ -196,19 +196,23 @@ pub fn report_method_error(&self,
let field_ty = field.ty(tcx, substs);
if self.is_fn_ty(&field_ty, span) {
err.help(&format!("use `({0}.{1})(...)` if you \
meant to call the function \
stored in the `{1}` field",
expr_string,
item_name));
if tcx.vis_is_accessible_from(field.vis, self.body_id) {
if self.is_fn_ty(&field_ty, span) {
err.help(&format!("use `({0}.{1})(...)` if you \
meant to call the function \
stored in the `{1}` field",
expr_string,
item_name));
} else {
err.help(&format!("did you mean to write `{0}.{1}` \
instead of `{0}.{1}(...)`?",
expr_string,
item_name));
}
err.span_label(span, &"field, not a method");
} else {
err.help(&format!("did you mean to write `{0}.{1}` \
instead of `{0}.{1}(...)`?",
expr_string,
item_name));
err.span_label(span, &"private field, not a method");
}
err.span_label(span, &"field, not a method");
break;
}
}
+12 -4
View File
@@ -427,12 +427,15 @@ fn list_item(parser: &mut ParserWrapper, buffer: &mut String,
looper(parser, &mut content, Some(x), toc_builder, shorter, &mut None);
}
}
if shorter.is_compact() {
break
}
}
buffer.push_str(&format!("<li>{}</li>", content));
}
fn list(parser: &mut ParserWrapper, buffer: &mut String, toc_builder: &mut Option<TocBuilder>,
shorter: MarkdownOutputStyle) {
shorter: MarkdownOutputStyle, is_sorted_list: bool) {
debug!("List");
let mut content = String::new();
while let Some(event) = parser.next() {
@@ -445,8 +448,13 @@ fn list(parser: &mut ParserWrapper, buffer: &mut String, toc_builder: &mut Optio
looper(parser, &mut content, Some(x), toc_builder, shorter, &mut None);
}
}
if shorter.is_compact() {
break
}
}
buffer.push_str(&format!("<ul>{}</ul>", content));
buffer.push_str(&format!("<{0}>{1}</{0}>",
if is_sorted_list { "ol" } else { "ul" },
content));
}
fn emphasis(parser: &mut ParserWrapper, buffer: &mut String,
@@ -516,8 +524,8 @@ fn looper<'a>(parser: &'a mut ParserWrapper, buffer: &mut String, next_event: Op
Event::Start(Tag::BlockQuote) => {
blockquote(parser, buffer, toc_builder, shorter);
}
Event::Start(Tag::List(_)) => {
list(parser, buffer, toc_builder, shorter);
Event::Start(Tag::List(x)) => {
list(parser, buffer, toc_builder, shorter, x.is_some());
}
Event::Start(Tag::Emphasis) => {
emphasis(parser, buffer, toc_builder, shorter, id);
+58 -8
View File
@@ -9,6 +9,20 @@
// except according to those terms.
//! Operations on ASCII strings and characters.
//!
//! Most string operations in Rust act on UTF-8 strings. However, at times it
//! makes more sense to only consider the ASCII character set for a specific
//! operation.
//!
//! The [`AsciiExt`] trait provides methods that allow for character
//! operations that only act on the ASCII subset and leave non-ASCII characters
//! alone.
//!
//! The [`escape_default`] function provides an iterator over the bytes of an
//! escaped version of the character given.
//!
//! [`AsciiExt`]: trait.AsciiExt.html
//! [`escape_default`]: fn.escape_default.html
#![stable(feature = "rust1", since = "1.0.0")]
@@ -53,11 +67,11 @@ pub trait AsciiExt {
/// use std::ascii::AsciiExt;
///
/// let ascii = 'a';
/// let utf8 = '❤';
/// let non_ascii = '❤';
/// let int_ascii = 97;
///
/// assert!(ascii.is_ascii());
/// assert!(!utf8.is_ascii());
/// assert!(!non_ascii.is_ascii());
/// assert!(int_ascii.is_ascii());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
@@ -79,11 +93,11 @@ pub trait AsciiExt {
/// use std::ascii::AsciiExt;
///
/// let ascii = 'a';
/// let utf8 = '❤';
/// let non_ascii = '❤';
/// let int_ascii = 97;
///
/// assert_eq!('A', ascii.to_ascii_uppercase());
/// assert_eq!('❤', utf8.to_ascii_uppercase());
/// assert_eq!('❤', non_ascii.to_ascii_uppercase());
/// assert_eq!(65, int_ascii.to_ascii_uppercase());
/// ```
///
@@ -108,11 +122,11 @@ pub trait AsciiExt {
/// use std::ascii::AsciiExt;
///
/// let ascii = 'A';
/// let utf8 = '❤';
/// let non_ascii = '❤';
/// let int_ascii = 65;
///
/// assert_eq!('a', ascii.to_ascii_lowercase());
/// assert_eq!('❤', utf8.to_ascii_lowercase());
/// assert_eq!('❤', non_ascii.to_ascii_lowercase());
/// assert_eq!(97, int_ascii.to_ascii_lowercase());
/// ```
///
@@ -934,8 +948,12 @@ fn is_ascii_control(&self) -> bool {
}
}
/// An iterator over the escaped version of a byte, constructed via
/// `std::ascii::escape_default`.
/// An iterator over the escaped version of a byte.
///
/// This `struct` is created by the [`escape_default`] function. See its
/// documentation for more.
///
/// [`escape_default`]: fn.escape_default.html
#[stable(feature = "rust1", since = "1.0.0")]
pub struct EscapeDefault {
range: Range<usize>,
@@ -966,6 +984,38 @@ pub struct EscapeDefault {
///
/// assert_eq!(b'\\', escaped.next().unwrap());
/// assert_eq!(b't', escaped.next().unwrap());
///
/// let mut escaped = ascii::escape_default(b'\r');
///
/// assert_eq!(b'\\', escaped.next().unwrap());
/// assert_eq!(b'r', escaped.next().unwrap());
///
/// let mut escaped = ascii::escape_default(b'\n');
///
/// assert_eq!(b'\\', escaped.next().unwrap());
/// assert_eq!(b'n', escaped.next().unwrap());
///
/// let mut escaped = ascii::escape_default(b'\'');
///
/// assert_eq!(b'\\', escaped.next().unwrap());
/// assert_eq!(b'\'', escaped.next().unwrap());
///
/// let mut escaped = ascii::escape_default(b'"');
///
/// assert_eq!(b'\\', escaped.next().unwrap());
/// assert_eq!(b'"', escaped.next().unwrap());
///
/// let mut escaped = ascii::escape_default(b'\\');
///
/// assert_eq!(b'\\', escaped.next().unwrap());
/// assert_eq!(b'\\', escaped.next().unwrap());
///
/// let mut escaped = ascii::escape_default(b'\x9d');
///
/// assert_eq!(b'\\', escaped.next().unwrap());
/// assert_eq!(b'x', escaped.next().unwrap());
/// assert_eq!(b'9', escaped.next().unwrap());
/// assert_eq!(b'd', escaped.next().unwrap());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn escape_default(c: u8) -> EscapeDefault {
+6 -3
View File
@@ -1726,9 +1726,9 @@ pub fn new() -> DirBuilder {
}
}
/// Indicate that directories create should be created recursively, creating
/// all parent directories if they do not exist with the same security and
/// permissions settings.
/// Indicates that directories should be created recursively, creating all
/// parent directories. Parents that do not exist are created with the same
/// security and permissions settings.
///
/// This option defaults to `false`.
///
@@ -1749,6 +1749,9 @@ pub fn recursive(&mut self, recursive: bool) -> &mut Self {
/// Create the specified directory with the options configured in this
/// builder.
///
/// It is considered an error if the directory already exists unless
/// recursive mode is enabled.
///
/// # Examples
///
/// ```no_run
+4 -5
View File
@@ -50,12 +50,11 @@ struct BarrierState {
generation_id: usize,
}
/// A result returned from wait.
/// A `BarrierWaitResult` is returned by [`wait`] when all threads in the [`Barrier`]
/// have rendezvoused.
///
/// Currently this opaque structure only has one method, [`.is_leader`]. Only
/// one thread will receive a result that will return `true` from this function.
///
/// [`.is_leader`]: #method.is_leader
/// [`wait`]: struct.Barrier.html#method.wait
/// [`Barrier`]: struct.Barrier.html
///
/// # Examples
///
+172 -46
View File
@@ -13,40 +13,50 @@
//! This module provides message-based communication over channels, concretely
//! defined among three types:
//!
//! * `Sender`
//! * `SyncSender`
//! * `Receiver`
//! * [`Sender`]
//! * [`SyncSender`]
//! * [`Receiver`]
//!
//! A `Sender` or `SyncSender` is used to send data to a `Receiver`. Both
//! A [`Sender`] or [`SyncSender`] is used to send data to a [`Receiver`]. Both
//! senders are clone-able (multi-producer) such that many threads can send
//! simultaneously to one receiver (single-consumer).
//!
//! These channels come in two flavors:
//!
//! 1. An asynchronous, infinitely buffered channel. The `channel()` function
//! 1. An asynchronous, infinitely buffered channel. The [`channel`] function
//! will return a `(Sender, Receiver)` tuple where all sends will be
//! **asynchronous** (they never block). The channel conceptually has an
//! infinite buffer.
//!
//! 2. A synchronous, bounded channel. The `sync_channel()` function will return
//! a `(SyncSender, Receiver)` tuple where the storage for pending messages
//! is a pre-allocated buffer of a fixed size. All sends will be
//! 2. A synchronous, bounded channel. The [`sync_channel`] function will
//! return a `(SyncSender, Receiver)` tuple where the storage for pending
//! messages is a pre-allocated buffer of a fixed size. All sends will be
//! **synchronous** by blocking until there is buffer space available. Note
//! that a bound of 0 is allowed, causing the channel to become a
//! "rendezvous" channel where each sender atomically hands off a message to
//! a receiver.
//! that a bound of 0 is allowed, causing the channel to become a "rendezvous"
//! channel where each sender atomically hands off a message to a receiver.
//!
//! [`Sender`]: ../../../std/sync/mpsc/struct.Sender.html
//! [`SyncSender`]: ../../../std/sync/mpsc/struct.SyncSender.html
//! [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html
//! [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
//! [`channel`]: ../../../std/sync/mpsc/fn.channel.html
//! [`sync_channel`]: ../../../std/sync/mpsc/fn.sync_channel.html
//!
//! ## Disconnection
//!
//! The send and receive operations on channels will all return a `Result`
//! The send and receive operations on channels will all return a [`Result`]
//! indicating whether the operation succeeded or not. An unsuccessful operation
//! is normally indicative of the other half of a channel having "hung up" by
//! being dropped in its corresponding thread.
//!
//! Once half of a channel has been deallocated, most operations can no longer
//! continue to make progress, so `Err` will be returned. Many applications will
//! continue to `unwrap()` the results returned from this module, instigating a
//! propagation of failure among threads if one unexpectedly dies.
//! continue to make progress, so [`Err`] will be returned. Many applications
//! will continue to [`unwrap`] the results returned from this module,
//! instigating a propagation of failure among threads if one unexpectedly dies.
//!
//! [`Result`]: ../../../std/result/enum.Result.html
//! [`Err`]: ../../../std/result/enum.Result.html#variant.Err
//! [`unwrap`]: ../../../std/result/enum.Result.html#method.unwrap
//!
//! # Examples
//!
@@ -288,7 +298,31 @@
mod spsc_queue;
/// The receiving-half of Rust's channel type. This half can only be owned by
/// one thread
/// one thread.
///
/// Messages sent to the channel can be retrieved using [`recv`].
///
/// [`recv`]: ../../../std/sync/mpsc/struct.Receiver.html#method.recv
///
/// # Examples
///
/// ```rust
/// use std::sync::mpsc::channel;
/// use std::thread;
/// use std::time::Duration;
///
/// let (send, recv) = channel();
///
/// thread::spawn(move || {
/// send.send("Hello world!").unwrap();
/// thread::sleep(Duration::from_secs(2)); // block for two seconds
/// send.send("Delayed for 2 seconds").unwrap();
/// });
///
/// println!("{}", recv.recv().unwrap()); // Received immediately
/// println!("Waiting...");
/// println!("{}", recv.recv().unwrap()); // Received after 2 seconds
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Receiver<T> {
inner: UnsafeCell<Flavor<T>>,
@@ -302,9 +336,12 @@ unsafe impl<T: Send> Send for Receiver<T> { }
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> !Sync for Receiver<T> { }
/// An iterator over messages on a receiver, this iterator will block
/// whenever `next` is called, waiting for a new message, and `None` will be
/// returned when the corresponding channel has hung up.
/// An iterator over messages on a receiver, this iterator will block whenever
/// [`next`] is called, waiting for a new message, and [`None`] will be returned
/// when the corresponding channel has hung up.
///
/// [`next`]: ../../../std/iter/trait.Iterator.html#tymethod.next
/// [`None`]: ../../../std/option/enum.Option.html#variant.None
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)]
pub struct Iter<'a, T: 'a> {
@@ -312,11 +349,13 @@ pub struct Iter<'a, T: 'a> {
}
/// An iterator that attempts to yield all pending values for a receiver.
/// `None` will be returned when there are no pending values remaining or
/// if the corresponding channel has hung up.
/// [`None`] will be returned when there are no pending values remaining or if
/// the corresponding channel has hung up.
///
/// This Iterator will never block the caller in order to wait for data to
/// become available. Instead, it will return `None`.
/// become available. Instead, it will return [`None`].
///
/// [`None`]: ../../../std/option/enum.Option.html#variant.None
#[stable(feature = "receiver_try_iter", since = "1.15.0")]
#[derive(Debug)]
pub struct TryIter<'a, T: 'a> {
@@ -324,8 +363,12 @@ pub struct TryIter<'a, T: 'a> {
}
/// An owning iterator over messages on a receiver, this iterator will block
/// whenever `next` is called, waiting for a new message, and `None` will be
/// whenever [`next`] is called, waiting for a new message, and [`None`] will be
/// returned when the corresponding channel has hung up.
///
/// [`next`]: ../../../std/iter/trait.Iterator.html#tymethod.next
/// [`None`]: ../../../std/option/enum.Option.html#variant.None
///
#[stable(feature = "receiver_into_iter", since = "1.1.0")]
#[derive(Debug)]
pub struct IntoIter<T> {
@@ -334,6 +377,35 @@ pub struct IntoIter<T> {
/// The sending-half of Rust's asynchronous channel type. This half can only be
/// owned by one thread, but it can be cloned to send to other threads.
///
/// Messages can be sent through this channel with [`send`].
///
/// [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
///
/// # Examples
///
/// ```rust
/// use std::sync::mpsc::channel;
/// use std::thread;
///
/// let (sender, receiver) = channel();
/// let sender2 = sender.clone();
///
/// // First thread owns sender
/// thread::spawn(move || {
/// sender.send(1).unwrap();
/// });
///
/// // Second thread owns sender2
/// thread::spawn(move || {
/// sender2.send(2).unwrap();
/// });
///
/// let msg = receiver.recv().unwrap();
/// let msg2 = receiver.recv().unwrap();
///
/// assert_eq!(3, msg + msg2);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Sender<T> {
inner: UnsafeCell<Flavor<T>>,
@@ -349,6 +421,10 @@ impl<T> !Sync for Sender<T> { }
/// The sending-half of Rust's synchronous channel type. This half can only be
/// owned by one thread, but it can be cloned to send to other threads.
///
/// [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
/// [`SyncSender::send`]: ../../../std/sync/mpsc/struct.SyncSender.html#method.send
///
#[stable(feature = "rust1", since = "1.0.0")]
pub struct SyncSender<T> {
inner: Arc<sync::Packet<T>>,
@@ -360,25 +436,32 @@ unsafe impl<T: Send> Send for SyncSender<T> {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> !Sync for SyncSender<T> {}
/// An error returned from the `send` function on channels.
/// An error returned from the [`send`] function on channels.
///
/// A `send` operation can only fail if the receiving end of a channel is
/// A [`send`] operation can only fail if the receiving end of a channel is
/// disconnected, implying that the data could never be received. The error
/// contains the data being sent as a payload so it can be recovered.
///
/// [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct SendError<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);
/// An error returned from the `recv` function on a `Receiver`.
/// An error returned from the [`recv`] function on a [`Receiver`].
///
/// The `recv` operation can only fail if the sending half of a channel is
/// The [`recv`] operation can only fail if the sending half of a channel is
/// disconnected, implying that no further messages will ever be received.
///
/// [`recv`]: ../../../std/sync/mpsc/struct.Receiver.html#method.recv
/// [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct RecvError;
/// This enumeration is the list of the possible reasons that `try_recv` could
/// This enumeration is the list of the possible reasons that [`try_recv`] could
/// not return data when called.
///
/// [`try_recv`]: ../../../std/sync/mpsc/struct.Receiver.html#method.try_recv
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub enum TryRecvError {
@@ -393,8 +476,10 @@ pub enum TryRecvError {
Disconnected,
}
/// This enumeration is the list of possible errors that `recv_timeout` could
/// This enumeration is the list of possible errors that [`recv_timeout`] could
/// not return data when called.
///
/// [`recv_timeout`]: ../../../std/sync/mpsc/struct.Receiver.html#method.recv_timeout
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[stable(feature = "mpsc_recv_timeout", since = "1.12.0")]
pub enum RecvTimeoutError {
@@ -409,7 +494,9 @@ pub enum RecvTimeoutError {
}
/// This enumeration is the list of the possible error outcomes for the
/// `SyncSender::try_send` method.
/// [`SyncSender::try_send`] method.
///
/// [`SyncSender::try_send`]: ../../../std/sync/mpsc/struct.SyncSender.html#method.try_send
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum TrySendError<T> {
@@ -556,10 +643,13 @@ fn new(inner: Flavor<T>) -> Sender<T> {
/// A successful send occurs when it is determined that the other end of
/// the channel has not hung up already. An unsuccessful send would be one
/// where the corresponding receiver has already been deallocated. Note
/// that a return value of `Err` means that the data will never be
/// received, but a return value of `Ok` does *not* mean that the data
/// that a return value of [`Err`] means that the data will never be
/// received, but a return value of [`Ok`] does *not* mean that the data
/// will be received. It is possible for the corresponding receiver to
/// hang up immediately after this function returns `Ok`.
/// hang up immediately after this function returns [`Ok`].
///
/// [`Err`]: ../../../std/result/enum.Result.html#variant.Err
/// [`Ok`]: ../../../std/result/enum.Result.html#variant.Ok
///
/// This method will never block the current thread.
///
@@ -702,9 +792,12 @@ fn new(inner: Arc<sync::Packet<T>>) -> SyncSender<T> {
/// time. If the buffer size is 0, however, it can be guaranteed that the
/// receiver has indeed received the data if this function returns success.
///
/// This function will never panic, but it may return `Err` if the
/// `Receiver` has disconnected and is no longer able to receive
/// This function will never panic, but it may return [`Err`] if the
/// [`Receiver`] has disconnected and is no longer able to receive
/// information.
///
/// [`Err`]: ../../../std/result/enum.Result.html#variant.Err
/// [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html
#[stable(feature = "rust1", since = "1.0.0")]
pub fn send(&self, t: T) -> Result<(), SendError<T>> {
self.inner.send(t).map_err(SendError)
@@ -712,13 +805,16 @@ pub fn send(&self, t: T) -> Result<(), SendError<T>> {
/// Attempts to send a value on this channel without blocking.
///
/// This method differs from `send` by returning immediately if the
/// This method differs from [`send`] by returning immediately if the
/// channel's buffer is full or no receiver is waiting to acquire some
/// data. Compared with `send`, this function has two failure cases
/// data. Compared with [`send`], this function has two failure cases
/// instead of one (one for disconnection, one for a full buffer).
///
/// See `SyncSender::send` for notes about guarantees of whether the
/// See [`SyncSender::send`] for notes about guarantees of whether the
/// receiver has received the data or not if this function is successful.
///
/// [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
/// [`SyncSender::send`]: ../../../std/sync/mpsc/struct.SyncSender.html#method.send
#[stable(feature = "rust1", since = "1.0.0")]
pub fn try_send(&self, t: T) -> Result<(), TrySendError<T>> {
self.inner.try_send(t)
@@ -819,15 +915,18 @@ pub fn try_recv(&self) -> Result<T, TryRecvError> {
///
/// This function will always block the current thread if there is no data
/// available and it's possible for more data to be sent. Once a message is
/// sent to the corresponding `Sender`, then this receiver will wake up and
/// sent to the corresponding [`Sender`], then this receiver will wake up and
/// return that message.
///
/// If the corresponding `Sender` has disconnected, or it disconnects while
/// this call is blocking, this call will wake up and return `Err` to
/// If the corresponding [`Sender`] has disconnected, or it disconnects while
/// this call is blocking, this call will wake up and return [`Err`] to
/// indicate that no more messages can ever be received on this channel.
/// However, since channels are buffered, messages sent before the disconnect
/// will still be properly received.
///
/// [`Sender`]: ../../../std/sync/mpsc/struct.Sender.html
/// [`Err`]: ../../../std/result/enum.Result.html#variant.Err
///
/// # Examples
///
/// ```
@@ -907,15 +1006,18 @@ pub fn recv(&self) -> Result<T, RecvError> {
///
/// This function will always block the current thread if there is no data
/// available and it's possible for more data to be sent. Once a message is
/// sent to the corresponding `Sender`, then this receiver will wake up and
/// sent to the corresponding [`Sender`], then this receiver will wake up and
/// return that message.
///
/// If the corresponding `Sender` has disconnected, or it disconnects while
/// this call is blocking, this call will wake up and return `Err` to
/// If the corresponding [`Sender`] has disconnected, or it disconnects while
/// this call is blocking, this call will wake up and return [`Err`] to
/// indicate that no more messages can ever be received on this channel.
/// However, since channels are buffered, messages sent before the disconnect
/// will still be properly received.
///
/// [`Sender`]: ../../../std/sync/mpsc/struct.Sender.html
/// [`Err`]: ../../../std/result/enum.Result.html#variant.Err
///
/// # Examples
///
/// ```no_run
@@ -993,7 +1095,29 @@ fn recv_max_until(&self, deadline: Instant) -> Result<T, RecvTimeoutError> {
}
/// Returns an iterator that will block waiting for messages, but never
/// `panic!`. It will return `None` when the channel has hung up.
/// [`panic!`]. It will return [`None`] when the channel has hung up.
///
/// [`panic!`]: ../../../std/macro.panic.html
/// [`None`]: ../../../std/option/enum.Option.html#variant.None
///
/// # Examples
///
/// ```rust
/// use std::sync::mpsc::channel;
/// use std::thread;
///
/// let (send, recv) = channel();
///
/// thread::spawn(move || {
/// send.send(1u8).unwrap();
/// send.send(2u8).unwrap();
/// send.send(3u8).unwrap();
/// });
///
/// for x in recv.iter() {
/// println!("Got: {}", x);
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn iter(&self) -> Iter<T> {
Iter { rx: self }
@@ -1001,8 +1125,10 @@ pub fn iter(&self) -> Iter<T> {
/// Returns an iterator that will attempt to yield all pending values.
/// It will return `None` if there are no more pending values or if the
/// channel has hung up. The iterator will never `panic!` or block the
/// channel has hung up. The iterator will never [`panic!`] or block the
/// user by waiting for values.
///
/// [`panic!`]: ../../../std/macro.panic.html
#[stable(feature = "receiver_try_iter", since = "1.15.0")]
pub fn try_iter(&self) -> TryIter<T> {
TryIter { rx: self }
+7 -7
View File
@@ -30,7 +30,7 @@
///
/// The mutexes in this module implement a strategy called "poisoning" where a
/// mutex is considered poisoned whenever a thread panics while holding the
/// lock. Once a mutex is poisoned, all other threads are unable to access the
/// mutex. Once a mutex is poisoned, all other threads are unable to access the
/// data by default as it is likely tainted (some invariant is not being
/// upheld).
///
@@ -115,7 +115,7 @@ pub struct Mutex<T: ?Sized> {
// Note that this mutex is in a *box*, not inlined into the struct itself.
// Once a native mutex has been used once, its address can never change (it
// can't be moved). This mutex type can be safely moved at any time, so to
// ensure that the native mutex is used correctly we box the inner lock to
// ensure that the native mutex is used correctly we box the inner mutex to
// give it a constant address.
inner: Box<sys::Mutex>,
poison: poison::Flag,
@@ -183,7 +183,7 @@ impl<T: ?Sized> Mutex<T> {
/// Acquires a mutex, blocking the current thread until it is able to do so.
///
/// This function will block the local thread until it is available to acquire
/// the mutex. Upon returning, the thread is the only thread with the mutex
/// the mutex. Upon returning, the thread is the only thread with the lock
/// held. An RAII guard is returned to allow scoped unlock of the lock. When
/// the guard goes out of scope, the mutex will be unlocked.
///
@@ -267,9 +267,9 @@ pub fn try_lock(&self) -> TryLockResult<MutexGuard<T>> {
}
}
/// Determines whether the lock is poisoned.
/// Determines whether the mutex is poisoned.
///
/// If another thread is active, the lock can still become poisoned at any
/// If another thread is active, the mutex can still become poisoned at any
/// time. You should not trust a `false` value for program correctness
/// without additional synchronization.
///
@@ -312,7 +312,7 @@ pub fn is_poisoned(&self) -> bool {
#[stable(feature = "mutex_into_inner", since = "1.6.0")]
pub fn into_inner(self) -> LockResult<T> where T: Sized {
// We know statically that there are no outstanding references to
// `self` so there's no need to lock the inner lock.
// `self` so there's no need to lock the inner mutex.
//
// To get the inner value, we'd like to call `data.into_inner()`,
// but because `Mutex` impl-s `Drop`, we can't move out of it, so
@@ -353,7 +353,7 @@ pub fn into_inner(self) -> LockResult<T> where T: Sized {
#[stable(feature = "mutex_get_mut", since = "1.6.0")]
pub fn get_mut(&mut self) -> LockResult<&mut T> {
// We know statically that there are no other references to `self`, so
// there's no need to lock the inner lock.
// there's no need to lock the inner mutex.
let data = unsafe { &mut *self.data.get() };
poison::map_result(self.poison.borrow(), |_| data )
}
-15
View File
@@ -72,13 +72,6 @@ pub trait IntoRawFd {
fn into_raw_fd(self) -> RawFd;
}
#[stable(feature = "rust1", since = "1.0.0")]
impl AsRawFd for RawFd {
fn as_raw_fd(&self) -> RawFd {
*self
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl AsRawFd for fs::File {
fn as_raw_fd(&self) -> RawFd {
@@ -91,14 +84,6 @@ unsafe fn from_raw_fd(fd: RawFd) -> fs::File {
fs::File::from_inner(sys::fs::File::from_inner(fd))
}
}
#[stable(feature = "into_raw_os", since = "1.4.0")]
impl IntoRawFd for RawFd {
fn into_raw_fd(self) -> RawFd {
self
}
}
#[stable(feature = "into_raw_os", since = "1.4.0")]
impl IntoRawFd for fs::File {
fn into_raw_fd(self) -> RawFd {
+1 -1
View File
@@ -158,7 +158,7 @@
//! [`Err`]: ../../std/result/enum.Result.html#variant.Err
//! [`panic!`]: ../../std/macro.panic.html
//! [`Builder`]: ../../std/thread/struct.Builder.html
//! [`thread::current`]: ../../std/thread/fn.spawn.html
//! [`thread::current`]: ../../std/thread/fn.current.html
//! [`Thread`]: ../../std/thread/struct.Thread.html
//! [`park`]: ../../std/thread/fn.park.html
//! [`unpark`]: ../../std/thread/struct.Thread.html#method.unpark
+3 -9
View File
@@ -292,9 +292,6 @@ pub fn new() -> Features {
// Allows attributes on lifetime/type formal parameters in generics (RFC 1327)
(active, generic_param_attrs, "1.11.0", Some(34761)),
// The #![windows_subsystem] attribute
(active, windows_subsystem, "1.14.0", Some(37499)),
// Allows #[link(..., cfg(..))]
(active, link_cfg, "1.14.0", Some(37406)),
@@ -408,7 +405,8 @@ pub fn new() -> Features {
(accepted, static_recursion, "1.17.0", Some(29719)),
// pub(restricted) visibilities (RFC 1422)
(accepted, pub_restricted, "1.17.0", Some(32409)),
// The #![windows_subsystem] attribute
(accepted, windows_subsystem, "1.18.0", Some(37499)),
);
// If you change this, please modify src/doc/unstable-book as well. You must
// move that documentation into the relevant place in the other docs, and
@@ -768,11 +766,7 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
"unboxed_closures are still evolving",
cfg_fn!(unboxed_closures))),
("windows_subsystem", Whitelisted, Gated(Stability::Unstable,
"windows_subsystem",
"the windows subsystem attribute \
is currently unstable",
cfg_fn!(windows_subsystem))),
("windows_subsystem", Whitelisted, Ungated),
("proc_macro_attribute", Normal, Gated(Stability::Unstable,
"proc_macro",
+4 -2
View File
@@ -39,8 +39,10 @@ pub trait Stats {
///
/// Note: this method sacrifices performance at the altar of accuracy
/// Depends on IEEE-754 arithmetic guarantees. See proof of correctness at:
/// ["Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates"]
/// (http://www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps)
/// ["Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric
/// Predicates"][paper]
///
/// [paper]: http://www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps
fn sum(&self) -> f64;
/// Minimum value of the samples.
@@ -10,7 +10,6 @@
// error-pattern: invalid windows subsystem `wrong`, only `windows` and `console` are allowed
#![feature(windows_subsystem)]
#![windows_subsystem = "wrong"]
fn main() {}
@@ -0,0 +1,7 @@
-include ../tools.mk
all:
$(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out 2>&1
rm $(TMPDIR)/out.ll $(TMPDIR)/out.s
$(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out2.ext 2>&1
rm $(TMPDIR)/out2.ll $(TMPDIR)/out2.s
@@ -1,4 +1,4 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@@ -8,9 +8,4 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// gate-test-windows_subsystem
#![windows_subsystem = "console"]
//~^ ERROR: the windows subsystem attribute is currently unstable
fn main() {}
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(windows_subsystem)]
#![windows_subsystem = "console"]
fn main() {}
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(windows_subsystem)]
#![windows_subsystem = "windows"]
fn main() {}
+32
View File
@@ -0,0 +1,32 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_name = "foo"]
// ignore-tidy-linelength
// @has foo/fn.f.html
// @has - "<pre class='rust fn'>pub fn f()</pre><div class='docblock'><ol><li>list<ol><li>fooooo</li><li>x</li></ol></li><li>foo</li></ol>"
/// 1. list
/// 1. fooooo
/// 2. x
/// 2. foo
pub fn f() {}
// @has foo/fn.foo2.html
// @has - "<pre class='rust fn'>pub fn foo2()</pre><div class='docblock'><ul><li>normal list<ul><li><p>sub list</p></li><li><p>new elem still same elem</p><p>and again same elem!</p></li></ul></li><li>new big elem</li></ul>"
/// * normal list
/// * sub list
/// * new elem
/// still same elem
///
/// and again same elem!
/// * new big elem
pub fn foo2() {}
@@ -0,0 +1,29 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub mod animal {
pub struct Dog {
pub age: usize,
dog_age: usize,
}
impl Dog {
pub fn new(age: usize) -> Dog {
Dog { age: age, dog_age: age * 7 }
}
}
}
fn main() {
let dog = animal::Dog::new(3);
let dog_age = dog.dog_age();
//let dog_age = dog.dog_age;
println!("{}", dog_age);
}
@@ -0,0 +1,8 @@
error: no method named `dog_age` found for type `animal::Dog` in the current scope
--> $DIR/private-field.rs:26:23
|
26 | let dog_age = dog.dog_age();
| ^^^^^^^ private field, not a method
error: aborting due to previous error