Skip to content

Commit c4cca3a

Browse files
committed
Auto merge of #44936 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 15 pull requests - Successful merges: #44124, #44287, #44320, #44694, #44708, #44794, #44797, #44824, #44836, #44840, #44845, #44854, #44889, #44900, #44903 - Failed merges:
2 parents 4491ea5 + d6451f0 commit c4cca3a

Some content is hidden

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

47 files changed

+458
-318
lines changed

src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl<'a> Builder<'a> {
306306
Subcommand::Bench { ref paths, .. } => (Kind::Bench, &paths[..]),
307307
Subcommand::Dist { ref paths } => (Kind::Dist, &paths[..]),
308308
Subcommand::Install { ref paths } => (Kind::Install, &paths[..]),
309-
Subcommand::Clean => panic!(),
309+
Subcommand::Clean { .. } => panic!(),
310310
};
311311

312312
let builder = Builder {

src/bootstrap/clean.rs

+20-15
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,37 @@
1313
//! Responsible for cleaning out a build directory of all old and stale
1414
//! artifacts to prepare for a fresh build. Currently doesn't remove the
1515
//! `build/cache` directory (download cache) or the `build/$target/llvm`
16-
//! directory as we want that cached between builds.
16+
//! directory unless the --all flag is present.
1717
1818
use std::fs;
1919
use std::io::{self, ErrorKind};
2020
use std::path::Path;
2121

2222
use Build;
2323

24-
pub fn clean(build: &Build) {
24+
pub fn clean(build: &Build, all: bool) {
2525
rm_rf("tmp".as_ref());
26-
rm_rf(&build.out.join("tmp"));
27-
rm_rf(&build.out.join("dist"));
2826

29-
for host in &build.hosts {
30-
let entries = match build.out.join(host).read_dir() {
31-
Ok(iter) => iter,
32-
Err(_) => continue,
33-
};
27+
if all {
28+
rm_rf(&build.out);
29+
} else {
30+
rm_rf(&build.out.join("tmp"));
31+
rm_rf(&build.out.join("dist"));
3432

35-
for entry in entries {
36-
let entry = t!(entry);
37-
if entry.file_name().to_str() == Some("llvm") {
38-
continue
33+
for host in &build.hosts {
34+
let entries = match build.out.join(host).read_dir() {
35+
Ok(iter) => iter,
36+
Err(_) => continue,
37+
};
38+
39+
for entry in entries {
40+
let entry = t!(entry);
41+
if entry.file_name().to_str() == Some("llvm") {
42+
continue
43+
}
44+
let path = t!(entry.path().canonicalize());
45+
rm_rf(&path);
3946
}
40-
let path = t!(entry.path().canonicalize());
41-
rm_rf(&path);
4247
}
4348
}
4449
}

src/bootstrap/flags.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ pub enum Subcommand {
6060
paths: Vec<PathBuf>,
6161
test_args: Vec<String>,
6262
},
63-
Clean,
63+
Clean {
64+
all: bool,
65+
},
6466
Dist {
6567
paths: Vec<PathBuf>,
6668
},
@@ -147,6 +149,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
147149
opts.optmulti("", "test-args", "extra arguments", "ARGS");
148150
},
149151
"bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); },
152+
"clean" => { opts.optflag("", "all", "clean all build artifacts"); },
150153
_ => { },
151154
};
152155

@@ -250,17 +253,18 @@ Arguments:
250253
}
251254
});
252255

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

259262
let maybe_rules_help = Builder::get_help(&build, subcommand.as_str());
260263
extra_help.push_str(maybe_rules_help.unwrap_or_default().as_str());
261-
} else {
262-
extra_help.push_str(format!("Run `./x.py {} -h -v` to see a list of available paths.",
263-
subcommand).as_str());
264+
} else if subcommand.as_str() != "clean" {
265+
extra_help.push_str(format!(
266+
"Run `./x.py {} -h -v` to see a list of available paths.",
267+
subcommand).as_str());
264268
}
265269

