diff options
| author | bors <bors@rust-lang.org> | 2020-11-06 16:12:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-06 16:12:13 +0000 |
| commit | 7e9a36fa8a4ec06daec581e23f390389e05f25e4 (patch) | |
| tree | afe67d3f71142bcd9766b5f6480c994017da6519 /src | |
| parent | dc06a36074f04c6a77b5834f2950011d49607898 (diff) | |
| parent | af50c796faaf68adf01eb16afe86f368a64cc906 (diff) | |
| download | rust-7e9a36fa8a4ec06daec581e23f390389e05f25e4.tar.gz rust-7e9a36fa8a4ec06daec581e23f390389e05f25e4.zip | |
Auto merge of #78810 - JohnTitor:rollup-8fhtvxu, r=JohnTitor
Rollup of 15 pull requests Successful merges: - #74979 (`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit) - #78006 (Use Intra-doc links for std::io::buffered) - #78167 (Fix unreachable sub-branch detection in or-patterns) - #78514 (Allow using 1/2/3/4 for `x.py setup` options) - #78538 (BTreeMap: document a curious assumption in test cases) - #78559 (Add LLVM upgrades from 7 to 10 to RELEASES.md) - #78666 (Fix shellcheck error) - #78705 (Print a summary of which test suite failed) - #78726 (Add link to rust website) - #78730 (Expand explanation of reverse_bits) - #78760 (`deny(invalid_codeblock_attributes)` for rustc_error_codes) - #78771 (inliner: Copy unevaluated constants only after successful inlining) - #78794 (rustc_expand: use collect_bang helper instead of manual reimplementation) - #78795 (The renumber pass is long gone) - #78798 (Fixing Spelling Typos) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
46 files changed, 111 insertions, 37 deletions
diff --git a/src/bootstrap/setup.rs b/src/bootstrap/setup.rs index f5ce45a5bd1..55d2445fc49 100644 --- a/src/bootstrap/setup.rs +++ b/src/bootstrap/setup.rs @@ -127,14 +127,17 @@ pub fn setup(src_path: &Path, profile: Profile) { // Used to get the path for `Subcommand::Setup` pub fn interactive_path() -> io::Result<Profile> { - fn abbrev_all() -> impl Iterator<Item = (String, Profile)> { - ('a'..).map(|c| c.to_string()).zip(Profile::all()) + fn abbrev_all() -> impl Iterator<Item = ((String, String), Profile)> { + ('a'..) + .zip(1..) + .map(|(letter, number)| (letter.to_string(), number.to_string())) + .zip(Profile::all()) } fn parse_with_abbrev(input: &str) -> Result<Profile, String> { let input = input.trim().to_lowercase(); - for (letter, profile) in abbrev_all() { - if input == letter { + for ((letter, number), profile) in abbrev_all() { + if input == letter || input == number { return Ok(profile); } } @@ -142,13 +145,13 @@ pub fn interactive_path() -> io::Result<Profile> { } println!("Welcome to the Rust project! What do you want to do with x.py?"); - for (letter, profile) in abbrev_all() { + for ((letter, _), profile) in abbrev_all() { println!("{}) {}: {}", letter, profile, profile.purpose()); } let template = loop { print!( "Please choose one ({}): ", - abbrev_all().map(|(l, _)| l).collect::<Vec<_>>().join("/") + abbrev_all().map(|((l, _), _)| l).collect::<Vec<_>>().join("/") ); io::stdout().flush()?; let mut input = String::new(); diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 5a73f583045..b48e9696c9a 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1040,6 +1040,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the cmd.arg("--src-base").arg(builder.src.join("src/test").join(suite)); cmd.arg("--build-base").arg(testdir(builder, compiler.host).join(suite)); cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target)); + cmd.arg("--suite").arg(suite); cmd.arg("--mode").arg(mode); cmd.arg("--target").arg(target.rustc_target_arg()); cmd.arg("--host").arg(&*compiler.host.triple); diff --git a/src/ci/docker/host-x86_64/disabled/dist-x86_64-dragonfly/build-toolchain.sh b/src/ci/docker/host-x86_64/disabled/dist-x86_64-dragonfly/build-toolchain.sh index 112d747fe4e..409bca45c94 100755 --- a/src/ci/docker/host-x86_64/disabled/dist-x86_64-dragonfly/build-toolchain.sh +++ b/src/ci/docker/host-x86_64/disabled/dist-x86_64-dragonfly/build-toolchain.sh @@ -17,7 +17,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID set -x diff --git a/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/build-toolchain.sh b/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/build-toolchain.sh index faf30f36a20..189e537ecae 100755 --- a/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/build-toolchain.sh +++ b/src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/build-toolchain.sh @@ -22,7 +22,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID set -x diff --git a/src/ci/docker/host-x86_64/dist-aarch64-linux/build-toolchains.sh b/src/ci/docker/host-x86_64/dist-aarch64-linux/build-toolchains.sh index 390ba1a1ddf..f15a7081612 100755 --- a/src/ci/docker/host-x86_64/dist-aarch64-linux/build-toolchains.sh +++ b/src/ci/docker/host-x86_64/dist-aarch64-linux/build-toolchains.sh @@ -11,7 +11,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/host-x86_64/dist-arm-linux/build-toolchains.sh b/src/ci/docker/host-x86_64/dist-arm-linux/build-toolchains.sh index 2e790b77a96..3fd88252199 100755 --- a/src/ci/docker/host-x86_64/dist-arm-linux/build-toolchains.sh +++ b/src/ci/docker/host-x86_64/dist-arm-linux/build-toolchains.sh @@ -12,7 +12,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/host-x86_64/dist-armhf-linux/build-toolchains.sh b/src/ci/docker/host-x86_64/dist-armhf-linux/build-toolchains.sh index a01c2e0eb0a..f425efd6057 100755 --- a/src/ci/docker/host-x86_64/dist-armhf-linux/build-toolchains.sh +++ b/src/ci/docker/host-x86_64/dist-armhf-linux/build-toolchains.sh @@ -12,7 +12,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/host-x86_64/dist-armv7-linux/build-toolchains.sh b/src/ci/docker/host-x86_64/dist-armv7-linux/build-toolchains.sh index 28f8ba2437b..17dda2dbd16 100755 --- a/src/ci/docker/host-x86_64/dist-armv7-linux/build-toolchains.sh +++ b/src/ci/docker/host-x86_64/dist-armv7-linux/build-toolchains.sh @@ -12,7 +12,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/host-x86_64/dist-powerpc-linux/build-powerpc-toolchain.sh b/src/ci/docker/host-x86_64/dist-powerpc-linux/build-powerpc-toolchain.sh index d2e39834d6e..264d0764f29 100755 --- a/src/ci/docker/host-x86_64/dist-powerpc-linux/build-powerpc-toolchain.sh +++ b/src/ci/docker/host-x86_64/dist-powerpc-linux/build-powerpc-toolchain.sh @@ -11,7 +11,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/host-x86_64/dist-powerpc64-linux/shared.sh b/src/ci/docker/host-x86_64/dist-powerpc64-linux/shared.sh index b8735692789..dc86dddd464 100644 --- a/src/ci/docker/host-x86_64/dist-powerpc64-linux/shared.sh +++ b/src/ci/docker/host-x86_64/dist-powerpc64-linux/shared.sh @@ -1,3 +1,4 @@ +#!/bin/sh hide_output() { set +x on_err=" @@ -8,7 +9,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID set -x diff --git a/src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh b/src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh index b8735692789..dc86dddd464 100644 --- a/src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh +++ b/src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh @@ -1,3 +1,4 @@ +#!/bin/sh hide_output() { set +x on_err=" @@ -8,7 +9,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID set -x diff --git a/src/ci/docker/host-x86_64/dist-riscv64-linux/build-toolchains.sh b/src/ci/docker/host-x86_64/dist-riscv64-linux/build-toolchains.sh index 6a7c022d01a..a7025b2b754 100755 --- a/src/ci/docker/host-x86_64/dist-riscv64-linux/build-toolchains.sh +++ b/src/ci/docker/host-x86_64/dist-riscv64-linux/build-toolchains.sh @@ -12,7 +12,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/host-x86_64/dist-riscv64-linux/crosstool-ng.sh b/src/ci/docker/host-x86_64/dist-riscv64-linux/crosstool-ng.sh index fb067a79a5c..3a40f6cddb3 100644 --- a/src/ci/docker/host-x86_64/dist-riscv64-linux/crosstool-ng.sh +++ b/src/ci/docker/host-x86_64/dist-riscv64-linux/crosstool-ng.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex # Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz diff --git a/src/ci/docker/host-x86_64/dist-s390x-linux/build-s390x-toolchain.sh b/src/ci/docker/host-x86_64/dist-s390x-linux/build-s390x-toolchain.sh index df9529da8a1..6f8d6be842b 100755 --- a/src/ci/docker/host-x86_64/dist-s390x-linux/build-s390x-toolchain.sh +++ b/src/ci/docker/host-x86_64/dist-s390x-linux/build-s390x-toolchain.sh @@ -11,7 +11,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/host-x86_64/dist-various-1/build-rumprun.sh b/src/ci/docker/host-x86_64/dist-various-1/build-rumprun.sh index 9c7aaef4f43..103dbbe6fda 100755 --- a/src/ci/docker/host-x86_64/dist-various-1/build-rumprun.sh +++ b/src/ci/docker/host-x86_64/dist-various-1/build-rumprun.sh @@ -11,7 +11,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID rm /tmp/build.log diff --git a/src/ci/docker/host-x86_64/dist-various-1/install-mips-musl.sh b/src/ci/docker/host-x86_64/dist-various-1/install-mips-musl.sh index 9584258d234..abab1809346 100755 --- a/src/ci/docker/host-x86_64/dist-various-1/install-mips-musl.sh +++ b/src/ci/docker/host-x86_64/dist-various-1/install-mips-musl.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex mkdir /usr/local/mips-linux-musl diff --git a/src/ci/docker/host-x86_64/dist-various-1/install-mipsel-musl.sh b/src/ci/docker/host-x86_64/dist-various-1/install-mipsel-musl.sh index 50a8e554b16..779acb2d841 100755 --- a/src/ci/docker/host-x86_64/dist-various-1/install-mipsel-musl.sh +++ b/src/ci/docker/host-x86_64/dist-various-1/install-mipsel-musl.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex mkdir /usr/local/mipsel-linux-musl diff --git a/src/ci/docker/host-x86_64/dist-various-2/shared.sh b/src/ci/docker/host-x86_64/dist-various-2/shared.sh index 7abace65b9c..267d8b79cc2 100644 --- a/src/ci/docker/host-x86_64/dist-various-2/shared.sh +++ b/src/ci/docker/host-x86_64/dist-various-2/shared.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash hide_output() { { set +x; } 2>/dev/null on_err=" diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh index b8735692789..dc86dddd464 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh @@ -1,3 +1,4 @@ +#!/bin/sh hide_output() { set +x on_err=" @@ -8,7 +9,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID set -x diff --git a/src/ci/docker/host-x86_64/dist-x86_64-netbsd/build-netbsd-toolchain.sh b/src/ci/docker/host-x86_64/dist-x86_64-netbsd/build-netbsd-toolchain.sh index f8697c698b9..5dfa47b4eed 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-netbsd/build-netbsd-toolchain.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-netbsd/build-netbsd-toolchain.sh @@ -13,7 +13,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log rm /tmp/build.log trap - ERR kill $PING_LOOP_PID diff --git a/src/ci/docker/scripts/android-base-apt-get.sh b/src/ci/docker/scripts/android-base-apt-get.sh index 1795b1696d3..f1761f80643 100644 --- a/src/ci/docker/scripts/android-base-apt-get.sh +++ b/src/ci/docker/scripts/android-base-apt-get.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex apt-get update diff --git a/src/ci/docker/scripts/android-ndk.sh b/src/ci/docker/scripts/android-ndk.sh index dafcb3cb7a7..ba70c62ea30 100644 --- a/src/ci/docker/scripts/android-ndk.sh +++ b/src/ci/docker/scripts/android-ndk.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex URL=https://dl.google.com/android/repository diff --git a/src/ci/docker/scripts/android-sdk.sh b/src/ci/docker/scripts/android-sdk.sh index e35be697a8d..23360d30951 100755 --- a/src/ci/docker/scripts/android-sdk.sh +++ b/src/ci/docker/scripts/android-sdk.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex export ANDROID_HOME=/android/sdk diff --git a/src/ci/docker/scripts/cross-apt-packages.sh b/src/ci/docker/scripts/cross-apt-packages.sh index 2de376443ad..57cb6d5cda8 100644 --- a/src/ci/docker/scripts/cross-apt-packages.sh +++ b/src/ci/docker/scripts/cross-apt-packages.sh @@ -1,3 +1,4 @@ +#!/bin/sh apt-get update && apt-get install -y --no-install-recommends \ automake \ bison \ diff --git a/src/ci/docker/scripts/crosstool-ng-1.24.sh b/src/ci/docker/scripts/crosstool-ng-1.24.sh index fb067a79a5c..3a40f6cddb3 100644 --- a/src/ci/docker/scripts/crosstool-ng-1.24.sh +++ b/src/ci/docker/scripts/crosstool-ng-1.24.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex # Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz diff --git a/src/ci/docker/scripts/crosstool-ng.sh b/src/ci/docker/scripts/crosstool-ng.sh index 2773e687ebe..1d0c28c8e58 100644 --- a/src/ci/docker/scripts/crosstool-ng.sh +++ b/src/ci/docker/scripts/crosstool-ng.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex url="https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.22.0.tar.gz" diff --git a/src/ci/docker/scripts/emscripten.sh b/src/ci/docker/scripts/emscripten.sh index 9481ee95399..56dc96283ed 100644 --- a/src/ci/docker/scripts/emscripten.sh +++ b/src/ci/docker/scripts/emscripten.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex hide_output() { @@ -10,7 +11,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID rm -f /tmp/build.log diff --git a/src/ci/docker/scripts/freebsd-toolchain.sh b/src/ci/docker/scripts/freebsd-toolchain.sh index b10263d5a26..c7ff78ca90c 100755 --- a/src/ci/docker/scripts/freebsd-toolchain.sh +++ b/src/ci/docker/scripts/freebsd-toolchain.sh @@ -19,7 +19,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & local ping_loop_pid=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $ping_loop_pid set -x diff --git a/src/ci/docker/scripts/make3.sh b/src/ci/docker/scripts/make3.sh index 47cb4158229..283700d06f6 100644 --- a/src/ci/docker/scripts/make3.sh +++ b/src/ci/docker/scripts/make3.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex curl -f https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf - diff --git a/src/ci/docker/scripts/musl-toolchain.sh b/src/ci/docker/scripts/musl-toolchain.sh index c56338a4f95..59fc921ec26 100644 --- a/src/ci/docker/scripts/musl-toolchain.sh +++ b/src/ci/docker/scripts/musl-toolchain.sh @@ -1,3 +1,4 @@ +#!/bin/sh # This script runs `musl-cross-make` to prepare C toolchain (Binutils, GCC, musl itself) # and builds static libunwind that we distribute for static target. # @@ -19,7 +20,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID rm /tmp/build.log diff --git a/src/ci/docker/scripts/musl.sh b/src/ci/docker/scripts/musl.sh index 58393a5719a..65e15950559 100644 --- a/src/ci/docker/scripts/musl.sh +++ b/src/ci/docker/scripts/musl.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex hide_output() { @@ -10,7 +11,7 @@ exit 1 trap "$on_err" ERR bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & PING_LOOP_PID=$! - $@ &> /tmp/build.log + "$@" &> /tmp/build.log trap - ERR kill $PING_LOOP_PID rm /tmp/build.log @@ -32,7 +33,7 @@ if [ ! -d $MUSL ]; then fi cd $MUSL -./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG $@ +./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG "$@" if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then hide_output make -j$(nproc) AR=ar RANLIB=ranlib else diff --git a/src/ci/docker/scripts/rustbuild-setup.sh b/src/ci/docker/scripts/rustbuild-setup.sh index 94d7e600eac..baf2a686871 100644 --- a/src/ci/docker/scripts/rustbuild-setup.sh +++ b/src/ci/docker/scripts/rustbuild-setup.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild diff --git a/src/ci/docker/scripts/sccache.sh b/src/ci/docker/scripts/sccache.sh index cebba57344b..292b3c1d562 100644 --- a/src/ci/docker/scripts/sccache.sh +++ b/src/ci/docker/scripts/sccache.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -ex case "$(uname -m)" in diff --git a/src/ci/init_repo.sh b/src/ci/init_repo.sh index 92c6e546a38..060b3079dad 100755 --- a/src/ci/init_repo.sh +++ b/src/ci/init_repo.sh @@ -53,6 +53,7 @@ modules=($modules) use_git="" urls="$(git config --file .gitmodules --get-regexp '\.url$' | cut -d' ' -f2)" urls=($urls) +# shellcheck disable=SC2068 for i in ${!modules[@]}; do module=${modules[$i]} if [[ " $included " = *" $module "* ]]; then diff --git a/src/ci/shared.sh b/src/ci/shared.sh index c93d4774e39..3c196c9478c 100644 --- a/src/ci/shared.sh +++ b/src/ci/shared.sh @@ -1,4 +1,5 @@ #!/bin/false +# shellcheck shell=bash # This file is intended to be sourced with `. shared.sh` or # `source shared.sh`, hence the invalid shebang and not being diff --git a/src/doc/index.md b/src/doc/index.md index 2d10230ffcf..2c92d5e2a18 100644 --- a/src/doc/index.md +++ b/src/doc/index.md @@ -26,7 +26,7 @@ h2 { } </style> -Welcome to an overview of the documentation provided by the Rust project. +Welcome to an overview of the documentation provided by the [Rust project]. All of these projects are managed by the Docs Team; there are other unofficial documentation resources as well! @@ -139,3 +139,4 @@ When developing for Bare Metal or Embedded Linux systems, you may find these res [The Embedded Rust Book] is targeted at developers familiar with embedded development and familiar with Rust, but have not used Rust for embedded development. [The Embedded Rust Book]: embedded-book/index.html +[Rust project]: https://www.rust-lang.org diff --git a/src/test/run-make/thumb-none-qemu/script.sh b/src/test/run-make/thumb-none-qemu/script.sh index 045d02a8ed2..a8aa72af184 100644 --- a/src/test/run-make/thumb-none-qemu/script.sh +++ b/src/test/run-make/thumb-none-qemu/script.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -exuo pipefail CRATE=example diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh index ec93c980160..54645e9e257 100644 --- a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -exuo pipefail function build { diff --git a/src/test/ui/error-codes/E0027.stderr b/src/test/ui/error-codes/E0027.stderr index c09f1ff1f2a..cf0ff631148 100644 --- a/src/test/ui/error-codes/E0027.stderr +++ b/src/test/ui/error-codes/E0027.stderr @@ -8,7 +8,7 @@ help: include the missing field in the pattern | LL | Dog { age: x, name } => {} | ^^^^^^ -help: if you don't care about this missing field, you can explicitely ignore it +help: if you don't care about this missing field, you can explicitly ignore it | LL | Dog { age: x, .. } => {} | ^^^^ @@ -23,7 +23,7 @@ help: include the missing fields in the pattern | LL | Dog { name, age } => {} | ^^^^^^^^^^^^^ -help: if you don't care about these missing fields, you can explicitely ignore them +help: if you don't care about these missing fields, you can explicitly ignore them | LL | Dog { .. } => {} | ^^^^^^ diff --git a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs index a1147cb5cfc..512f1e283cb 100644 --- a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs +++ b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs @@ -77,10 +77,17 @@ fn main() { (false | true, false | true) => {} } match (true, true) { - (true, false) => {} - (false, true) => {} + (true, true) => {} + (false, false) => {} (false | true, false | true) => {} } + // https://github.com/rust-lang/rust/issues/76836 + match None { + Some(false) => {} + None | Some(true + | false) => {} //~ ERROR unreachable + } + // A subpattern that is unreachable in all branches is overall unreachable. match (true, true) { (false, true) => {} diff --git a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr index d92b545a869..e968310d108 100644 --- a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr +++ b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr @@ -101,16 +101,22 @@ LL | Some(0 | ^ error: unreachable pattern - --> $DIR/exhaustiveness-unreachable-pattern.rs:89:15 + --> $DIR/exhaustiveness-unreachable-pattern.rs:88:19 + | +LL | | false) => {} + | ^^^^^ + +error: unreachable pattern + --> $DIR/exhaustiveness-unreachable-pattern.rs:96:15 | LL | | true) => {} | ^^^^ error: unreachable pattern - --> $DIR/exhaustiveness-unreachable-pattern.rs:95:15 + --> $DIR/exhaustiveness-unreachable-pattern.rs:102:15 | LL | | true, | ^^^^ -error: aborting due to 18 previous errors +error: aborting due to 19 previous errors diff --git a/src/test/ui/structs/struct-field-cfg.stderr b/src/test/ui/structs/struct-field-cfg.stderr index b913b929079..740ea3829dc 100644 --- a/src/test/ui/structs/struct-field-cfg.stderr +++ b/src/test/ui/structs/struct-field-cfg.stderr @@ -22,7 +22,7 @@ help: include the missing field in the pattern | LL | let Foo { present } = foo; | ^^^^^^^^^^^ -help: if you don't care about this missing field, you can explicitely ignore it +help: if you don't care about this missing field, you can explicitly ignore it | LL | let Foo { .. } = foo; | ^^^^^^ diff --git a/src/test/ui/structs/struct-pat-derived-error.stderr b/src/test/ui/structs/struct-pat-derived-error.stderr index f3e9ce76f1e..921d060faa3 100644 --- a/src/test/ui/structs/struct-pat-derived-error.stderr +++ b/src/test/ui/structs/struct-pat-derived-error.stderr @@ -20,7 +20,7 @@ help: include the missing fields in the pattern | LL | let A { x, y, b, c } = self.d; | ^^^^^^ -help: if you don't care about these missing fields, you can explicitely ignore them +help: if you don't care about these missing fields, you can explicitly ignore them | LL | let A { x, y, .. } = self.d; | ^^^^ diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 2f832b53a90..24ef98cd784 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -224,6 +224,10 @@ pub struct Config { /// The test mode, compile-fail, run-fail, ui pub mode: Mode, + /// The test suite (essentially which directory is running, but without the + /// directory prefix such as src/test) + pub suite: String, + /// The debugger to use in debuginfo mode. Unset otherwise. pub debugger: Option<Debugger>, diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 1f82b137ee6..4bcbd89f095 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -39,6 +39,7 @@ fn config() -> Config { let args = &[ "compiletest", "--mode=ui", + "--suite=ui", "--compile-lib-path=", "--run-lib-path=", "--rustc-path=", diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 2b2a6cfa8bd..2b167ac8e9f 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -70,6 +70,12 @@ pub fn parse_config(args: Vec<String>) -> Config { "compile-fail | run-fail | run-pass-valgrind | pretty | debug-info | codegen | rustdoc \ codegen-units | incremental | run-make | ui | js-doc-test | mir-opt | assembly", ) + .reqopt( + "", + "suite", + "which suite of compile tests to run. used for nicer error reporting.", + "SUITE", + ) .optopt( "", "pass", @@ -201,6 +207,7 @@ pub fn parse_config(args: Vec<String>) -> Config { build_base: opt_path(matches, "build-base"), stage_id: matches.opt_str("stage-id").unwrap(), mode: matches.opt_str("mode").unwrap().parse().expect("invalid mode"), + suite: matches.opt_str("suite").unwrap(), debugger: None, run_ignored, filter: matches.free.first().cloned(), @@ -340,7 +347,7 @@ pub fn run_tests(config: Config) { configs.extend(configure_lldb(&config)); } } else { - configs.push(config); + configs.push(config.clone()); }; let mut tests = Vec::new(); @@ -351,11 +358,32 @@ pub fn run_tests(config: Config) { let res = test::run_tests_console(&opts, tests); match res { Ok(true) => {} - Ok(false) => panic!("Some tests failed"), + Ok(false) => { + // We want to report that the tests failed, but we also want to give + // some indication of just what tests we were running. Especially on + // CI, where there can be cross-compiled tests for a lot of + // architectures, without this critical information it can be quite + // easy to miss which tests failed, and as such fail to reproduce + // the failure locally. + + eprintln!( + "Some tests failed in compiletest suite={}{} mode={} host={} target={}", + config.suite, + config.compare_mode.map(|c| format!(" compare_mode={:?}", c)).unwrap_or_default(), + config.mode, + config.host, + config.target + ); + + std::process::exit(1); + } Err(e) => { // We don't know if tests passed or not, but if there was an error // during testing we don't want to just suceeed (we may not have // tested something), so fail. + // + // This should realistically "never" happen, so don't try to make + // this a pretty error message. panic!("I/O failure during tests: {:?}", e); } } |
