Skip to content
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

Rollup of 8 pull requests #49374

Closed
wants to merge 21 commits into from
Closed
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
908328f
Document when types have OS-dependent sizes
Phlosioneer Mar 11, 2018
e63b1a0
Remove "and may change between Rust releases"
Phlosioneer Mar 11, 2018
68d6edd
Some comments and documentation for name resolution crate
vorner Feb 18, 2018
38cbdcd
Use an uninitialized buffer in GenericRadix::fmt_int, like in Display…
glandium Mar 17, 2018
deae8de
Clarify AcqRel's docs
steveklabnik Mar 19, 2018
1af952c
Remove StdioRaw doc additions, add backticks
Phlosioneer Mar 20, 2018
433a03e
fixup! Some comments and documentation for name resolution crate
vorner Mar 24, 2018
efd0442
Add backticks
Phlosioneer Mar 25, 2018
f198b0a
Fix confusing doc for `scan`
chisophugis Mar 25, 2018
23013c7
update wording as per feedback
steveklabnik Mar 25, 2018
fbec3ec
Implement get_key_value for HashMap, BTreeMap
Diggsey Dec 25, 2017
ac54e85
Fix pretty-printing for raw identifiers
petrochenkov Mar 25, 2018
bd28641
rustbuild: Disable docs on cross-compiled builds
alexcrichton Mar 19, 2018
da2e92e
Rollup merge of #48693 - vorner:doc-name-resolution, r=petrochenkov
kennytm Mar 26, 2018
9cc0545
Rollup merge of #48932 - Phlosioneer:43601-document-opaque-size, r=Ko…
kennytm Mar 26, 2018
abd08d9
Rollup merge of #49103 - glandium:uninitialized, r=cramertj
kennytm Mar 26, 2018
a81aeaa
Rollup merge of #49170 - steveklabnik:gh49127, r=nagisa
kennytm Mar 26, 2018
ede4cd9
Rollup merge of #49187 - alexcrichton:no-cross-docs, r=kennytm
kennytm Mar 26, 2018
ca521d3
Rollup merge of #49346 - Diggsey:hashmap-get-pair, r=Mark-Simulacrum
kennytm Mar 26, 2018
6fe9ce2
Rollup merge of #49353 - chisophugis:patch-1, r=Mark-Simulacrum
kennytm Mar 26, 2018
7ad1889
Rollup merge of #49369 - petrochenkov:rprint, r=oli-obk
kennytm Mar 26, 2018
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
11 changes: 5 additions & 6 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl Step for Std {
copy_musl_third_party_objects(build, target, &libdir);
}

let out_dir = build.stage_out(compiler, Mode::Libstd);
let out_dir = build.cargo_out(compiler, Mode::Libstd, target);
build.clear_if_dirty(&out_dir, &builder.rustc(compiler));
let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "build");
std_cargo(builder, &compiler, target, &mut cargo);
Expand Down Expand Up @@ -360,7 +360,7 @@ impl Step for Test {
return;
}

let out_dir = build.stage_out(compiler, Mode::Libtest);
let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
build.clear_if_dirty(&out_dir, &libstd_stamp(build, compiler, target));
let mut cargo = builder.cargo(compiler, Mode::Libtest, target, "build");
test_cargo(build, &compiler, target, &mut cargo);
Expand Down Expand Up @@ -482,10 +482,9 @@ impl Step for Rustc {
compiler: builder.compiler(self.compiler.stage, build.build),
target: build.build,
});

let stage_out = builder.stage_out(compiler, Mode::Librustc);
build.clear_if_dirty(&stage_out, &libstd_stamp(build, compiler, target));
build.clear_if_dirty(&stage_out, &libtest_stamp(build, compiler, target));
let cargo_out = builder.cargo_out(compiler, Mode::Librustc, target);
build.clear_if_dirty(&cargo_out, &libstd_stamp(build, compiler, target));
build.clear_if_dirty(&cargo_out, &libtest_stamp(build, compiler, target));

let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "build");
rustc_cargo(build, &mut cargo);
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ impl Step for Rustdoc {
};

builder.ensure(compile::Rustc { compiler: build_compiler, target });
builder.ensure(compile::Rustc {
compiler: build_compiler,
target: builder.build.build,
});

