From 9f1a3a131b3a32ac86f5d230357fff94b17c34cb Mon Sep 17 00:00:00 2001 From: fleetingbytes <7075397+fleetingbytes@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:09:15 +0200 Subject: [PATCH 01/29] Update env.rs Remove `Errors` section from `var_os` documentation --- library/std/src/env.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 183f9ab3b08f6..3fcf96c761bf2 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -242,16 +242,6 @@ fn _var(key: &OsStr) -> Result { /// is valid Unicode. If you want to have an error on invalid UTF-8, /// use the [`var`] function instead. /// -/// # Errors -/// -/// This function returns an error if the environment variable isn't set. -/// -/// This function may return an error if the environment variable's name contains -/// the equal sign character (`=`) or the NUL character. -/// -/// This function may return an error if the environment variable's value contains -/// the NUL character. -/// /// # Examples /// /// ``` From c252f0d4044876509e08be27f82dbf0f33bc5cc2 Mon Sep 17 00:00:00 2001 From: fleetingbytes <7075397+fleetingbytes@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:46:43 +0200 Subject: [PATCH 02/29] add situation where var_os returns None Re-introduced some of the former errors as situations where `None` is returned. --- library/std/src/env.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 3fcf96c761bf2..63338bd5876bf 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -236,7 +236,13 @@ fn _var(key: &OsStr) -> Result { } /// Fetches the environment variable `key` from the current process, returning -/// [`None`] if the variable isn't set or there's another error. +/// [`None`] in the following situations: +/// +/// - the environment variable isn't set +/// - the environment variable's name contains +/// the equal sign character (`=`) or the NUL character +/// +/// If this is not desired, consider using [`var_os`]. /// /// Note that the method will not check if the environment variable /// is valid Unicode. If you want to have an error on invalid UTF-8, From 5618c8efd7925b6f1b5d8e5b30228f065606e841 Mon Sep 17 00:00:00 2001 From: fleetingbytes <7075397+fleetingbytes@users.noreply.github.com> Date: Mon, 3 Apr 2023 17:13:30 +0200 Subject: [PATCH 03/29] remove self-reference in var_os doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: León Orell Valerian Liehr --- library/std/src/env.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 63338bd5876bf..c9f8e617df602 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -242,7 +242,6 @@ fn _var(key: &OsStr) -> Result { /// - the environment variable's name contains /// the equal sign character (`=`) or the NUL character /// -/// If this is not desired, consider using [`var_os`]. /// /// Note that the method will not check if the environment variable /// is valid Unicode. If you want to have an error on invalid UTF-8, From a450557a54b871ce182900cde3894a3494876e1e Mon Sep 17 00:00:00 2001 From: fleetingbytes <7075397+fleetingbytes@users.noreply.github.com> Date: Mon, 3 Apr 2023 17:17:43 +0200 Subject: [PATCH 04/29] Remove redundant empty line one is enough --- library/std/src/env.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index c9f8e617df602..1345469d8b329 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -242,7 +242,6 @@ fn _var(key: &OsStr) -> Result { /// - the environment variable's name contains /// the equal sign character (`=`) or the NUL character /// -/// /// Note that the method will not check if the environment variable /// is valid Unicode. If you want to have an error on invalid UTF-8, /// use the [`var`] function instead. From 4cb73cc7d014d9848c0e00531cbd9dcc561e4253 Mon Sep 17 00:00:00 2001 From: fleetingbytes <7075397+fleetingbytes@users.noreply.github.com> Date: Mon, 3 Apr 2023 19:30:20 +0200 Subject: [PATCH 05/29] Preserve potential mood for equal or NUL sign Original `var_os` description said that it _may_ return an error if the value contains `=` or NUL. Let's make no promises on the `None` return value in these situation either, keep it in the [potential mood](https://en.wikipedia.org/wiki/Grammatical_mood#Potential). --- library/std/src/env.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 1345469d8b329..51e5c60ed294e 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -236,11 +236,9 @@ fn _var(key: &OsStr) -> Result { } /// Fetches the environment variable `key` from the current process, returning -/// [`None`] in the following situations: -/// -/// - the environment variable isn't set -/// - the environment variable's name contains -/// the equal sign character (`=`) or the NUL character +/// [`None`] if the environment variable isn't set. It may return `None` also +/// if the environment variable's name contains +/// the equal sign character (`=`) or the NUL character. /// /// Note that the method will not check if the environment variable /// is valid Unicode. If you want to have an error on invalid UTF-8, From ad26dab27cd314d13e64fe5b49cfa5260a57ab53 Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Thu, 12 May 2022 21:17:31 +0800 Subject: [PATCH 06/29] Initial support for loongarch64-unknown-linux-gnu --- .../src/spec/loongarch64_unknown_linux_gnu.rs | 17 ++++ compiler/rustc_target/src/spec/mod.rs | 1 + src/doc/rustc/src/SUMMARY.md | 1 + src/doc/rustc/src/platform-support.md | 1 + .../src/platform-support/loongarch-linux.md | 92 +++++++++++++++++++ tests/ui/check-cfg/compact-values.stderr | 2 +- 6 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs create mode 100644 src/doc/rustc/src/platform-support/loongarch-linux.md diff --git a/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs new file mode 100644 index 0000000000000..db8b9c70e6702 --- /dev/null +++ b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs @@ -0,0 +1,17 @@ +use crate::spec::{Target, TargetOptions}; + +pub fn target() -> Target { + Target { + llvm_target: "loongarch64-unknown-linux-gnu".into(), + pointer_width: 64, + data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(), + arch: "loongarch64".into(), + options: TargetOptions { + cpu: "generic".into(), + features: "+f,+d".into(), + llvm_abiname: "lp64d".into(), + max_atomic_width: Some(64), + ..super::linux_gnu_base::opts() + }, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 2553b11d8789b..c92a796c70e0d 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1021,6 +1021,7 @@ supported_targets! { ("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32), ("i686-unknown-linux-gnu", i686_unknown_linux_gnu), ("i586-unknown-linux-gnu", i586_unknown_linux_gnu), + ("loongarch64-unknown-linux-gnu", loongarch64_unknown_linux_gnu), ("m68k-unknown-linux-gnu", m68k_unknown_linux_gnu), ("mips-unknown-linux-gnu", mips_unknown_linux_gnu), ("mips64-unknown-linux-gnuabi64", mips64_unknown_linux_gnuabi64), diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md index 752f1cc4aba03..bbf53a09ce897 100644 --- a/src/doc/rustc/src/SUMMARY.md +++ b/src/doc/rustc/src/SUMMARY.md @@ -28,6 +28,7 @@ - [\*-android and \*-androideabi](platform-support/android.md) - [\*-unknown-fuchsia](platform-support/fuchsia.md) - [\*-kmc-solid_\*](platform-support/kmc-solid.md) + - [loongarch\*-unknown-linux-\*](platform-support/loongarch-linux.md) - [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md) - [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md) - [mipsel-sony-psx](platform-support/mipsel-sony-psx.md) diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index 2d74a2240969c..f9de456d17e5b 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -263,6 +263,7 @@ target | std | host | notes `i686-uwp-windows-gnu` | ? | | `i686-uwp-windows-msvc` | ? | | `i686-wrs-vxworks` | ? | | +[`loongarch64-unknown-linux-gnu`](platform-support/loongarch-linux.md) | ? | | LoongArch64 Linux (LP64D ABI) [`m68k-unknown-linux-gnu`](platform-support/m68k-unknown-linux-gnu.md) | ? | | Motorola 680x0 Linux `mips-unknown-linux-uclibc` | ✓ | | MIPS Linux with uClibc [`mips64-openwrt-linux-musl`](platform-support/mips64-openwrt-linux-musl.md) | ? | | MIPS64 for OpenWrt Linux MUSL diff --git a/src/doc/rustc/src/platform-support/loongarch-linux.md b/src/doc/rustc/src/platform-support/loongarch-linux.md new file mode 100644 index 0000000000000..e046ec244ece9 --- /dev/null +++ b/src/doc/rustc/src/platform-support/loongarch-linux.md @@ -0,0 +1,92 @@ +# loongarch\*-unknown-linux-\* + +**Tier: 3** + +[LoongArch] is a new RISC ISA developed by Loongson Technology Corporation Limited. + +[LoongArch]: https://loongson.github.io/LoongArch-Documentation/README-EN.html + +The target name follow this format: `--, where `` specifies the CPU family/model, `` specifies the vendor and `` the operating system name. +While the integer base ABI is implied by the machine field, the floating point base ABI type is encoded into the os field of the specifier using the string suffix ``. + +| `` | `Description` | +|------------------------|--------------------------------------------------------------------| +| f64 | The base ABI use 64-bits FPRs for parameter passing.(lp64d)| +| f32 | The base ABI uses 32-bit FPRs for parameter passing. (lp64f)| +| sf | The base ABI uses no FPR for parameter passing. (lp64s) | + +|`ABI type(Base ABI/ABI extension)`| `C library` | `kernel` | `target tuple` | +|----------------------------------|-------------|----------|----------------------------------| +| lp64d/base | glibc | linux | loongarch64-unknown-linux-gnu | +| lp64f/base | glibc | linux | loongarch64-unknown-linux-gnuf32 | +| lp64s/base | glibc | linux | loongarch64-unknown-linux-gnusf | +| lp64d/base | musl libc | linux | loongarch64-unknown-linux-musl| +| lp64f/base | musl libc | linux | loongarch64-unknown-linux-muslf32| +| lp64s/base | musl libc | linux | loongarch64-unknown-linux-muslsf | + +## Target maintainers + +- [ZHAI xiaojuan](https://github.com/zhaixiaojuan) `zhaixiaojuan@loongson.cn` +- [WANG rui](https://github.com/heiher) `wangrui@loongson.cn` +- [ZHAI xiang](https://github.com/xiangzhai) `zhaixiang@loongson.cn` +- [WANG Xuerui](https://github.com/xen0n) `git@xen0n.name` + +## Requirements + +This target is cross-compiled. +A GNU toolchain for LoongArch target is required. It can be downloaded from https://github.com/loongson/build-tools/releases, or built from the source code of GCC (12.1.0 or later) and Binutils (2.40 or later). + +## Building the target + +The target can be built by enabling it for a `rustc` build. + +```toml +[build] +target = ["loongarch64-unknown-linux-gnu"] +``` + +Make sure `loongarch64-unknown-linux-gnu-gcc` can be searched from the directories specified in`$PATH`. Alternatively, you can use GNU LoongArch Toolchain by adding the following to `config.toml`: + +```toml +[target.loongarch64-unknown-linux-gnu] +# ADJUST THIS PATH TO POINT AT YOUR TOOLCHAIN +cc = "/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-gcc" +cxx = "/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-g++" +ar = "/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-ar" +ranlib = "/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-ranlib" +linker = "/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-gcc" +``` + +## Cross-compilation + +This target can be cross-compiled on a `x86_64-unknown-linux-gnu` host. Cross-compilation on other hosts may work but is not tested. + +## Testing +To test a cross-compiled binary on your build system, install the qemu binary that supports the LoongArch architecture and execute the following commands. +```text +CC_loongarch64_unknown_linux_gnu=/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-gcc \ +CXX_loongarch64_unknown_linux_gnu=/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-g++ \ +AR_loongarch64_unknown_linux_gnu=/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-gcc-ar \ +CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNUN_LINKER=/TOOLCHAIN_PATH/bin/loongarch64-unknown-linux-gnu-gcc \ +# SET TARGET SYSTEM LIBRARY PATH +CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNUN_RUNNER="qemu-loongarch64 -L /TOOLCHAIN_PATH/TARGET_LIBRAY_PATH" \ +cargo run --target loongarch64-unknown-linux-gnu --release +``` +Tested on x86 architecture, other architectures not tested. + +## Building Rust programs + +Rust does not yet ship pre-compiled artifacts for this target. To compile for this target, you will either need to build Rust with the target enabled (see "Building the target" above), or build your own copy of `std` by using `build-std` or similar. + +If `rustc` has support for that target and the library artifacts are available, then Rust static libraries can be built for that target: + +```shell +$ rustc --target loongarch64-unknown-linux-gnu your-code.rs --crate-type staticlib +$ ls libyour_code.a +``` + +On Rust Nightly it's possible to build without the target artifacts available: + +```text +cargo build -Z build-std --target loongarch64-unknown-linux-gnu +``` diff --git a/tests/ui/check-cfg/compact-values.stderr b/tests/ui/check-cfg/compact-values.stderr index 9864aa385f99e..5ca4d3b3de741 100644 --- a/tests/ui/check-cfg/compact-values.stderr +++ b/tests/ui/check-cfg/compact-values.stderr @@ -4,7 +4,7 @@ warning: unexpected `cfg` condition value LL | #[cfg(target(os = "linux", arch = "X"))] | ^^^^^^^^^^ | - = note: expected values for `target_arch` are: aarch64, arm, avr, bpf, hexagon, m68k, mips, mips64, msp430, nvptx64, powerpc, powerpc64, riscv32, riscv64, s390x, sparc, sparc64, wasm32, wasm64, x86, x86_64 + = note: expected values for `target_arch` are: aarch64, arm, avr, bpf, hexagon, loongarch64, m68k, mips, mips64, msp430, nvptx64, powerpc, powerpc64, riscv32, riscv64, s390x, sparc, sparc64, wasm32, wasm64, x86, x86_64 = note: `#[warn(unexpected_cfgs)]` on by default warning: 1 warning emitted From a5e23115bdd3b4655d2bad6076c69c90eec6f12d Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Wed, 6 Jul 2022 18:29:04 +0800 Subject: [PATCH 07/29] library/std: Add support for loongarch64 --- library/std/src/env.rs | 1 + library/std/src/os/linux/raw.rs | 1 + library/std/src/sys/common/alloc.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 183f9ab3b08f6..3014fe6e2fc2b 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -895,6 +895,7 @@ pub mod consts { /// - x86_64 /// - arm /// - aarch64 + /// - loongarch64 /// - m68k /// - mips /// - mips64 diff --git a/library/std/src/os/linux/raw.rs b/library/std/src/os/linux/raw.rs index f46028c3a96c9..c55ca8ba26e2f 100644 --- a/library/std/src/os/linux/raw.rs +++ b/library/std/src/os/linux/raw.rs @@ -231,6 +231,7 @@ mod arch { } #[cfg(any( + target_arch = "loongarch64", target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64", diff --git a/library/std/src/sys/common/alloc.rs b/library/std/src/sys/common/alloc.rs index 403a5e627f1e7..a5fcbdf39c6c6 100644 --- a/library/std/src/sys/common/alloc.rs +++ b/library/std/src/sys/common/alloc.rs @@ -22,6 +22,7 @@ pub const MIN_ALIGN: usize = 8; #[cfg(any( target_arch = "x86_64", target_arch = "aarch64", + target_arch = "loongarch64", target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64", From 50be2a30cb8d5141e45c1528b7f538094174941f Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Wed, 6 Jul 2022 18:41:14 +0800 Subject: [PATCH 08/29] library/unwind: Add definitions for loongarch64 --- library/unwind/src/libunwind.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/unwind/src/libunwind.rs b/library/unwind/src/libunwind.rs index eeeed3afcd30c..f6a68073b2f7e 100644 --- a/library/unwind/src/libunwind.rs +++ b/library/unwind/src/libunwind.rs @@ -75,6 +75,9 @@ pub const unwinder_private_data_size: usize = 20; #[cfg(all(target_arch = "hexagon", target_os = "linux"))] pub const unwinder_private_data_size: usize = 35; +#[cfg(target_arch = "loongarch64")] +pub const unwinder_private_data_size: usize = 2; + #[repr(C)] pub struct _Unwind_Exception { pub exception_class: _Unwind_Exception_Class, From f465bc7874012fdd019d8025861e6dae1e996d5e Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Thu, 7 Jul 2022 10:38:18 +0800 Subject: [PATCH 09/29] rustdoc: Add human-readable cfg string for loongarch64 --- src/librustdoc/clean/cfg.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs index dd58a5b51fc1a..5177cffe6bae4 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs @@ -517,6 +517,7 @@ impl<'a> fmt::Display for Display<'a> { "aarch64" => "AArch64", "arm" => "ARM", "asmjs" => "JavaScript", + "loongarch64" => "LoongArch LA64", "m68k" => "M68k", "mips" => "MIPS", "mips64" => "MIPS-64", From 10f7ba562a2f84ff2cfc6d5beec795c24c7e15cd Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Thu, 7 Jul 2022 11:35:08 +0800 Subject: [PATCH 10/29] Add LLVM target and cputype matching for loongarch64 --- src/bootstrap/bootstrap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 013d1ab525b0c..cd59484398c3c 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -304,6 +304,7 @@ def default_build_triple(verbose): 'i486': 'i686', 'i686': 'i686', 'i786': 'i686', + 'loongarch64': 'loongarch64', 'm68k': 'm68k', 'powerpc': 'powerpc', 'powerpc64': 'powerpc64', From ccf54177990bd569ec1903735e2c55b6b68471a8 Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Thu, 7 Jul 2022 15:46:10 +0800 Subject: [PATCH 11/29] Enable loongarch64 LLVM target --- compiler/rustc_llvm/build.rs | 1 + compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 7 +++++++ compiler/rustc_llvm/src/lib.rs | 8 ++++++++ config.example.toml | 2 +- src/bootstrap/llvm.rs | 2 +- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index f8e9ec535e456..b0783d75d4756 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -10,6 +10,7 @@ const OPTIONAL_COMPONENTS: &[&str] = &[ "aarch64", "amdgpu", "avr", + "loongarch", "m68k", "mips", "powerpc", diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index e604e44a7157b..d48b3a30fc167 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -146,6 +146,12 @@ extern "C" void LLVMTimeTraceProfilerFinish(const char* FileName) { #define SUBTARGET_HEXAGON #endif +#ifdef LLVM_COMPONENT_LOONGARCH +#define SUBTARGET_LOONGARCH SUBTARGET(LoongArch) +#else +#define SUBTARGET_LOONGARCH +#endif + #define GEN_SUBTARGETS \ SUBTARGET_X86 \ SUBTARGET_ARM \ @@ -159,6 +165,7 @@ extern "C" void LLVMTimeTraceProfilerFinish(const char* FileName) { SUBTARGET_SPARC \ SUBTARGET_HEXAGON \ SUBTARGET_RISCV \ + SUBTARGET_LOONGARCH \ #define SUBTARGET(x) \ namespace llvm { \ diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index 8542dcf5bf0fe..06351731bdecd 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -102,6 +102,14 @@ pub fn initialize_available_targets() { LLVMInitializeM68kAsmPrinter, LLVMInitializeM68kAsmParser ); + init_target!( + llvm_component = "loongarch", + LLVMInitializeLoongArchTargetInfo, + LLVMInitializeLoongArchTarget, + LLVMInitializeLoongArchTargetMC, + LLVMInitializeLoongArchAsmPrinter, + LLVMInitializeLoongArchAsmParser + ); init_target!( llvm_component = "mips", LLVMInitializeMipsTargetInfo, diff --git a/config.example.toml b/config.example.toml index 5ef83760aed2d..27b6781ca3550 100644 --- a/config.example.toml +++ b/config.example.toml @@ -88,7 +88,7 @@ changelog-seen = 2 # the resulting rustc being unable to compile for the disabled architectures. # # To add support for new targets, see https://rustc-dev-guide.rust-lang.org/building/new-target.html. -#targets = "AArch64;ARM;BPF;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86" +#targets = "AArch64;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86" # LLVM experimental targets to build support for. These targets are specified in # the same format as above, but since these targets are experimental, they are diff --git a/src/bootstrap/llvm.rs b/src/bootstrap/llvm.rs index de06f8ca8c0bb..55b2da7872d2a 100644 --- a/src/bootstrap/llvm.rs +++ b/src/bootstrap/llvm.rs @@ -291,7 +291,7 @@ impl Step for Llvm { let llvm_targets = match &builder.config.llvm_targets { Some(s) => s, None => { - "AArch64;ARM;BPF;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;\ + "AArch64;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;\ Sparc;SystemZ;WebAssembly;X86" } }; From ca8cad789675b8d8350090c4b8c3a3365d6bcd5b Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Wed, 10 Aug 2022 17:32:53 +0800 Subject: [PATCH 12/29] Add loongarch64 to exception list --- src/bootstrap/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 20b92b294fec5..61d764c05c7ec 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -129,7 +129,8 @@ const EXTRA_CHECK_CFGS: &[(Option, &'static str, Option<&[&'static str]>)] /* Extra values not defined in the built-in targets yet, but used in std */ (Some(Mode::Std), "target_env", Some(&["libnx"])), // (Some(Mode::Std), "target_os", Some(&[])), - (Some(Mode::Std), "target_arch", Some(&["asmjs", "spirv", "nvptx", "xtensa"])), + // #[cfg(bootstrap)] loongarch64 + (Some(Mode::Std), "target_arch", Some(&["asmjs", "spirv", "nvptx", "xtensa", "loongarch64"])), /* Extra names used by dependencies */ // FIXME: Used by serde_json, but we should not be triggering on external dependencies. (Some(Mode::Rustc), "no_btreemap_remove_entry", None), From b7c5323d42a661665c97e2e14223ac57068775db Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Fri, 3 Feb 2023 11:37:31 +0800 Subject: [PATCH 13/29] Add loongarch64 to fn create_object_file --- compiler/rustc_codegen_ssa/src/back/metadata.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 4ab56699922f5..19485175fd1c1 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -128,6 +128,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option Architecture::Msp430, "hexagon" => Architecture::Hexagon, "bpf" => Architecture::Bpf, + "loongarch64" => Architecture::LoongArch64, // Unsupported architecture. _ => return None, }; From 737e1d25692ff57699fddb379d62dd6ec1cb2006 Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Fri, 3 Feb 2023 11:47:27 +0800 Subject: [PATCH 14/29] loongarch64: calculate the ELF header flags --- compiler/rustc_codegen_ssa/src/back/metadata.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 19485175fd1c1..8ee7d8cf6d027 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -192,6 +192,10 @@ pub(crate) fn create_object_file(sess: &Session) -> Option { + // Source: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version + elf::EF_LARCH_OBJABI_V1 | elf::EF_LARCH_ABI_DOUBLE_FLOAT + } _ => 0, }; // adapted from LLVM's `MCELFObjectTargetWriter::getOSABI` From 7944930b0908cecfd58a47ca2b7b2b42136ada14 Mon Sep 17 00:00:00 2001 From: James Farrell Date: Thu, 6 Apr 2023 18:53:29 +0000 Subject: [PATCH 15/29] Pass host linker to compiletest. Tests marked `// force-host` were using the default linker, even if a custom linker was configured in config.toml. This change adds a new flag, --host-linker, to compiletest, and renames --linker to --target-linker. --- src/bootstrap/test.rs | 5 ++++- src/tools/compiletest/src/common.rs | 3 ++- src/tools/compiletest/src/main.rs | 9 ++++++--- src/tools/compiletest/src/runtest.rs | 11 ++++++++--- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 92a7603a9df6b..0d5672305e8b5 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1535,7 +1535,10 @@ note: if you're sure you want to do this, please open an issue as to why. In the flags.extend(builder.config.cmd.rustc_args().iter().map(|s| s.to_string())); if let Some(linker) = builder.linker(target) { - cmd.arg("--linker").arg(linker); + cmd.arg("--target-linker").arg(linker); + } + if let Some(linker) = builder.linker(compiler.host) { + cmd.arg("--host-linker").arg(linker); } let mut hostflags = flags.clone(); diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 28c045f83824b..f61d6f2521377 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -369,7 +369,8 @@ pub struct Config { pub cflags: String, pub cxxflags: String, pub ar: String, - pub linker: Option, + pub target_linker: Option, + pub host_linker: Option, pub llvm_components: String, /// Path to a NodeJS executable. Used for JS doctests, emscripten and WASM tests diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index bce61c55c3d0a..8537d72cd8724 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -132,7 +132,8 @@ pub fn parse_config(args: Vec) -> Config { .reqopt("", "cflags", "flags for the C compiler", "FLAGS") .reqopt("", "cxxflags", "flags for the CXX compiler", "FLAGS") .optopt("", "ar", "path to an archiver", "PATH") - .optopt("", "linker", "path to a linker", "PATH") + .optopt("", "target-linker", "path to a linker for the target", "PATH") + .optopt("", "host-linker", "path to a linker for the host", "PATH") .reqopt("", "llvm-components", "list of LLVM components built in", "LIST") .optopt("", "llvm-bin-dir", "Path to LLVM's `bin` directory", "PATH") .optopt("", "nodejs", "the name of nodejs", "PATH") @@ -303,7 +304,8 @@ pub fn parse_config(args: Vec) -> Config { cflags: matches.opt_str("cflags").unwrap(), cxxflags: matches.opt_str("cxxflags").unwrap(), ar: matches.opt_str("ar").unwrap_or_else(|| String::from("ar")), - linker: matches.opt_str("linker"), + target_linker: matches.opt_str("target-linker"), + host_linker: matches.opt_str("host-linker"), llvm_components: matches.opt_str("llvm-components").unwrap(), nodejs: matches.opt_str("nodejs"), npm: matches.opt_str("npm"), @@ -346,7 +348,8 @@ pub fn log_config(config: &Config) { logv(c, format!("adb_test_dir: {:?}", config.adb_test_dir)); logv(c, format!("adb_device_status: {}", config.adb_device_status)); logv(c, format!("ar: {}", config.ar)); - logv(c, format!("linker: {:?}", config.linker)); + logv(c, format!("target-linker: {:?}", config.target_linker)); + logv(c, format!("host-linker: {:?}", config.host_linker)); logv(c, format!("verbose: {}", config.verbose)); logv(c, format!("format: {:?}", config.format)); logv(c, "\n".to_string()); diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index a400307231052..957560fcee5ed 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1567,7 +1567,7 @@ impl<'test> TestCx<'test> { rustdoc.arg("--output-format").arg("json").arg("-Zunstable-options"); } - if let Some(ref linker) = self.config.linker { + if let Some(ref linker) = self.config.target_linker { rustdoc.arg(format!("-Clinker={}", linker)); } @@ -2080,10 +2080,15 @@ impl<'test> TestCx<'test> { if self.props.force_host { self.maybe_add_external_args(&mut rustc, &self.config.host_rustcflags); + if !is_rustdoc { + if let Some(ref linker) = self.config.host_linker { + rustc.arg(format!("-Clinker={}", linker)); + } + } } else { self.maybe_add_external_args(&mut rustc, &self.config.target_rustcflags); if !is_rustdoc { - if let Some(ref linker) = self.config.linker { + if let Some(ref linker) = self.config.target_linker { rustc.arg(format!("-Clinker={}", linker)); } } @@ -3035,7 +3040,7 @@ impl<'test> TestCx<'test> { cmd.env("NODE", node); } - if let Some(ref linker) = self.config.linker { + if let Some(ref linker) = self.config.target_linker { cmd.env("RUSTC_LINKER", linker); } From bf1758d229d08a1a40fb78c0031bba26060a8fe6 Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Fri, 3 Feb 2023 16:24:11 +0800 Subject: [PATCH 16/29] Define UNWIND_DATA_REG for loongarch64 --- library/std/src/personality/gcc.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/std/src/personality/gcc.rs b/library/std/src/personality/gcc.rs index 41c0fe725a540..0421b47be024e 100644 --- a/library/std/src/personality/gcc.rs +++ b/library/std/src/personality/gcc.rs @@ -77,6 +77,9 @@ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1 #[cfg(any(target_arch = "riscv64", target_arch = "riscv32"))] const UNWIND_DATA_REG: (i32, i32) = (10, 11); // x10, x11 +#[cfg(target_arch = "loongarch64")] +const UNWIND_DATA_REG: (i32, i32) = (4, 5); // a0, a1 + // The following code is based on GCC's C and C++ personality routines. For reference, see: // https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/libsupc++/eh_personality.cc // https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c From a3f0046142aec8e00d3e8192f83a8cc0bacef9e8 Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Tue, 28 Mar 2023 16:18:12 +0800 Subject: [PATCH 17/29] Define MIN_ALIGN for loongarch64 --- compiler/rustc_codegen_gcc/example/alloc_system.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_codegen_gcc/example/alloc_system.rs b/compiler/rustc_codegen_gcc/example/alloc_system.rs index 9ec18da90d819..046903fe5aca4 100644 --- a/compiler/rustc_codegen_gcc/example/alloc_system.rs +++ b/compiler/rustc_codegen_gcc/example/alloc_system.rs @@ -15,6 +15,7 @@ const MIN_ALIGN: usize = 8; #[cfg(any(target_arch = "x86_64", target_arch = "aarch64", + target_arch = "loongarch64", target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64"))] From 53fa6fe56fda45fc9ed0c3ae2a847e2745611f05 Mon Sep 17 00:00:00 2001 From: Patrik Kormosi Date: Sun, 9 Apr 2023 10:38:35 +0200 Subject: [PATCH 18/29] Fix typo in todo! macro docstring --- library/core/src/macros/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 529f62f4d6cd7..c39a269c1de4e 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -713,7 +713,7 @@ macro_rules! unimplemented { /// Indicates unfinished code. /// /// This can be useful if you are prototyping and are just looking to have your -/// code typecheck. +/// code typechecked. /// /// The difference between [`unimplemented!`] and `todo!` is that while `todo!` conveys /// an intent of implementing the functionality later and the message is "not yet From d92f74e43b76a7ec37d2ef7dfe6d930331ff5157 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 9 Apr 2023 00:09:53 +0000 Subject: [PATCH 19/29] Support safe transmute in new solver --- compiler/rustc_middle/src/ty/visit.rs | 3 ++ .../src/solve/assembly/mod.rs | 7 +++++ .../src/solve/eval_ctxt.rs | 21 ++++++++++++++ .../src/solve/project_goals.rs | 7 +++++ .../src/solve/trait_goals.rs | 29 +++++++++++++++++++ 5 files changed, 67 insertions(+) diff --git a/compiler/rustc_middle/src/ty/visit.rs b/compiler/rustc_middle/src/ty/visit.rs index 6814cadb9a8e4..08a62c900f972 100644 --- a/compiler/rustc_middle/src/ty/visit.rs +++ b/compiler/rustc_middle/src/ty/visit.rs @@ -83,6 +83,9 @@ pub trait TypeVisitableExt<'tcx>: TypeVisitable> { | TypeFlags::HAS_CT_PLACEHOLDER, ) } + fn has_non_region_placeholders(&self) -> bool { + self.has_type_flags(TypeFlags::HAS_TY_PLACEHOLDER | TypeFlags::HAS_CT_PLACEHOLDER) + } fn needs_subst(&self) -> bool { self.has_type_flags(TypeFlags::NEEDS_SUBST) } diff --git a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs index 12ee80b6722b1..a33e8ef4b4a3c 100644 --- a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs +++ b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs @@ -225,6 +225,11 @@ pub(super) trait GoalKind<'tcx>: TypeFoldable> + Copy + Eq { ecx: &mut EvalCtxt<'_, 'tcx>, goal: Goal<'tcx, Self>, ) -> QueryResult<'tcx>; + + fn consider_builtin_transmute_candidate( + ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> QueryResult<'tcx>; } impl<'tcx> EvalCtxt<'_, 'tcx> { @@ -373,6 +378,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { G::consider_builtin_discriminant_kind_candidate(self, goal) } else if lang_items.destruct_trait() == Some(trait_def_id) { G::consider_builtin_destruct_candidate(self, goal) + } else if lang_items.transmute_trait() == Some(trait_def_id) { + G::consider_builtin_transmute_candidate(self, goal) } else { Err(NoSolution) }; diff --git a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs index 28aca76cceb66..c29b5b04e000a 100644 --- a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs +++ b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs @@ -639,4 +639,25 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { crate::traits::wf::unnormalized_obligations(self.infcx, param_env, arg) .map(|obligations| obligations.into_iter().map(|obligation| obligation.into())) } + + pub(super) fn is_transmutable( + &self, + src_and_dst: rustc_transmute::Types<'tcx>, + scope: Ty<'tcx>, + assume: rustc_transmute::Assume, + ) -> Result { + // FIXME(transmutability): This really should be returning nested goals for `Answer::If*` + match rustc_transmute::TransmuteTypeEnv::new(self.infcx).is_transmutable( + ObligationCause::dummy(), + ty::Binder::dummy(src_and_dst), + scope, + assume, + ) { + rustc_transmute::Answer::Yes => Ok(Certainty::Yes), + rustc_transmute::Answer::No(_) + | rustc_transmute::Answer::IfTransmutable { .. } + | rustc_transmute::Answer::IfAll(_) + | rustc_transmute::Answer::IfAny(_) => Err(NoSolution), + } + } } diff --git a/compiler/rustc_trait_selection/src/solve/project_goals.rs b/compiler/rustc_trait_selection/src/solve/project_goals.rs index 2a47da81ec760..14cb43b89c3aa 100644 --- a/compiler/rustc_trait_selection/src/solve/project_goals.rs +++ b/compiler/rustc_trait_selection/src/solve/project_goals.rs @@ -524,6 +524,13 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> { ) -> QueryResult<'tcx> { bug!("`Destruct` does not have an associated type: {:?}", goal); } + + fn consider_builtin_transmute_candidate( + _ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> QueryResult<'tcx> { + bug!("`BikeshedIntrinsicFrom` does not have an associated type: {:?}", goal) + } } /// This behavior is also implemented in `rustc_ty_utils` and in the old `project` code. diff --git a/compiler/rustc_trait_selection/src/solve/trait_goals.rs b/compiler/rustc_trait_selection/src/solve/trait_goals.rs index 81f89fd950c8d..c7375c9ffa64b 100644 --- a/compiler/rustc_trait_selection/src/solve/trait_goals.rs +++ b/compiler/rustc_trait_selection/src/solve/trait_goals.rs @@ -556,6 +556,35 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { Err(NoSolution) } } + + fn consider_builtin_transmute_candidate( + ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> QueryResult<'tcx> { + // `rustc_transmute` does not have support for type or const params + if goal.has_non_region_placeholders() { + return Err(NoSolution); + } + + // Erase regions because we compute layouts in `rustc_transmute`, + // which will ICE for region vars. + let substs = ecx.tcx().erase_regions(goal.predicate.trait_ref.substs); + + let Some(assume) = rustc_transmute::Assume::from_const( + ecx.tcx(), + goal.param_env, + substs.const_at(3), + ) else { + return Err(NoSolution); + }; + + let certainty = ecx.is_transmutable( + rustc_transmute::Types { dst: substs.type_at(0), src: substs.type_at(1) }, + substs.type_at(2), + assume, + )?; + ecx.evaluate_added_goals_and_make_canonical_response(certainty) + } } impl<'tcx> EvalCtxt<'_, 'tcx> { From 4adee91eac5f9cbe32078303f391cf30671ec61a Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 9 Apr 2023 21:22:18 +0000 Subject: [PATCH 20/29] tests --- .../{bool.stderr => bool.current.stderr} | 4 +- .../primitives/bool.next.stderr | 19 + tests/ui/transmutability/primitives/bool.rs | 4 +- ...{numbers.stderr => numbers.current.stderr} | 228 ++--- .../primitives/numbers.next.stderr | 915 ++++++++++++++++++ .../ui/transmutability/primitives/numbers.rs | 3 + .../{unit.stderr => unit.current.stderr} | 4 +- .../primitives/unit.next.stderr | 25 + tests/ui/transmutability/primitives/unit.rs | 3 + ...ences.stderr => references.current.stderr} | 4 +- .../ui/transmutability/references.next.stderr | 26 + tests/ui/transmutability/references.rs | 3 + 12 files changed, 1117 insertions(+), 121 deletions(-) rename tests/ui/transmutability/primitives/{bool.stderr => bool.current.stderr} (94%) create mode 100644 tests/ui/transmutability/primitives/bool.next.stderr rename tests/ui/transmutability/primitives/{numbers.stderr => numbers.current.stderr} (94%) create mode 100644 tests/ui/transmutability/primitives/numbers.next.stderr rename tests/ui/transmutability/primitives/{unit.stderr => unit.current.stderr} (95%) create mode 100644 tests/ui/transmutability/primitives/unit.next.stderr rename tests/ui/transmutability/{references.stderr => references.current.stderr} (95%) create mode 100644 tests/ui/transmutability/references.next.stderr diff --git a/tests/ui/transmutability/primitives/bool.stderr b/tests/ui/transmutability/primitives/bool.current.stderr similarity index 94% rename from tests/ui/transmutability/primitives/bool.stderr rename to tests/ui/transmutability/primitives/bool.current.stderr index 22decf15e546b..999302224eebf 100644 --- a/tests/ui/transmutability/primitives/bool.stderr +++ b/tests/ui/transmutability/primitives/bool.current.stderr @@ -1,12 +1,12 @@ error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`. - --> $DIR/bool.rs:22:35 + --> $DIR/bool.rs:24:35 | LL | assert::is_transmutable::(); | ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `bool` note: required by a bound in `is_transmutable` - --> $DIR/bool.rs:12:14 + --> $DIR/bool.rs:14:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function diff --git a/tests/ui/transmutability/primitives/bool.next.stderr b/tests/ui/transmutability/primitives/bool.next.stderr new file mode 100644 index 0000000000000..999302224eebf --- /dev/null +++ b/tests/ui/transmutability/primitives/bool.next.stderr @@ -0,0 +1,19 @@ +error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`. + --> $DIR/bool.rs:24:35 + | +LL | assert::is_transmutable::(); + | ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `bool` +note: required by a bound in `is_transmutable` + --> $DIR/bool.rs:14:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/primitives/bool.rs b/tests/ui/transmutability/primitives/bool.rs index eebb74fff471c..de77cfc78aa89 100644 --- a/tests/ui/transmutability/primitives/bool.rs +++ b/tests/ui/transmutability/primitives/bool.rs @@ -1,8 +1,10 @@ +// revisions: current next +//[next] compile-flags: -Ztrait-solver=next + #![crate_type = "lib"] #![feature(transmutability)] #![allow(dead_code)] #![allow(incomplete_features)] - mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; diff --git a/tests/ui/transmutability/primitives/numbers.stderr b/tests/ui/transmutability/primitives/numbers.current.stderr similarity index 94% rename from tests/ui/transmutability/primitives/numbers.stderr rename to tests/ui/transmutability/primitives/numbers.current.stderr index c04a0e82aa283..bbf1f1669995e 100644 --- a/tests/ui/transmutability/primitives/numbers.stderr +++ b/tests/ui/transmutability/primitives/numbers.current.stderr @@ -1,12 +1,12 @@ error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:62:40 + --> $DIR/numbers.rs:65:40 | LL | assert::is_transmutable::< i8, i16>(); | ^^^ `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -15,14 +15,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:63:40 + --> $DIR/numbers.rs:66:40 | LL | assert::is_transmutable::< i8, u16>(); | ^^^ `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -31,14 +31,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:64:40 + --> $DIR/numbers.rs:67:40 | LL | assert::is_transmutable::< i8, i32>(); | ^^^ `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -47,14 +47,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:65:40 + --> $DIR/numbers.rs:68:40 | LL | assert::is_transmutable::< i8, f32>(); | ^^^ `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -63,14 +63,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:66:40 + --> $DIR/numbers.rs:69:40 | LL | assert::is_transmutable::< i8, u32>(); | ^^^ `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -79,14 +79,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:67:40 + --> $DIR/numbers.rs:70:40 | LL | assert::is_transmutable::< i8, u64>(); | ^^^ `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -95,14 +95,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:68:40 + --> $DIR/numbers.rs:71:40 | LL | assert::is_transmutable::< i8, i64>(); | ^^^ `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -111,14 +111,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:69:40 + --> $DIR/numbers.rs:72:40 | LL | assert::is_transmutable::< i8, f64>(); | ^^^ `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -127,14 +127,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:70:39 + --> $DIR/numbers.rs:73:39 | LL | assert::is_transmutable::< i8, u128>(); | ^^^^ `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -143,14 +143,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:71:39 + --> $DIR/numbers.rs:74:39 | LL | assert::is_transmutable::< i8, i128>(); | ^^^^ `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -159,14 +159,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:73:40 + --> $DIR/numbers.rs:76:40 | LL | assert::is_transmutable::< u8, i16>(); | ^^^ `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -175,14 +175,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:74:40 + --> $DIR/numbers.rs:77:40 | LL | assert::is_transmutable::< u8, u16>(); | ^^^ `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -191,14 +191,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:75:40 + --> $DIR/numbers.rs:78:40 | LL | assert::is_transmutable::< u8, i32>(); | ^^^ `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -207,14 +207,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:76:40 + --> $DIR/numbers.rs:79:40 | LL | assert::is_transmutable::< u8, f32>(); | ^^^ `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -223,14 +223,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:77:40 + --> $DIR/numbers.rs:80:40 | LL | assert::is_transmutable::< u8, u32>(); | ^^^ `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -239,14 +239,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:78:40 + --> $DIR/numbers.rs:81:40 | LL | assert::is_transmutable::< u8, u64>(); | ^^^ `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -255,14 +255,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:79:40 + --> $DIR/numbers.rs:82:40 | LL | assert::is_transmutable::< u8, i64>(); | ^^^ `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -271,14 +271,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:80:40 + --> $DIR/numbers.rs:83:40 | LL | assert::is_transmutable::< u8, f64>(); | ^^^ `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -287,14 +287,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:81:39 + --> $DIR/numbers.rs:84:39 | LL | assert::is_transmutable::< u8, u128>(); | ^^^^ `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -303,14 +303,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:82:39 + --> $DIR/numbers.rs:85:39 | LL | assert::is_transmutable::< u8, i128>(); | ^^^^ `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -319,14 +319,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:84:40 + --> $DIR/numbers.rs:87:40 | LL | assert::is_transmutable::< i16, i32>(); | ^^^ `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -335,14 +335,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:85:40 + --> $DIR/numbers.rs:88:40 | LL | assert::is_transmutable::< i16, f32>(); | ^^^ `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -351,14 +351,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:86:40 + --> $DIR/numbers.rs:89:40 | LL | assert::is_transmutable::< i16, u32>(); | ^^^ `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -367,14 +367,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:87:40 + --> $DIR/numbers.rs:90:40 | LL | assert::is_transmutable::< i16, u64>(); | ^^^ `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -383,14 +383,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:88:40 + --> $DIR/numbers.rs:91:40 | LL | assert::is_transmutable::< i16, i64>(); | ^^^ `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -399,14 +399,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:89:40 + --> $DIR/numbers.rs:92:40 | LL | assert::is_transmutable::< i16, f64>(); | ^^^ `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -415,14 +415,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:90:39 + --> $DIR/numbers.rs:93:39 | LL | assert::is_transmutable::< i16, u128>(); | ^^^^ `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -431,14 +431,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:91:39 + --> $DIR/numbers.rs:94:39 | LL | assert::is_transmutable::< i16, i128>(); | ^^^^ `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -447,14 +447,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:93:40 + --> $DIR/numbers.rs:96:40 | LL | assert::is_transmutable::< u16, i32>(); | ^^^ `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -463,14 +463,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:94:40 + --> $DIR/numbers.rs:97:40 | LL | assert::is_transmutable::< u16, f32>(); | ^^^ `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -479,14 +479,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:95:40 + --> $DIR/numbers.rs:98:40 | LL | assert::is_transmutable::< u16, u32>(); | ^^^ `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -495,14 +495,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:96:40 + --> $DIR/numbers.rs:99:40 | LL | assert::is_transmutable::< u16, u64>(); | ^^^ `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -511,14 +511,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:97:40 + --> $DIR/numbers.rs:100:40 | LL | assert::is_transmutable::< u16, i64>(); | ^^^ `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -527,14 +527,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:98:40 + --> $DIR/numbers.rs:101:40 | LL | assert::is_transmutable::< u16, f64>(); | ^^^ `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -543,14 +543,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:99:39 + --> $DIR/numbers.rs:102:39 | LL | assert::is_transmutable::< u16, u128>(); | ^^^^ `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -559,14 +559,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:100:39 + --> $DIR/numbers.rs:103:39 | LL | assert::is_transmutable::< u16, i128>(); | ^^^^ `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -575,14 +575,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:102:40 + --> $DIR/numbers.rs:105:40 | LL | assert::is_transmutable::< i32, u64>(); | ^^^ `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -591,14 +591,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:103:40 + --> $DIR/numbers.rs:106:40 | LL | assert::is_transmutable::< i32, i64>(); | ^^^ `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -607,14 +607,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:104:40 + --> $DIR/numbers.rs:107:40 | LL | assert::is_transmutable::< i32, f64>(); | ^^^ `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -623,14 +623,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:105:39 + --> $DIR/numbers.rs:108:39 | LL | assert::is_transmutable::< i32, u128>(); | ^^^^ `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -639,14 +639,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:106:39 + --> $DIR/numbers.rs:109:39 | LL | assert::is_transmutable::< i32, i128>(); | ^^^^ `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -655,14 +655,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:108:40 + --> $DIR/numbers.rs:111:40 | LL | assert::is_transmutable::< f32, u64>(); | ^^^ `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -671,14 +671,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:109:40 + --> $DIR/numbers.rs:112:40 | LL | assert::is_transmutable::< f32, i64>(); | ^^^ `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -687,14 +687,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:110:40 + --> $DIR/numbers.rs:113:40 | LL | assert::is_transmutable::< f32, f64>(); | ^^^ `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -703,14 +703,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:111:39 + --> $DIR/numbers.rs:114:39 | LL | assert::is_transmutable::< f32, u128>(); | ^^^^ `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -719,14 +719,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:112:39 + --> $DIR/numbers.rs:115:39 | LL | assert::is_transmutable::< f32, i128>(); | ^^^^ `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -735,14 +735,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:114:40 + --> $DIR/numbers.rs:117:40 | LL | assert::is_transmutable::< u32, u64>(); | ^^^ `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -751,14 +751,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:115:40 + --> $DIR/numbers.rs:118:40 | LL | assert::is_transmutable::< u32, i64>(); | ^^^ `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -767,14 +767,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:116:40 + --> $DIR/numbers.rs:119:40 | LL | assert::is_transmutable::< u32, f64>(); | ^^^ `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -783,14 +783,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:117:39 + --> $DIR/numbers.rs:120:39 | LL | assert::is_transmutable::< u32, u128>(); | ^^^^ `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -799,14 +799,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:118:39 + --> $DIR/numbers.rs:121:39 | LL | assert::is_transmutable::< u32, i128>(); | ^^^^ `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -815,14 +815,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:120:39 + --> $DIR/numbers.rs:123:39 | LL | assert::is_transmutable::< u64, u128>(); | ^^^^ `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -831,14 +831,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:121:39 + --> $DIR/numbers.rs:124:39 | LL | assert::is_transmutable::< u64, i128>(); | ^^^^ `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -847,14 +847,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:123:39 + --> $DIR/numbers.rs:126:39 | LL | assert::is_transmutable::< i64, u128>(); | ^^^^ `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -863,14 +863,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:124:39 + --> $DIR/numbers.rs:127:39 | LL | assert::is_transmutable::< i64, i128>(); | ^^^^ `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -879,14 +879,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:126:39 + --> $DIR/numbers.rs:129:39 | LL | assert::is_transmutable::< f64, u128>(); | ^^^^ `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -895,14 +895,14 @@ LL | Dst: BikeshedIntrinsicFrom | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. - --> $DIR/numbers.rs:127:39 + --> $DIR/numbers.rs:130:39 | LL | assert::is_transmutable::< f64, i128>(); | ^^^^ `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:12:14 + --> $DIR/numbers.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function diff --git a/tests/ui/transmutability/primitives/numbers.next.stderr b/tests/ui/transmutability/primitives/numbers.next.stderr new file mode 100644 index 0000000000000..bbf1f1669995e --- /dev/null +++ b/tests/ui/transmutability/primitives/numbers.next.stderr @@ -0,0 +1,915 @@ +error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:65:40 + | +LL | assert::is_transmutable::< i8, i16>(); + | ^^^ `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:66:40 + | +LL | assert::is_transmutable::< i8, u16>(); + | ^^^ `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:67:40 + | +LL | assert::is_transmutable::< i8, i32>(); + | ^^^ `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:68:40 + | +LL | assert::is_transmutable::< i8, f32>(); + | ^^^ `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:69:40 + | +LL | assert::is_transmutable::< i8, u32>(); + | ^^^ `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:70:40 + | +LL | assert::is_transmutable::< i8, u64>(); + | ^^^ `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:71:40 + | +LL | assert::is_transmutable::< i8, i64>(); + | ^^^ `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:72:40 + | +LL | assert::is_transmutable::< i8, f64>(); + | ^^^ `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:73:39 + | +LL | assert::is_transmutable::< i8, u128>(); + | ^^^^ `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:74:39 + | +LL | assert::is_transmutable::< i8, i128>(); + | ^^^^ `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:76:40 + | +LL | assert::is_transmutable::< u8, i16>(); + | ^^^ `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:77:40 + | +LL | assert::is_transmutable::< u8, u16>(); + | ^^^ `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:78:40 + | +LL | assert::is_transmutable::< u8, i32>(); + | ^^^ `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:79:40 + | +LL | assert::is_transmutable::< u8, f32>(); + | ^^^ `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:80:40 + | +LL | assert::is_transmutable::< u8, u32>(); + | ^^^ `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:81:40 + | +LL | assert::is_transmutable::< u8, u64>(); + | ^^^ `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:82:40 + | +LL | assert::is_transmutable::< u8, i64>(); + | ^^^ `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:83:40 + | +LL | assert::is_transmutable::< u8, f64>(); + | ^^^ `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:84:39 + | +LL | assert::is_transmutable::< u8, u128>(); + | ^^^^ `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:85:39 + | +LL | assert::is_transmutable::< u8, i128>(); + | ^^^^ `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:87:40 + | +LL | assert::is_transmutable::< i16, i32>(); + | ^^^ `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:88:40 + | +LL | assert::is_transmutable::< i16, f32>(); + | ^^^ `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:89:40 + | +LL | assert::is_transmutable::< i16, u32>(); + | ^^^ `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:90:40 + | +LL | assert::is_transmutable::< i16, u64>(); + | ^^^ `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:91:40 + | +LL | assert::is_transmutable::< i16, i64>(); + | ^^^ `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:92:40 + | +LL | assert::is_transmutable::< i16, f64>(); + | ^^^ `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:93:39 + | +LL | assert::is_transmutable::< i16, u128>(); + | ^^^^ `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:94:39 + | +LL | assert::is_transmutable::< i16, i128>(); + | ^^^^ `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:96:40 + | +LL | assert::is_transmutable::< u16, i32>(); + | ^^^ `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:97:40 + | +LL | assert::is_transmutable::< u16, f32>(); + | ^^^ `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:98:40 + | +LL | assert::is_transmutable::< u16, u32>(); + | ^^^ `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:99:40 + | +LL | assert::is_transmutable::< u16, u64>(); + | ^^^ `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:100:40 + | +LL | assert::is_transmutable::< u16, i64>(); + | ^^^ `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:101:40 + | +LL | assert::is_transmutable::< u16, f64>(); + | ^^^ `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:102:39 + | +LL | assert::is_transmutable::< u16, u128>(); + | ^^^^ `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:103:39 + | +LL | assert::is_transmutable::< u16, i128>(); + | ^^^^ `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:105:40 + | +LL | assert::is_transmutable::< i32, u64>(); + | ^^^ `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:106:40 + | +LL | assert::is_transmutable::< i32, i64>(); + | ^^^ `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:107:40 + | +LL | assert::is_transmutable::< i32, f64>(); + | ^^^ `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:108:39 + | +LL | assert::is_transmutable::< i32, u128>(); + | ^^^^ `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:109:39 + | +LL | assert::is_transmutable::< i32, i128>(); + | ^^^^ `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:111:40 + | +LL | assert::is_transmutable::< f32, u64>(); + | ^^^ `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:112:40 + | +LL | assert::is_transmutable::< f32, i64>(); + | ^^^ `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:113:40 + | +LL | assert::is_transmutable::< f32, f64>(); + | ^^^ `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:114:39 + | +LL | assert::is_transmutable::< f32, u128>(); + | ^^^^ `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:115:39 + | +LL | assert::is_transmutable::< f32, i128>(); + | ^^^^ `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:117:40 + | +LL | assert::is_transmutable::< u32, u64>(); + | ^^^ `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:118:40 + | +LL | assert::is_transmutable::< u32, i64>(); + | ^^^ `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:119:40 + | +LL | assert::is_transmutable::< u32, f64>(); + | ^^^ `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:120:39 + | +LL | assert::is_transmutable::< u32, u128>(); + | ^^^^ `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:121:39 + | +LL | assert::is_transmutable::< u32, i128>(); + | ^^^^ `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:123:39 + | +LL | assert::is_transmutable::< u64, u128>(); + | ^^^^ `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:124:39 + | +LL | assert::is_transmutable::< u64, i128>(); + | ^^^^ `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:126:39 + | +LL | assert::is_transmutable::< i64, u128>(); + | ^^^^ `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:127:39 + | +LL | assert::is_transmutable::< i64, i128>(); + | ^^^^ `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:129:39 + | +LL | assert::is_transmutable::< f64, u128>(); + | ^^^^ `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + --> $DIR/numbers.rs:130:39 + | +LL | assert::is_transmutable::< f64, i128>(); + | ^^^^ `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` +note: required by a bound in `is_transmutable` + --> $DIR/numbers.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error: aborting due to 57 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/primitives/numbers.rs b/tests/ui/transmutability/primitives/numbers.rs index 0df43d2045f72..e980e91ed06a6 100644 --- a/tests/ui/transmutability/primitives/numbers.rs +++ b/tests/ui/transmutability/primitives/numbers.rs @@ -1,3 +1,6 @@ +// revisions: current next +//[next] compile-flags: -Ztrait-solver=next + #![crate_type = "lib"] #![feature(transmutability)] #![allow(dead_code)] diff --git a/tests/ui/transmutability/primitives/unit.stderr b/tests/ui/transmutability/primitives/unit.current.stderr similarity index 95% rename from tests/ui/transmutability/primitives/unit.stderr rename to tests/ui/transmutability/primitives/unit.current.stderr index 988cd33b3bf7b..c20355e16f5f4 100644 --- a/tests/ui/transmutability/primitives/unit.stderr +++ b/tests/ui/transmutability/primitives/unit.current.stderr @@ -1,12 +1,12 @@ error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`. - --> $DIR/unit.rs:28:35 + --> $DIR/unit.rs:31:35 | LL | assert::is_transmutable::<(), u8, Context>(); | ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`. | = help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u8` note: required by a bound in `is_transmutable` - --> $DIR/unit.rs:12:14 + --> $DIR/unit.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this function diff --git a/tests/ui/transmutability/primitives/unit.next.stderr b/tests/ui/transmutability/primitives/unit.next.stderr new file mode 100644 index 0000000000000..c20355e16f5f4 --- /dev/null +++ b/tests/ui/transmutability/primitives/unit.next.stderr @@ -0,0 +1,25 @@ +error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`. + --> $DIR/unit.rs:31:35 + | +LL | assert::is_transmutable::<(), u8, Context>(); + | ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`. + | + = help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u8` +note: required by a bound in `is_transmutable` + --> $DIR/unit.rs:15:14 + | +LL | pub fn is_transmutable() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/primitives/unit.rs b/tests/ui/transmutability/primitives/unit.rs index 1975a61de9882..12eac175106e6 100644 --- a/tests/ui/transmutability/primitives/unit.rs +++ b/tests/ui/transmutability/primitives/unit.rs @@ -1,3 +1,6 @@ +// revisions: current next +//[next] compile-flags: -Ztrait-solver=next + //! The unit type, `()`, should be one byte. #![crate_type = "lib"] diff --git a/tests/ui/transmutability/references.stderr b/tests/ui/transmutability/references.current.stderr similarity index 95% rename from tests/ui/transmutability/references.stderr rename to tests/ui/transmutability/references.current.stderr index eb3bd03fd3169..39d42cc4fa6c8 100644 --- a/tests/ui/transmutability/references.stderr +++ b/tests/ui/transmutability/references.current.stderr @@ -1,12 +1,12 @@ error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`. - --> $DIR/references.rs:26:52 + --> $DIR/references.rs:29:52 | LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>(); | ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`. | = help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `&'static Unit` note: required by a bound in `is_maybe_transmutable` - --> $DIR/references.rs:13:14 + --> $DIR/references.rs:16:14 | LL | pub fn is_maybe_transmutable() | --------------------- required by a bound in this function diff --git a/tests/ui/transmutability/references.next.stderr b/tests/ui/transmutability/references.next.stderr new file mode 100644 index 0000000000000..39d42cc4fa6c8 --- /dev/null +++ b/tests/ui/transmutability/references.next.stderr @@ -0,0 +1,26 @@ +error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`. + --> $DIR/references.rs:29:52 + | +LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>(); + | ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`. + | + = help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `&'static Unit` +note: required by a bound in `is_maybe_transmutable` + --> $DIR/references.rs:16:14 + | +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/references.rs b/tests/ui/transmutability/references.rs index af3ff0ec1d205..8c2b25ebba1e3 100644 --- a/tests/ui/transmutability/references.rs +++ b/tests/ui/transmutability/references.rs @@ -1,3 +1,6 @@ +// revisions: current next +//[next] compile-flags: -Ztrait-solver=next + //! Transmutations involving references are not yet supported. #![crate_type = "lib"] From b410f3f7aeea95ba5362bb5dddbf5e66183adc40 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Mon, 10 Apr 2023 21:02:29 +0200 Subject: [PATCH 21/29] Fix typos in librustdoc --- src/librustdoc/clean/types.rs | 2 +- src/librustdoc/config.rs | 2 +- src/librustdoc/html/format.rs | 4 ++-- src/librustdoc/html/render/print_item.rs | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index a37d4f316439a..cd97766752d28 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -2019,7 +2019,7 @@ impl Variant { #[derive(Clone, Debug)] pub(crate) struct Discriminant { - // In the case of cross crate re-exports, we don't have the nessesary information + // In the case of cross crate re-exports, we don't have the necessary information // to reconstruct the expression of the discriminant, only the value. pub(super) expr: Option, pub(super) value: DefId, diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index ea8c7e9a67c32..c848089dad6b9 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -230,7 +230,7 @@ pub(crate) struct RenderOptions { pub(crate) extension_css: Option, /// A map of crate names to the URL to use instead of querying the crate's `html_root_url`. pub(crate) extern_html_root_urls: BTreeMap, - /// Whether to give precedence to `html_root_url` or `--exten-html-root-url`. + /// Whether to give precedence to `html_root_url` or `--extern-html-root-url`. pub(crate) extern_html_root_takes_precedence: bool, /// A map of the default settings (values are as for DOM storage API). Keys should lack the /// `rustdoc-` prefix. diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 7a2449cbe9ace..1b445b8981e1a 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -349,10 +349,10 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>( let mut br_with_padding = String::with_capacity(6 * indent + 28); br_with_padding.push_str("\n"); - let padding_amout = + let padding_amount = if ending == Ending::Newline { indent + 4 } else { indent + "fn where ".len() }; - for _ in 0..padding_amout { + for _ in 0..padding_amount { br_with_padding.push_str(" "); } let where_preds = where_preds.to_string().replace('\n', &br_with_padding); diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 6bce57340040b..9a968e48b272f 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -1796,10 +1796,11 @@ fn render_struct( } match ty { None => { - let where_diplayed = g.map(|g| print_where_clause_and_check(w, g, cx)).unwrap_or(false); + let where_displayed = + g.map(|g| print_where_clause_and_check(w, g, cx)).unwrap_or(false); // If there wasn't a `where` clause, we add a whitespace. - if !where_diplayed { + if !where_displayed { w.write_str(" {"); } else { w.write_str("{"); From f470c299366c4598fe2477d3e7a846e220abb75e Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Mon, 10 Apr 2023 21:02:49 +0200 Subject: [PATCH 22/29] Fix remaining typos --- config.example.toml | 2 +- src/bootstrap/channel.rs | 2 +- src/doc/style-guide/src/expressions.md | 2 +- .../compiler-flags/dump-mono-stats-format.md | 2 +- src/etc/installer/msi/rust.wxs | 2 +- src/rustdoc-json-types/lib.rs | 2 +- .../collect-license-metadata/src/path_tree.rs | 88 +++++++++---------- src/tools/generate-copyright/src/main.rs | 14 +-- src/tools/jsondocck/src/main.rs | 2 +- src/tools/jsondoclint/src/item_kind.rs | 4 +- src/tools/jsondoclint/src/main.rs | 6 +- src/tools/publish_toolstate.py | 6 +- triagebot.toml | 4 +- 13 files changed, 68 insertions(+), 68 deletions(-) diff --git a/config.example.toml b/config.example.toml index b27a34e61c545..081b3638383df 100644 --- a/config.example.toml +++ b/config.example.toml @@ -257,7 +257,7 @@ changelog-seen = 2 #python = "python" # The path to the REUSE executable to use. Note that REUSE is not required in -# most cases, as our tooling relies on a cached (and shrinked) copy of the +# most cases, as our tooling relies on a cached (and shrunk) copy of the # REUSE output present in the git repository and in our source tarballs. # # REUSE is only needed if your changes caused the overall licensing of the diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index 390047f6fdce1..c3e3fa009a677 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -139,7 +139,7 @@ pub fn read_commit_info_file(root: &Path) -> Option { sha: sha.to_owned(), short_sha: short_sha.to_owned(), }, - _ => panic!("the `git-comit-info` file is malformed"), + _ => panic!("the `git-commit-info` file is malformed"), }; Some(info) } else { diff --git a/src/doc/style-guide/src/expressions.md b/src/doc/style-guide/src/expressions.md index c7d0446dded19..96f66c89c259f 100644 --- a/src/doc/style-guide/src/expressions.md +++ b/src/doc/style-guide/src/expressions.md @@ -643,7 +643,7 @@ Examples: ```rust match foo { foo => bar, - a_very_long_patten | another_pattern if an_expression() => { + a_very_long_pattern | another_pattern if an_expression() => { no_room_for_this_expression() } foo => { diff --git a/src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md b/src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md index a497a75261fed..05ffdcf201c82 100644 --- a/src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md +++ b/src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md @@ -3,4 +3,4 @@ -------------------- The `-Z dump-mono-stats-format` compiler flag controls what file format to use for `-Z dump-mono-stats`. -The default is markdown; currently JSON is also supported. JSON can be useful for programatically manipulating the results (e.g. to find the item that took the longest to compile). +The default is markdown; currently JSON is also supported. JSON can be useful for programmatically manipulating the results (e.g. to find the item that took the longest to compile). diff --git a/src/etc/installer/msi/rust.wxs b/src/etc/installer/msi/rust.wxs index 9f4e4fd0611df..f29e1e4d27a27 100644 --- a/src/etc/installer/msi/rust.wxs +++ b/src/etc/installer/msi/rust.wxs @@ -119,7 +119,7 @@ NOT ALLUSERS - + NOT ALLUSERS diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 4c210291b113b..3cf8ceed62036 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -550,7 +550,7 @@ pub enum Type { DynTrait(DynTrait), /// Parameterized types Generic(String), - /// Built in numberic (i*, u*, f*) types, bool, and char + /// Built in numeric (i*, u*, f*) types, bool, and char Primitive(String), /// `extern "ABI" fn` FunctionPointer(Box), diff --git a/src/tools/collect-license-metadata/src/path_tree.rs b/src/tools/collect-license-metadata/src/path_tree.rs index 7a2a440636d91..68b6cef643272 100644 --- a/src/tools/collect-license-metadata/src/path_tree.rs +++ b/src/tools/collect-license-metadata/src/path_tree.rs @@ -10,8 +10,8 @@ use std::path::{Path, PathBuf}; #[derive(serde::Serialize)] #[serde(rename_all = "kebab-case", tag = "type")] pub(crate) enum Node { - Root { childs: Vec> }, - Directory { name: PathBuf, childs: Vec>, license: Option }, + Root { children: Vec> }, + Directory { name: PathBuf, children: Vec>, license: Option }, File { name: PathBuf, license: L }, Group { files: Vec, directories: Vec, license: L }, Empty, @@ -48,14 +48,14 @@ impl Node { /// ``` fn merge_directories(&mut self) { match self { - Node::Root { childs } | Node::Directory { childs, license: None, .. } => { + Node::Root { children } | Node::Directory { children, license: None, .. } => { let mut directories = BTreeMap::new(); let mut files = Vec::new(); - for child in childs.drain(..) { + for child in children.drain(..) { match child { - Node::Directory { name, mut childs, license: None } => { - directories.entry(name).or_insert_with(Vec::new).append(&mut childs); + Node::Directory { name, mut children, license: None } => { + directories.entry(name).or_insert_with(Vec::new).append(&mut children); } file @ Node::File { .. } => { files.push(file); @@ -73,14 +73,14 @@ impl Node { } } - childs.extend(directories.into_iter().map(|(name, childs)| Node::Directory { + children.extend(directories.into_iter().map(|(name, children)| Node::Directory { name, - childs, + children, license: None, })); - childs.append(&mut files); + children.append(&mut files); - for child in &mut *childs { + for child in &mut *children { child.merge_directories(); } } @@ -105,13 +105,13 @@ impl Node { /// our inclusion of LLVM. fn collapse_in_licensed_directories(&mut self) { match self { - Node::Directory { childs, license, .. } => { - for child in &mut *childs { + Node::Directory { children, license, .. } => { + for child in &mut *children { child.collapse_in_licensed_directories(); } let mut licenses_count = BTreeMap::new(); - for child in &*childs { + for child in &*children { let Some(license) = child.license() else { continue }; *licenses_count.entry(license).or_insert(0) += 1; } @@ -122,12 +122,12 @@ impl Node { .map(|(license, _)| license); if let Some(most_popular_license) = most_popular_license { - childs.retain(|child| child.license() != Some(most_popular_license)); + children.retain(|child| child.license() != Some(most_popular_license)); *license = Some(most_popular_license); } } - Node::Root { childs } => { - for child in &mut *childs { + Node::Root { children } => { + for child in &mut *children { child.collapse_in_licensed_directories(); } } @@ -138,29 +138,29 @@ impl Node { } /// Reduce the depth of the tree by merging subdirectories with the same license as their - /// parent directory into their parent, and adjusting the paths of the childs accordingly. + /// parent directory into their parent, and adjusting the paths of the children accordingly. fn merge_directory_licenses(&mut self) { match self { - Node::Root { childs } => { - for child in &mut *childs { + Node::Root { children } => { + for child in &mut *children { child.merge_directory_licenses(); } } - Node::Directory { childs, license, .. } => { + Node::Directory { children, license, .. } => { let mut to_add = Vec::new(); - for child in &mut *childs { + for child in &mut *children { child.merge_directory_licenses(); let Node::Directory { name: child_name, - childs: child_childs, + children: child_children, license: child_license, } = child else { continue }; if child_license != license { continue; } - for mut child_child in child_childs.drain(..) { + for mut child_child in child_children.drain(..) { match &mut child_child { Node::Root { .. } => { panic!("can't have a root inside another element"); @@ -181,7 +181,7 @@ impl Node { *child = Node::Empty; } - childs.append(&mut to_add); + children.append(&mut to_add); } Node::Empty => {} Node::File { .. } => {} @@ -203,14 +203,14 @@ impl Node { directories: Vec, } match self { - Node::Root { childs } | Node::Directory { childs, .. } => { + Node::Root { children } | Node::Directory { children, .. } => { let mut grouped: BTreeMap = BTreeMap::new(); - for child in &mut *childs { + for child in &mut *children { child.merge_groups(); match child { - Node::Directory { name, childs, license: Some(license) } => { - if childs.is_empty() { + Node::Directory { name, children, license: Some(license) } => { + if children.is_empty() { grouped .entry(*license) .or_insert_with(Grouped::default) @@ -234,16 +234,16 @@ impl Node { for (license, mut grouped) in grouped.into_iter() { if grouped.files.len() + grouped.directories.len() <= 1 { if let Some(name) = grouped.files.pop() { - childs.push(Node::File { license, name }); + children.push(Node::File { license, name }); } else if let Some(name) = grouped.directories.pop() { - childs.push(Node::Directory { + children.push(Node::Directory { name, - childs: Vec::new(), + children: Vec::new(), license: Some(license), }); } } else { - childs.push(Node::Group { + children.push(Node::Group { license, files: grouped.files, directories: grouped.directories, @@ -261,11 +261,11 @@ impl Node { /// sure to remove them from the tree. fn remove_empty(&mut self) { match self { - Node::Root { childs } | Node::Directory { childs, .. } => { - for child in &mut *childs { + Node::Root { children } | Node::Directory { children, .. } => { + for child in &mut *children { child.remove_empty(); } - childs.retain(|child| !matches!(child, Node::Empty)); + children.retain(|child| !matches!(child, Node::Empty)); } Node::Group { .. } => {} Node::File { .. } => {} @@ -275,7 +275,7 @@ impl Node { fn license(&self) -> Option { match self { - Node::Directory { childs, license: Some(license), .. } if childs.is_empty() => { + Node::Directory { children, license: Some(license), .. } if children.is_empty() => { Some(*license) } Node::File { license, .. } => Some(*license), @@ -285,7 +285,7 @@ impl Node { } pub(crate) fn build(mut input: Vec<(PathBuf, LicenseId)>) -> Node { - let mut childs = Vec::new(); + let mut children = Vec::new(); // Ensure reproducibility of all future steps. input.sort(); @@ -295,15 +295,15 @@ pub(crate) fn build(mut input: Vec<(PathBuf, LicenseId)>) -> Node { for component in path.parent().unwrap_or_else(|| Path::new(".")).components().rev() { node = Node::Directory { name: component.as_os_str().into(), - childs: vec![node], + children: vec![node], license: None, }; } - childs.push(node); + children.push(node); } - Node::Root { childs } + Node::Root { children } } /// Convert a `Node` into a `Node<&License>`, expanding all interned license IDs with a @@ -313,14 +313,14 @@ pub(crate) fn expand_interned_licenses( interner: &LicensesInterner, ) -> Node<&License> { match node { - Node::Root { childs } => Node::Root { - childs: childs + Node::Root { children } => Node::Root { + children: children .into_iter() .map(|child| expand_interned_licenses(child, interner)) .collect(), }, - Node::Directory { name, childs, license } => Node::Directory { - childs: childs + Node::Directory { name, children, license } => Node::Directory { + children: children .into_iter() .map(|child| expand_interned_licenses(child, interner)) .collect(), diff --git a/src/tools/generate-copyright/src/main.rs b/src/tools/generate-copyright/src/main.rs index 4d116c7da653a..60c77167613db 100644 --- a/src/tools/generate-copyright/src/main.rs +++ b/src/tools/generate-copyright/src/main.rs @@ -20,17 +20,17 @@ fn render_recursive(node: &Node, buffer: &mut Vec, depth: usize) -> Result<( let prefix = std::iter::repeat("> ").take(depth + 1).collect::(); match node { - Node::Root { childs } => { - for child in childs { + Node::Root { children } => { + for child in children { render_recursive(child, buffer, depth)?; } } - Node::Directory { name, childs, license } => { + Node::Directory { name, children, license } => { render_license(&prefix, std::iter::once(name), license, buffer)?; - if !childs.is_empty() { + if !children.is_empty() { writeln!(buffer, "{prefix}")?; writeln!(buffer, "{prefix}*Exceptions:*")?; - for child in childs { + for child in children { writeln!(buffer, "{prefix}")?; render_recursive(child, buffer, depth + 1)?; } @@ -73,8 +73,8 @@ struct Metadata { #[derive(serde::Deserialize)] #[serde(rename_all = "kebab-case", tag = "type")] pub(crate) enum Node { - Root { childs: Vec }, - Directory { name: String, childs: Vec, license: License }, + Root { children: Vec }, + Directory { name: String, children: Vec, license: License }, File { name: String, license: License }, Group { files: Vec, directories: Vec, license: License }, } diff --git a/src/tools/jsondocck/src/main.rs b/src/tools/jsondocck/src/main.rs index 76770fe36a708..e3d05ec83159d 100644 --- a/src/tools/jsondocck/src/main.rs +++ b/src/tools/jsondocck/src/main.rs @@ -237,7 +237,7 @@ fn check_command(command: Command, cache: &mut Cache) -> Result<(), CkError> { // Serde json doesn't implement Ord or Hash for Value, so we must // use a Vec here. While in theory that makes setwize equality - // O(n^2), in practice n will never be large enought to matter. + // O(n^2), in practice n will never be large enough to matter. let expected_values = values.iter().map(|v| string_to_value(v, cache)).collect::>(); if expected_values.len() != got_values.len() { diff --git a/src/tools/jsondoclint/src/item_kind.rs b/src/tools/jsondoclint/src/item_kind.rs index b395c6e7d2d62..45a9c93ee0b54 100644 --- a/src/tools/jsondoclint/src/item_kind.rs +++ b/src/tools/jsondoclint/src/item_kind.rs @@ -1,6 +1,6 @@ use rustdoc_json_types::{Item, ItemEnum, ItemKind, ItemSummary}; -/// A univeral way to represent an [`ItemEnum`] or [`ItemKind`] +/// A universal way to represent an [`ItemEnum`] or [`ItemKind`] #[derive(Debug, Clone, Copy)] pub(crate) enum Kind { Module, @@ -53,7 +53,7 @@ impl Kind { Primitive => true, ForeignType => true, - // FIXME(adotinthevoid): I'm not sure if these are corrent + // FIXME(adotinthevoid): I'm not sure if these are correct Keyword => false, OpaqueTy => false, ProcAttribute => false, diff --git a/src/tools/jsondoclint/src/main.rs b/src/tools/jsondoclint/src/main.rs index 05e938f4f7df4..ee163ddfdd9a8 100644 --- a/src/tools/jsondoclint/src/main.rs +++ b/src/tools/jsondoclint/src/main.rs @@ -72,7 +72,7 @@ fn main() -> Result<()> { ) } [sel] => eprintln!( - "{} not in index or paths, but refered to at '{}'", + "{} not in index or paths, but referred to at '{}'", err.id.0, json_find::to_jsonpath(&sel) ), @@ -85,12 +85,12 @@ fn main() -> Result<()> { .collect::>() .join(", "); eprintln!( - "{} not in index or paths, but refered to at {sels}", + "{} not in index or paths, but referred to at {sels}", err.id.0 ); } else { eprintln!( - "{} not in index or paths, but refered to at '{}' and {} more", + "{} not in index or paths, but referred to at '{}' and {} more", err.id.0, json_find::to_jsonpath(&sel), sels.len() - 1, diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index 395bcc745f8dd..bad86701daeda 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -86,7 +86,7 @@ def gh_url(): return os.environ['TOOLSTATE_ISSUES_API_URL'] -def maybe_delink(message): +def maybe_unlink(message): # type: (str) -> str if os.environ.get('TOOLSTATE_SKIP_MENTIONS') is not None: return message.replace("@", "") @@ -109,7 +109,7 @@ def issue( else: status_description = 'no longer builds' request = json.dumps({ - 'body': maybe_delink(textwrap.dedent('''\ + 'body': maybe_unlink(textwrap.dedent('''\ Hello, this is your friendly neighborhood mergebot. After merging PR {}, I observed that the tool {} {}. A follow-up PR to the repository {} is needed to fix the fallout. @@ -285,7 +285,7 @@ def update_latest( issue_url = gh_url() + '/{}/comments'.format(number) response = urllib2.urlopen(urllib2.Request( issue_url, - json.dumps({'body': maybe_delink(message)}).encode(), + json.dumps({'body': maybe_unlink(message)}).encode(), { 'Authorization': 'token ' + github_token, 'Content-Type': 'application/json', diff --git a/triagebot.toml b/triagebot.toml index 5f4de0562f89f..58f51959e1f81 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -344,11 +344,11 @@ message = "Some changes occurred in `const_evaluatable.rs`" cc = ["@BoxyUwU"] [mentions."compiler/rustc_middle/src/ty/abstract_const.rs"] -message = "Some changes occured in `abstract_const.rs`" +message = "Some changes occurred in `abstract_const.rs`" cc = ["@BoxyUwU"] [mentions."compiler/rustc_ty_utils/src/consts.rs"] -message = "Some changes occured in `rustc_ty_utils::consts.rs`" +message = "Some changes occurred in `rustc_ty_utils::consts.rs`" cc = ["@BoxyUwU"] [mentions."compiler/rustc_trait_selection/src/solve/"] From dd28cfbc85160c08c57390adb50d03e755c8b425 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 10 Apr 2023 15:13:49 -0700 Subject: [PATCH 23/29] rustdoc: remove redundant expandSection code from main.js This functionality is already tested in `hash-item-expansion.goml`, and was implemented twice: * First, in code that ran at load time and at hash change: 917cdd295d2eed213c135d6f984c650f016ee3d6 * Later, the hash change event handler was itself run at load time, and the code handling both cases diverged in implementation, though their behavior still matches pretty well: f66a331335f3ac931afabca6f927a9d7dc17db3e --- src/librustdoc/html/static/js/main.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 56ee4c1510e8f..a6655663b82f7 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -331,10 +331,6 @@ function preLoadCss(cssUrl) { }, }; - function getPageId() { - return window.location.hash.replace(/^#/, ""); - } - const toggleAllDocsId = "toggle-all-docs"; let savedHash = ""; @@ -355,12 +351,12 @@ function preLoadCss(cssUrl) { } } // This part is used in case an element is not visible. - if (savedHash !== window.location.hash) { - savedHash = window.location.hash; - if (savedHash.length === 0) { - return; + const pageId = window.location.hash.replace(/^#/, ""); + if (savedHash !== pageId) { + savedHash = pageId; + if (pageId !== "") { + expandSection(pageId); } - expandSection(savedHash.slice(1)); // we remove the '#' } } @@ -699,11 +695,6 @@ function preLoadCss(cssUrl) { } }); - - const pageId = getPageId(); - if (pageId !== "") { - expandSection(pageId); - } }()); window.rustdoc_add_line_numbers_to_examples = () => { From 7d269633b1e254ad21f23994bbf04a6a8296abf7 Mon Sep 17 00:00:00 2001 From: fleetingbytes <7075397+fleetingbytes@users.noreply.github.com> Date: Tue, 11 Apr 2023 04:13:35 +0200 Subject: [PATCH 24/29] Break up long first paragraph Further referring to `var_os` as a "function" (like in `var`), rather than "method". --- library/std/src/env.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 51e5c60ed294e..74394694d43ca 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -236,11 +236,12 @@ fn _var(key: &OsStr) -> Result { } /// Fetches the environment variable `key` from the current process, returning -/// [`None`] if the environment variable isn't set. It may return `None` also -/// if the environment variable's name contains +/// [`None`] if the variable isn't set or if there is another error. +/// +/// It may return `None` if the environment variable's name contains /// the equal sign character (`=`) or the NUL character. /// -/// Note that the method will not check if the environment variable +/// Note that this function will not check if the environment variable /// is valid Unicode. If you want to have an error on invalid UTF-8, /// use the [`var`] function instead. /// From 72bfd55d4b15053df3801eb920ce23032685cf1b Mon Sep 17 00:00:00 2001 From: Tomoaki Kawada Date: Tue, 11 Apr 2023 12:00:36 +0900 Subject: [PATCH 25/29] kmc-solid: Implement `Socket::read_buf` --- library/std/src/sys/solid/net.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/library/std/src/sys/solid/net.rs b/library/std/src/sys/solid/net.rs index 1b98ef993b04a..7d7bfae14329a 100644 --- a/library/std/src/sys/solid/net.rs +++ b/library/std/src/sys/solid/net.rs @@ -2,7 +2,7 @@ use super::abi; use crate::{ cmp, ffi::CStr, - io::{self, ErrorKind, IoSlice, IoSliceMut}, + io::{self, BorrowedBuf, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut}, mem, net::{Shutdown, SocketAddr}, ptr, str, @@ -294,19 +294,30 @@ impl Socket { self.0.duplicate().map(Socket) } - fn recv_with_flags(&self, buf: &mut [u8], flags: c_int) -> io::Result { + fn recv_with_flags(&self, mut buf: BorrowedCursor<'_>, flags: c_int) -> io::Result<()> { let ret = cvt(unsafe { - netc::recv(self.0.raw(), buf.as_mut_ptr() as *mut c_void, buf.len(), flags) + netc::recv(self.0.raw(), buf.as_mut().as_mut_ptr().cast(), buf.capacity(), flags) })?; - Ok(ret as usize) + unsafe { + buf.advance(ret as usize); + } + Ok(()) } pub fn read(&self, buf: &mut [u8]) -> io::Result { - self.recv_with_flags(buf, 0) + let mut buf = BorrowedBuf::from(buf); + self.recv_with_flags(buf.unfilled(), 0)?; + Ok(buf.len()) } pub fn peek(&self, buf: &mut [u8]) -> io::Result { - self.recv_with_flags(buf, MSG_PEEK) + let mut buf = BorrowedBuf::from(buf); + self.recv_with_flags(buf.unfilled(), MSG_PEEK)?; + Ok(buf.len()) + } + + pub fn read_buf(&self, buf: BorrowedCursor<'_>) -> io::Result<()> { + self.recv_with_flags(buf, 0) } pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result { From 47ff60dc09299b15102b4ebe0efd6a0446fe5a05 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 9 Apr 2023 12:31:04 -0500 Subject: [PATCH 26/29] Fix `x test ui --target foo` when download-rustc is enabled Previously, we would never build the target std, only the host std. --- src/bootstrap/compile.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index e3581943f2ca2..85d1c12cc6a09 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -83,11 +83,11 @@ impl Step for Std { let target = self.target; let compiler = self.compiler; - // These artifacts were already copied (in `impl Step for Sysroot`). - // Don't recompile them. + // When using `download-rustc`, we already have artifacts for the host available + // (they were copied in `impl Step for Sysroot`). Don't recompile them. // NOTE: the ABI of the beta compiler is different from the ABI of the downloaded compiler, // so its artifacts can't be reused. - if builder.download_rustc() && compiler.stage != 0 { + if builder.download_rustc() && compiler.stage != 0 && target == builder.build.build { return; } From d5339becd43c681111daf0d5b2fb7f270abde60c Mon Sep 17 00:00:00 2001 From: reez12g Date: Thu, 6 Apr 2023 19:30:12 +0900 Subject: [PATCH 27/29] rename tests/ui/unique to tests/ui/box/unit --- tests/ui/{unique => box/unit}/expr-block-generic-unique1.rs | 0 tests/ui/{unique => box/unit}/expr-block-generic-unique2.rs | 0 tests/ui/{unique => box/unit}/expr-if-unique.rs | 0 tests/ui/{unique => box/unit}/unique-assign-copy.rs | 0 tests/ui/{unique => box/unit}/unique-assign-drop.rs | 0 tests/ui/{unique => box/unit}/unique-assign-generic.rs | 0 tests/ui/{unique => box/unit}/unique-assign.rs | 0 tests/ui/{unique => box/unit}/unique-autoderef-field.rs | 0 tests/ui/{unique => box/unit}/unique-autoderef-index.rs | 0 tests/ui/{unique => box/unit}/unique-cmp.rs | 0 tests/ui/{unique => box/unit}/unique-containing-tag.rs | 0 tests/ui/{unique => box/unit}/unique-create.rs | 0 tests/ui/{unique => box/unit}/unique-decl-init-copy.rs | 0 tests/ui/{unique => box/unit}/unique-decl-init.rs | 0 tests/ui/{unique => box/unit}/unique-decl-move.rs | 0 tests/ui/{unique => box/unit}/unique-decl.rs | 0 tests/ui/{unique => box/unit}/unique-deref.rs | 0 tests/ui/{unique => box/unit}/unique-destructure.rs | 0 tests/ui/{unique => box/unit}/unique-drop-complex.rs | 0 tests/ui/{unique => box/unit}/unique-ffi-symbols.rs | 0 tests/ui/{unique => box/unit}/unique-fn-arg-move.rs | 0 tests/ui/{unique => box/unit}/unique-fn-arg-mut.rs | 0 tests/ui/{unique => box/unit}/unique-fn-arg.rs | 0 tests/ui/{unique => box/unit}/unique-fn-ret.rs | 0 tests/ui/{unique => box/unit}/unique-generic-assign.rs | 0 tests/ui/{unique => box/unit}/unique-in-tag.rs | 0 tests/ui/{unique => box/unit}/unique-in-vec-copy.rs | 0 tests/ui/{unique => box/unit}/unique-in-vec.rs | 0 tests/ui/{unique => box/unit}/unique-init.rs | 0 tests/ui/{unique => box/unit}/unique-kinds.rs | 0 tests/ui/{unique => box/unit}/unique-log.rs | 0 tests/ui/{unique => box/unit}/unique-match-discrim.rs | 0 tests/ui/{unique => box/unit}/unique-move-drop.rs | 0 tests/ui/{unique => box/unit}/unique-move-temp.rs | 0 tests/ui/{unique => box/unit}/unique-move.rs | 0 tests/ui/{unique => box/unit}/unique-mutable.rs | 0 tests/ui/{unique => box/unit}/unique-object-move.rs | 0 tests/ui/{unique => box/unit}/unique-object-noncopyable.rs | 0 tests/ui/{unique => box/unit}/unique-object-noncopyable.stderr | 0 tests/ui/{unique => box/unit}/unique-pat-2.rs | 0 tests/ui/{unique => box/unit}/unique-pat-3.rs | 0 tests/ui/{unique => box/unit}/unique-pat.rs | 0 tests/ui/{unique => box/unit}/unique-pinned-nocopy.rs | 0 tests/ui/{unique => box/unit}/unique-pinned-nocopy.stderr | 0 tests/ui/{unique => box/unit}/unique-rec.rs | 0 tests/ui/{unique => box/unit}/unique-send-2.rs | 0 tests/ui/{unique => box/unit}/unique-send.rs | 0 tests/ui/{unique => box/unit}/unique-swap.rs | 0 tests/ui/{unique => box/unit}/unwind-unique.rs | 0 49 files changed, 0 insertions(+), 0 deletions(-) rename tests/ui/{unique => box/unit}/expr-block-generic-unique1.rs (100%) rename tests/ui/{unique => box/unit}/expr-block-generic-unique2.rs (100%) rename tests/ui/{unique => box/unit}/expr-if-unique.rs (100%) rename tests/ui/{unique => box/unit}/unique-assign-copy.rs (100%) rename tests/ui/{unique => box/unit}/unique-assign-drop.rs (100%) rename tests/ui/{unique => box/unit}/unique-assign-generic.rs (100%) rename tests/ui/{unique => box/unit}/unique-assign.rs (100%) rename tests/ui/{unique => box/unit}/unique-autoderef-field.rs (100%) rename tests/ui/{unique => box/unit}/unique-autoderef-index.rs (100%) rename tests/ui/{unique => box/unit}/unique-cmp.rs (100%) rename tests/ui/{unique => box/unit}/unique-containing-tag.rs (100%) rename tests/ui/{unique => box/unit}/unique-create.rs (100%) rename tests/ui/{unique => box/unit}/unique-decl-init-copy.rs (100%) rename tests/ui/{unique => box/unit}/unique-decl-init.rs (100%) rename tests/ui/{unique => box/unit}/unique-decl-move.rs (100%) rename tests/ui/{unique => box/unit}/unique-decl.rs (100%) rename tests/ui/{unique => box/unit}/unique-deref.rs (100%) rename tests/ui/{unique => box/unit}/unique-destructure.rs (100%) rename tests/ui/{unique => box/unit}/unique-drop-complex.rs (100%) rename tests/ui/{unique => box/unit}/unique-ffi-symbols.rs (100%) rename tests/ui/{unique => box/unit}/unique-fn-arg-move.rs (100%) rename tests/ui/{unique => box/unit}/unique-fn-arg-mut.rs (100%) rename tests/ui/{unique => box/unit}/unique-fn-arg.rs (100%) rename tests/ui/{unique => box/unit}/unique-fn-ret.rs (100%) rename tests/ui/{unique => box/unit}/unique-generic-assign.rs (100%) rename tests/ui/{unique => box/unit}/unique-in-tag.rs (100%) rename tests/ui/{unique => box/unit}/unique-in-vec-copy.rs (100%) rename tests/ui/{unique => box/unit}/unique-in-vec.rs (100%) rename tests/ui/{unique => box/unit}/unique-init.rs (100%) rename tests/ui/{unique => box/unit}/unique-kinds.rs (100%) rename tests/ui/{unique => box/unit}/unique-log.rs (100%) rename tests/ui/{unique => box/unit}/unique-match-discrim.rs (100%) rename tests/ui/{unique => box/unit}/unique-move-drop.rs (100%) rename tests/ui/{unique => box/unit}/unique-move-temp.rs (100%) rename tests/ui/{unique => box/unit}/unique-move.rs (100%) rename tests/ui/{unique => box/unit}/unique-mutable.rs (100%) rename tests/ui/{unique => box/unit}/unique-object-move.rs (100%) rename tests/ui/{unique => box/unit}/unique-object-noncopyable.rs (100%) rename tests/ui/{unique => box/unit}/unique-object-noncopyable.stderr (100%) rename tests/ui/{unique => box/unit}/unique-pat-2.rs (100%) rename tests/ui/{unique => box/unit}/unique-pat-3.rs (100%) rename tests/ui/{unique => box/unit}/unique-pat.rs (100%) rename tests/ui/{unique => box/unit}/unique-pinned-nocopy.rs (100%) rename tests/ui/{unique => box/unit}/unique-pinned-nocopy.stderr (100%) rename tests/ui/{unique => box/unit}/unique-rec.rs (100%) rename tests/ui/{unique => box/unit}/unique-send-2.rs (100%) rename tests/ui/{unique => box/unit}/unique-send.rs (100%) rename tests/ui/{unique => box/unit}/unique-swap.rs (100%) rename tests/ui/{unique => box/unit}/unwind-unique.rs (100%) diff --git a/tests/ui/unique/expr-block-generic-unique1.rs b/tests/ui/box/unit/expr-block-generic-unique1.rs similarity index 100% rename from tests/ui/unique/expr-block-generic-unique1.rs rename to tests/ui/box/unit/expr-block-generic-unique1.rs diff --git a/tests/ui/unique/expr-block-generic-unique2.rs b/tests/ui/box/unit/expr-block-generic-unique2.rs similarity index 100% rename from tests/ui/unique/expr-block-generic-unique2.rs rename to tests/ui/box/unit/expr-block-generic-unique2.rs diff --git a/tests/ui/unique/expr-if-unique.rs b/tests/ui/box/unit/expr-if-unique.rs similarity index 100% rename from tests/ui/unique/expr-if-unique.rs rename to tests/ui/box/unit/expr-if-unique.rs diff --git a/tests/ui/unique/unique-assign-copy.rs b/tests/ui/box/unit/unique-assign-copy.rs similarity index 100% rename from tests/ui/unique/unique-assign-copy.rs rename to tests/ui/box/unit/unique-assign-copy.rs diff --git a/tests/ui/unique/unique-assign-drop.rs b/tests/ui/box/unit/unique-assign-drop.rs similarity index 100% rename from tests/ui/unique/unique-assign-drop.rs rename to tests/ui/box/unit/unique-assign-drop.rs diff --git a/tests/ui/unique/unique-assign-generic.rs b/tests/ui/box/unit/unique-assign-generic.rs similarity index 100% rename from tests/ui/unique/unique-assign-generic.rs rename to tests/ui/box/unit/unique-assign-generic.rs diff --git a/tests/ui/unique/unique-assign.rs b/tests/ui/box/unit/unique-assign.rs similarity index 100% rename from tests/ui/unique/unique-assign.rs rename to tests/ui/box/unit/unique-assign.rs diff --git a/tests/ui/unique/unique-autoderef-field.rs b/tests/ui/box/unit/unique-autoderef-field.rs similarity index 100% rename from tests/ui/unique/unique-autoderef-field.rs rename to tests/ui/box/unit/unique-autoderef-field.rs diff --git a/tests/ui/unique/unique-autoderef-index.rs b/tests/ui/box/unit/unique-autoderef-index.rs similarity index 100% rename from tests/ui/unique/unique-autoderef-index.rs rename to tests/ui/box/unit/unique-autoderef-index.rs diff --git a/tests/ui/unique/unique-cmp.rs b/tests/ui/box/unit/unique-cmp.rs similarity index 100% rename from tests/ui/unique/unique-cmp.rs rename to tests/ui/box/unit/unique-cmp.rs diff --git a/tests/ui/unique/unique-containing-tag.rs b/tests/ui/box/unit/unique-containing-tag.rs similarity index 100% rename from tests/ui/unique/unique-containing-tag.rs rename to tests/ui/box/unit/unique-containing-tag.rs diff --git a/tests/ui/unique/unique-create.rs b/tests/ui/box/unit/unique-create.rs similarity index 100% rename from tests/ui/unique/unique-create.rs rename to tests/ui/box/unit/unique-create.rs diff --git a/tests/ui/unique/unique-decl-init-copy.rs b/tests/ui/box/unit/unique-decl-init-copy.rs similarity index 100% rename from tests/ui/unique/unique-decl-init-copy.rs rename to tests/ui/box/unit/unique-decl-init-copy.rs diff --git a/tests/ui/unique/unique-decl-init.rs b/tests/ui/box/unit/unique-decl-init.rs similarity index 100% rename from tests/ui/unique/unique-decl-init.rs rename to tests/ui/box/unit/unique-decl-init.rs diff --git a/tests/ui/unique/unique-decl-move.rs b/tests/ui/box/unit/unique-decl-move.rs similarity index 100% rename from tests/ui/unique/unique-decl-move.rs rename to tests/ui/box/unit/unique-decl-move.rs diff --git a/tests/ui/unique/unique-decl.rs b/tests/ui/box/unit/unique-decl.rs similarity index 100% rename from tests/ui/unique/unique-decl.rs rename to tests/ui/box/unit/unique-decl.rs diff --git a/tests/ui/unique/unique-deref.rs b/tests/ui/box/unit/unique-deref.rs similarity index 100% rename from tests/ui/unique/unique-deref.rs rename to tests/ui/box/unit/unique-deref.rs diff --git a/tests/ui/unique/unique-destructure.rs b/tests/ui/box/unit/unique-destructure.rs similarity index 100% rename from tests/ui/unique/unique-destructure.rs rename to tests/ui/box/unit/unique-destructure.rs diff --git a/tests/ui/unique/unique-drop-complex.rs b/tests/ui/box/unit/unique-drop-complex.rs similarity index 100% rename from tests/ui/unique/unique-drop-complex.rs rename to tests/ui/box/unit/unique-drop-complex.rs diff --git a/tests/ui/unique/unique-ffi-symbols.rs b/tests/ui/box/unit/unique-ffi-symbols.rs similarity index 100% rename from tests/ui/unique/unique-ffi-symbols.rs rename to tests/ui/box/unit/unique-ffi-symbols.rs diff --git a/tests/ui/unique/unique-fn-arg-move.rs b/tests/ui/box/unit/unique-fn-arg-move.rs similarity index 100% rename from tests/ui/unique/unique-fn-arg-move.rs rename to tests/ui/box/unit/unique-fn-arg-move.rs diff --git a/tests/ui/unique/unique-fn-arg-mut.rs b/tests/ui/box/unit/unique-fn-arg-mut.rs similarity index 100% rename from tests/ui/unique/unique-fn-arg-mut.rs rename to tests/ui/box/unit/unique-fn-arg-mut.rs diff --git a/tests/ui/unique/unique-fn-arg.rs b/tests/ui/box/unit/unique-fn-arg.rs similarity index 100% rename from tests/ui/unique/unique-fn-arg.rs rename to tests/ui/box/unit/unique-fn-arg.rs diff --git a/tests/ui/unique/unique-fn-ret.rs b/tests/ui/box/unit/unique-fn-ret.rs similarity index 100% rename from tests/ui/unique/unique-fn-ret.rs rename to tests/ui/box/unit/unique-fn-ret.rs diff --git a/tests/ui/unique/unique-generic-assign.rs b/tests/ui/box/unit/unique-generic-assign.rs similarity index 100% rename from tests/ui/unique/unique-generic-assign.rs rename to tests/ui/box/unit/unique-generic-assign.rs diff --git a/tests/ui/unique/unique-in-tag.rs b/tests/ui/box/unit/unique-in-tag.rs similarity index 100% rename from tests/ui/unique/unique-in-tag.rs rename to tests/ui/box/unit/unique-in-tag.rs diff --git a/tests/ui/unique/unique-in-vec-copy.rs b/tests/ui/box/unit/unique-in-vec-copy.rs similarity index 100% rename from tests/ui/unique/unique-in-vec-copy.rs rename to tests/ui/box/unit/unique-in-vec-copy.rs diff --git a/tests/ui/unique/unique-in-vec.rs b/tests/ui/box/unit/unique-in-vec.rs similarity index 100% rename from tests/ui/unique/unique-in-vec.rs rename to tests/ui/box/unit/unique-in-vec.rs diff --git a/tests/ui/unique/unique-init.rs b/tests/ui/box/unit/unique-init.rs similarity index 100% rename from tests/ui/unique/unique-init.rs rename to tests/ui/box/unit/unique-init.rs diff --git a/tests/ui/unique/unique-kinds.rs b/tests/ui/box/unit/unique-kinds.rs similarity index 100% rename from tests/ui/unique/unique-kinds.rs rename to tests/ui/box/unit/unique-kinds.rs diff --git a/tests/ui/unique/unique-log.rs b/tests/ui/box/unit/unique-log.rs similarity index 100% rename from tests/ui/unique/unique-log.rs rename to tests/ui/box/unit/unique-log.rs diff --git a/tests/ui/unique/unique-match-discrim.rs b/tests/ui/box/unit/unique-match-discrim.rs similarity index 100% rename from tests/ui/unique/unique-match-discrim.rs rename to tests/ui/box/unit/unique-match-discrim.rs diff --git a/tests/ui/unique/unique-move-drop.rs b/tests/ui/box/unit/unique-move-drop.rs similarity index 100% rename from tests/ui/unique/unique-move-drop.rs rename to tests/ui/box/unit/unique-move-drop.rs diff --git a/tests/ui/unique/unique-move-temp.rs b/tests/ui/box/unit/unique-move-temp.rs similarity index 100% rename from tests/ui/unique/unique-move-temp.rs rename to tests/ui/box/unit/unique-move-temp.rs diff --git a/tests/ui/unique/unique-move.rs b/tests/ui/box/unit/unique-move.rs similarity index 100% rename from tests/ui/unique/unique-move.rs rename to tests/ui/box/unit/unique-move.rs diff --git a/tests/ui/unique/unique-mutable.rs b/tests/ui/box/unit/unique-mutable.rs similarity index 100% rename from tests/ui/unique/unique-mutable.rs rename to tests/ui/box/unit/unique-mutable.rs diff --git a/tests/ui/unique/unique-object-move.rs b/tests/ui/box/unit/unique-object-move.rs similarity index 100% rename from tests/ui/unique/unique-object-move.rs rename to tests/ui/box/unit/unique-object-move.rs diff --git a/tests/ui/unique/unique-object-noncopyable.rs b/tests/ui/box/unit/unique-object-noncopyable.rs similarity index 100% rename from tests/ui/unique/unique-object-noncopyable.rs rename to tests/ui/box/unit/unique-object-noncopyable.rs diff --git a/tests/ui/unique/unique-object-noncopyable.stderr b/tests/ui/box/unit/unique-object-noncopyable.stderr similarity index 100% rename from tests/ui/unique/unique-object-noncopyable.stderr rename to tests/ui/box/unit/unique-object-noncopyable.stderr diff --git a/tests/ui/unique/unique-pat-2.rs b/tests/ui/box/unit/unique-pat-2.rs similarity index 100% rename from tests/ui/unique/unique-pat-2.rs rename to tests/ui/box/unit/unique-pat-2.rs diff --git a/tests/ui/unique/unique-pat-3.rs b/tests/ui/box/unit/unique-pat-3.rs similarity index 100% rename from tests/ui/unique/unique-pat-3.rs rename to tests/ui/box/unit/unique-pat-3.rs diff --git a/tests/ui/unique/unique-pat.rs b/tests/ui/box/unit/unique-pat.rs similarity index 100% rename from tests/ui/unique/unique-pat.rs rename to tests/ui/box/unit/unique-pat.rs diff --git a/tests/ui/unique/unique-pinned-nocopy.rs b/tests/ui/box/unit/unique-pinned-nocopy.rs similarity index 100% rename from tests/ui/unique/unique-pinned-nocopy.rs rename to tests/ui/box/unit/unique-pinned-nocopy.rs diff --git a/tests/ui/unique/unique-pinned-nocopy.stderr b/tests/ui/box/unit/unique-pinned-nocopy.stderr similarity index 100% rename from tests/ui/unique/unique-pinned-nocopy.stderr rename to tests/ui/box/unit/unique-pinned-nocopy.stderr diff --git a/tests/ui/unique/unique-rec.rs b/tests/ui/box/unit/unique-rec.rs similarity index 100% rename from tests/ui/unique/unique-rec.rs rename to tests/ui/box/unit/unique-rec.rs diff --git a/tests/ui/unique/unique-send-2.rs b/tests/ui/box/unit/unique-send-2.rs similarity index 100% rename from tests/ui/unique/unique-send-2.rs rename to tests/ui/box/unit/unique-send-2.rs diff --git a/tests/ui/unique/unique-send.rs b/tests/ui/box/unit/unique-send.rs similarity index 100% rename from tests/ui/unique/unique-send.rs rename to tests/ui/box/unit/unique-send.rs diff --git a/tests/ui/unique/unique-swap.rs b/tests/ui/box/unit/unique-swap.rs similarity index 100% rename from tests/ui/unique/unique-swap.rs rename to tests/ui/box/unit/unique-swap.rs diff --git a/tests/ui/unique/unwind-unique.rs b/tests/ui/box/unit/unwind-unique.rs similarity index 100% rename from tests/ui/unique/unwind-unique.rs rename to tests/ui/box/unit/unwind-unique.rs From c37e72897ce8f55f753721541cf4b3ddb083cd7c Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 11 Apr 2023 14:04:50 +0200 Subject: [PATCH 28/29] rename maybe_delink to maybe_remove_mention --- src/tools/publish_toolstate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index bad86701daeda..2018c239ba068 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -86,7 +86,7 @@ def gh_url(): return os.environ['TOOLSTATE_ISSUES_API_URL'] -def maybe_unlink(message): +def maybe_remove_mention(message): # type: (str) -> str if os.environ.get('TOOLSTATE_SKIP_MENTIONS') is not None: return message.replace("@", "") @@ -109,7 +109,7 @@ def issue( else: status_description = 'no longer builds' request = json.dumps({ - 'body': maybe_unlink(textwrap.dedent('''\ + 'body': maybe_remove_mention(textwrap.dedent('''\ Hello, this is your friendly neighborhood mergebot. After merging PR {}, I observed that the tool {} {}. A follow-up PR to the repository {} is needed to fix the fallout. @@ -285,7 +285,7 @@ def update_latest( issue_url = gh_url() + '/{}/comments'.format(number) response = urllib2.urlopen(urllib2.Request( issue_url, - json.dumps({'body': maybe_unlink(message)}).encode(), + json.dumps({'body': maybe_remove_mention(message)}).encode(), { 'Authorization': 'token ' + github_token, 'Content-Type': 'application/json', From 4e84d695f35bc5708ded1d191f22ba961730cac7 Mon Sep 17 00:00:00 2001 From: Patrik Kormosi Date: Tue, 11 Apr 2023 16:29:48 +0200 Subject: [PATCH 29/29] Reword the docstring in todo! macro definition --- library/core/src/macros/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index c39a269c1de4e..7c93c93b4a019 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -712,8 +712,8 @@ macro_rules! unimplemented { /// Indicates unfinished code. /// -/// This can be useful if you are prototyping and are just looking to have your -/// code typechecked. +/// This can be useful if you are prototyping and just +/// want a placeholder to let your code pass type analysis. /// /// The difference between [`unimplemented!`] and `todo!` is that while `todo!` conveys /// an intent of implementing the functionality later and the message is "not yet