266270
// User passed in -h/--help?
@@ -290,10 +294,13 @@ Arguments:
290294
}
291295
"clean" => {
292296
if paths.len() > 0 {
293-
println!("\nclean takes no arguments\n");
297+
println!("\nclean does not take a path argument\n");
294298
usage(1, &opts, &subcommand_help, &extra_help);
295299
}
296-
Subcommand::Clean
300+
301+
Subcommand::Clean {
302+
all: matches.opt_present("all"),
303+
}
297304
}
298305
"dist" => {
299306
Subcommand::Dist {

src/bootstrap/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ impl Build {
345345
job::setup(self);
346346
}
347347

348-
if let Subcommand::Clean = self.config.cmd {
349-
return clean::clean(self);
348+
if let Subcommand::Clean { all } = self.config.cmd {
349+
return clean::clean(self, all);
350350
}
351351

352352
self.verbose("finding compilers");

src/bootstrap/native.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ impl Step for Openssl {
367367
if !ok {
368368
panic!("failed to download openssl source")
369369
}
370-
let mut shasum = if target.contains("apple") {
370+
let mut shasum = if target.contains("apple") || build.build.contains("netbsd") {
371371
let mut cmd = Command::new("shasum");
372372
cmd.arg("-a").arg("256");
373373
cmd
@@ -387,7 +387,7 @@ impl Step for Openssl {
387387
let dst = build.openssl_install_dir(target).unwrap();
388388
drop(fs::remove_dir_all(&obj));
389389
drop(fs::remove_dir_all(&dst));
390-
build.run(Command::new("tar").arg("xf").arg(&tarball).current_dir(&out));
390+
build.run(Command::new("tar").arg("zxf").arg(&tarball).current_dir(&out));
391391

392392
let mut configure = Command::new("perl");
393393
configure.arg(obj.join("Configure"));

src/ci/docker/disabled/aarch64-gnu/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ WORKDIR /build
3131
# The `config` config file was a previously generated config file for
3232
# the kernel. This file was generated by running `make defconfig`
3333
# followed by `make menuconfig` and then enabling the IPv6 protocol page.
34-
COPY disabled/aarch64-gnu/config /build/.config
34+
COPY aarch64-gnu/config /build/.config
3535
RUN curl https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.42.tar.xz | \
3636
tar xJf - && \
3737
cd /build/linux-4.4.42 && \

src/ci/docker/disabled/wasm32-exp/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1717

1818
# emscripten
1919
COPY scripts/emscripten-wasm.sh /scripts/
20-
COPY disabled/wasm32-exp/node.sh /usr/local/bin/node
20+
COPY wasm32-exp/node.sh /usr/local/bin/node
2121
RUN bash /scripts/emscripten-wasm.sh
2222

2323
# cache

src/ci/docker/run.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
3636
echo Cannot run disabled images on travis!
3737
exit 1
3838
fi
39-
retry docker \
39+
# retry messes with the pipe from tar to docker. Not needed on non-travis
40+
# Transform changes the context of disabled Dockerfiles to match the enabled ones
41+
tar --transform 's#^./disabled/#./#' -C $docker_dir -c . | docker \
4042
build \
4143
--rm \
4244
-t rust-ci \
43-
-f "$docker_dir/disabled/$image/Dockerfile" \
44-
"$docker_dir"
45+
-f "$image/Dockerfile" \
46+
-
4547
else
4648
echo Invalid image: $image
4749
exit 1

src/liballoc/vec.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ impl<T> Vec<T> {
19501950
/// assert_eq!(u, &[1, 2]);
19511951
/// ```
19521952
#[inline]
1953-
#[stable(feature = "vec_splice", since = "1.22.0")]
1953+
#[stable(feature = "vec_splice", since = "1.21.0")]
19541954
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
19551955
where R: RangeArgument<usize>, I: IntoIterator<Item=T>
19561956
{
@@ -2553,13 +2553,13 @@ impl<'a, T> InPlace<T> for PlaceBack<'a, T> {
25532553
/// [`splice()`]: struct.Vec.html#method.splice
25542554
/// [`Vec`]: struct.Vec.html
25552555
#[derive(Debug)]
2556-
#[stable(feature = "vec_splice", since = "1.22.0")]
2556+
#[stable(feature = "vec_splice", since = "1.21.0")]
25572557
pub struct Splice<'a, I: Iterator + 'a> {
25582558
drain: Drain<'a, I::Item>,
25592559
replace_with: I,
25602560
}
25612561

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

@@ -2572,18 +2572,18 @@ impl<'a, I: Iterator> Iterator for Splice<'a, I> {
25722572
}
25732573
}
25742574

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

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

25852585

2586-
#[stable(feature = "vec_splice", since = "1.22.0")]
2586+
#[stable(feature = "vec_splice", since = "1.21.0")]
25872587
impl<'a, I: Iterator> Drop for Splice<'a, I> {
25882588
fn drop(&mut self) {
25892589
// exhaust drain first

src/libcore/cmp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
456456
/// assert_eq!(2, 1.max(2));
457457
/// assert_eq!(2, 2.max(2));
458458
/// ```
459-
#[stable(feature = "ord_max_min", since = "1.22.0")]
459+
#[stable(feature = "ord_max_min", since = "1.21.0")]
460460
fn max(self, other: Self) -> Self
461461
where Self: Sized {
462462
if other >= self { other } else { self }
@@ -472,7 +472,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
472472
/// assert_eq!(1, 1.min(2));
473473
/// assert_eq!(2, 2.min(2));
474474
/// ```
475-
#[stable(feature = "ord_max_min", since = "1.22.0")]
475+
#[stable(feature = "ord_max_min", since = "1.21.0")]
476476
fn min(self, other: Self) -> Self
477477
where Self: Sized {
478478
if self <= other { self } else { other }

src/libcore/fmt/mod.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,14 @@ impl<'a> Display for Arguments<'a> {
488488
/// The origin is: Point { x: 0, y: 0 }
489489
/// ```
490490
///
491-
/// There are a number of `debug_*` methods on `Formatter` to help you with manual
491+
/// There are a number of `debug_*` methods on [`Formatter`] to help you with manual
492492
/// implementations, such as [`debug_struct`][debug_struct].
493493
///
494494
/// `Debug` implementations using either `derive` or the debug builder API
495-
/// on `Formatter` support pretty printing using the alternate flag: `{:#?}`.
495+
/// on [`Formatter`] support pretty printing using the alternate flag: `{:#?}`.
496496
///
497497
/// [debug_struct]: ../../std/fmt/struct.Formatter.html#method.debug_struct
498+
/// [`Formatter`]: ../../std/fmt/struct.Formatter.html
498499
///
499500
/// Pretty printing with `#?`:
500501
///
@@ -1321,8 +1322,11 @@ impl<'a> Formatter<'a> {
13211322
self.flags & (1 << FlagV1::SignAwareZeroPad as u32) != 0
13221323
}
13231324

1324-
/// Creates a `DebugStruct` builder designed to assist with creation of
1325-
/// `fmt::Debug` implementations for structs.
1325+
/// Creates a [`DebugStruct`] builder designed to assist with creation of
1326+
/// [`fmt::Debug`] implementations for structs.
1327+
///
1328+
/// [`DebugStruct`]: ../../std/fmt/struct.DebugStruct.html
1329+
/// [`fmt::Debug`]: ../../std/fmt/trait.Debug.html
13261330
///
13271331
/// # Examples
13281332
///

src/libcore/internal_macros.rs

+19
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,22 @@ macro_rules! forward_ref_binop {
6868
}
6969
}
7070
}
71+
72+
// implements "T op= &U", based on "T op= U"
73+
// where U is expected to be `Copy`able
74+
macro_rules! forward_ref_op_assign {
75+
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
76+
forward_ref_op_assign!(impl $imp, $method for $t, $u,
77+
#[stable(feature = "op_assign_builtins_by_ref", since = "1.22.0")]);
78+
};
79+
(impl $imp:ident, $method:ident for $t:ty, $u:ty, #[$attr:meta]) => {
80+
#[$attr]
81+
impl<'a> $imp<&'a $u> for $t {
82+
#[inline]
83+
fn $method(&mut self, other: &'a $u) {
84+
$imp::$method(self, *other);
85+
}
86+
}
87+
}
88+
}
89+

src/libcore/iter/iterator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ pub trait Iterator {
518518
/// .for_each(|(i, x)| println!("{}:{}", i, x));
519519
/// ```
520520
#[inline]
521-
#[stable(feature = "iterator_for_each", since = "1.22.0")]
521+
#[stable(feature = "iterator_for_each", since = "1.21.0")]
522522
fn for_each<F>(self, mut f: F) where
523523
Self: Sized, F: FnMut(Self::Item),
524524
{

src/libcore/iter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ impl<I> Iterator for Cycle<I> where I: Clone + Iterator {
558558
#[unstable(feature = "fused", issue = "35602")]
559559
impl<I> FusedIterator for Cycle<I> where I: Clone + Iterator {}
560560

561-
/// An adapter for stepping iterators by a custom amount.
561+
/// An iterator for stepping iterators by a custom amount.
562562
///
563563
/// This `struct` is created by the [`step_by`] method on [`Iterator`]. See
564564
/// its documentation for more.

src/libcore/marker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub trait Sized {
122122
/// [RFC982]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
123123
/// [nomicon-coerce]: ../../nomicon/coercions.html
124124
#[unstable(feature = "unsize", issue = "27732")]
125-
#[lang="unsize"]
125+
#[lang = "unsize"]
126126
pub trait Unsize<T: ?Sized> {
127127
// Empty.
128128
}

src/libcore/mem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
402402
/// }
403403
/// ```
404404
#[inline]
405-
#[stable(feature = "needs_drop", since = "1.22.0")]
405+
#[stable(feature = "needs_drop", since = "1.21.0")]
406406
pub fn needs_drop<T>() -> bool {
407407
unsafe { intrinsics::needs_drop::<T>() }
408408
}

0 commit comments

Comments
 (0)