let mut cargo = prepare_tool_cargo(builder,
build_compiler,
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-aarch64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnueabi-gcc \

ENV HOSTS=aarch64-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
3 changes: 2 additions & 1 deletion src/ci/docker/dist-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ ENV RUST_CONFIGURE_ARGS \
--armv7-linux-androideabi-ndk=/android/ndk/arm-14 \
--i686-linux-android-ndk=/android/ndk/x86-14 \
--aarch64-linux-android-ndk=/android/ndk/arm64-21 \
--x86_64-linux-android-ndk=/android/ndk/x86_64-21
--x86_64-linux-android-ndk=/android/ndk/x86_64-21 \
--disable-docs

ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-arm-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc \

ENV HOSTS=arm-unknown-linux-gnueabi

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-armhf-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \

ENV HOSTS=arm-unknown-linux-gnueabihf

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-armv7-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \

ENV HOSTS=armv7-unknown-linux-gnueabihf

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
3 changes: 2 additions & 1 deletion src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ RUN sh /scripts/sccache.sh
ENV RUST_CONFIGURE_ARGS \
--musl-root-i586=/musl-i586 \
--musl-root-i686=/musl-i686 \
--enable-extended
--enable-extended \
--disable-docs

# Newer binutils broke things on some vms/distros (i.e., linking against
# unknown relocs disabled by the following flag), so we need to go out of our
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-i686-freebsd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ ENV \

ENV HOSTS=i686-unknown-freebsd

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-mips-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ RUN sh /scripts/sccache.sh

ENV HOSTS=mips-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-mips64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ RUN sh /scripts/sccache.sh

ENV HOSTS=mips64-unknown-linux-gnuabi64

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-mips64el-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ RUN sh /scripts/sccache.sh

ENV HOSTS=mips64el-unknown-linux-gnuabi64

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-mipsel-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ RUN sh /scripts/sccache.sh

ENV HOSTS=mipsel-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-powerpc-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ENV \

ENV HOSTS=powerpc-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS

# FIXME(#36150) this will fail the bootstrap. Probably means something bad is
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-powerpc64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ ENV \

ENV HOSTS=powerpc64-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-powerpc64le-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ ENV \

ENV HOSTS=powerpc64le-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-s390x-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ ENV \

ENV HOSTS=s390x-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
3 changes: 2 additions & 1 deletion src/ci/docker/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ ENV RUST_CONFIGURE_ARGS \
--musl-root-aarch64=/musl-aarch64 \
--musl-root-mips=/musl-mips \
--musl-root-mipsel=/musl-mipsel \
--enable-emscripten
--enable-emscripten \
--disable-docs

ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-various-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ ENV TARGETS=$TARGETS,x86_64-sun-solaris
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
ENV TARGETS=$TARGETS,x86_64-unknown-cloudabi

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
2 changes: 1 addition & 1 deletion src/ci/docker/dist-x86_64-freebsd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ ENV \

ENV HOSTS=x86_64-unknown-freebsd

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
3 changes: 2 additions & 1 deletion src/ci/docker/dist-x86_64-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS \
--musl-root-x86_64=/musl-x86_64 \
--enable-extended
--enable-extended \
--disable-docs

# Newer binutils broke things on some vms/distros (i.e., linking against
# unknown relocs disabled by the following flag), so we need to go out of our
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-x86_64-netbsd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ ENV \

ENV HOSTS=x86_64-unknown-netbsd

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
27 changes: 27 additions & 0 deletions src/liballoc/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,33 @@ impl<K: Ord, V> BTreeMap<K, V> {
}
}

/// Returns the key-value pair corresponding to the supplied key.
///
/// The supplied key may be any borrowed form of the map's key type, but the ordering
/// on the borrowed form *must* match the ordering on the key type.
///
/// # Examples
///
/// ```
/// #![feature(map_get_key_value)]
/// use std::collections::BTreeMap;
///
/// let mut map = BTreeMap::new();
/// map.insert(1, "a");
/// assert_eq!(map.get_key_value(&1), Some((&1, &"a")));
/// assert_eq!(map.get_key_value(&2), None);
/// ```
#[unstable(feature = "map_get_key_value", issue = "49347")]
pub fn get_key_value<Q: ?Sized>(&self, k: &Q) -> Option<(&K, &V)>
where K: Borrow<Q>,
Q: Ord
{
match search::search_tree(self.root.as_ref(), k) {
Found(handle) => Some(handle.into_kv()),
GoDown(_) => None,
}
}

/// Returns `true` if the map contains a value for the specified key.
///
/// The key may be any borrowed form of the map's key type, but the ordering
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ trait GenericRadix {
// characters for a base 2 number.
let zero = T::zero();
let is_nonnegative = x >= zero;
let mut buf = [0; 128];
let mut buf: [u8; 128] = unsafe { mem::uninitialized() };
let mut curr = buf.len();
let base = T::from_u8(Self::BASE);
if is_nonnegative {
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,13 +974,13 @@ pub trait Iterator {
/// // each iteration, we'll multiply the state by the element
/// *state = *state * x;
///
/// // the value passed on to the next iteration
/// Some(*state)
/// // then, we'll yield the negation of the state
/// Some(-*state)
/// });
///
/// assert_eq!(iter.next(), Some(1));
/// assert_eq!(iter.next(), Some(2));
/// assert_eq!(iter.next(), Some(6));
/// assert_eq!(iter.next(), Some(-1));
/// assert_eq!(iter.next(), Some(-2));
/// assert_eq!(iter.next(), Some(-6));
/// assert_eq!(iter.next(), None);
/// ```
#[inline]
Expand Down
7 changes: 5 additions & 2 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ pub enum Ordering {
/// [`Release`]: http://llvm.org/docs/Atomics.html#release
#[stable(feature = "rust1", since = "1.0.0")]
Acquire,
/// When coupled with a load, uses [`Acquire`] ordering, and with a store
/// [`Release`] ordering.
/// Has the effects of both [`Acquire`] and [`Release`] together.
///
/// This ordering is only applicable for operations that combine both loads and stores.
///
/// For loads it uses [`Acquire`] ordering. For stores it uses the [`Release`] ordering.
///
/// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire
/// [`Release`]: http://llvm.org/docs/Atomics.html#release
Expand Down
8 changes: 6 additions & 2 deletions src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub use self::AnnNode::*;
use syntax::abi::Abi;
use syntax::ast;
use syntax::codemap::{CodeMap, Spanned};
use syntax::parse::ParseSess;
use syntax::parse::{token, ParseSess};
use syntax::parse::lexer::comments;
use syntax::print::pp::{self, Breaks};
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
Expand Down Expand Up @@ -1561,7 +1561,11 @@ impl<'a> State<'a> {
}

pub fn print_name(&mut self, name: ast::Name) -> io::Result<()> {
self.s.word(&name.as_str())?;
if token::is_raw_guess(ast::Ident::with_empty_ctxt(name)) {
self.s.word(&format!("r#{}", name))?;
} else {
self.s.word(&name.as_str())?;
}
self.ann.post(self, NodeName(&name))
}

Expand Down
Loading