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 15 pull requests #44936

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f65bb2a
Manuall rebase of @Migi pull/41336
Eh2406 Sep 3, 2017
9a547fc
get ci green
Eh2406 Sep 3, 2017
732dd2f
Missing trailing newline
Eh2406 Sep 12, 2017
b91bac2
readd test
Eh2406 Sep 14, 2017
2c78bb4
Add --all flag to ./x.py clean
tommyip Sep 20, 2017
09d90e5
Do not show "available paths" help in ./x.py clean
tommyip Sep 20, 2017
cfc711e
fix version number
Eh2406 Sep 21, 2017
2adeba6
update xsv to head
Eh2406 Sep 21, 2017
15fa85c
extract explicit_predicates_of
Sep 23, 2017
99c0c52
docs improvement std::sync::{PoisonError, TryLockError}
lorepozo Sep 23, 2017
bc43e17
Add doc example to HashMap::hasher
napen123 Sep 23, 2017
874124b
Backport libs stabilizations to 1.21 beta
dtolnay Sep 25, 2017
d5d41f2
Add missing links in fmt module
GuillaumeGomez Sep 25, 2017
3db0094
Improve wording for StepBy
steveklabnik Sep 25, 2017
20d4c0f
Move src/librustc_mir/transform/nll.rs to a subdirectory
SimonSapin Sep 25, 2017
f7fd04a
docs improvement sync::atomic::Atomic*
lorepozo Sep 25, 2017
e58f528
merge fixes, addressing CR comments
gaurikholkar Sep 11, 2017
aa6f0c8
modify message for return time having multiple lifetimes
gaurikholkar Sep 11, 2017
bbf82be
tidy fix
gaurikholkar Sep 11, 2017
d7bb575
use present tense consistently and update references
nikomatsakis Sep 12, 2017
9e4649e
remove random newlines from error messages, fix compile-fail test
nikomatsakis Sep 12, 2017
4bbb58d
remove error code description
gaurikholkar Sep 23, 2017
5c59bba
minor fixes
gaurikholkar Sep 24, 2017
73543d5
fix test reference
nikomatsakis Sep 26, 2017
b53b853
bootstrap: use shasum(1) on NetBSD build hosts
jakllsch Aug 31, 2017
90aa66b
bootstrap: use tar -z on extract
jakllsch Aug 31, 2017
cde47ce
Remove DepNodeIndex::new is already impl for Idx
spastorino Sep 27, 2017
20fc215
Normalize spaces in lang attributes.
Havvy Sep 28, 2017
3457a22
ci: Fix building disabled containers
kallisti5 Sep 5, 2017
f407b2b
Rollup merge of #44124 - gaurikholkar:return_self, r=arielb1
Mark-Simulacrum Sep 29, 2017
f91c55e
Rollup merge of #44287 - Eh2406:master, r=aturon
Mark-Simulacrum Sep 29, 2017
20f892f
Rollup merge of #44320 - jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1a…
Mark-Simulacrum Sep 29, 2017
6bc8ca0
Rollup merge of #44694 - tommyip:make_clean, r=Mark-Simulacrum
Mark-Simulacrum Sep 29, 2017
8083877
Rollup merge of #44708 - toidiu:ak-44493, r=nikomatsakis
Mark-Simulacrum Sep 29, 2017
f2feb83
Rollup merge of #44794 - napen123:master, r=frewsxcv
Mark-Simulacrum Sep 29, 2017
b1437bc
Rollup merge of #44797 - lucasem:master, r=frewsxcv
Mark-Simulacrum Sep 29, 2017
570f1ce
Rollup merge of #44824 - dtolnay:22really21, r=alexcrichton
Mark-Simulacrum Sep 29, 2017
327cd0d
Rollup merge of #44836 - GuillaumeGomez:fmt-missing-links, r=QuietMis…
Mark-Simulacrum Sep 29, 2017
3d7a390
Rollup merge of #44840 - steveklabnik:fix-wording, r=BurntSushi
Mark-Simulacrum Sep 29, 2017
7c3d376
Rollup merge of #44845 - SimonSapin:nll_mod_rs, r=nikomatsakis
Mark-Simulacrum Sep 29, 2017
7756d39
Rollup merge of #44854 - lucasem:atomic-docs, r=steveklabnik
Mark-Simulacrum Sep 29, 2017
37c74e1
Rollup merge of #44889 - spastorino:remove_new, r=arielb1
Mark-Simulacrum Sep 29, 2017
4489a7a
Rollup merge of #44900 - Havvy:normalize-lang-attribute-spacing, r=sf…
Mark-Simulacrum Sep 29, 2017
d6451f0
Rollup merge of #44903 - kallisti5:ci-build-disabled, r=aidanhs
Mark-Simulacrum Sep 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl<'a> Builder<'a> {
Subcommand::Bench { ref paths, .. } => (Kind::Bench, &paths[..]),
Subcommand::Dist { ref paths } => (Kind::Dist, &paths[..]),
Subcommand::Install { ref paths } => (Kind::Install, &paths[..]),
Subcommand::Clean => panic!(),
Subcommand::Clean { .. } => panic!(),
};

