From 71e3ea35b175fa50e5fcd033980666548b718081 Mon Sep 17 00:00:00 2001 From: clubby789 Date: Sun, 29 Dec 2024 03:31:37 +0000 Subject: [PATCH 1/5] Add codegen test for issue 63646 --- tests/codegen/range_to_inclusive.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/codegen/range_to_inclusive.rs diff --git a/tests/codegen/range_to_inclusive.rs b/tests/codegen/range_to_inclusive.rs new file mode 100644 index 0000000000000..f3001897f88d9 --- /dev/null +++ b/tests/codegen/range_to_inclusive.rs @@ -0,0 +1,28 @@ +//! Test that `RangeTo` and `RangeToInclusive` generate identical +//! (and optimal) code; #63646 +//@ compile-flags: -O -Zmerge-functions=disabled +#![crate_type = "lib"] + +#[no_mangle] +// CHECK-LABEL: range_to( +pub fn range_to(a: i32, mut b: i32) -> i32 { + // CHECK: %1 = and i32 %0, %a + // CHECK-NEXT: ret i32 %1 + for _ in 0..65 { + b &= a; + } + + b +} + +#[no_mangle] +// CHECK-LABEL: range_to_inclusive( +pub fn range_to_inclusive(a: i32, mut b: i32) -> i32 { + // CHECK: %1 = and i32 %0, %a + // CHECK-NEXT: ret i32 %1 + for _ in 0..=64 { + b &= a; + } + + b +} From 4c279fb7af22ac24833464a5d7ffa56ca79a251d Mon Sep 17 00:00:00 2001 From: Horu <73709188+HigherOrderLogic@users.noreply.github.com> Date: Mon, 30 Dec 2024 14:56:21 +0700 Subject: [PATCH 2/5] chore: fix typos --- src/bootstrap/src/core/build_steps/test.rs | 2 +- src/bootstrap/src/lib.rs | 2 +- src/bootstrap/src/utils/tarball.rs | 2 +- src/ci/scripts/install-clang.sh | 2 +- src/tools/linkchecker/main.rs | 2 +- src/tools/nix-dev-shell/envrc-flake | 2 +- src/tools/nix-dev-shell/envrc-shell | 2 +- tests/ui/associated-types/associated-types-eq-2.rs | 2 +- tests/ui/associated-types/project-defer-unification.rs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index fe2dd9cc5f3ee..6aa6e4e277d4e 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2637,7 +2637,7 @@ fn prepare_cargo_test( ) -> BootstrapCommand { let mut cargo = cargo.into(); - // Propegate `--bless` if it has not already been set/unset + // Propagate `--bless` if it has not already been set/unset // Any tools that want to use this should bless if `RUSTC_BLESS` is set to // anything other than `0`. if builder.config.cmd.bless() && !cargo.get_envs().any(|v| v.0 == "RUSTC_BLESS") { diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index eff259212c581..4cc812829f9b6 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -1691,7 +1691,7 @@ Executed at: {executed_at}"#, } } if let Ok(()) = fs::hard_link(&src, dst) { - // Attempt to "easy copy" by creating a hard link (symlinks are priviledged on windows), + // Attempt to "easy copy" by creating a hard link (symlinks are privileged on windows), // but if that fails just fall back to a slow `copy` operation. } else { if let Err(e) = fs::copy(&src, dst) { diff --git a/src/bootstrap/src/utils/tarball.rs b/src/bootstrap/src/utils/tarball.rs index 3c6c7a7fa180a..843ea65e83862 100644 --- a/src/bootstrap/src/utils/tarball.rs +++ b/src/bootstrap/src/utils/tarball.rs @@ -1,7 +1,7 @@ //! Facilitates the management and generation of tarballs. //! //! Tarballs efficiently hold Rust compiler build artifacts and -//! capture a snapshot of each boostrap stage. +//! capture a snapshot of each bootstrap stage. //! In uplifting, a tarball from Stage N captures essential components //! to assemble Stage N + 1 compiler. diff --git a/src/ci/scripts/install-clang.sh b/src/ci/scripts/install-clang.sh index 6103aa61248ae..5522095e3049b 100755 --- a/src/ci/scripts/install-clang.sh +++ b/src/ci/scripts/install-clang.sh @@ -15,7 +15,7 @@ LLVM_VERSION="18.1.4" if isMacOS; then # FIXME: This is the latest pre-built version of LLVM that's available for - # x86_64 MacOS. We may want to consider bulding our own LLVM binaries + # x86_64 MacOS. We may want to consider building our own LLVM binaries # instead, or set `USE_XCODE_CLANG` like AArch64 does. LLVM_VERSION="15.0.7" diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index 833e41df53706..570b2c374c0e6 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -8,7 +8,7 @@ //! //! Currently uses a combination of HTML parsing to //! extract the `href` and `id` attributes, -//! and regex search on the orignal markdown to handle intra-doc links. +//! and regex search on the original markdown to handle intra-doc links. //! //! These values are then translated to file URLs if possible and then the //! destination is asserted to exist. diff --git a/src/tools/nix-dev-shell/envrc-flake b/src/tools/nix-dev-shell/envrc-flake index 849ed1f4fc56d..f3e5442b86b2a 100644 --- a/src/tools/nix-dev-shell/envrc-flake +++ b/src/tools/nix-dev-shell/envrc-flake @@ -1,4 +1,4 @@ -# If you want to use this as an .envrc file to create a shell with necessery components +# If you want to use this as an .envrc file to create a shell with necessary components # to develop rustc, use the following command in the root of the rusr checkout: # # ln -s ./src/tools/nix-dev-shell/envrc-flake ./.envrc && nix flake update --flake ./src/tools/nix-dev-shell diff --git a/src/tools/nix-dev-shell/envrc-shell b/src/tools/nix-dev-shell/envrc-shell index d8f900fe86a6d..4080d7d538406 100644 --- a/src/tools/nix-dev-shell/envrc-shell +++ b/src/tools/nix-dev-shell/envrc-shell @@ -1,4 +1,4 @@ -# If you want to use this as an .envrc file to create a shell with necessery components +# If you want to use this as an .envrc file to create a shell with necessary components # to develop rustc, use the following command in the root of the rusr checkout: # # ln -s ./src/tools/nix-dev-shell/envrc-shell ./.envrc diff --git a/tests/ui/associated-types/associated-types-eq-2.rs b/tests/ui/associated-types/associated-types-eq-2.rs index 88eb298106100..9d2860d1b309b 100644 --- a/tests/ui/associated-types/associated-types-eq-2.rs +++ b/tests/ui/associated-types/associated-types-eq-2.rs @@ -33,7 +33,7 @@ fn baz(_x: &>::A) {} trait Tr2 { } -// Test for when wrongly specifed equality constraint's ident +// Test for when wrongly specified equality constraint's ident // matches some generic param's ident // (Note: E0229 is emitted only for the first erroneous equality // constraint (T2) not for any subequent ones (e.g. T3)) diff --git a/tests/ui/associated-types/project-defer-unification.rs b/tests/ui/associated-types/project-defer-unification.rs index cec088496fd38..b51228ef4117f 100644 --- a/tests/ui/associated-types/project-defer-unification.rs +++ b/tests/ui/associated-types/project-defer-unification.rs @@ -93,7 +93,7 @@ where Pix: Pixel + 'static, let mut indices: ImageBuffer<_,Vec<_>> = loop { }; for (pixel, idx) in image.pixels().zip(indices.pixels_mut()) { - // failured occurred here ^^ because we were requiring that we + // failure occurred here ^^ because we were requiring that we // could project Pixel or Subpixel from `T_indices` (type of // `indices`), but the type is insufficiently constrained // until we reach the return below. From a0b3452fb5809fab08b6c10fc778abbe6f3e0abf Mon Sep 17 00:00:00 2001 From: ericlehong <193237094+ericlehong@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:43:22 +0800 Subject: [PATCH 3/5] Fix typos Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com> --- src/etc/test-float-parse/README.md | 2 +- src/etc/test-float-parse/src/lib.rs | 8 ++++---- src/tools/suggest-tests/src/static_suggestions.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/etc/test-float-parse/README.md b/src/etc/test-float-parse/README.md index 21b20d0a072d7..5e2c43d1cad61 100644 --- a/src/etc/test-float-parse/README.md +++ b/src/etc/test-float-parse/README.md @@ -3,7 +3,7 @@ These are tests designed to test decimal to float conversions (`dec2flt`) used by the standard library. -It consistes of a collection of test generators that each generate a set of +It consists of a collection of test generators that each generate a set of patterns intended to test a specific property. In addition, there are exhaustive tests (for <= `f32`) and fuzzers (for anything that can't be run exhaustively). diff --git a/src/etc/test-float-parse/src/lib.rs b/src/etc/test-float-parse/src/lib.rs index 71b1aa0667109..3c71b0dc32e74 100644 --- a/src/etc/test-float-parse/src/lib.rs +++ b/src/etc/test-float-parse/src/lib.rs @@ -35,7 +35,7 @@ const DEFAULT_MAX_FAILURES: u64 = 20; /// Register exhaustive tests only for <= 32 bits. No more because it would take years. const MAX_BITS_FOR_EXHAUUSTIVE: u32 = 32; -/// If there are more tests than this threashold, the test will be defered until after all +/// If there are more tests than this threshold, the test will be deferred until after all /// others run (so as to avoid thread pool starvation). They also can be excluded with /// `--skip-huge`. const HUGE_TEST_CUTOFF: u64 = 5_000_000; @@ -109,7 +109,7 @@ pub fn run(cfg: Config, include: &[String], exclude: &[String]) -> ExitCode { ui::finish(&tests, elapsed, &cfg) } -/// Enumerate tests to run but don't actaully run them. +/// Enumerate tests to run but don't actually run them. pub fn register_tests(cfg: &Config) -> Vec { let mut tests = Vec::new(); @@ -120,7 +120,7 @@ pub fn register_tests(cfg: &Config) -> Vec { tests.sort_unstable_by_key(|t| (t.float_name, t.gen_name)); for i in 0..(tests.len() - 1) { if tests[i].gen_name == tests[i + 1].gen_name { - panic!("dupliate test name {}", tests[i].gen_name); + panic!("duplicate test name {}", tests[i].gen_name); } } @@ -295,7 +295,7 @@ enum Update { fail: CheckFailure, /// String for which parsing was attempted. input: Box, - /// The parsed & decomposed `FloatRes`, aleady stringified so we don't need generics here. + /// The parsed & decomposed `FloatRes`, already stringified so we don't need generics here. float_res: Box, }, /// Exited with an unexpected condition. diff --git a/src/tools/suggest-tests/src/static_suggestions.rs b/src/tools/suggest-tests/src/static_suggestions.rs index b216138cf9a58..d363d583b546f 100644 --- a/src/tools/suggest-tests/src/static_suggestions.rs +++ b/src/tools/suggest-tests/src/static_suggestions.rs @@ -2,7 +2,7 @@ use std::sync::OnceLock; use crate::{Suggestion, sug}; -// FIXME: perhaps this could use `std::lazy` when it is stablizied +// FIXME: perhaps this could use `std::lazy` when it is stabilized macro_rules! static_suggestions { ($( [ $( $glob:expr ),* $(,)? ] => [ $( $suggestion:expr ),* $(,)? ] ),* $(,)? ) => { pub(crate) fn static_suggestions() -> &'static [(Vec<&'static str>, Vec)] From ac3ffccf37a4eefb50844c01919da935ca668431 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Fri, 1 Nov 2024 21:45:49 +0100 Subject: [PATCH 4/5] Add illumos target documentation --- src/doc/rustc/src/SUMMARY.md | 1 + src/doc/rustc/src/platform-support.md | 4 +- src/doc/rustc/src/platform-support/illumos.md | 42 +++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 src/doc/rustc/src/platform-support/illumos.md diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md index 9743b3ba442ad..f0c3720eae14f 100644 --- a/src/doc/rustc/src/SUMMARY.md +++ b/src/doc/rustc/src/SUMMARY.md @@ -56,6 +56,7 @@ - [csky-unknown-linux-gnuabiv2\*](platform-support/csky-unknown-linux-gnuabiv2.md) - [hexagon-unknown-linux-musl](platform-support/hexagon-unknown-linux-musl.md) - [hexagon-unknown-none-elf](platform-support/hexagon-unknown-none-elf.md) + - [illumos](platform-support/illumos.md) - [loongarch\*-unknown-linux-\*](platform-support/loongarch-linux.md) - [loongarch\*-unknown-none\*](platform-support/loongarch-none.md) - [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md) diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index 00ab61051c3ca..b82e371ebfba1 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -102,7 +102,7 @@ target | notes [`riscv64gc-unknown-linux-musl`](platform-support/riscv64gc-unknown-linux-musl.md) | RISC-V Linux (kernel 4.20, musl 1.2.3) [`s390x-unknown-linux-gnu`](platform-support/s390x-unknown-linux-gnu.md) | S390x Linux (kernel 3.2, glibc 2.17) [`x86_64-unknown-freebsd`](platform-support/freebsd.md) | 64-bit amd64 FreeBSD -`x86_64-unknown-illumos` | illumos +[`x86_64-unknown-illumos`](platform-support/illumos.md) | illumos `x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.3 [`x86_64-unknown-netbsd`](platform-support/netbsd.md) | NetBSD/amd64 @@ -261,7 +261,7 @@ target | std | host | notes [`aarch64-unknown-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 7.1 RTOS | [`aarch64-unknown-freebsd`](platform-support/freebsd.md) | ✓ | ✓ | ARM64 FreeBSD [`aarch64-unknown-hermit`](platform-support/hermit.md) | ✓ | | ARM64 Hermit -`aarch64-unknown-illumos` | ✓ | ✓ | ARM64 illumos +[`aarch64-unknown-illumos`](platform-support/illumos.md) | ✓ | ✓ | ARM64 illumos `aarch64-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (ILP32 ABI) [`aarch64-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | ARM64 NetBSD [`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD diff --git a/src/doc/rustc/src/platform-support/illumos.md b/src/doc/rustc/src/platform-support/illumos.md new file mode 100644 index 0000000000000..dd2ae90f6741f --- /dev/null +++ b/src/doc/rustc/src/platform-support/illumos.md @@ -0,0 +1,42 @@ +# `aarch64-unknown-illumos` and `x86_64-unknown-illumos` + +**Tier: 2/3** + +[illumos](https://www.illumos.org/), is a Unix operating system which provides next-generation features for downstream distributions, +including advanced system debugging, next generation filesystem, networking, and virtualization options. + +## Target maintainers + +- Joshua M. Clulow ([@jclulow](https://github.com/jclulow)) +- Patrick Mooney ([@pfmooney](https://github.com/pfmooney)) + +## Requirements + +The target supports host tools. + +The illumos target supports `std` and uses the standard ELF file format. + +`x86_64-unknown-illumos` is a tier 2 target with host tools. +`aarch64-unknown-illumos` is a tier 3 target. + +## Building the target + +These targets can be built by adding `aarch64-unknown-illumos` and +`x86_64-unknown-illumos` as targets in the rustc list. + +## Building Rust programs + +Rust ships pre-compiled artifacts for the `x86_64-unknown-illumos` target. +Rust does not ship pre-compiled artifacts for `aarch64-unknown-illumos`, +it requires building the target either as shown above or using `-Zbuild-std`. + +## Testing + +Tests can be run in the same way as a regular binary. + +## Cross-compilation toolchains and C code + +The target supports C code. + +The illumos project makes available [prebuilt sysroot artefacts](https://github.com/illumos/sysroot) which can be used for cross compilation. +The official Rust binaries are cross-compiled using these artefacts. From b4d14ceae7d33da6deb8cc4e96ca8e467db614a3 Mon Sep 17 00:00:00 2001 From: ranger-ross Date: Tue, 31 Dec 2024 00:28:58 +0900 Subject: [PATCH 5/5] ci: Cleanup docker build logs in CI --- src/ci/docker/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index a0adf60b6b2c9..d1bc0519bc1eb 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -76,8 +76,9 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then # Include cache version. Can be used to manually bust the Docker cache. echo "2" >> $hash_key - echo "Image input" + echo "::group::Image checksum input" cat $hash_key + echo "::endgroup::" cksum=$(sha512sum $hash_key | \ awk '{print $1}')