Skip to content

Commit cc22428

Browse files
committed
Auto merge of #52802 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests Successful merges: - #52702 (Suggest fix when encountering different mutability from impl to trait) - #52703 (Improve a few vectors - calculate capacity or build from iterators) - #52740 (Suggest underscore when using dashes in crate namet push fork) - #52759 (Impl Send & Sync for JoinHandle) - #52760 (rustc_metadata: test loading atoi instead of cos) - #52763 (Omit the vendor component in Fuchsia triple) - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag) - #52769 (Incorporate a stray test) - #52777 (Fix doc comment for 'ptr::copy_to' method) - #52779 (revert accidental atty downgrade) - #52781 (Use a slice where a vector is not necessary) Failed merges: r? @ghost
2 parents 0560747 + 59f8422 commit cc22428

File tree

43 files changed

+185
-113
lines changed

Some content is hidden

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

43 files changed

+185
-113
lines changed

src/Cargo.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ dependencies = [
8787

8888
[[package]]
8989
name = "atty"
90-
version = "0.2.10"
90+
version = "0.2.11"
9191
source = "registry+https://github.com/rust-lang/crates.io-index"
9292
dependencies = [
9393
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -187,7 +187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
187187
name = "cargo"
188188
version = "0.30.0"
189189
dependencies = [
190-
"atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
190+
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
191191
"bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
192192
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
193193
"core-foundation 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -303,7 +303,7 @@ version = "2.32.0"
303303
source = "registry+https://github.com/rust-lang/crates.io-index"
304304
dependencies = [
305305
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
306-
"atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
306+
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
307307
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
308308
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
309309
"textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -622,7 +622,7 @@ name = "env_logger"
622622
version = "0.5.10"
623623
source = "registry+https://github.com/rust-lang/crates.io-index"
624624
dependencies = [
625-
"atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
625+
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
626626
"humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
627627
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
628628
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1844,7 +1844,7 @@ name = "rustc-ap-rustc_errors"
18441844
version = "182.0.0"
18451845
source = "registry+https://github.com/rust-lang/crates.io-index"
18461846
dependencies = [
1847-
"atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
1847+
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
18481848
"rustc-ap-rustc_data_structures 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
18491849
"rustc-ap-serialize 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
18501850
"rustc-ap-syntax_pos 182.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2097,7 +2097,7 @@ dependencies = [
20972097
name = "rustc_errors"
20982098
version = "0.0.0"
20992099
dependencies = [
2100-
"atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
2100+
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
21012101
"rustc_data_structures 0.0.0",
21022102
"serialize 0.0.0",
21032103
"syntax_pos 0.0.0",
@@ -3056,7 +3056,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
30563056
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
30573057
"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
30583058
"checksum assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98589b0e465a6c510d95fceebd365bb79bedece7f6e18a480897f2015f85ec51"
3059-
"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1"
3059+
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
30603060
"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
30613061
"checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e"
30623062
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ COPY scripts/sccache.sh /scripts/
3434
RUN sh /scripts/sccache.sh
3535

3636
ENV \
37-
AR_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-ar \
38-
CC_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang \
39-
CXX_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang++ \
40-
AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \
41-
CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \
42-
CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \
37+
AR_x86_64_fuchsia=x86_64-fuchsia-ar \
38+
CC_x86_64_fuchsia=x86_64-fuchsia-clang \
39+
CXX_x86_64_fuchsia=x86_64-fuchsia-clang++ \
40+
AR_aarch64_fuchsia=aarch64-fuchsia-ar \
41+
CC_aarch64_fuchsia=aarch64-fuchsia-clang \
42+
CXX_aarch64_fuchsia=aarch64-fuchsia-clang++ \
4343
AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-ar \
4444
CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-gcc \
4545
CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-g++ \
4646
AR_x86_64_sun_solaris=x86_64-sun-solaris2.10-ar \
4747
CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \
4848
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++
4949

50-
ENV TARGETS=x86_64-unknown-fuchsia
51-
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
50+
ENV TARGETS=x86_64-fuchsia
51+
ENV TARGETS=$TARGETS,aarch64-fuchsia
5252
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
5353
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
5454
ENV TARGETS=$TARGETS,x86_64-sun-solaris

src/ci/docker/dist-various-2/build-fuchsia-toolchain.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ build() {
3939
esac
4040

4141
hide_output make -j$(getconf _NPROCESSORS_ONLN) $tgt
42-
dst=/usr/local/${arch}-unknown-fuchsia
42+
dst=/usr/local/${arch}-fuchsia
4343
mkdir -p $dst
4444
cp -a build-${tgt}/sysroot/include $dst/
4545
cp -a build-${tgt}/sysroot/lib $dst/
@@ -55,11 +55,11 @@ rm -rf zircon
5555

5656
for arch in x86_64 aarch64; do
5757
for tool in clang clang++; do
58-
cat >/usr/local/bin/${arch}-unknown-fuchsia-${tool} <<EOF
58+
cat >/usr/local/bin/${arch}-fuchsia-${tool} <<EOF
5959
#!/bin/sh
60-
${tool} --target=${arch}-unknown-fuchsia --sysroot=/usr/local/${arch}-unknown-fuchsia "\$@"
60+
${tool} --target=${arch}-fuchsia --sysroot=/usr/local/${arch}-fuchsia "\$@"
6161
EOF
62-
chmod +x /usr/local/bin/${arch}-unknown-fuchsia-${tool}
62+
chmod +x /usr/local/bin/${arch}-fuchsia-${tool}
6363
done
64-
ln -s /usr/local/bin/llvm-ar /usr/local/bin/${arch}-unknown-fuchsia-ar
64+
ln -s /usr/local/bin/llvm-ar /usr/local/bin/${arch}-fuchsia-ar
6565
done

src/liballoc/tests/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#![feature(try_reserve)]
2525
#![feature(unboxed_closures)]
2626
#![feature(exact_chunks)]
27+
#![feature(repeat_generic_slice)]
2728

2829
extern crate alloc_system;
2930
extern crate core;

src/liballoc/tests/slice.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,3 +1529,14 @@ fn panic_safe() {
15291529
}
15301530
}
15311531
}
1532+
1533+
#[test]
1534+
fn repeat_generic_slice() {
1535+
assert_eq!([1, 2].repeat(2), vec![1, 2, 1, 2]);
1536+
assert_eq!([1, 2, 3, 4].repeat(0), vec![]);
1537+
assert_eq!([1, 2, 3, 4].repeat(1), vec![1, 2, 3, 4]);
1538+
assert_eq!(
1539+
[1, 2, 3, 4].repeat(3),
1540+
vec![1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
1541+
);
1542+
}

src/libcore/ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,8 @@ impl<T: ?Sized> *const T {
11621162
///
11631163
/// Care must be taken with the ownership of `self` and `dest`.
11641164
/// This method semantically moves the values of `self` into `dest`.
1165-
/// However it does not drop the contents of `self`, or prevent the contents
1166-
/// of `dest` from being dropped or used.
1165+
/// However it does not drop the contents of `dest`, or prevent the contents
1166+
/// of `self` from being dropped or used.
11671167
///
11681168
/// # Examples
11691169
///

src/librustc/hir/lowering.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ impl<'a> LoweringContext<'a> {
746746
// This is used to track which lifetimes have already been defined, and
747747
// which are new in-band lifetimes that need to have a definition created
748748
// for them.
749-
fn with_in_scope_lifetime_defs<T, F>(&mut self, params: &Vec<GenericParam>, f: F) -> T
749+
fn with_in_scope_lifetime_defs<T, F>(&mut self, params: &[GenericParam], f: F) -> T
750750
where
751751
F: FnOnce(&mut LoweringContext) -> T,
752752
{
@@ -2237,7 +2237,7 @@ impl<'a> LoweringContext<'a> {
22372237

22382238
fn lower_generic_params(
22392239
&mut self,
2240-
params: &Vec<GenericParam>,
2240+
params: &[GenericParam],
22412241
add_bounds: &NodeMap<Vec<GenericBound>>,
22422242
mut itctx: ImplTraitContext,
22432243
) -> hir::HirVec<hir::GenericParam> {

src/librustc/hir/map/hir_id_validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'a, 'hir: 'a> HirIdValidator<'a, 'hir> {
105105
.collect();
106106

107107
// Try to map those to something more useful
108-
let mut missing_items = vec![];
108+
let mut missing_items = Vec::with_capacity(missing.len());
109109

110110
for local_id in missing {
111111
let hir_id = HirId {

src/librustc/ich/hcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for Span {
396396
pub fn hash_stable_trait_impls<'a, 'gcx, W, R>(
397397
hcx: &mut StableHashingContext<'a>,
398398
hasher: &mut StableHasher<W>,
399-
blanket_impls: &Vec<DefId>,
399+
blanket_impls: &[DefId],
400400
non_blanket_impls: &HashMap<fast_reject::SimplifiedType, Vec<DefId>, R>)
401401
where W: StableHasherResult,
402402
R: std_hash::BuildHasher,

src/librustc/infer/outlives/obligations.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,7 @@ where
505505
}
506506

507507
fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> {
508-
let mut bounds = vec![];
509-
510-
for subty in ty.walk_shallow() {
511-
bounds.push(self.type_bound(subty));
512-
}
508+
let mut bounds = ty.walk_shallow().map(|subty| self.type_bound(subty)).collect::<Vec<_>>();
513509

514510
let mut regions = ty.regions();
515511
regions.retain(|r| !r.is_late_bound()); // ignore late-bound regions

0 commit comments

Comments
 (0)