let builder = Builder {
Expand Down
35 changes: 20 additions & 15 deletions src/bootstrap/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,37 @@
//! Responsible for cleaning out a build directory of all old and stale
//! artifacts to prepare for a fresh build. Currently doesn't remove the
//! `build/cache` directory (download cache) or the `build/$target/llvm`
//! directory as we want that cached between builds.
//! directory unless the --all flag is present.

use std::fs;
use std::io::{self, ErrorKind};
use std::path::Path;

use Build;

pub fn clean(build: &Build) {
pub fn clean(build: &Build, all: bool) {
rm_rf("tmp".as_ref());
rm_rf(&build.out.join("tmp"));
rm_rf(&build.out.join("dist"));

for host in &build.hosts {
let entries = match build.out.join(host).read_dir() {
Ok(iter) => iter,
Err(_) => continue,
};
if all {
rm_rf(&build.out);
} else {
rm_rf(&build.out.join("tmp"));
rm_rf(&build.out.join("dist"));

for entry in entries {
let entry = t!(entry);
if entry.file_name().to_str() == Some("llvm") {
continue
for host in &build.hosts {
let entries = match build.out.join(host).read_dir() {
Ok(iter) => iter,
Err(_) => continue,
};

for entry in entries {
let entry = t!(entry);
if entry.file_name().to_str() == Some("llvm") {
continue
}
let path = t!(entry.path().canonicalize());
rm_rf(&path);
}
let path = t!(entry.path().canonicalize());
rm_rf(&path);
}
}
}
Expand Down
21 changes: 14 additions & 7 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ pub enum Subcommand {
paths: Vec<PathBuf>,
test_args: Vec<String>,
},
Clean,
Clean {
all: bool,
},
Dist {
paths: Vec<PathBuf>,
},
Expand Down Expand Up @@ -147,6 +149,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
opts.optmulti("", "test-args", "extra arguments", "ARGS");
},
"bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); },
"clean" => { opts.optflag("", "all", "clean all build artifacts"); },
_ => { },
};

Expand Down Expand Up @@ -250,17 +253,18 @@ Arguments:
}
});

// All subcommands can have an optional "Available paths" section
// All subcommands except `clean` can have an optional "Available paths" section
if matches.opt_present("verbose") {
let config = Config::parse(&["build".to_string()]);
let mut build = Build::new(config);
metadata::build(&mut build);

let maybe_rules_help = Builder::get_help(&build, subcommand.as_str());
extra_help.push_str(maybe_rules_help.unwrap_or_default().as_str());
} else {
extra_help.push_str(format!("Run `./x.py {} -h -v` to see a list of available paths.",
subcommand).as_str());
} else if subcommand.as_str() != "clean" {
extra_help.push_str(format!(
"Run `./x.py {} -h -v` to see a list of available paths.",
subcommand).as_str());
}

// User passed in -h/--help?
Expand Down Expand Up @@ -290,10 +294,13 @@ Arguments:
}
"clean" => {
if paths.len() > 0 {
println!("\nclean takes no arguments\n");
println!("\nclean does not take a path argument\n");
usage(1, &opts, &subcommand_help, &extra_help);
}
Subcommand::Clean

Subcommand::Clean {
all: matches.opt_present("all"),
}
}
"dist" => {
Subcommand::Dist {
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ impl Build {
job::setup(self);
}

if let Subcommand::Clean = self.config.cmd {
return clean::clean(self);
if let Subcommand::Clean { all } = self.config.cmd {
return clean::clean(self, all);
}

self.verbose("finding compilers");
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl Step for Openssl {
if !ok {
panic!("failed to download openssl source")
}
let mut shasum = if target.contains("apple") {
let mut shasum = if target.contains("apple") || build.build.contains("netbsd") {
let mut cmd = Command::new("shasum");
cmd.arg("-a").arg("256");
cmd
Expand All @@ -387,7 +387,7 @@ impl Step for Openssl {
let dst = build.openssl_install_dir(target).unwrap();
drop(fs::remove_dir_all(&obj));
drop(fs::remove_dir_all(&dst));
build.run(Command::new("tar").arg("xf").arg(&tarball).current_dir(&out));
build.run(Command::new("tar").arg("zxf").arg(&tarball).current_dir(&out));

let mut configure = Command::new("perl");
configure.arg(obj.join("Configure"));
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/disabled/aarch64-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ WORKDIR /build
# The `config` config file was a previously generated config file for
# the kernel. This file was generated by running `make defconfig`
# followed by `make menuconfig` and then enabling the IPv6 protocol page.
COPY disabled/aarch64-gnu/config /build/.config
COPY aarch64-gnu/config /build/.config
RUN curl https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.42.tar.xz | \
tar xJf - && \
cd /build/linux-4.4.42 && \
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/disabled/wasm32-exp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

# emscripten
COPY scripts/emscripten-wasm.sh /scripts/
COPY disabled/wasm32-exp/node.sh /usr/local/bin/node
COPY wasm32-exp/node.sh /usr/local/bin/node
RUN bash /scripts/emscripten-wasm.sh

# cache
Expand Down
8 changes: 5 additions & 3 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
echo Cannot run disabled images on travis!
exit 1
fi
retry docker \
# retry messes with the pipe from tar to docker. Not needed on non-travis
# Transform changes the context of disabled Dockerfiles to match the enabled ones
tar --transform 's#^./disabled/#./#' -C $docker_dir -c . | docker \
build \
--rm \
-t rust-ci \
-f "$docker_dir/disabled/$image/Dockerfile" \
"$docker_dir"
-f "$image/Dockerfile" \
-
else
echo Invalid image: $image
exit 1
Expand Down
12 changes: 6 additions & 6 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ impl<T> Vec<T> {
/// assert_eq!(u, &[1, 2]);
/// ```
#[inline]
#[stable(feature = "vec_splice", since = "1.22.0")]
#[stable(feature = "vec_splice", since = "1.21.0")]
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
where R: RangeArgument<usize>, I: IntoIterator<Item=T>
{
Expand Down Expand Up @@ -2553,13 +2553,13 @@ impl<'a, T> InPlace<T> for PlaceBack<'a, T> {
/// [`splice()`]: struct.Vec.html#method.splice
/// [`Vec`]: struct.Vec.html
#[derive(Debug)]
#[stable(feature = "vec_splice", since = "1.22.0")]
#[stable(feature = "vec_splice", since = "1.21.0")]
pub struct Splice<'a, I: Iterator + 'a> {
drain: Drain<'a, I::Item>,
replace_with: I,
}

#[stable(feature = "vec_splice", since = "1.22.0")]
#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> Iterator for Splice<'a, I> {
type Item = I::Item;

Expand All @@ -2572,18 +2572,18 @@ impl<'a, I: Iterator> Iterator for Splice<'a, I> {
}
}

#[stable(feature = "vec_splice", since = "1.22.0")]
#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> DoubleEndedIterator for Splice<'a, I> {
fn next_back(&mut self) -> Option<Self::Item> {
self.drain.next_back()
}
}

#[stable(feature = "vec_splice", since = "1.22.0")]
#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> ExactSizeIterator for Splice<'a, I> {}


#[stable(feature = "vec_splice", since = "1.22.0")]
#[stable(feature = "vec_splice", since = "1.21.0")]
impl<'a, I: Iterator> Drop for Splice<'a, I> {
fn drop(&mut self) {
// exhaust drain first
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
/// assert_eq!(2, 1.max(2));
/// assert_eq!(2, 2.max(2));
/// ```
#[stable(feature = "ord_max_min", since = "1.22.0")]
#[stable(feature = "ord_max_min", since = "1.21.0")]
fn max(self, other: Self) -> Self
where Self: Sized {
if other >= self { other } else { self }
Expand All @@ -472,7 +472,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
/// assert_eq!(1, 1.min(2));
/// assert_eq!(2, 2.min(2));
/// ```
#[stable(feature = "ord_max_min", since = "1.22.0")]
#[stable(feature = "ord_max_min", since = "1.21.0")]
fn min(self, other: Self) -> Self
where Self: Sized {
if self <= other { self } else { other }
Expand Down
12 changes: 8 additions & 4 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,14 @@ impl<'a> Display for Arguments<'a> {
/// The origin is: Point { x: 0, y: 0 }
/// ```
///
/// There are a number of `debug_*` methods on `Formatter` to help you with manual
/// There are a number of `debug_*` methods on [`Formatter`] to help you with manual
/// implementations, such as [`debug_struct`][debug_struct].
///
/// `Debug` implementations using either `derive` or the debug builder API
/// on `Formatter` support pretty printing using the alternate flag: `{:#?}`.
/// on [`Formatter`] support pretty printing using the alternate flag: `{:#?}`.
///
/// [debug_struct]: ../../std/fmt/struct.Formatter.html#method.debug_struct
/// [`Formatter`]: ../../std/fmt/struct.Formatter.html
///
/// Pretty printing with `#?`:
///
Expand Down Expand Up @@ -1321,8 +1322,11 @@ impl<'a> Formatter<'a> {
self.flags & (1 << FlagV1::SignAwareZeroPad as u32) != 0
}

/// Creates a `DebugStruct` builder designed to assist with creation of
/// `fmt::Debug` implementations for structs.
/// Creates a [`DebugStruct`] builder designed to assist with creation of
/// [`fmt::Debug`] implementations for structs.
///
/// [`DebugStruct`]: ../../std/fmt/struct.DebugStruct.html
/// [`fmt::Debug`]: ../../std/fmt/trait.Debug.html
///
/// # Examples
///
Expand Down
19 changes: 19 additions & 0 deletions src/libcore/internal_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,22 @@ macro_rules! forward_ref_binop {
}
}
}

// implements "T op= &U", based on "T op= U"
// where U is expected to be `Copy`able
macro_rules! forward_ref_op_assign {
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
forward_ref_op_assign!(impl $imp, $method for $t, $u,
#[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]);
};
(impl $imp:ident, $method:ident for $t:ty, $u:ty, #[$attr:meta]) => {
#[$attr]
impl<'a> $imp<&'a $u> for $t {
#[inline]
fn $method(&mut self, other: &'a $u) {
$imp::$method(self, *other);
}
}
}
}

2 changes: 1 addition & 1 deletion src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ pub trait Iterator {
/// .for_each(|(i, x)| println!("{}:{}", i, x));
/// ```
#[inline]
#[stable(feature = "iterator_for_each", since = "1.22.0")]
#[stable(feature = "iterator_for_each", since = "1.21.0")]
fn for_each<F>(self, mut f: F) where
Self: Sized, F: FnMut(Self::Item),
{
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ impl<I> Iterator for Cycle<I> where I: Clone + Iterator {
#[unstable(feature = "fused", issue = "35602")]
impl<I> FusedIterator for Cycle<I> where I: Clone + Iterator {}

/// An adapter for stepping iterators by a custom amount.
/// An iterator for stepping iterators by a custom amount.
///
/// This `struct` is created by the [`step_by`] method on [`Iterator`]. See
/// its documentation for more.
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub trait Sized {
/// [RFC982]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
/// [nomicon-coerce]: ../../nomicon/coercions.html
#[unstable(feature = "unsize", issue = "27732")]
#[lang="unsize"]
#[lang = "unsize"]
pub trait Unsize<T: ?Sized> {
// Empty.
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
/// }
/// ```
#[inline]
#[stable(feature = "needs_drop", since = "1.22.0")]
#[stable(feature = "needs_drop", since = "1.21.0")]
pub fn needs_drop<T>() -> bool {
unsafe { intrinsics::needs_drop::<T>() }
}
Expand Down
Loading