diff options
Diffstat (limited to 'tests')
715 files changed, 6257 insertions, 1923 deletions
diff --git a/tests/assembly-llvm/asm/aarch64-outline-atomics.rs b/tests/assembly-llvm/asm/aarch64-outline-atomics.rs index 5990fb84942..22599c18dcf 100644 --- a/tests/assembly-llvm/asm/aarch64-outline-atomics.rs +++ b/tests/assembly-llvm/asm/aarch64-outline-atomics.rs @@ -1,7 +1,5 @@ //@ assembly-output: emit-asm //@ compile-flags: -Copt-level=3 -//@ compile-flags: --target aarch64-unknown-linux-gnu -//@ needs-llvm-components: aarch64 //@ only-aarch64 //@ only-linux diff --git a/tests/assembly-llvm/dwarf-mixed-versions-lto.rs b/tests/assembly-llvm/dwarf-mixed-versions-lto.rs index 9910a6e2f5f..828328df843 100644 --- a/tests/assembly-llvm/dwarf-mixed-versions-lto.rs +++ b/tests/assembly-llvm/dwarf-mixed-versions-lto.rs @@ -1,6 +1,7 @@ // This test ensures that if LTO occurs between crates with different DWARF versions, we // will choose the highest DWARF version for the final binary. This matches Clang's behavior. // Note: `.2byte` directive is used on MIPS. +// Note: `.half` directive is used on RISC-V. //@ only-linux //@ aux-build:dwarf-mixed-versions-lto-aux.rs @@ -15,6 +16,6 @@ fn main() { } // CHECK: .section .debug_info -// CHECK-NOT: {{\.(short|hword|2byte)}} 2 -// CHECK-NOT: {{\.(short|hword|2byte)}} 4 -// CHECK: {{\.(short|hword|2byte)}} 5 +// CHECK-NOT: {{\.(short|hword|2byte|half)}} 2 +// CHECK-NOT: {{\.(short|hword|2byte|half)}} 4 +// CHECK: {{\.(short|hword|2byte|half)}} 5 diff --git a/tests/assembly-llvm/nvptx-safe-naming.rs b/tests/assembly-llvm/nvptx-safe-naming.rs index d7b46aadd9c..6a6659a4e30 100644 --- a/tests/assembly-llvm/nvptx-safe-naming.rs +++ b/tests/assembly-llvm/nvptx-safe-naming.rs @@ -1,6 +1,9 @@ //@ assembly-output: ptx-linker //@ compile-flags: --crate-type cdylib -Z unstable-options -Clinker-flavor=llbc //@ only-nvptx64 +//@ revisions: LLVM20 LLVM21 +//@ [LLVM21] min-llvm-version: 21 +//@ [LLVM20] max-llvm-major-version: 20 #![feature(abi_ptx)] #![no_std] @@ -15,7 +18,8 @@ extern crate breakpoint_panic_handler; #[no_mangle] pub unsafe extern "ptx-kernel" fn top_kernel(a: *const u32, b: *mut u32) { // CHECK: call.uni (retval0), - // CHECK-NEXT: [[IMPL_FN]] + // LLVM20-NEXT: [[IMPL_FN]] + // LLVM21-SAME: [[IMPL_FN]] *b = deep::private::MyStruct::new(*a).square(); } diff --git a/tests/assembly-llvm/x86-return-float.rs b/tests/assembly-llvm/x86-return-float.rs index 165c11d2280..4db93f68485 100644 --- a/tests/assembly-llvm/x86-return-float.rs +++ b/tests/assembly-llvm/x86-return-float.rs @@ -334,9 +334,9 @@ pub fn return_f128(x: f128) -> f128 { // linux-NEXT: .cfi_offset // CHECK-NEXT: movl %esp, %ebp // linux-NEXT: .cfi_def_cfa_register - // linux-NEXT: movaps 8(%ebp), %xmm0 - // win-NEXT: movups 8(%ebp), %xmm0 - // CHECK-NEXT: popl %ebp + // linux: movaps 8(%ebp), %xmm0 + // win: movups 8(%ebp), %xmm0 + // CHECK: popl %ebp // linux-NEXT: .cfi_def_cfa // CHECK-NEXT: retl x diff --git a/tests/codegen-llvm/abi-efiapi.rs b/tests/codegen-llvm/abi-efiapi.rs index 1736f0daf0f..4cd645101a8 100644 --- a/tests/codegen-llvm/abi-efiapi.rs +++ b/tests/codegen-llvm/abi-efiapi.rs @@ -3,15 +3,15 @@ //@ add-core-stubs //@ revisions:x86_64 i686 aarch64 arm riscv //@[x86_64] compile-flags: --target x86_64-unknown-uefi -//@[x86_64] needs-llvm-components: aarch64 arm riscv +//@[x86_64] needs-llvm-components: x86 //@[i686] compile-flags: --target i686-unknown-linux-musl -//@[i686] needs-llvm-components: aarch64 arm riscv +//@[i686] needs-llvm-components: x86 //@[aarch64] compile-flags: --target aarch64-unknown-none -//@[aarch64] needs-llvm-components: aarch64 arm riscv +//@[aarch64] needs-llvm-components: aarch64 //@[arm] compile-flags: --target armv7r-none-eabi -//@[arm] needs-llvm-components: aarch64 arm riscv +//@[arm] needs-llvm-components: arm //@[riscv] compile-flags: --target riscv64gc-unknown-none-elf -//@[riscv] needs-llvm-components: aarch64 arm riscv +//@[riscv] needs-llvm-components: riscv //@ compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] diff --git a/tests/codegen-llvm/cast-target-abi.rs b/tests/codegen-llvm/cast-target-abi.rs index cbd49e2f022..28d3ad5f61c 100644 --- a/tests/codegen-llvm/cast-target-abi.rs +++ b/tests/codegen-llvm/cast-target-abi.rs @@ -4,7 +4,7 @@ //@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes -Zlint-llvm-ir //@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu -//@[aarch64] needs-llvm-components: arm +//@[aarch64] needs-llvm-components: aarch64 //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu //@[loongarch64] needs-llvm-components: loongarch //@[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu diff --git a/tests/codegen-llvm/cf-protection.rs b/tests/codegen-llvm/cf-protection.rs index f1349a5dcb9..9efadb59932 100644 --- a/tests/codegen-llvm/cf-protection.rs +++ b/tests/codegen-llvm/cf-protection.rs @@ -3,7 +3,7 @@ //@ add-core-stubs //@ revisions: undefined none branch return full //@ needs-llvm-components: x86 -//@ [undefined] compile-flags: +// [undefined] no extra compile-flags //@ [none] compile-flags: -Z cf-protection=none //@ [branch] compile-flags: -Z cf-protection=branch //@ [return] compile-flags: -Z cf-protection=return diff --git a/tests/codegen-llvm/cffi/c-variadic-ffi.rs b/tests/codegen-llvm/cffi/c-variadic-ffi.rs new file mode 100644 index 00000000000..3e99c9fb84e --- /dev/null +++ b/tests/codegen-llvm/cffi/c-variadic-ffi.rs @@ -0,0 +1,86 @@ +//! Test calling variadic functions with various ABIs. +//@ add-core-stubs +//@ compile-flags: -Z merge-functions=disabled +//@ revisions: x86_32 x86_32_win x86_64 aarch64 arm32 +//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//@[x86_64] needs-llvm-components: x86 +//@[x86_32_win] compile-flags: --target i686-pc-windows-msvc +//@[x86_32_win] needs-llvm-components: x86 +//@[x86_32] compile-flags: --target i686-unknown-linux-gnu +//@[x86_32] needs-llvm-components: x86 +//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu +//@[aarch64] needs-llvm-components: aarch64 +//@[arm32] compile-flags: --target armv7-unknown-linux-gnueabihf +//@[arm32] needs-llvm-components: arm +#![crate_type = "lib"] +#![feature(no_core)] +#![feature(extended_varargs_abi_support, extern_system_varargs)] +#![no_core] + +extern crate minicore; + +// CHECK-LABEL: @c +#[unsafe(no_mangle)] +fn c(f: extern "C" fn(i32, ...)) { + // CHECK: call void (i32, ...) + f(22, 44); +} + +// CHECK-LABEL: @system +#[unsafe(no_mangle)] +fn system(f: extern "system" fn(i32, ...)) { + // Crucially, this is *always* the C calling convention, even on Windows. + // CHECK: call void (i32, ...) + f(22, 44); +} + +// x86_32-LABEL: @cdecl +#[unsafe(no_mangle)] +#[cfg(target_arch = "x86")] +fn cdecl(f: extern "cdecl" fn(i32, ...)) { + // x86_32: call void (i32, ...) + f(22, 44); +} + +// x86_64-LABEL: @sysv +#[unsafe(no_mangle)] +#[cfg(target_arch = "x86_64")] +fn sysv(f: extern "sysv64" fn(i32, ...)) { + // x86_64: call x86_64_sysvcc void (i32, ...) + f(22, 44); +} + +// x86_64-LABEL: @win +#[unsafe(no_mangle)] +#[cfg(target_arch = "x86_64")] +fn win(f: extern "win64" fn(i32, ...)) { + // x86_64: call win64cc void (i32, ...) + f(22, 44); +} + +// CHECK-LABEL: @efiapi +#[unsafe(no_mangle)] +#[cfg(any( + target_arch = "arm", + target_arch = "aarch64", + target_arch = "riscv32", + target_arch = "riscv64", + target_arch = "x86", + target_arch = "x86_64" +))] +fn efiapi(f: extern "efiapi" fn(i32, ...)) { + // x86_32: call void (i32, ...) + // x86_32_win: call void (i32, ...) + // x86_64: call win64cc void (i32, ...) + // aarch64: call void (i32, ...) + // arm32: call arm_aapcscc void (i32, ...) + f(22, 44); +} + +// arm32-LABEL: @aapcs +#[unsafe(no_mangle)] +#[cfg(target_arch = "arm")] +fn aapcs(f: extern "aapcs" fn(i32, ...)) { + // arm32: call arm_aapcscc void (i32, ...) + f(22, 44); +} diff --git a/tests/codegen-llvm/codemodels.rs b/tests/codegen-llvm/codemodels.rs index 06d2eade78a..e82e094aab8 100644 --- a/tests/codegen-llvm/codemodels.rs +++ b/tests/codegen-llvm/codemodels.rs @@ -1,7 +1,7 @@ //@ only-x86_64 //@ revisions: NOMODEL MODEL-SMALL MODEL-KERNEL MODEL-MEDIUM MODEL-LARGE -//@[NOMODEL] compile-flags: +// [NOMODEL] no compile-flags //@[MODEL-SMALL] compile-flags: -C code-model=small //@[MODEL-KERNEL] compile-flags: -C code-model=kernel //@[MODEL-MEDIUM] compile-flags: -C code-model=medium diff --git a/tests/codegen-llvm/const-vector.rs b/tests/codegen-llvm/const-vector.rs index a2249f4fff7..f4307492341 100644 --- a/tests/codegen-llvm/const-vector.rs +++ b/tests/codegen-llvm/const-vector.rs @@ -15,6 +15,7 @@ #![feature(arm_target_feature)] #![feature(mips_target_feature)] #![allow(non_camel_case_types)] +#![feature(riscv_target_feature)] #[path = "../auxiliary/minisimd.rs"] mod minisimd; @@ -42,6 +43,7 @@ extern "unadjusted" { #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))] #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))] #[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))] +#[cfg_attr(target_arch = "riscv64", target_feature(enable = "v"))] pub fn do_call() { unsafe { // CHECK: call void @test_i8x2(<2 x i8> <i8 32, i8 64> diff --git a/tests/codegen-llvm/debuginfo-cyclic-structure.rs b/tests/codegen-llvm/debuginfo-cyclic-structure.rs new file mode 100644 index 00000000000..b8cc5447741 --- /dev/null +++ b/tests/codegen-llvm/debuginfo-cyclic-structure.rs @@ -0,0 +1,32 @@ +//@ compile-flags:-g -Copt-level=0 -C panic=abort + +// Check that debug information exists for structures containing loops (cyclic references). +// Previously it may incorrectly prune member information during recursive type inference check. + +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Arc<debuginfo_cyclic_structure::Inner<alloc::sync::Arc<debuginfo_cyclic_structure::Handle{{.*}}elements: ![[FIELDS:[0-9]+]] +// CHECK: ![[FIELDS]] = !{!{{.*}}} +// CHECK-NOT: ![[FIELDS]] = !{} + +#![crate_type = "lib"] + +use std::mem::MaybeUninit; +use std::sync::Arc; + +struct Inner<T> { + buffer: Box<MaybeUninit<T>>, +} +struct Shared { + shared: Arc<Inner<Arc<Handle>>>, +} +struct Handle { + shared: Shared, +} +struct Core { + inner: Arc<Inner<Arc<Handle>>>, +} + +#[no_mangle] +extern "C" fn test() { + let с = Core { inner: Arc::new(Inner { buffer: Box::new(MaybeUninit::uninit()) }) }; + std::hint::black_box(с); +} diff --git a/tests/codegen-llvm/diverging-function-call-debuginfo.rs b/tests/codegen-llvm/diverging-function-call-debuginfo.rs new file mode 100644 index 00000000000..1a80fe1643d --- /dev/null +++ b/tests/codegen-llvm/diverging-function-call-debuginfo.rs @@ -0,0 +1,38 @@ +/// Make sure that line debuginfo is correct for diverging calls under certain +/// conditions. In particular we want to ensure that the line number is never +/// 0, but we check the absence of 0 by looking for the expected exact line +/// numbers. Regression test for <https://github.com/rust-lang/rust/issues/59558>. + +//@ compile-flags: -g -Clto -Copt-level=0 +//@ no-prefer-dynamic + +// First find the scope of both diverge() calls, namely this main() function. +// CHECK-DAG: [[MAIN_SCOPE:![0-9]+]] = distinct !DISubprogram(name: "main", linkageName: {{.*}}diverging_function_call_debuginfo{{.*}}main{{.*}} +fn main() { + if True == False { + // unreachable + // Then find the DILocation with the correct line number for this call ... + // CHECK-DAG: [[UNREACHABLE_CALL_DBG:![0-9]+]] = !DILocation(line: [[@LINE+1]], {{.*}}scope: [[MAIN_SCOPE]] + diverge(); + } + + // ... and this call. + // CHECK-DAG: [[LAST_CALL_DBG:![0-9]+]] = !DILocation(line: [[@LINE+1]], {{.*}}scope: [[MAIN_SCOPE]] + diverge(); +} + +#[derive(PartialEq)] +pub enum MyBool { + True, + False, +} + +use MyBool::*; + +fn diverge() -> ! { + panic!(); +} + +// Finally make sure both DILocations belong to each the respective diverge() call. +// CHECK-DAG: call void {{.*}}diverging_function_call_debuginfo{{.*}}diverge{{.*}} !dbg [[LAST_CALL_DBG]] +// CHECK-DAG: call void {{.*}}diverging_function_call_debuginfo{{.*}}diverge{{.*}} !dbg [[UNREACHABLE_CALL_DBG]] diff --git a/tests/codegen-llvm/ehcontguard_disabled.rs b/tests/codegen-llvm/ehcontguard_disabled.rs index 9efb2721b3e..962d14e7eb9 100644 --- a/tests/codegen-llvm/ehcontguard_disabled.rs +++ b/tests/codegen-llvm/ehcontguard_disabled.rs @@ -1,5 +1,3 @@ -//@ compile-flags: - #![crate_type = "lib"] // A basic test function. diff --git a/tests/codegen-llvm/enum/enum-discriminant-eq.rs b/tests/codegen-llvm/enum/enum-discriminant-eq.rs index 0494c5f551b..d599685c2e5 100644 --- a/tests/codegen-llvm/enum/enum-discriminant-eq.rs +++ b/tests/codegen-llvm/enum/enum-discriminant-eq.rs @@ -1,6 +1,9 @@ //@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled //@ min-llvm-version: 20 //@ only-64bit +//@ revisions: LLVM20 LLVM21 +//@ [LLVM21] min-llvm-version: 21 +//@ [LLVM20] max-llvm-major-version: 20 // The `derive(PartialEq)` on enums with field-less variants compares discriminants, // so make sure we emit that in some reasonable way. @@ -137,17 +140,20 @@ pub fn mid_nz32_eq_discr(a: Mid<NonZero<u32>>, b: Mid<NonZero<u32>>) -> bool { pub fn mid_ac_eq_discr(a: Mid<AC>, b: Mid<AC>) -> bool { // CHECK-LABEL: @mid_ac_eq_discr( - // CHECK: %[[A_REL_DISCR:.+]] = xor i8 %a, -128 + // LLVM20: %[[A_REL_DISCR:.+]] = xor i8 %a, -128 // CHECK: %[[A_IS_NICHE:.+]] = icmp slt i8 %a, 0 // CHECK: %[[A_NOT_HOLE:.+]] = icmp ne i8 %a, -127 // CHECK: tail call void @llvm.assume(i1 %[[A_NOT_HOLE]]) - // CHECK: %[[A_DISCR:.+]] = select i1 %[[A_IS_NICHE]], i8 %[[A_REL_DISCR]], i8 1 + // LLVM20: %[[A_DISCR:.+]] = select i1 %[[A_IS_NICHE]], i8 %[[A_REL_DISCR]], i8 1 - // CHECK: %[[B_REL_DISCR:.+]] = xor i8 %b, -128 + // LLVM20: %[[B_REL_DISCR:.+]] = xor i8 %b, -128 // CHECK: %[[B_IS_NICHE:.+]] = icmp slt i8 %b, 0 // CHECK: %[[B_NOT_HOLE:.+]] = icmp ne i8 %b, -127 // CHECK: tail call void @llvm.assume(i1 %[[B_NOT_HOLE]]) - // CHECK: %[[B_DISCR:.+]] = select i1 %[[B_IS_NICHE]], i8 %[[B_REL_DISCR]], i8 1 + // LLVM20: %[[B_DISCR:.+]] = select i1 %[[B_IS_NICHE]], i8 %[[B_REL_DISCR]], i8 1 + + // LLVM21: %[[A_DISCR:.+]] = select i1 %[[A_IS_NICHE]], i8 %a, i8 -127 + // LLVM21: %[[B_DISCR:.+]] = select i1 %[[B_IS_NICHE]], i8 %b, i8 -127 // CHECK: %[[R:.+]] = icmp eq i8 %[[A_DISCR]], %[[B_DISCR]] // CHECK: ret i1 %[[R]] diff --git a/tests/codegen-llvm/enum/enum-transparent-extract.rs b/tests/codegen-llvm/enum/enum-transparent-extract.rs new file mode 100644 index 00000000000..c5efb8d472b --- /dev/null +++ b/tests/codegen-llvm/enum/enum-transparent-extract.rs @@ -0,0 +1,31 @@ +//@ compile-flags: -Copt-level=0 +//@ only-64bit + +#![crate_type = "lib"] + +use std::ops::ControlFlow; + +pub enum Never {} + +#[no_mangle] +pub fn make_unmake_result_never(x: i32) -> i32 { + // CHECK-LABEL: define i32 @make_unmake_result_never(i32 %x) + // CHECK: start: + // CHECK-NEXT: ret i32 %x + + let y: Result<i32, Never> = Ok(x); + let Ok(z) = y; + z +} + +#[no_mangle] +pub fn extract_control_flow_never(x: ControlFlow<&str, Never>) -> &str { + // CHECK-LABEL: define { ptr, i64 } @extract_control_flow_never(ptr align 1 %x.0, i64 %x.1) + // CHECK: start: + // CHECK-NEXT: %[[P0:.+]] = insertvalue { ptr, i64 } poison, ptr %x.0, 0 + // CHECK-NEXT: %[[P1:.+]] = insertvalue { ptr, i64 } %[[P0]], i64 %x.1, 1 + // CHECK-NEXT: ret { ptr, i64 } %[[P1]] + + let ControlFlow::Break(s) = x; + s +} diff --git a/tests/codegen-llvm/intrinsics/transmute-niched.rs b/tests/codegen-llvm/intrinsics/transmute-niched.rs index 8ff5cc8ee4f..a886d9eee59 100644 --- a/tests/codegen-llvm/intrinsics/transmute-niched.rs +++ b/tests/codegen-llvm/intrinsics/transmute-niched.rs @@ -163,11 +163,8 @@ pub unsafe fn check_swap_pair(x: (char, NonZero<u32>)) -> (NonZero<u32>, char) { pub unsafe fn check_bool_from_ordering(x: std::cmp::Ordering) -> bool { // CHECK-NOT: icmp // CHECK-NOT: assume - // OPT: %0 = sub i8 %x, -1 - // OPT: %1 = icmp ule i8 %0, 2 - // OPT: call void @llvm.assume(i1 %1) - // OPT: %2 = icmp ule i8 %x, 1 - // OPT: call void @llvm.assume(i1 %2) + // OPT: %0 = icmp ule i8 %x, 1 + // OPT: call void @llvm.assume(i1 %0) // CHECK-NOT: icmp // CHECK-NOT: assume // CHECK: %[[R:.+]] = trunc{{( nuw)?}} i8 %x to i1 @@ -184,9 +181,6 @@ pub unsafe fn check_bool_to_ordering(x: bool) -> std::cmp::Ordering { // CHECK-NOT: assume // OPT: %0 = icmp ule i8 %_0, 1 // OPT: call void @llvm.assume(i1 %0) - // OPT: %1 = sub i8 %_0, -1 - // OPT: %2 = icmp ule i8 %1, 2 - // OPT: call void @llvm.assume(i1 %2) // CHECK-NOT: icmp // CHECK-NOT: assume // CHECK: ret i8 %_0 @@ -221,3 +215,42 @@ pub unsafe fn check_ptr_to_nonnull(x: *const u8) -> NonNull<u8> { transmute(x) } + +#[repr(usize)] +pub enum FourOrEight { + Four = 4, + Eight = 8, +} + +// CHECK-LABEL: @check_nonnull_to_four_or_eight( +#[no_mangle] +pub unsafe fn check_nonnull_to_four_or_eight(x: NonNull<u8>) -> FourOrEight { + // CHECK: start + // CHECK-NEXT: %[[RET:.+]] = ptrtoint ptr %x to i64 + // CHECK-NOT: icmp + // CHECK-NOT: assume + // OPT: %0 = sub i64 %[[RET]], 4 + // OPT: %1 = icmp ule i64 %0, 4 + // OPT: call void @llvm.assume(i1 %1) + // CHECK-NOT: icmp + // CHECK-NOT: assume + // CHECK: ret i64 %[[RET]] + + transmute(x) +} + +// CHECK-LABEL: @check_four_or_eight_to_nonnull( +#[no_mangle] +pub unsafe fn check_four_or_eight_to_nonnull(x: FourOrEight) -> NonNull<u8> { + // CHECK-NOT: icmp + // CHECK-NOT: assume + // OPT: %0 = sub i64 %x, 4 + // OPT: %1 = icmp ule i64 %0, 4 + // OPT: call void @llvm.assume(i1 %1) + // CHECK-NOT: icmp + // CHECK-NOT: assume + // CHECK: %[[RET:.+]] = getelementptr i8, ptr null, i64 %x + // CHECK-NEXT: ret ptr %[[RET]] + + transmute(x) +} diff --git a/tests/codegen-llvm/intrinsics/transmute-simd.rs b/tests/codegen-llvm/intrinsics/transmute-simd.rs new file mode 100644 index 00000000000..e34b27e1333 --- /dev/null +++ b/tests/codegen-llvm/intrinsics/transmute-simd.rs @@ -0,0 +1,176 @@ +//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes +//@ only-64bit (so I don't need to worry about usize) +//@ revisions: aarch64 x86_64 +//@ [aarch64] only-aarch64 +//@ [aarch64] compile-flags: -C target-feature=+neon +//@ [x86_64] only-x86_64 +//@ [x86_64] compile-flags: -C target-feature=+sse2 + +#![crate_type = "lib"] +#![feature(core_intrinsics)] +#![feature(portable_simd)] + +use std::intrinsics::transmute; +use std::simd::{Simd, f32x4, f64x2, i32x4, i64x2}; +type PtrX2 = Simd<*const (), 2>; + +// These tests use the "C" ABI so that the vectors in question aren't passed and +// returned though memory (as they are in the "Rust" ABI), which greatly +// simplifies seeing the difference between the in-operand cases vs the ones +// that fallback to just using the `LocalKind::Memory` path. + +// CHECK-LABEL: <2 x i64> @mixed_int(<4 x i32> %v) +#[no_mangle] +pub extern "C" fn mixed_int(v: i32x4) -> i64x2 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <4 x i32> %v to <2 x i64> + // CHECK: ret <2 x i64> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x double> @mixed_float(<4 x float> %v) +#[no_mangle] +pub extern "C" fn mixed_float(v: f32x4) -> f64x2 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <4 x float> %v to <2 x double> + // CHECK: ret <2 x double> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <4 x i32> @float_int_same_lanes(<4 x float> %v) +#[no_mangle] +pub extern "C" fn float_int_same_lanes(v: f32x4) -> i32x4 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <4 x float> %v to <4 x i32> + // CHECK: ret <4 x i32> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x double> @int_float_same_lanes(<2 x i64> %v) +#[no_mangle] +pub extern "C" fn int_float_same_lanes(v: i64x2) -> f64x2 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <2 x i64> %v to <2 x double> + // CHECK: ret <2 x double> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x i64> @float_int_widen(<4 x float> %v) +#[no_mangle] +pub extern "C" fn float_int_widen(v: f32x4) -> i64x2 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <4 x float> %v to <2 x i64> + // CHECK: ret <2 x i64> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x double> @int_float_widen(<4 x i32> %v) +#[no_mangle] +pub extern "C" fn int_float_widen(v: i32x4) -> f64x2 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <4 x i32> %v to <2 x double> + // CHECK: ret <2 x double> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <4 x i32> @float_int_narrow(<2 x double> %v) +#[no_mangle] +pub extern "C" fn float_int_narrow(v: f64x2) -> i32x4 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <2 x double> %v to <4 x i32> + // CHECK: ret <4 x i32> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <4 x float> @int_float_narrow(<2 x i64> %v) +#[no_mangle] +pub extern "C" fn int_float_narrow(v: i64x2) -> f32x4 { + // CHECK-NOT: alloca + // CHECK: %[[RET:.+]] = bitcast <2 x i64> %v to <4 x float> + // CHECK: ret <4 x float> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x ptr> @float_ptr_same_lanes(<2 x double> %v) +#[no_mangle] +pub extern "C" fn float_ptr_same_lanes(v: f64x2) -> PtrX2 { + // CHECK-NOT: alloca + // CHECK: %[[TEMP:.+]] = alloca [16 x i8] + // CHECK-NOT: alloca + // CHECK: call void @llvm.lifetime.start.p0(i64 16, ptr %[[TEMP]]) + // CHECK: store <2 x double> %v, ptr %[[TEMP]] + // CHECK: %[[RET:.+]] = load <2 x ptr>, ptr %[[TEMP]] + // CHECK: call void @llvm.lifetime.end.p0(i64 16, ptr %[[TEMP]]) + // CHECK: ret <2 x ptr> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x double> @ptr_float_same_lanes(<2 x ptr> %v) +#[no_mangle] +pub extern "C" fn ptr_float_same_lanes(v: PtrX2) -> f64x2 { + // CHECK-NOT: alloca + // CHECK: %[[TEMP:.+]] = alloca [16 x i8] + // CHECK-NOT: alloca + // CHECK: call void @llvm.lifetime.start.p0(i64 16, ptr %[[TEMP]]) + // CHECK: store <2 x ptr> %v, ptr %[[TEMP]] + // CHECK: %[[RET:.+]] = load <2 x double>, ptr %[[TEMP]] + // CHECK: call void @llvm.lifetime.end.p0(i64 16, ptr %[[TEMP]]) + // CHECK: ret <2 x double> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x ptr> @int_ptr_same_lanes(<2 x i64> %v) +#[no_mangle] +pub extern "C" fn int_ptr_same_lanes(v: i64x2) -> PtrX2 { + // CHECK-NOT: alloca + // CHECK: %[[TEMP:.+]] = alloca [16 x i8] + // CHECK-NOT: alloca + // CHECK: call void @llvm.lifetime.start.p0(i64 16, ptr %[[TEMP]]) + // CHECK: store <2 x i64> %v, ptr %[[TEMP]] + // CHECK: %[[RET:.+]] = load <2 x ptr>, ptr %[[TEMP]] + // CHECK: call void @llvm.lifetime.end.p0(i64 16, ptr %[[TEMP]]) + // CHECK: ret <2 x ptr> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x i64> @ptr_int_same_lanes(<2 x ptr> %v) +#[no_mangle] +pub extern "C" fn ptr_int_same_lanes(v: PtrX2) -> i64x2 { + // CHECK-NOT: alloca + // CHECK: %[[TEMP:.+]] = alloca [16 x i8] + // CHECK-NOT: alloca + // CHECK: call void @llvm.lifetime.start.p0(i64 16, ptr %[[TEMP]]) + // CHECK: store <2 x ptr> %v, ptr %[[TEMP]] + // CHECK: %[[RET:.+]] = load <2 x i64>, ptr %[[TEMP]] + // CHECK: call void @llvm.lifetime.end.p0(i64 16, ptr %[[TEMP]]) + // CHECK: ret <2 x i64> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x ptr> @float_ptr_widen(<4 x float> %v) +#[no_mangle] +pub extern "C" fn float_ptr_widen(v: f32x4) -> PtrX2 { + // CHECK-NOT: alloca + // CHECK: %[[TEMP:.+]] = alloca [16 x i8] + // CHECK-NOT: alloca + // CHECK: call void @llvm.lifetime.start.p0(i64 16, ptr %[[TEMP]]) + // CHECK: store <4 x float> %v, ptr %[[TEMP]] + // CHECK: %[[RET:.+]] = load <2 x ptr>, ptr %[[TEMP]] + // CHECK: call void @llvm.lifetime.end.p0(i64 16, ptr %[[TEMP]]) + // CHECK: ret <2 x ptr> %[[RET]] + unsafe { transmute(v) } +} + +// CHECK-LABEL: <2 x ptr> @int_ptr_widen(<4 x i32> %v) +#[no_mangle] +pub extern "C" fn int_ptr_widen(v: i32x4) -> PtrX2 { + // CHECK-NOT: alloca + // CHECK: %[[TEMP:.+]] = alloca [16 x i8] + // CHECK-NOT: alloca + // CHECK: call void @llvm.lifetime.start.p0(i64 16, ptr %[[TEMP]]) + // CHECK: store <4 x i32> %v, ptr %[[TEMP]] + // CHECK: %[[RET:.+]] = load <2 x ptr>, ptr %[[TEMP]] + // CHECK: call void @llvm.lifetime.end.p0(i64 16, ptr %[[TEMP]]) + // CHECK: ret <2 x ptr> %[[RET]] + unsafe { transmute(v) } +} diff --git a/tests/codegen-llvm/intrinsics/transmute.rs b/tests/codegen-llvm/intrinsics/transmute.rs index c9a1cd58af3..91cff38773d 100644 --- a/tests/codegen-llvm/intrinsics/transmute.rs +++ b/tests/codegen-llvm/intrinsics/transmute.rs @@ -191,22 +191,28 @@ pub unsafe fn check_byte_from_bool(x: bool) -> u8 { // CHECK-LABEL: @check_to_pair( #[no_mangle] pub unsafe fn check_to_pair(x: u64) -> Option<i32> { - // CHECK: %_0 = alloca [8 x i8], align 4 - // CHECK: store i64 %x, ptr %_0, align 4 + // CHECK: %[[TEMP:.+]] = alloca [8 x i8], align 8 + // CHECK: call void @llvm.lifetime.start.p0(i64 8, ptr %[[TEMP]]) + // CHECK: store i64 %x, ptr %[[TEMP]], align 8 + // CHECK: %[[PAIR0:.+]] = load i32, ptr %[[TEMP]], align 8 + // CHECK: %[[PAIR1P:.+]] = getelementptr inbounds i8, ptr %[[TEMP]], i64 4 + // CHECK: %[[PAIR1:.+]] = load i32, ptr %[[PAIR1P]], align 4 + // CHECK: call void @llvm.lifetime.end.p0(i64 8, ptr %[[TEMP]]) + // CHECK: insertvalue {{.+}}, i32 %[[PAIR0]], 0 + // CHECK: insertvalue {{.+}}, i32 %[[PAIR1]], 1 transmute(x) } // CHECK-LABEL: @check_from_pair( #[no_mangle] pub unsafe fn check_from_pair(x: Option<i32>) -> u64 { - // The two arguments are of types that are only 4-aligned, but they're - // immediates so we can write using the destination alloca's alignment. - const { assert!(std::mem::align_of::<Option<i32>>() == 4) }; - - // CHECK: %_0 = alloca [8 x i8], align 8 - // CHECK: store i32 %x.0, ptr %_0, align 8 - // CHECK: store i32 %x.1, ptr %0, align 4 - // CHECK: %[[R:.+]] = load i64, ptr %_0, align 8 + // CHECK: %[[TEMP:.+]] = alloca [8 x i8], align 8 + // CHECK: call void @llvm.lifetime.start.p0(i64 8, ptr %[[TEMP]]) + // CHECK: store i32 %x.0, ptr %[[TEMP]], align 8 + // CHECK: %[[PAIR1P:.+]] = getelementptr inbounds i8, ptr %[[TEMP]], i64 4 + // CHECK: store i32 %x.1, ptr %[[PAIR1P]], align 4 + // CHECK: %[[R:.+]] = load i64, ptr %[[TEMP]], align 8 + // CHECK: call void @llvm.lifetime.end.p0(i64 8, ptr %[[TEMP]]) // CHECK: ret i64 %[[R]] transmute(x) } diff --git a/tests/codegen-llvm/naked-fn/naked-functions.rs b/tests/codegen-llvm/naked-fn/naked-functions.rs index 344af6eb42f..8a7ee4b4de5 100644 --- a/tests/codegen-llvm/naked-fn/naked-functions.rs +++ b/tests/codegen-llvm/naked-fn/naked-functions.rs @@ -8,7 +8,7 @@ //@[win_i686] compile-flags: --target i686-pc-windows-gnu //@[win_i686] needs-llvm-components: x86 //@[macos] compile-flags: --target aarch64-apple-darwin -//@[macos] needs-llvm-components: arm +//@[macos] needs-llvm-components: aarch64 //@[thumb] compile-flags: --target thumbv7em-none-eabi //@[thumb] needs-llvm-components: arm diff --git a/tests/codegen-llvm/sanitizer/address-sanitizer-globals-tracking.rs b/tests/codegen-llvm/sanitizer/address-sanitizer-globals-tracking.rs index f319306f93f..642bf5e7576 100644 --- a/tests/codegen-llvm/sanitizer/address-sanitizer-globals-tracking.rs +++ b/tests/codegen-llvm/sanitizer/address-sanitizer-globals-tracking.rs @@ -19,9 +19,9 @@ //@ only-linux // //@ revisions:ASAN ASAN-FAT-LTO -//@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static -//@[ASAN] compile-flags: -//@[ASAN-FAT-LTO] compile-flags: -Cprefer-dynamic=false -Clto=fat +//@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static +// [ASAN] no extra compile-flags +//@[ASAN-FAT-LTO] compile-flags: -Cprefer-dynamic=false -Clto=fat #![crate_type = "staticlib"] diff --git a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs index 6b40918dd3a..02c31fb8e9b 100644 --- a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs +++ b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs @@ -5,7 +5,7 @@ //@ [aarch64] compile-flags: --target aarch64-unknown-none //@ [aarch64] needs-llvm-components: aarch64 //@ [x86_64] compile-flags: --target x86_64-unknown-none -//@ [x86_64] needs-llvm-components: +//@ [x86_64] needs-llvm-components: x86 //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Copt-level=0 #![crate_type = "lib"] diff --git a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs index 942b50deb02..9a60d51713f 100644 --- a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs +++ b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs @@ -5,7 +5,7 @@ //@ [aarch64] compile-flags: --target aarch64-unknown-none //@ [aarch64] needs-llvm-components: aarch64 //@ [x86_64] compile-flags: --target x86_64-unknown-none -//@ [x86_64] needs-llvm-components: +//@ [x86_64] needs-llvm-components: x86 //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Zsanitizer-cfi-generalize-pointers #![crate_type = "lib"] diff --git a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs index c89d9bdd121..134f4ff4bfd 100644 --- a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs +++ b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs @@ -5,7 +5,7 @@ //@ [aarch64] compile-flags: --target aarch64-unknown-none //@ [aarch64] needs-llvm-components: aarch64 //@ [x86_64] compile-flags: --target x86_64-unknown-none -//@ [x86_64] needs-llvm-components: +//@ [x86_64] needs-llvm-components: x86 //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Zsanitizer-cfi-normalize-integers -Zsanitizer-cfi-generalize-pointers #![crate_type = "lib"] diff --git a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs index 220cae1a4fa..4328b7fa07d 100644 --- a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs +++ b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs @@ -5,7 +5,7 @@ //@ [aarch64] compile-flags: --target aarch64-unknown-none //@ [aarch64] needs-llvm-components: aarch64 //@ [x86_64] compile-flags: --target x86_64-unknown-none -//@ [x86_64] needs-llvm-components: +//@ [x86_64] needs-llvm-components: x86 //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Zsanitizer-cfi-normalize-integers #![crate_type = "lib"] diff --git a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs index bb9a0005903..81a9db1b97a 100644 --- a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs +++ b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs @@ -5,7 +5,7 @@ //@ [aarch64] compile-flags: --target aarch64-unknown-none //@ [aarch64] needs-llvm-components: aarch64 //@ [x86_64] compile-flags: --target x86_64-unknown-none -//@ [x86_64] needs-llvm-components: +//@ [x86_64] needs-llvm-components: x86 //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Copt-level=0 #![crate_type = "lib"] diff --git a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle.rs index 8b844b99142..61056c2a54e 100644 --- a/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle.rs +++ b/tests/codegen-llvm/sanitizer/kcfi/emit-kcfi-operand-bundle.rs @@ -5,7 +5,7 @@ //@ [aarch64] compile-flags: --target aarch64-unknown-none //@ [aarch64] needs-llvm-components: aarch64 //@ [x86_64] compile-flags: --target x86_64-unknown-none -//@ [x86_64] needs-llvm-components: +//@ [x86_64] needs-llvm-components: x86 //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Copt-level=0 #![crate_type = "lib"] diff --git a/tests/codegen-llvm/sanitizer/kcfi/emit-type-metadata-trait-objects.rs b/tests/codegen-llvm/sanitizer/kcfi/emit-type-metadata-trait-objects.rs index 15c107bea15..182af162d78 100644 --- a/tests/codegen-llvm/sanitizer/kcfi/emit-type-metadata-trait-objects.rs +++ b/tests/codegen-llvm/sanitizer/kcfi/emit-type-metadata-trait-objects.rs @@ -5,7 +5,7 @@ //@ [aarch64] compile-flags: --target aarch64-unknown-none //@ [aarch64] needs-llvm-components: aarch64 //@ [x86_64] compile-flags: --target x86_64-unknown-none -//@ [x86_64] needs-llvm-components: +//@ [x86_64] needs-llvm-components: x86 //@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Copt-level=0 #![crate_type = "lib"] diff --git a/tests/codegen-llvm/sanitizer/memory-track-origins.rs b/tests/codegen-llvm/sanitizer/memory-track-origins.rs index 318c277e10c..5eb5b356b05 100644 --- a/tests/codegen-llvm/sanitizer/memory-track-origins.rs +++ b/tests/codegen-llvm/sanitizer/memory-track-origins.rs @@ -5,7 +5,7 @@ //@ revisions:MSAN-0 MSAN-1 MSAN-2 MSAN-1-LTO MSAN-2-LTO // //@ compile-flags: -Zsanitizer=memory -Ctarget-feature=-crt-static -//@[MSAN-0] compile-flags: +// [MSAN-0] no extra compile-flags //@[MSAN-1] compile-flags: -Zsanitizer-memory-track-origins=1 //@[MSAN-2] compile-flags: -Zsanitizer-memory-track-origins //@[MSAN-1-LTO] compile-flags: -Zsanitizer-memory-track-origins=1 -C lto=fat diff --git a/tests/codegen-llvm/ub-checks.rs b/tests/codegen-llvm/ub-checks.rs index 67f5bff08d5..c40bc9acc52 100644 --- a/tests/codegen-llvm/ub-checks.rs +++ b/tests/codegen-llvm/ub-checks.rs @@ -6,7 +6,7 @@ // but ub-checks are explicitly disabled. //@ revisions: DEBUG NOCHECKS -//@ [DEBUG] compile-flags: +// [DEBUG] no extra compile-flags //@ [NOCHECKS] compile-flags: -Zub-checks=no //@ compile-flags: -Copt-level=3 -Cdebug-assertions=yes diff --git a/tests/codegen-llvm/wasm_exceptions.rs b/tests/codegen-llvm/wasm_exceptions.rs index 07b8ae6e9d7..796b69b722b 100644 --- a/tests/codegen-llvm/wasm_exceptions.rs +++ b/tests/codegen-llvm/wasm_exceptions.rs @@ -2,7 +2,7 @@ //@ compile-flags: -C panic=unwind -Z emscripten-wasm-eh #![crate_type = "lib"] -#![feature(core_intrinsics)] +#![feature(core_intrinsics, wasm_exception_handling_intrinsics)] extern "C-unwind" { fn may_panic(); @@ -57,3 +57,17 @@ pub fn test_rtry() { // CHECK: {{.*}} = catchpad within {{.*}} [ptr null] // CHECK: catchret } + +// Make sure the intrinsic is not inferred as nounwind. This is a regression test for #132416. +// CHECK-LABEL: @test_intrinsic() {{.*}} @__gxx_wasm_personality_v0 +#[no_mangle] +pub fn test_intrinsic() { + let _log_on_drop = LogOnDrop; + unsafe { + core::arch::wasm32::throw::<0>(core::ptr::null_mut()); + } + + // CHECK-NOT: call + // CHECK: invoke void @llvm.wasm.throw(i32 noundef 0, ptr noundef null) + // CHECK: %cleanuppad = cleanuppad within none [] +} diff --git a/tests/coverage/auto-derived.auto.cov-map b/tests/coverage/auto-derived.auto.cov-map new file mode 100644 index 00000000000..e3d411d895a --- /dev/null +++ b/tests/coverage/auto-derived.auto.cov-map @@ -0,0 +1,23 @@ +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn::inner_fn_on +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 23, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 31, 9) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: auto_derived::main +Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 51, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/auto-derived.auto.coverage b/tests/coverage/auto-derived.auto.coverage new file mode 100644 index 00000000000..242abbf8031 --- /dev/null +++ b/tests/coverage/auto-derived.auto.coverage @@ -0,0 +1,54 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: base auto on + LL| | + LL| |// Tests for how `#[automatically_derived]` affects coverage instrumentation. + LL| |// + LL| |// The actual behaviour is an implementation detail, so this test mostly exists + LL| |// to show when that behaviour has been accidentally or deliberately changed. + LL| |// + LL| |// Revision guide: + LL| |// - base: Test baseline instrumentation behaviour without `#[automatically_derived]` + LL| |// - auto: Test how `#[automatically_derived]` affects instrumentation + LL| |// - on: Test interaction between auto-derived and `#[coverage(on)]` + LL| | + LL| |struct MyStruct; + LL| | + LL| |trait MyTrait { + LL| | fn my_assoc_fn(); + LL| |} + LL| | + LL| |#[cfg_attr(auto, automatically_derived)] + LL| |#[cfg_attr(on, automatically_derived)] + LL| |#[cfg_attr(on, coverage(on))] + LL| |impl MyTrait for MyStruct { + LL| | fn my_assoc_fn() { + LL| | fn inner_fn() { + LL| | say("in inner fn"); + LL| | } + LL| | + LL| | #[coverage(on)] + LL| 1| fn inner_fn_on() { + LL| 1| say("in inner fn (on)"); + LL| 1| } + LL| | + LL| | let closure = || { + LL| | say("in closure"); + LL| | }; + LL| | + LL| | closure(); + LL| | inner_fn(); + LL| | inner_fn_on(); + LL| | } + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |#[inline(never)] + LL| |fn say(s: &str) { + LL| | println!("{s}"); + LL| |} + LL| | + LL| 1|fn main() { + LL| 1| MyStruct::my_assoc_fn(); + LL| 1|} + diff --git a/tests/coverage/auto-derived.base.cov-map b/tests/coverage/auto-derived.base.cov-map new file mode 100644 index 00000000000..2dcd616300d --- /dev/null +++ b/tests/coverage/auto-derived.base.cov-map @@ -0,0 +1,61 @@ +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn +Raw bytes (34): 0x[01, 01, 00, 06, 01, 19, 05, 00, 15, 01, 0a, 0d, 00, 14, 01, 04, 09, 00, 12, 01, 01, 09, 00, 11, 01, 01, 09, 00, 14, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 25, 5) to (start + 0, 21) +- Code(Counter(0)) at (prev + 10, 13) to (start + 0, 20) +- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 20) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c0 + +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn::inner_fn +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 09, 00, 16, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1e, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 26, 9) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn::inner_fn_on +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 23, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 31, 9) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn::{closure#0} +Raw bytes (24): 0x[01, 01, 00, 04, 01, 23, 1a, 00, 1b, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1d, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 35, 26) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 29) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: auto_derived::main +Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 51, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/auto-derived.base.coverage b/tests/coverage/auto-derived.base.coverage new file mode 100644 index 00000000000..6ab6aa5c4df --- /dev/null +++ b/tests/coverage/auto-derived.base.coverage @@ -0,0 +1,54 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: base auto on + LL| | + LL| |// Tests for how `#[automatically_derived]` affects coverage instrumentation. + LL| |// + LL| |// The actual behaviour is an implementation detail, so this test mostly exists + LL| |// to show when that behaviour has been accidentally or deliberately changed. + LL| |// + LL| |// Revision guide: + LL| |// - base: Test baseline instrumentation behaviour without `#[automatically_derived]` + LL| |// - auto: Test how `#[automatically_derived]` affects instrumentation + LL| |// - on: Test interaction between auto-derived and `#[coverage(on)]` + LL| | + LL| |struct MyStruct; + LL| | + LL| |trait MyTrait { + LL| | fn my_assoc_fn(); + LL| |} + LL| | + LL| |#[cfg_attr(auto, automatically_derived)] + LL| |#[cfg_attr(on, automatically_derived)] + LL| |#[cfg_attr(on, coverage(on))] + LL| |impl MyTrait for MyStruct { + LL| 1| fn my_assoc_fn() { + LL| 1| fn inner_fn() { + LL| 1| say("in inner fn"); + LL| 1| } + LL| | + LL| | #[coverage(on)] + LL| 1| fn inner_fn_on() { + LL| 1| say("in inner fn (on)"); + LL| 1| } + LL| | + LL| 1| let closure = || { + LL| 1| say("in closure"); + LL| 1| }; + LL| | + LL| 1| closure(); + LL| 1| inner_fn(); + LL| 1| inner_fn_on(); + LL| 1| } + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |#[inline(never)] + LL| |fn say(s: &str) { + LL| | println!("{s}"); + LL| |} + LL| | + LL| 1|fn main() { + LL| 1| MyStruct::my_assoc_fn(); + LL| 1|} + diff --git a/tests/coverage/auto-derived.on.cov-map b/tests/coverage/auto-derived.on.cov-map new file mode 100644 index 00000000000..2dcd616300d --- /dev/null +++ b/tests/coverage/auto-derived.on.cov-map @@ -0,0 +1,61 @@ +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn +Raw bytes (34): 0x[01, 01, 00, 06, 01, 19, 05, 00, 15, 01, 0a, 0d, 00, 14, 01, 04, 09, 00, 12, 01, 01, 09, 00, 11, 01, 01, 09, 00, 14, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 25, 5) to (start + 0, 21) +- Code(Counter(0)) at (prev + 10, 13) to (start + 0, 20) +- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 20) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c0 + +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn::inner_fn +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 09, 00, 16, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1e, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 26, 9) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn::inner_fn_on +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 23, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 31, 9) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: <auto_derived::MyStruct as auto_derived::MyTrait>::my_assoc_fn::{closure#0} +Raw bytes (24): 0x[01, 01, 00, 04, 01, 23, 1a, 00, 1b, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1d, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 35, 26) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 29) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: auto_derived::main +Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/auto-derived.rs +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 51, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/auto-derived.on.coverage b/tests/coverage/auto-derived.on.coverage new file mode 100644 index 00000000000..6ab6aa5c4df --- /dev/null +++ b/tests/coverage/auto-derived.on.coverage @@ -0,0 +1,54 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: base auto on + LL| | + LL| |// Tests for how `#[automatically_derived]` affects coverage instrumentation. + LL| |// + LL| |// The actual behaviour is an implementation detail, so this test mostly exists + LL| |// to show when that behaviour has been accidentally or deliberately changed. + LL| |// + LL| |// Revision guide: + LL| |// - base: Test baseline instrumentation behaviour without `#[automatically_derived]` + LL| |// - auto: Test how `#[automatically_derived]` affects instrumentation + LL| |// - on: Test interaction between auto-derived and `#[coverage(on)]` + LL| | + LL| |struct MyStruct; + LL| | + LL| |trait MyTrait { + LL| | fn my_assoc_fn(); + LL| |} + LL| | + LL| |#[cfg_attr(auto, automatically_derived)] + LL| |#[cfg_attr(on, automatically_derived)] + LL| |#[cfg_attr(on, coverage(on))] + LL| |impl MyTrait for MyStruct { + LL| 1| fn my_assoc_fn() { + LL| 1| fn inner_fn() { + LL| 1| say("in inner fn"); + LL| 1| } + LL| | + LL| | #[coverage(on)] + LL| 1| fn inner_fn_on() { + LL| 1| say("in inner fn (on)"); + LL| 1| } + LL| | + LL| 1| let closure = || { + LL| 1| say("in closure"); + LL| 1| }; + LL| | + LL| 1| closure(); + LL| 1| inner_fn(); + LL| 1| inner_fn_on(); + LL| 1| } + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |#[inline(never)] + LL| |fn say(s: &str) { + LL| | println!("{s}"); + LL| |} + LL| | + LL| 1|fn main() { + LL| 1| MyStruct::my_assoc_fn(); + LL| 1|} + diff --git a/tests/coverage/auto-derived.rs b/tests/coverage/auto-derived.rs new file mode 100644 index 00000000000..cbf8279918a --- /dev/null +++ b/tests/coverage/auto-derived.rs @@ -0,0 +1,53 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: base auto on + +// Tests for how `#[automatically_derived]` affects coverage instrumentation. +// +// The actual behaviour is an implementation detail, so this test mostly exists +// to show when that behaviour has been accidentally or deliberately changed. +// +// Revision guide: +// - base: Test baseline instrumentation behaviour without `#[automatically_derived]` +// - auto: Test how `#[automatically_derived]` affects instrumentation +// - on: Test interaction between auto-derived and `#[coverage(on)]` + +struct MyStruct; + +trait MyTrait { + fn my_assoc_fn(); +} + +#[cfg_attr(auto, automatically_derived)] +#[cfg_attr(on, automatically_derived)] +#[cfg_attr(on, coverage(on))] +impl MyTrait for MyStruct { + fn my_assoc_fn() { + fn inner_fn() { + say("in inner fn"); + } + + #[coverage(on)] + fn inner_fn_on() { + say("in inner fn (on)"); + } + + let closure = || { + say("in closure"); + }; + + closure(); + inner_fn(); + inner_fn_on(); + } +} + +#[coverage(off)] +#[inline(never)] +fn say(s: &str) { + println!("{s}"); +} + +fn main() { + MyStruct::my_assoc_fn(); +} diff --git a/tests/coverage/auxiliary/try_in_macro_helper.rs b/tests/coverage/auxiliary/try_in_macro_helper.rs new file mode 100644 index 00000000000..27d2af15b05 --- /dev/null +++ b/tests/coverage/auxiliary/try_in_macro_helper.rs @@ -0,0 +1,31 @@ +//@ edition: 2024 +// (The proc-macro crate doesn't need to be instrumented.) +//@ compile-flags: -Cinstrument-coverage=off + +use proc_macro::TokenStream; + +/// Minimized form of `#[derive(arbitrary::Arbitrary)]` that still triggers +/// the original bug. +const CODE: &str = " + impl Arbitrary for MyEnum { + fn try_size_hint() -> Option<usize> { + Some(0)?; + None + } + } +"; + +#[proc_macro_attribute] +pub fn attr(_attr: TokenStream, _item: TokenStream) -> TokenStream { + CODE.parse().unwrap() +} + +#[proc_macro] +pub fn bang(_item: TokenStream) -> TokenStream { + CODE.parse().unwrap() +} + +#[proc_macro_derive(Arbitrary)] +pub fn derive_arbitrary(_item: TokenStream) -> TokenStream { + CODE.parse().unwrap() +} diff --git a/tests/coverage/try-in-macro.attr.cov-map b/tests/coverage/try-in-macro.attr.cov-map new file mode 100644 index 00000000000..7111e89637c --- /dev/null +++ b/tests/coverage/try-in-macro.attr.cov-map @@ -0,0 +1,20 @@ +Function name: <try_in_macro::MyEnum as try_in_macro::Arbitrary>::try_size_hint +Raw bytes (9): 0x[01, 01, 00, 01, 00, 1e, 2a, 00, 2b] +Number of files: 1 +- file 0 => $DIR/try-in-macro.rs +Number of expressions: 0 +Number of file 0 mappings: 1 +- Code(Zero) at (prev + 30, 42) to (start + 0, 43) +Highest counter ID seen: (none) + +Function name: try_in_macro::main +Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/try-in-macro.rs +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 41, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/try-in-macro.attr.coverage b/tests/coverage/try-in-macro.attr.coverage new file mode 100644 index 00000000000..457a161f3c7 --- /dev/null +++ b/tests/coverage/try-in-macro.attr.coverage @@ -0,0 +1,44 @@ + LL| |//! Regression test for <https://github.com/rust-lang/rust/issues/141577>. + LL| |//! + LL| |//! The changes in <https://github.com/rust-lang/rust/pull/144298> exposed a + LL| |//! latent bug that would sometimes cause the compiler to emit a covfun record + LL| |//! for a function, but not emit a corresponding PGO symbol name entry, because + LL| |//! the function did not have any physical coverage counters. The `llvm-cov` + LL| |//! tool would then fail to resolve the covfun record's function name hash, + LL| |//! and exit with the cryptic error: + LL| |//! + LL| |//! ```text + LL| |//! malformed instrumentation profile data: function name is empty + LL| |//! ``` + LL| |//! + LL| |//! The bug was then triggered in the wild by the macro-expansion of + LL| |//! `#[derive(arbitrary::Arbitrary)]`. + LL| |//! + LL| |//! This test uses a minimized form of the `Arbitrary` derive macro that was + LL| |//! found to still trigger the original bug. The bug could also be triggered + LL| |//! by a bang proc-macro or an attribute proc-macro. + LL| | + LL| |//@ edition: 2024 + LL| |//@ revisions: attr bang derive + LL| |//@ proc-macro: try_in_macro_helper.rs + LL| | + LL| |trait Arbitrary { + LL| | fn try_size_hint() -> Option<usize>; + LL| |} + LL| | + LL| |// Expand via an attribute proc-macro. + LL| |#[cfg_attr(attr, try_in_macro_helper::attr)] + LL| |const _: () = (); + LL| | + LL| |// Expand via a regular bang-style proc-macro. + LL| |#[cfg(bang)] + LL| |try_in_macro_helper::bang!(); + LL| | + LL| |// Expand via a derive proc-macro. + LL| |#[cfg_attr(derive, derive(try_in_macro_helper::Arbitrary))] + LL| |enum MyEnum {} + LL| | + LL| 1|fn main() { + LL| 1| MyEnum::try_size_hint(); + LL| 1|} + diff --git a/tests/coverage/try-in-macro.bang.cov-map b/tests/coverage/try-in-macro.bang.cov-map new file mode 100644 index 00000000000..80bd91a993c --- /dev/null +++ b/tests/coverage/try-in-macro.bang.cov-map @@ -0,0 +1,20 @@ +Function name: <try_in_macro::MyEnum as try_in_macro::Arbitrary>::try_size_hint +Raw bytes (9): 0x[01, 01, 00, 01, 00, 23, 1c, 00, 1d] +Number of files: 1 +- file 0 => $DIR/try-in-macro.rs +Number of expressions: 0 +Number of file 0 mappings: 1 +- Code(Zero) at (prev + 35, 28) to (start + 0, 29) +Highest counter ID seen: (none) + +Function name: try_in_macro::main +Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/try-in-macro.rs +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 41, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/try-in-macro.bang.coverage b/tests/coverage/try-in-macro.bang.coverage new file mode 100644 index 00000000000..457a161f3c7 --- /dev/null +++ b/tests/coverage/try-in-macro.bang.coverage @@ -0,0 +1,44 @@ + LL| |//! Regression test for <https://github.com/rust-lang/rust/issues/141577>. + LL| |//! + LL| |//! The changes in <https://github.com/rust-lang/rust/pull/144298> exposed a + LL| |//! latent bug that would sometimes cause the compiler to emit a covfun record + LL| |//! for a function, but not emit a corresponding PGO symbol name entry, because + LL| |//! the function did not have any physical coverage counters. The `llvm-cov` + LL| |//! tool would then fail to resolve the covfun record's function name hash, + LL| |//! and exit with the cryptic error: + LL| |//! + LL| |//! ```text + LL| |//! malformed instrumentation profile data: function name is empty + LL| |//! ``` + LL| |//! + LL| |//! The bug was then triggered in the wild by the macro-expansion of + LL| |//! `#[derive(arbitrary::Arbitrary)]`. + LL| |//! + LL| |//! This test uses a minimized form of the `Arbitrary` derive macro that was + LL| |//! found to still trigger the original bug. The bug could also be triggered + LL| |//! by a bang proc-macro or an attribute proc-macro. + LL| | + LL| |//@ edition: 2024 + LL| |//@ revisions: attr bang derive + LL| |//@ proc-macro: try_in_macro_helper.rs + LL| | + LL| |trait Arbitrary { + LL| | fn try_size_hint() -> Option<usize>; + LL| |} + LL| | + LL| |// Expand via an attribute proc-macro. + LL| |#[cfg_attr(attr, try_in_macro_helper::attr)] + LL| |const _: () = (); + LL| | + LL| |// Expand via a regular bang-style proc-macro. + LL| |#[cfg(bang)] + LL| |try_in_macro_helper::bang!(); + LL| | + LL| |// Expand via a derive proc-macro. + LL| |#[cfg_attr(derive, derive(try_in_macro_helper::Arbitrary))] + LL| |enum MyEnum {} + LL| | + LL| 1|fn main() { + LL| 1| MyEnum::try_size_hint(); + LL| 1|} + diff --git a/tests/coverage/try-in-macro.derive.cov-map b/tests/coverage/try-in-macro.derive.cov-map new file mode 100644 index 00000000000..6646b6693ba --- /dev/null +++ b/tests/coverage/try-in-macro.derive.cov-map @@ -0,0 +1,20 @@ +Function name: <try_in_macro::MyEnum as try_in_macro::Arbitrary>::try_size_hint +Raw bytes (9): 0x[01, 01, 00, 01, 00, 26, 38, 00, 39] +Number of files: 1 +- file 0 => $DIR/try-in-macro.rs +Number of expressions: 0 +Number of file 0 mappings: 1 +- Code(Zero) at (prev + 38, 56) to (start + 0, 57) +Highest counter ID seen: (none) + +Function name: try_in_macro::main +Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/try-in-macro.rs +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 41, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/try-in-macro.derive.coverage b/tests/coverage/try-in-macro.derive.coverage new file mode 100644 index 00000000000..457a161f3c7 --- /dev/null +++ b/tests/coverage/try-in-macro.derive.coverage @@ -0,0 +1,44 @@ + LL| |//! Regression test for <https://github.com/rust-lang/rust/issues/141577>. + LL| |//! + LL| |//! The changes in <https://github.com/rust-lang/rust/pull/144298> exposed a + LL| |//! latent bug that would sometimes cause the compiler to emit a covfun record + LL| |//! for a function, but not emit a corresponding PGO symbol name entry, because + LL| |//! the function did not have any physical coverage counters. The `llvm-cov` + LL| |//! tool would then fail to resolve the covfun record's function name hash, + LL| |//! and exit with the cryptic error: + LL| |//! + LL| |//! ```text + LL| |//! malformed instrumentation profile data: function name is empty + LL| |//! ``` + LL| |//! + LL| |//! The bug was then triggered in the wild by the macro-expansion of + LL| |//! `#[derive(arbitrary::Arbitrary)]`. + LL| |//! + LL| |//! This test uses a minimized form of the `Arbitrary` derive macro that was + LL| |//! found to still trigger the original bug. The bug could also be triggered + LL| |//! by a bang proc-macro or an attribute proc-macro. + LL| | + LL| |//@ edition: 2024 + LL| |//@ revisions: attr bang derive + LL| |//@ proc-macro: try_in_macro_helper.rs + LL| | + LL| |trait Arbitrary { + LL| | fn try_size_hint() -> Option<usize>; + LL| |} + LL| | + LL| |// Expand via an attribute proc-macro. + LL| |#[cfg_attr(attr, try_in_macro_helper::attr)] + LL| |const _: () = (); + LL| | + LL| |// Expand via a regular bang-style proc-macro. + LL| |#[cfg(bang)] + LL| |try_in_macro_helper::bang!(); + LL| | + LL| |// Expand via a derive proc-macro. + LL| |#[cfg_attr(derive, derive(try_in_macro_helper::Arbitrary))] + LL| |enum MyEnum {} + LL| | + LL| 1|fn main() { + LL| 1| MyEnum::try_size_hint(); + LL| 1|} + diff --git a/tests/coverage/try-in-macro.rs b/tests/coverage/try-in-macro.rs new file mode 100644 index 00000000000..ab9d6675418 --- /dev/null +++ b/tests/coverage/try-in-macro.rs @@ -0,0 +1,43 @@ +//! Regression test for <https://github.com/rust-lang/rust/issues/141577>. +//! +//! The changes in <https://github.com/rust-lang/rust/pull/144298> exposed a +//! latent bug that would sometimes cause the compiler to emit a covfun record +//! for a function, but not emit a corresponding PGO symbol name entry, because +//! the function did not have any physical coverage counters. The `llvm-cov` +//! tool would then fail to resolve the covfun record's function name hash, +//! and exit with the cryptic error: +//! +//! ```text +//! malformed instrumentation profile data: function name is empty +//! ``` +//! +//! The bug was then triggered in the wild by the macro-expansion of +//! `#[derive(arbitrary::Arbitrary)]`. +//! +//! This test uses a minimized form of the `Arbitrary` derive macro that was +//! found to still trigger the original bug. The bug could also be triggered +//! by a bang proc-macro or an attribute proc-macro. + +//@ edition: 2024 +//@ revisions: attr bang derive +//@ proc-macro: try_in_macro_helper.rs + +trait Arbitrary { + fn try_size_hint() -> Option<usize>; +} + +// Expand via an attribute proc-macro. +#[cfg_attr(attr, try_in_macro_helper::attr)] +const _: () = (); + +// Expand via a regular bang-style proc-macro. +#[cfg(bang)] +try_in_macro_helper::bang!(); + +// Expand via a derive proc-macro. +#[cfg_attr(derive, derive(try_in_macro_helper::Arbitrary))] +enum MyEnum {} + +fn main() { + MyEnum::try_size_hint(); +} diff --git a/tests/crashes/121097.rs b/tests/crashes/121097.rs deleted file mode 100644 index 65c6028e03e..00000000000 --- a/tests/crashes/121097.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ known-bug: #121097 -#[repr(simd)] -enum Aligned { - Zero = 0, - One = 1, -} - -fn tou8(al: Aligned) -> u8 { - al as u8 -} diff --git a/tests/crashes/121176.rs b/tests/crashes/121176.rs deleted file mode 100644 index 4d82e51de8f..00000000000 --- a/tests/crashes/121176.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #121176 -//@ needs-rustc-debug-assertions -use std::fmt::Debug; - -static STATIC_1: dyn Debug + Sync = *(); - -fn main() { - println!("{:?}", &STATIC_1); -} diff --git a/tests/crashes/129109.rs b/tests/crashes/129109.rs deleted file mode 100644 index 0db53b98a71..00000000000 --- a/tests/crashes/129109.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ known-bug: rust-lang/rust#129109 -//@ compile-flags: -Zmir-enable-passes=+GVN -Zvalidate-mir - -extern "C" { - pub static mut symbol: [i8]; -} - -fn main() { - println!("C", unsafe { &symbol }); -} diff --git a/tests/crashes/130970.rs b/tests/crashes/130970.rs deleted file mode 100644 index 698c2b478e1..00000000000 --- a/tests/crashes/130970.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #130970 -//@ compile-flags: -Zmir-enable-passes=+GVN -Zvalidate-mir - -fn main() { - extern "C" { - static symbol: [usize]; - } - println!("{}", symbol[0]); -} diff --git a/tests/crashes/131347.rs b/tests/crashes/131347.rs deleted file mode 100644 index 08f7d068e25..00000000000 --- a/tests/crashes/131347.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #131347 -//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir - -struct S; -static STUFF: [i8] = [0; S::N]; - -fn main() { - assert_eq!(STUFF, [0; 63]); -} diff --git a/tests/crashes/140100.rs b/tests/crashes/140100.rs deleted file mode 100644 index 0836ffe2d92..00000000000 --- a/tests/crashes/140100.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ known-bug: #140100 -fn a() -where - b: Sized, -{ - println!() -} diff --git a/tests/crashes/140365.rs b/tests/crashes/140365.rs deleted file mode 100644 index 809ceaf35a0..00000000000 --- a/tests/crashes/140365.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ known-bug: #140365 -//@compile-flags: -C opt-level=1 -Zvalidate-mir -fn f() -> &'static str -where - Self: Sized, -{ - "" -} diff --git a/tests/debuginfo/basic-types-globals-metadata.rs b/tests/debuginfo/basic-types-globals-metadata.rs index 53fc550a2dc..aec8ff183ad 100644 --- a/tests/debuginfo/basic-types-globals-metadata.rs +++ b/tests/debuginfo/basic-types-globals-metadata.rs @@ -59,7 +59,12 @@ static mut F64: f64 = 3.5; fn main() { _zzz(); // #break - let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F16, F32, F64) }; + let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) }; + // FIXME: Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which + // does not exist on some targets like PowerPC. + // See https://github.com/llvm/llvm-project/issues/97981 and + // https://github.com/rust-lang/compiler-builtins/issues/655 + let b = unsafe { F16 }; } fn _zzz() {()} diff --git a/tests/debuginfo/basic-types-globals.rs b/tests/debuginfo/basic-types-globals.rs index 41b69939650..15a0deb64c1 100644 --- a/tests/debuginfo/basic-types-globals.rs +++ b/tests/debuginfo/basic-types-globals.rs @@ -63,7 +63,12 @@ static mut F64: f64 = 3.5; fn main() { _zzz(); // #break - let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F16, F32, F64) }; + let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) }; + // FIXME: Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which + // does not exist on some targets like PowerPC. + // See https://github.com/llvm/llvm-project/issues/97981 and + // https://github.com/rust-lang/compiler-builtins/issues/655 + let b = unsafe { F16 }; } fn _zzz() {()} diff --git a/tests/debuginfo/by-value-non-immediate-argument.rs b/tests/debuginfo/by-value-non-immediate-argument.rs index 5233b95f1f4..deacea5f6cc 100644 --- a/tests/debuginfo/by-value-non-immediate-argument.rs +++ b/tests/debuginfo/by-value-non-immediate-argument.rs @@ -3,6 +3,7 @@ //@ compile-flags:-g //@ ignore-windows-gnu: #128973 //@ ignore-aarch64-unknown-linux-gnu (gdb tries to read from 0x0; FIXME: #128973) +//@ ignore-powerpc64: #128973 on both -gnu and -musl // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/unsized.rs b/tests/debuginfo/unsized.rs index 17c5e463fba..edd9f5af557 100644 --- a/tests/debuginfo/unsized.rs +++ b/tests/debuginfo/unsized.rs @@ -37,7 +37,6 @@ // cdb-check: [...] vtable : 0x[...] [Type: unsigned [...]int[...] (*)[4]] // cdb-command:dx _box -// cdb-check: // cdb-check:_box [Type: alloc::boxed::Box<unsized::Foo<dyn$<core::fmt::Debug> >,alloc::alloc::Global>] // cdb-check:[+0x000] pointer : 0x[...] [Type: unsized::Foo<dyn$<core::fmt::Debug> > *] // cdb-check:[...] vtable : 0x[...] [Type: unsigned [...]int[...] (*)[4]] diff --git a/tests/mir-opt/building/enum_cast.bar.built.after.mir b/tests/mir-opt/building/enum_cast.bar.built.after.mir index 72d0cf5d1e8..0dc6448ffad 100644 --- a/tests/mir-opt/building/enum_cast.bar.built.after.mir +++ b/tests/mir-opt/building/enum_cast.bar.built.after.mir @@ -5,16 +5,11 @@ fn bar(_1: Bar) -> usize { let mut _0: usize; let _2: Bar; let mut _3: isize; - let mut _4: u8; - let mut _5: bool; bb0: { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = copy _3 as u8 (IntToInt); - _5 = Le(copy _4, const 1_u8); - assume(move _5); _0 = move _3 as usize (IntToInt); StorageDead(_2); return; diff --git a/tests/mir-opt/building/enum_cast.boo.built.after.mir b/tests/mir-opt/building/enum_cast.boo.built.after.mir index 91e06dc8862..3540a2b1e2e 100644 --- a/tests/mir-opt/building/enum_cast.boo.built.after.mir +++ b/tests/mir-opt/building/enum_cast.boo.built.after.mir @@ -5,16 +5,11 @@ fn boo(_1: Boo) -> usize { let mut _0: usize; let _2: Boo; let mut _3: u8; - let mut _4: u8; - let mut _5: bool; bb0: { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = copy _3 as u8 (IntToInt); - _5 = Le(copy _4, const 1_u8); - assume(move _5); _0 = move _3 as usize (IntToInt); StorageDead(_2); return; diff --git a/tests/mir-opt/building/enum_cast.far.built.after.mir b/tests/mir-opt/building/enum_cast.far.built.after.mir index 14eaf344190..da34b7ba6c2 100644 --- a/tests/mir-opt/building/enum_cast.far.built.after.mir +++ b/tests/mir-opt/building/enum_cast.far.built.after.mir @@ -5,16 +5,11 @@ fn far(_1: Far) -> isize { let mut _0: isize; let _2: Far; let mut _3: i16; - let mut _4: u16; - let mut _5: bool; bb0: { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = copy _3 as u16 (IntToInt); - _5 = Le(copy _4, const 1_u16); - assume(move _5); _0 = move _3 as isize (IntToInt); StorageDead(_2); return; diff --git a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir index 1c2acbe3023..b84ce0de9a0 100644 --- a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir +++ b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir @@ -5,20 +5,11 @@ fn offsetty(_1: NotStartingAtZero) -> u32 { let mut _0: u32; let _2: NotStartingAtZero; let mut _3: isize; - let mut _4: u8; - let mut _5: bool; - let mut _6: bool; - let mut _7: bool; bb0: { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = copy _3 as u8 (IntToInt); - _5 = Ge(copy _4, const 4_u8); - _6 = Le(copy _4, const 8_u8); - _7 = BitAnd(move _5, move _6); - assume(move _7); _0 = move _3 as u32 (IntToInt); StorageDead(_2); return; diff --git a/tests/mir-opt/building/enum_cast.rs b/tests/mir-opt/building/enum_cast.rs index 4fb9a27e309..eaf5537e0ab 100644 --- a/tests/mir-opt/building/enum_cast.rs +++ b/tests/mir-opt/building/enum_cast.rs @@ -4,6 +4,13 @@ // EMIT_MIR enum_cast.boo.built.after.mir // EMIT_MIR enum_cast.far.built.after.mir +// Previously MIR building included range `Assume`s in the MIR statements, +// which these tests demonstrated, but now that we have range metadata on +// parameters in LLVM (in addition to !range metadata on loads) the impact +// of the extra volume of MIR is worse than its value. +// Thus these are now about the discriminant type and the cast type, +// both of which might be different from the backend type of the tag. + enum Foo { A, } diff --git a/tests/mir-opt/building/enum_cast.signy.built.after.mir b/tests/mir-opt/building/enum_cast.signy.built.after.mir index 39b6dfaf005..503c506748f 100644 --- a/tests/mir-opt/building/enum_cast.signy.built.after.mir +++ b/tests/mir-opt/building/enum_cast.signy.built.after.mir @@ -5,20 +5,11 @@ fn signy(_1: SignedAroundZero) -> i16 { let mut _0: i16; let _2: SignedAroundZero; let mut _3: i16; - let mut _4: u16; - let mut _5: bool; - let mut _6: bool; - let mut _7: bool; bb0: { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = copy _3 as u16 (IntToInt); - _5 = Ge(copy _4, const 65534_u16); - _6 = Le(copy _4, const 2_u16); - _7 = BitOr(move _5, move _6); - assume(move _7); _0 = move _3 as i16 (IntToInt); StorageDead(_2); return; diff --git a/tests/mir-opt/building/issue_101867.main.built.after.mir b/tests/mir-opt/building/issue_101867.main.built.after.mir index dd1d093c4db..e59b23fdd20 100644 --- a/tests/mir-opt/building/issue_101867.main.built.after.mir +++ b/tests/mir-opt/building/issue_101867.main.built.after.mir @@ -71,3 +71,7 @@ fn main() -> () { resume; } } + +ALLOC0 (size: 14, align: 1) { + 65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 │ explicit panic +} diff --git a/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir index 73ead005f8c..4ec12032690 100644 --- a/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir +++ b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir @@ -198,3 +198,7 @@ static XXX: &Foo = { return; } } + +ALLOC0 (size: 2, align: 1) { + 68 69 │ hi +} diff --git a/tests/mir-opt/building/user_type_annotations.let_else.built.after.mir b/tests/mir-opt/building/user_type_annotations.let_else.built.after.mir index 3a515787c10..6369dbec750 100644 --- a/tests/mir-opt/building/user_type_annotations.let_else.built.after.mir +++ b/tests/mir-opt/building/user_type_annotations.let_else.built.after.mir @@ -78,3 +78,9 @@ fn let_else() -> () { resume; } } + +ALLOC0 (size: 40, align: 1) { + 0x00 │ 69 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 3a 20 │ internal error: + 0x10 │ 65 6e 74 65 72 65 64 20 75 6e 72 65 61 63 68 61 │ entered unreacha + 0x20 │ 62 6c 65 20 63 6f 64 65 │ ble code +} diff --git a/tests/mir-opt/building/user_type_annotations.let_else_bindless.built.after.mir b/tests/mir-opt/building/user_type_annotations.let_else_bindless.built.after.mir index 52a6d904d45..b2a06ae53a8 100644 --- a/tests/mir-opt/building/user_type_annotations.let_else_bindless.built.after.mir +++ b/tests/mir-opt/building/user_type_annotations.let_else_bindless.built.after.mir @@ -60,3 +60,9 @@ fn let_else_bindless() -> () { resume; } } + +ALLOC0 (size: 40, align: 1) { + 0x00 │ 69 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 3a 20 │ internal error: + 0x10 │ 65 6e 74 65 72 65 64 20 75 6e 72 65 61 63 68 61 │ entered unreacha + 0x20 │ 62 6c 65 20 63 6f 64 65 │ ble code +} diff --git a/tests/mir-opt/const_debuginfo.main.SingleUseConsts.diff b/tests/mir-opt/const_debuginfo.main.SingleUseConsts.diff index 8088984bc77..9baf8439e59 100644 --- a/tests/mir-opt/const_debuginfo.main.SingleUseConsts.diff +++ b/tests/mir-opt/const_debuginfo.main.SingleUseConsts.diff @@ -123,3 +123,5 @@ ALLOC1 (size: 4, align: 2) { .. } + ALLOC2 (size: 13, align: 1) { .. } + diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-abort.diff b/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-abort.diff index 417406de39b..24b10217865 100644 --- a/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-abort.diff @@ -24,3 +24,7 @@ } } + ALLOC0 (size: 14, align: 1) { + 65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 │ explicit panic + } + diff --git a/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-unwind.diff index 63ba2c6865f..a73485e7944 100644 --- a/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-unwind.diff @@ -24,3 +24,7 @@ } } + ALLOC0 (size: 14, align: 1) { + 65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 │ explicit panic + } + diff --git a/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination-initial.diff index 5a550285871..8e224e0533a 100644 --- a/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination-initial.diff +++ b/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination-initial.diff @@ -17,3 +17,11 @@ } } + ALLOC0 (size: 5, align: 1) { + 57 6f 72 6c 64 │ World + } + + ALLOC1 (size: 5, align: 1) { + 48 65 6c 6c 6f │ Hello + } + diff --git a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff index 18c2897d528..3bde339a839 100644 --- a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff @@ -16,23 +16,31 @@ bb0: { _7 = (const "a",); - _1 = copy (_7.0: &str) as u128 (Transmute); - _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind unreachable]; +- _1 = copy (_7.0: &str) as u128 (Transmute); +- _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind unreachable]; ++ _1 = const "a" as u128 (Transmute); ++ _5 = identity::<&str>(const "a") -> [return: bb1, unwind unreachable]; } bb1: { _3 = copy _5 as u128 (Transmute); _8 = const "a"; - _2 = copy _8 as u128 (Transmute); - _6 = identity::<&str>(copy _8) -> [return: bb2, unwind unreachable]; +- _2 = copy _8 as u128 (Transmute); +- _6 = identity::<&str>(copy _8) -> [return: bb2, unwind unreachable]; ++ _2 = copy _1; ++ _6 = identity::<&str>(const "a") -> [return: bb2, unwind unreachable]; } bb2: { _4 = copy _6 as u128 (Transmute); - _9 = Eq(copy _1, copy _2); +- _9 = Eq(copy _1, copy _2); ++ _9 = const true; _10 = Eq(copy _3, copy _4); - _0 = (copy _9, copy _10); +- _0 = (copy _9, copy _10); ++ _0 = (const true, copy _10); return; } } + ALLOC0 (size: 1, align: 1) { .. } + diff --git a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff index 55f382e926e..cccfbf60585 100644 --- a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff @@ -16,23 +16,31 @@ bb0: { _7 = (const "a",); - _1 = copy (_7.0: &str) as u128 (Transmute); - _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind continue]; +- _1 = copy (_7.0: &str) as u128 (Transmute); +- _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind continue]; ++ _1 = const "a" as u128 (Transmute); ++ _5 = identity::<&str>(const "a") -> [return: bb1, unwind continue]; } bb1: { _3 = copy _5 as u128 (Transmute); _8 = const "a"; - _2 = copy _8 as u128 (Transmute); - _6 = identity::<&str>(copy _8) -> [return: bb2, unwind continue]; +- _2 = copy _8 as u128 (Transmute); +- _6 = identity::<&str>(copy _8) -> [return: bb2, unwind continue]; ++ _2 = copy _1; ++ _6 = identity::<&str>(const "a") -> [return: bb2, unwind continue]; } bb2: { _4 = copy _6 as u128 (Transmute); - _9 = Eq(copy _1, copy _2); +- _9 = Eq(copy _1, copy _2); ++ _9 = const true; _10 = Eq(copy _3, copy _4); - _0 = (copy _9, copy _10); +- _0 = (copy _9, copy _10); ++ _0 = (const true, copy _10); return; } } + ALLOC0 (size: 1, align: 1) { .. } + diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff index 3cce35d34e9..f3f63195637 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff @@ -8,10 +8,10 @@ let mut _3: fn(u8) -> u8; let _5: (); let mut _6: fn(u8) -> u8; - let mut _9: {closure@$DIR/gvn.rs:620:19: 620:21}; + let mut _9: {closure@$DIR/gvn.rs:617:19: 617:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:620:19: 620:21}; + let mut _13: {closure@$DIR/gvn.rs:617:19: 617:21}; let _14: (); let mut _15: fn(); scope 1 { @@ -19,7 +19,7 @@ let _4: fn(u8) -> u8; scope 2 { debug g => _4; - let _7: {closure@$DIR/gvn.rs:620:19: 620:21}; + let _7: {closure@$DIR/gvn.rs:617:19: 617:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -62,16 +62,16 @@ StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:620:19: 620:21}; +- _7 = {closure@$DIR/gvn.rs:617:19: 617:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21}; + nop; StorageLive(_9); - _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); StorageDead(_9); StorageLive(_10); StorageLive(_11); @@ -88,8 +88,8 @@ StorageLive(_13); - _13 = copy _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); -+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); StorageDead(_13); StorageLive(_14); StorageLive(_15); diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff index d85aca040fe..029e736a979 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff @@ -8,10 +8,10 @@ let mut _3: fn(u8) -> u8; let _5: (); let mut _6: fn(u8) -> u8; - let mut _9: {closure@$DIR/gvn.rs:620:19: 620:21}; + let mut _9: {closure@$DIR/gvn.rs:617:19: 617:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:620:19: 620:21}; + let mut _13: {closure@$DIR/gvn.rs:617:19: 617:21}; let _14: (); let mut _15: fn(); scope 1 { @@ -19,7 +19,7 @@ let _4: fn(u8) -> u8; scope 2 { debug g => _4; - let _7: {closure@$DIR/gvn.rs:620:19: 620:21}; + let _7: {closure@$DIR/gvn.rs:617:19: 617:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -62,16 +62,16 @@ StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:620:19: 620:21}; +- _7 = {closure@$DIR/gvn.rs:617:19: 617:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21}; + nop; StorageLive(_9); - _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); StorageDead(_9); StorageLive(_10); StorageLive(_11); @@ -88,8 +88,8 @@ StorageLive(_13); - _13 = copy _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); -+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:617:19: 617:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); StorageDead(_13); StorageLive(_14); StorageLive(_15); diff --git a/tests/mir-opt/gvn.rs b/tests/mir-opt/gvn.rs index 5d348bc3c1e..407980fd0fd 100644 --- a/tests/mir-opt/gvn.rs +++ b/tests/mir-opt/gvn.rs @@ -533,10 +533,10 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) { fn slices() { // CHECK-LABEL: fn slices( // CHECK: {{_.*}} = const " - // CHECK-NOT: {{_.*}} = const " - let s = "my favourite slice"; // This is a `Const::Slice` in MIR. + // CHECK: {{_.*}} = const " + let s = "my favourite slice"; opaque(s); - let t = s; // This should be the same pointer, so cannot be a `Const::Slice`. + let t = s; // This should be the same pointer. opaque(t); assert_eq!(s.as_ptr(), t.as_ptr()); let u = unsafe { transmute::<&str, &[u8]>(s) }; @@ -556,12 +556,12 @@ fn duplicate_slice() -> (bool, bool) { let d: &str; { // CHECK: [[a:_.*]] = (const "a",); - // CHECK: [[au:_.*]] = copy ([[a]].0: &str) as u128 (Transmute); + // CHECK: [[au:_.*]] = const "a" as u128 (Transmute); let a = ("a",); Call(au = transmute::<_, u128>(a.0), ReturnTo(bb1), UnwindContinue()) } bb1 = { - // CHECK: [[c:_.*]] = identity::<&str>(copy ([[a]].0: &str)) + // CHECK: [[c:_.*]] = identity::<&str>(const "a") Call(c = identity(a.0), ReturnTo(bb2), UnwindContinue()) } bb2 = { @@ -569,15 +569,13 @@ fn duplicate_slice() -> (bool, bool) { Call(cu = transmute::<_, u128>(c), ReturnTo(bb3), UnwindContinue()) } bb3 = { - // This slice is different from `a.0`. Hence `bu` is not `au`. // CHECK: [[b:_.*]] = const "a"; - // CHECK: [[bu:_.*]] = copy [[b]] as u128 (Transmute); + // CHECK: [[bu:_.*]] = copy [[au]]; let b = "a"; Call(bu = transmute::<_, u128>(b), ReturnTo(bb4), UnwindContinue()) } bb4 = { - // This returns a copy of `b`, which is not `a`. - // CHECK: [[d:_.*]] = identity::<&str>(copy [[b]]) + // CHECK: [[d:_.*]] = identity::<&str>(const "a") Call(d = identity(b), ReturnTo(bb5), UnwindContinue()) } bb5 = { @@ -585,8 +583,7 @@ fn duplicate_slice() -> (bool, bool) { Call(du = transmute::<_, u128>(d), ReturnTo(bb6), UnwindContinue()) } bb6 = { - // `direct` must not fold to `true`, as `indirect` will not. - // CHECK: = Eq(copy [[au]], copy [[bu]]); + // CHECK: = const true; // CHECK: = Eq(copy [[cu]], copy [[du]]); let direct = au == bu; let indirect = cu == du; diff --git a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff index e8e99b44e72..091c3bd5c7b 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff @@ -87,22 +87,24 @@ _1 = const "my favourite slice"; StorageLive(_2); StorageLive(_3); - _3 = copy _1; +- _3 = copy _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::<&str>(copy _1) -> [return: bb1, unwind unreachable]; ++ _3 = const "my favourite slice"; ++ _2 = opaque::<&str>(const "my favourite slice") -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_3); StorageDead(_2); StorageLive(_4); - _4 = copy _1; +- _4 = copy _1; ++ _4 = const "my favourite slice"; StorageLive(_5); StorageLive(_6); - _6 = copy _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind unreachable]; -+ _6 = copy _1; -+ _5 = opaque::<&str>(copy _1) -> [return: bb2, unwind unreachable]; ++ _6 = const "my favourite slice"; ++ _5 = opaque::<&str>(const "my favourite slice") -> [return: bb2, unwind unreachable]; } bb2: { @@ -315,3 +317,5 @@ } } + ALLOC0 (size: 18, align: 1) { .. } + diff --git a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff index 4296d4d4a59..9768956c9c8 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff @@ -87,22 +87,24 @@ _1 = const "my favourite slice"; StorageLive(_2); StorageLive(_3); - _3 = copy _1; +- _3 = copy _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::<&str>(copy _1) -> [return: bb1, unwind continue]; ++ _3 = const "my favourite slice"; ++ _2 = opaque::<&str>(const "my favourite slice") -> [return: bb1, unwind continue]; } bb1: { StorageDead(_3); StorageDead(_2); StorageLive(_4); - _4 = copy _1; +- _4 = copy _1; ++ _4 = const "my favourite slice"; StorageLive(_5); StorageLive(_6); - _6 = copy _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind continue]; -+ _6 = copy _1; -+ _5 = opaque::<&str>(copy _1) -> [return: bb2, unwind continue]; ++ _6 = const "my favourite slice"; ++ _5 = opaque::<&str>(const "my favourite slice") -> [return: bb2, unwind continue]; } bb2: { @@ -315,3 +317,5 @@ } } + ALLOC0 (size: 18, align: 1) { .. } + diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff index 0433152bb4f..3bbfd3a891e 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff @@ -47,3 +47,5 @@ } } + ALLOC0 (size: 14, align: 1) { .. } + diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff index 5722c865c2f..03464f43f81 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff @@ -47,3 +47,5 @@ } } + ALLOC0 (size: 14, align: 1) { .. } + diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff index bda85586515..423de59e575 100644 --- a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff @@ -38,5 +38,9 @@ + StorageLive(_7); + _7 = begin_panic::<&str>(const "explicit panic") -> unwind unreachable; } ++ } ++ ++ ALLOC0 (size: 14, align: 1) { ++ 65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 │ explicit panic } diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff index ecd72d2b37f..3689744dcb0 100644 --- a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff @@ -38,5 +38,9 @@ + StorageLive(_7); + _7 = begin_panic::<&str>(const "explicit panic") -> unwind continue; } ++ } ++ ++ ALLOC0 (size: 14, align: 1) { ++ 65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 │ explicit panic } diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff index 1e9a6dd4f5c..22e6ea722dd 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff @@ -64,9 +64,8 @@ + let mut _45: &mut std::future::Ready<()>; + let mut _46: &mut std::pin::Pin<&mut std::future::Ready<()>>; + scope 14 (inlined <Pin<&mut std::future::Ready<()>> as DerefMut>::deref_mut) { -+ let mut _47: std::pin::Pin<&mut std::future::Ready<()>>; + scope 15 (inlined Pin::<&mut std::future::Ready<()>>::as_mut) { -+ let mut _48: &mut &mut std::future::Ready<()>; ++ let mut _47: &mut &mut std::future::Ready<()>; + scope 16 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) { + } + scope 18 (inlined <&mut std::future::Ready<()> as DerefMut>::deref_mut) { @@ -76,15 +75,15 @@ + } + } + scope 19 (inlined Option::<()>::take) { -+ let mut _49: std::option::Option<()>; ++ let mut _48: std::option::Option<()>; + scope 20 (inlined std::mem::replace::<Option<()>>) { + scope 21 { + } + } + } + scope 22 (inlined #[track_caller] Option::<()>::expect) { -+ let mut _50: isize; -+ let mut _51: !; ++ let mut _49: isize; ++ let mut _50: !; + scope 23 { + } + } @@ -229,29 +228,26 @@ + StorageDead(_24); + StorageLive(_45); + StorageLive(_46); -+ StorageLive(_51); ++ StorageLive(_50); + StorageLive(_42); + StorageLive(_43); + StorageLive(_44); + _46 = &mut _19; + StorageLive(_47); -+ StorageLive(_48); -+ _48 = &mut (_19.0: &mut std::future::Ready<()>); ++ _47 = &mut (_19.0: &mut std::future::Ready<()>); + _45 = copy (_19.0: &mut std::future::Ready<()>); -+ StorageDead(_48); -+ _47 = Pin::<&mut std::future::Ready<()>> { pointer: copy _45 }; + StorageDead(_47); + _44 = &mut ((*_45).0: std::option::Option<()>); -+ StorageLive(_49); -+ _49 = Option::<()>::None; ++ StorageLive(_48); ++ _48 = Option::<()>::None; + _43 = copy ((*_45).0: std::option::Option<()>); -+ ((*_45).0: std::option::Option<()>) = copy _49; -+ StorageDead(_49); ++ ((*_45).0: std::option::Option<()>) = copy _48; ++ StorageDead(_48); + StorageDead(_44); -+ StorageLive(_50); -+ _50 = discriminant(_43); -+ switchInt(move _50) -> [0: bb11, 1: bb12, otherwise: bb5]; -+ } ++ StorageLive(_49); ++ _49 = discriminant(_43); ++ switchInt(move _49) -> [0: bb11, 1: bb12, otherwise: bb5]; + } + + bb5: { + unreachable; @@ -313,22 +309,27 @@ + } + + bb11: { -+ _51 = option::expect_failed(const "`Ready` polled after completion") -> unwind unreachable; ++ _50 = option::expect_failed(const "`Ready` polled after completion") -> unwind unreachable; + } + + bb12: { + _42 = move ((_43 as Some).0: ()); -+ StorageDead(_50); ++ StorageDead(_49); + StorageDead(_43); + _18 = Poll::<()>::Ready(move _42); + StorageDead(_42); -+ StorageDead(_51); ++ StorageDead(_50); + StorageDead(_46); + StorageDead(_45); + StorageDead(_22); + StorageDead(_19); + _25 = discriminant(_18); + switchInt(move _25) -> [0: bb7, 1: bb6, otherwise: bb5]; - } ++ } ++ } ++ ++ ALLOC0 (size: 31, align: 1) { ++ 0x00 │ 60 52 65 61 64 79 60 20 70 6f 6c 6c 65 64 20 61 │ `Ready` polled a ++ 0x10 │ 66 74 65 72 20 63 6f 6d 70 6c 65 74 69 6f 6e │ fter completion } diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff index 94b89a310ba..8b027e988b8 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff @@ -66,9 +66,8 @@ + let mut _47: &mut std::future::Ready<()>; + let mut _48: &mut std::pin::Pin<&mut std::future::Ready<()>>; + scope 14 (inlined <Pin<&mut std::future::Ready<()>> as DerefMut>::deref_mut) { -+ let mut _49: std::pin::Pin<&mut std::future::Ready<()>>; + scope 15 (inlined Pin::<&mut std::future::Ready<()>>::as_mut) { -+ let mut _50: &mut &mut std::future::Ready<()>; ++ let mut _49: &mut &mut std::future::Ready<()>; + scope 16 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) { + } + scope 18 (inlined <&mut std::future::Ready<()> as DerefMut>::deref_mut) { @@ -78,15 +77,15 @@ + } + } + scope 19 (inlined Option::<()>::take) { -+ let mut _51: std::option::Option<()>; ++ let mut _50: std::option::Option<()>; + scope 20 (inlined std::mem::replace::<Option<()>>) { + scope 21 { + } + } + } + scope 22 (inlined #[track_caller] Option::<()>::expect) { -+ let mut _52: isize; -+ let mut _53: !; ++ let mut _51: isize; ++ let mut _52: !; + scope 23 { + } + } @@ -246,35 +245,32 @@ + StorageDead(_24); + StorageLive(_47); + StorageLive(_48); -+ StorageLive(_53); ++ StorageLive(_52); + StorageLive(_44); + StorageLive(_45); + StorageLive(_46); + _48 = &mut _19; + StorageLive(_49); -+ StorageLive(_50); -+ _50 = &mut (_19.0: &mut std::future::Ready<()>); ++ _49 = &mut (_19.0: &mut std::future::Ready<()>); + _47 = copy (_19.0: &mut std::future::Ready<()>); -+ StorageDead(_50); -+ _49 = Pin::<&mut std::future::Ready<()>> { pointer: copy _47 }; + StorageDead(_49); + _46 = &mut ((*_47).0: std::option::Option<()>); -+ StorageLive(_51); -+ _51 = Option::<()>::None; ++ StorageLive(_50); ++ _50 = Option::<()>::None; + _45 = copy ((*_47).0: std::option::Option<()>); -+ ((*_47).0: std::option::Option<()>) = copy _51; -+ StorageDead(_51); ++ ((*_47).0: std::option::Option<()>) = copy _50; ++ StorageDead(_50); + StorageDead(_46); -+ StorageLive(_52); -+ _52 = discriminant(_45); -+ switchInt(move _52) -> [0: bb16, 1: bb17, otherwise: bb7]; ++ StorageLive(_51); ++ _51 = discriminant(_45); ++ switchInt(move _51) -> [0: bb16, 1: bb17, otherwise: bb7]; } - bb6 (cleanup): { - resume; + bb7: { + unreachable; -+ } + } + + bb8: { + _17 = const (); @@ -354,22 +350,27 @@ + } + + bb16: { -+ _53 = option::expect_failed(const "`Ready` polled after completion") -> bb11; ++ _52 = option::expect_failed(const "`Ready` polled after completion") -> bb11; + } + + bb17: { + _44 = move ((_45 as Some).0: ()); -+ StorageDead(_52); ++ StorageDead(_51); + StorageDead(_45); + _18 = Poll::<()>::Ready(move _44); + StorageDead(_44); -+ StorageDead(_53); ++ StorageDead(_52); + StorageDead(_48); + StorageDead(_47); + StorageDead(_22); + StorageDead(_19); + _25 = discriminant(_18); + switchInt(move _25) -> [0: bb9, 1: bb8, otherwise: bb7]; - } ++ } ++ } ++ ++ ALLOC0 (size: 31, align: 1) { ++ 0x00 │ 60 52 65 61 64 79 60 20 70 6f 6c 6c 65 64 20 61 │ `Ready` polled a ++ 0x10 │ 66 74 65 72 20 63 6f 6d 70 6c 65 74 69 6f 6e │ fter completion } diff --git a/tests/mir-opt/instsimplify/aggregate_array.strs.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/aggregate_array.strs.InstSimplify-after-simplifycfg.diff index f8884881756..ca5573cf97f 100644 --- a/tests/mir-opt/instsimplify/aggregate_array.strs.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/aggregate_array.strs.InstSimplify-after-simplifycfg.diff @@ -11,3 +11,7 @@ } } + ALLOC0 (size: 1, align: 1) { + 61 │ a + } + diff --git a/tests/mir-opt/instsimplify/align_of_slice.of_val_slice.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/align_of_slice.of_val_slice.InstSimplify-after-simplifycfg.diff new file mode 100644 index 00000000000..042e19bf2aa --- /dev/null +++ b/tests/mir-opt/instsimplify/align_of_slice.of_val_slice.InstSimplify-after-simplifycfg.diff @@ -0,0 +1,22 @@ +- // MIR for `of_val_slice` before InstSimplify-after-simplifycfg ++ // MIR for `of_val_slice` after InstSimplify-after-simplifycfg + + fn of_val_slice(_1: &[T]) -> usize { + debug slice => _1; + let mut _0: usize; + let mut _2: *const [T]; + + bb0: { + StorageLive(_2); + _2 = &raw const (*_1); +- _0 = std::intrinsics::align_of_val::<[T]>(move _2) -> [return: bb1, unwind unreachable]; ++ _0 = AlignOf(T); ++ goto -> bb1; + } + + bb1: { + StorageDead(_2); + return; + } + } + diff --git a/tests/mir-opt/instsimplify/align_of_slice.rs b/tests/mir-opt/instsimplify/align_of_slice.rs new file mode 100644 index 00000000000..0af05cb6b0b --- /dev/null +++ b/tests/mir-opt/instsimplify/align_of_slice.rs @@ -0,0 +1,12 @@ +//@ test-mir-pass: InstSimplify-after-simplifycfg +//@ needs-unwind + +#![crate_type = "lib"] +#![feature(core_intrinsics)] + +// EMIT_MIR align_of_slice.of_val_slice.InstSimplify-after-simplifycfg.diff +pub fn of_val_slice<T>(slice: &[T]) -> usize { + // CHECK-LABEL: fn of_val_slice(_1: &[T]) + // CHECK: _0 = AlignOf(T); + unsafe { core::intrinsics::align_of_val(slice) } +} diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff index c02bab3524b..08dee3697e0 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff @@ -51,3 +51,9 @@ } } + ALLOC0 (size: 40, align: 1) { + 0x00 │ 69 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 3a 20 │ internal error: + 0x10 │ 65 6e 74 65 72 65 64 20 75 6e 72 65 61 63 68 61 │ entered unreacha + 0x20 │ 62 6c 65 20 63 6f 64 65 │ ble code + } + diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff index 49be042588c..aa44a2ad532 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff @@ -51,3 +51,9 @@ } } + ALLOC0 (size: 40, align: 1) { + 0x00 │ 69 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 3a 20 │ internal error: + 0x10 │ 65 6e 74 65 72 65 64 20 75 6e 72 65 61 63 68 61 │ entered unreacha + 0x20 │ 62 6c 65 20 63 6f 64 65 │ ble code + } + diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir index 5876c55c52b..b5c23822162 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir @@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 { let _2: std::option::Option<u32>; scope 2 (inlined Option::<u32>::is_some) { let mut _3: isize; + scope 3 { + } } } - scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { + scope 4 (inlined #[track_caller] Option::<u32>::unwrap) { let mut _5: isize; let mut _6: !; - scope 4 { + scope 5 { } } diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir index f1185353a43..f22b8835735 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir @@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 { let _2: std::option::Option<u32>; scope 2 (inlined Option::<u32>::is_some) { let mut _3: isize; + scope 3 { + } } } - scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { + scope 4 (inlined #[track_caller] Option::<u32>::unwrap) { let mut _5: isize; let mut _6: !; - scope 4 { + scope 5 { } } diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir index 5876c55c52b..b5c23822162 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir @@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 { let _2: std::option::Option<u32>; scope 2 (inlined Option::<u32>::is_some) { let mut _3: isize; + scope 3 { + } } } - scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { + scope 4 (inlined #[track_caller] Option::<u32>::unwrap) { let mut _5: isize; let mut _6: !; - scope 4 { + scope 5 { } } diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir index f1185353a43..f22b8835735 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir @@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 { let _2: std::option::Option<u32>; scope 2 (inlined Option::<u32>::is_some) { let mut _3: isize; + scope 3 { + } } } - scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { + scope 4 (inlined #[track_caller] Option::<u32>::unwrap) { let mut _5: isize; let mut _6: !; - scope 4 { + scope 5 { } } diff --git a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff index 281f43b355d..3ce82fd0d47 100644 --- a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff @@ -7,6 +7,8 @@ let mut _2: bool; let mut _3: isize; + let mut _4: isize; + scope 1 { + } bb0: { StorageLive(_2); diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-abort.mir index fa6c6ce8e57..6e5f6dc9ea8 100644 --- a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -36,3 +36,7 @@ fn unwrap(_1: Option<T>) -> T { return; } } + +ALLOC0 (size: 14, align: 1) { + 65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 │ explicit panic +} diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 54fec3c0f98..758aa45f2a2 100644 --- a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -41,3 +41,7 @@ fn unwrap(_1: Option<T>) -> T { resume; } } + +ALLOC0 (size: 14, align: 1) { + 65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 │ explicit panic +} diff --git a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir index 99a7a6b6154..404de884ab5 100644 --- a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir +++ b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-abort.mir @@ -38,3 +38,5 @@ fn main() -> () { resume; } } + +ALLOC0 (size: 0, align: 1) {} diff --git a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir index 7364b329e12..47a0878ffae 100644 --- a/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir +++ b/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir @@ -38,3 +38,5 @@ fn main() -> () { resume; } } + +ALLOC0 (size: 0, align: 1) {} diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir index 1a1c8b4b942..83478e60b5d 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir @@ -25,9 +25,11 @@ fn step_forward(_1: u16, _2: usize) -> u16 { } scope 8 (inlined Option::<u16>::is_none) { scope 9 (inlined Option::<u16>::is_some) { + scope 10 { + } } } - scope 10 (inlined core::num::<impl u16>::wrapping_add) { + scope 11 (inlined core::num::<impl u16>::wrapping_add) { } } diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir index e7e19af048a..ac7a6e04451 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir @@ -25,9 +25,11 @@ fn step_forward(_1: u16, _2: usize) -> u16 { } scope 8 (inlined Option::<u16>::is_none) { scope 9 (inlined Option::<u16>::is_some) { + scope 10 { + } } } - scope 10 (inlined core::num::<impl u16>::wrapping_add) { + scope 11 (inlined core::num::<impl u16>::wrapping_add) { } } diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir new file mode 100644 index 00000000000..2777bba893b --- /dev/null +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir @@ -0,0 +1,108 @@ +// MIR for `generic_in_place` after PreCodegen + +fn generic_in_place(_1: *mut Box<[T]>) -> () { + debug ptr => _1; + let mut _0: (); + scope 1 (inlined drop_in_place::<Box<[T]>> - shim(Some(Box<[T]>))) { + scope 2 (inlined <Box<[T]> as Drop>::drop) { + let _2: std::ptr::NonNull<[T]>; + let mut _3: *mut [T]; + let mut _4: *const [T]; + let _12: (); + scope 3 { + let _8: std::ptr::alignment::AlignmentEnum; + scope 4 { + scope 12 (inlined Layout::size) { + } + scope 13 (inlined Unique::<[T]>::cast::<u8>) { + scope 14 (inlined NonNull::<[T]>::cast::<u8>) { + scope 15 (inlined NonNull::<[T]>::as_ptr) { + } + } + } + scope 16 (inlined <NonNull<u8> as From<Unique<u8>>>::from) { + scope 17 (inlined Unique::<u8>::as_non_null_ptr) { + } + } + scope 18 (inlined <std::alloc::Global as Allocator>::deallocate) { + let mut _9: *mut u8; + scope 19 (inlined Layout::size) { + } + scope 20 (inlined NonNull::<u8>::as_ptr) { + } + scope 21 (inlined std::alloc::dealloc) { + let mut _11: usize; + scope 22 (inlined Layout::size) { + } + scope 23 (inlined Layout::align) { + scope 24 (inlined std::ptr::Alignment::as_usize) { + let mut _10: u32; + } + } + } + } + } + scope 5 (inlined Unique::<[T]>::as_ptr) { + scope 6 (inlined NonNull::<[T]>::as_ptr) { + } + } + scope 7 (inlined Layout::for_value_raw::<[T]>) { + let mut _5: usize; + let mut _6: usize; + scope 8 { + scope 11 (inlined #[track_caller] Layout::from_size_align_unchecked) { + let mut _7: std::ptr::Alignment; + } + } + scope 9 (inlined size_of_val_raw::<[T]>) { + } + scope 10 (inlined align_of_val_raw::<[T]>) { + } + } + } + } + } + + bb0: { + StorageLive(_2); + _2 = copy (((*_1).0: std::ptr::Unique<[T]>).0: std::ptr::NonNull<[T]>); + StorageLive(_4); + _3 = copy _2 as *mut [T] (Transmute); + _4 = copy _2 as *const [T] (Transmute); + StorageLive(_6); + _5 = std::intrinsics::size_of_val::<[T]>(move _4) -> [return: bb1, unwind unreachable]; + } + + bb1: { + _6 = AlignOf(T); + StorageLive(_7); + _7 = copy _6 as std::ptr::Alignment (Transmute); + _8 = move (_7.0: std::ptr::alignment::AlignmentEnum); + StorageDead(_7); + StorageDead(_6); + StorageDead(_4); + switchInt(copy _5) -> [0: bb4, otherwise: bb2]; + } + + bb2: { + StorageLive(_9); + _9 = copy _3 as *mut u8 (PtrToPtr); + StorageLive(_11); + StorageLive(_10); + _10 = discriminant(_8); + _11 = move _10 as usize (IntToInt); + StorageDead(_10); + _12 = alloc::alloc::__rust_dealloc(move _9, move _5, move _11) -> [return: bb3, unwind unreachable]; + } + + bb3: { + StorageDead(_11); + StorageDead(_9); + goto -> bb4; + } + + bb4: { + StorageDead(_2); + return; + } +} diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir new file mode 100644 index 00000000000..2777bba893b --- /dev/null +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir @@ -0,0 +1,108 @@ +// MIR for `generic_in_place` after PreCodegen + +fn generic_in_place(_1: *mut Box<[T]>) -> () { + debug ptr => _1; + let mut _0: (); + scope 1 (inlined drop_in_place::<Box<[T]>> - shim(Some(Box<[T]>))) { + scope 2 (inlined <Box<[T]> as Drop>::drop) { + let _2: std::ptr::NonNull<[T]>; + let mut _3: *mut [T]; + let mut _4: *const [T]; + let _12: (); + scope 3 { + let _8: std::ptr::alignment::AlignmentEnum; + scope 4 { + scope 12 (inlined Layout::size) { + } + scope 13 (inlined Unique::<[T]>::cast::<u8>) { + scope 14 (inlined NonNull::<[T]>::cast::<u8>) { + scope 15 (inlined NonNull::<[T]>::as_ptr) { + } + } + } + scope 16 (inlined <NonNull<u8> as From<Unique<u8>>>::from) { + scope 17 (inlined Unique::<u8>::as_non_null_ptr) { + } + } + scope 18 (inlined <std::alloc::Global as Allocator>::deallocate) { + let mut _9: *mut u8; + scope 19 (inlined Layout::size) { + } + scope 20 (inlined NonNull::<u8>::as_ptr) { + } + scope 21 (inlined std::alloc::dealloc) { + let mut _11: usize; + scope 22 (inlined Layout::size) { + } + scope 23 (inlined Layout::align) { + scope 24 (inlined std::ptr::Alignment::as_usize) { + let mut _10: u32; + } + } + } + } + } + scope 5 (inlined Unique::<[T]>::as_ptr) { + scope 6 (inlined NonNull::<[T]>::as_ptr) { + } + } + scope 7 (inlined Layout::for_value_raw::<[T]>) { + let mut _5: usize; + let mut _6: usize; + scope 8 { + scope 11 (inlined #[track_caller] Layout::from_size_align_unchecked) { + let mut _7: std::ptr::Alignment; + } + } + scope 9 (inlined size_of_val_raw::<[T]>) { + } + scope 10 (inlined align_of_val_raw::<[T]>) { + } + } + } + } + } + + bb0: { + StorageLive(_2); + _2 = copy (((*_1).0: std::ptr::Unique<[T]>).0: std::ptr::NonNull<[T]>); + StorageLive(_4); + _3 = copy _2 as *mut [T] (Transmute); + _4 = copy _2 as *const [T] (Transmute); + StorageLive(_6); + _5 = std::intrinsics::size_of_val::<[T]>(move _4) -> [return: bb1, unwind unreachable]; + } + + bb1: { + _6 = AlignOf(T); + StorageLive(_7); + _7 = copy _6 as std::ptr::Alignment (Transmute); + _8 = move (_7.0: std::ptr::alignment::AlignmentEnum); + StorageDead(_7); + StorageDead(_6); + StorageDead(_4); + switchInt(copy _5) -> [0: bb4, otherwise: bb2]; + } + + bb2: { + StorageLive(_9); + _9 = copy _3 as *mut u8 (PtrToPtr); + StorageLive(_11); + StorageLive(_10); + _10 = discriminant(_8); + _11 = move _10 as usize (IntToInt); + StorageDead(_10); + _12 = alloc::alloc::__rust_dealloc(move _9, move _5, move _11) -> [return: bb3, unwind unreachable]; + } + + bb3: { + StorageDead(_11); + StorageDead(_9); + goto -> bb4; + } + + bb4: { + StorageDead(_2); + return; + } +} diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-abort.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-abort.mir new file mode 100644 index 00000000000..2be0a478c85 --- /dev/null +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-abort.mir @@ -0,0 +1,108 @@ +// MIR for `generic_in_place` after PreCodegen + +fn generic_in_place(_1: *mut Box<[T]>) -> () { + debug ptr => _1; + let mut _0: (); + scope 1 (inlined drop_in_place::<Box<[T]>> - shim(Some(Box<[T]>))) { + scope 2 (inlined <Box<[T]> as Drop>::drop) { + let _2: std::ptr::NonNull<[T]>; + let mut _3: *mut [T]; + let mut _4: *const [T]; + let _12: (); + scope 3 { + let _8: std::ptr::alignment::AlignmentEnum; + scope 4 { + scope 12 (inlined Layout::size) { + } + scope 13 (inlined Unique::<[T]>::cast::<u8>) { + scope 14 (inlined NonNull::<[T]>::cast::<u8>) { + scope 15 (inlined NonNull::<[T]>::as_ptr) { + } + } + } + scope 16 (inlined <NonNull<u8> as From<Unique<u8>>>::from) { + scope 17 (inlined Unique::<u8>::as_non_null_ptr) { + } + } + scope 18 (inlined <std::alloc::Global as Allocator>::deallocate) { + let mut _9: *mut u8; + scope 19 (inlined Layout::size) { + } + scope 20 (inlined NonNull::<u8>::as_ptr) { + } + scope 21 (inlined std::alloc::dealloc) { + let mut _11: usize; + scope 22 (inlined Layout::size) { + } + scope 23 (inlined Layout::align) { + scope 24 (inlined std::ptr::Alignment::as_usize) { + let mut _10: u64; + } + } + } + } + } + scope 5 (inlined Unique::<[T]>::as_ptr) { + scope 6 (inlined NonNull::<[T]>::as_ptr) { + } + } + scope 7 (inlined Layout::for_value_raw::<[T]>) { + let mut _5: usize; + let mut _6: usize; + scope 8 { + scope 11 (inlined #[track_caller] Layout::from_size_align_unchecked) { + let mut _7: std::ptr::Alignment; + } + } + scope 9 (inlined size_of_val_raw::<[T]>) { + } + scope 10 (inlined align_of_val_raw::<[T]>) { + } + } + } + } + } + + bb0: { + StorageLive(_2); + _2 = copy (((*_1).0: std::ptr::Unique<[T]>).0: std::ptr::NonNull<[T]>); + StorageLive(_4); + _3 = copy _2 as *mut [T] (Transmute); + _4 = copy _2 as *const [T] (Transmute); + StorageLive(_6); + _5 = std::intrinsics::size_of_val::<[T]>(move _4) -> [return: bb1, unwind unreachable]; + } + + bb1: { + _6 = AlignOf(T); + StorageLive(_7); + _7 = copy _6 as std::ptr::Alignment (Transmute); + _8 = move (_7.0: std::ptr::alignment::AlignmentEnum); + StorageDead(_7); + StorageDead(_6); + StorageDead(_4); + switchInt(copy _5) -> [0: bb4, otherwise: bb2]; + } + + bb2: { + StorageLive(_9); + _9 = copy _3 as *mut u8 (PtrToPtr); + StorageLive(_11); + StorageLive(_10); + _10 = discriminant(_8); + _11 = move _10 as usize (IntToInt); + StorageDead(_10); + _12 = alloc::alloc::__rust_dealloc(move _9, move _5, move _11) -> [return: bb3, unwind unreachable]; + } + + bb3: { + StorageDead(_11); + StorageDead(_9); + goto -> bb4; + } + + bb4: { + StorageDead(_2); + return; + } +} diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir new file mode 100644 index 00000000000..2be0a478c85 --- /dev/null +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir @@ -0,0 +1,108 @@ +// MIR for `generic_in_place` after PreCodegen + +fn generic_in_place(_1: *mut Box<[T]>) -> () { + debug ptr => _1; + let mut _0: (); + scope 1 (inlined drop_in_place::<Box<[T]>> - shim(Some(Box<[T]>))) { + scope 2 (inlined <Box<[T]> as Drop>::drop) { + let _2: std::ptr::NonNull<[T]>; + let mut _3: *mut [T]; + let mut _4: *const [T]; + let _12: (); + scope 3 { + let _8: std::ptr::alignment::AlignmentEnum; + scope 4 { + scope 12 (inlined Layout::size) { + } + scope 13 (inlined Unique::<[T]>::cast::<u8>) { + scope 14 (inlined NonNull::<[T]>::cast::<u8>) { + scope 15 (inlined NonNull::<[T]>::as_ptr) { + } + } + } + scope 16 (inlined <NonNull<u8> as From<Unique<u8>>>::from) { + scope 17 (inlined Unique::<u8>::as_non_null_ptr) { + } + } + scope 18 (inlined <std::alloc::Global as Allocator>::deallocate) { + let mut _9: *mut u8; + scope 19 (inlined Layout::size) { + } + scope 20 (inlined NonNull::<u8>::as_ptr) { + } + scope 21 (inlined std::alloc::dealloc) { + let mut _11: usize; + scope 22 (inlined Layout::size) { + } + scope 23 (inlined Layout::align) { + scope 24 (inlined std::ptr::Alignment::as_usize) { + let mut _10: u64; + } + } + } + } + } + scope 5 (inlined Unique::<[T]>::as_ptr) { + scope 6 (inlined NonNull::<[T]>::as_ptr) { + } + } + scope 7 (inlined Layout::for_value_raw::<[T]>) { + let mut _5: usize; + let mut _6: usize; + scope 8 { + scope 11 (inlined #[track_caller] Layout::from_size_align_unchecked) { + let mut _7: std::ptr::Alignment; + } + } + scope 9 (inlined size_of_val_raw::<[T]>) { + } + scope 10 (inlined align_of_val_raw::<[T]>) { + } + } + } + } + } + + bb0: { + StorageLive(_2); + _2 = copy (((*_1).0: std::ptr::Unique<[T]>).0: std::ptr::NonNull<[T]>); + StorageLive(_4); + _3 = copy _2 as *mut [T] (Transmute); + _4 = copy _2 as *const [T] (Transmute); + StorageLive(_6); + _5 = std::intrinsics::size_of_val::<[T]>(move _4) -> [return: bb1, unwind unreachable]; + } + + bb1: { + _6 = AlignOf(T); + StorageLive(_7); + _7 = copy _6 as std::ptr::Alignment (Transmute); + _8 = move (_7.0: std::ptr::alignment::AlignmentEnum); + StorageDead(_7); + StorageDead(_6); + StorageDead(_4); + switchInt(copy _5) -> [0: bb4, otherwise: bb2]; + } + + bb2: { + StorageLive(_9); + _9 = copy _3 as *mut u8 (PtrToPtr); + StorageLive(_11); + StorageLive(_10); + _10 = discriminant(_8); + _11 = move _10 as usize (IntToInt); + StorageDead(_10); + _12 = alloc::alloc::__rust_dealloc(move _9, move _5, move _11) -> [return: bb3, unwind unreachable]; + } + + bb3: { + StorageDead(_11); + StorageDead(_9); + goto -> bb4; + } + + bb4: { + StorageDead(_2); + return; + } +} diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.rs b/tests/mir-opt/pre-codegen/drop_boxed_slice.rs new file mode 100644 index 00000000000..11fb7afef0f --- /dev/null +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.rs @@ -0,0 +1,19 @@ +//@ compile-flags: -O -Zmir-opt-level=2 +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY +// EMIT_MIR_FOR_EACH_BIT_WIDTH + +#![crate_type = "lib"] + +// EMIT_MIR drop_boxed_slice.generic_in_place.PreCodegen.after.mir +pub unsafe fn generic_in_place<T: Copy>(ptr: *mut Box<[T]>) { + // CHECK-LABEL: fn generic_in_place(_1: *mut Box<[T]>) + // CHECK: (inlined <Box<[T]> as Drop>::drop) + // CHECK: [[SIZE:_.+]] = std::intrinsics::size_of_val::<[T]> + // CHECK: [[ALIGN:_.+]] = AlignOf(T); + // CHECK: [[B:_.+]] = copy [[ALIGN]] as std::ptr::Alignment (Transmute); + // CHECK: [[C:_.+]] = move ([[B]].0: std::ptr::alignment::AlignmentEnum); + // CHECK: [[D:_.+]] = discriminant([[C]]); + // CHECK: [[E:_.+]] = move [[D]] as usize (IntToInt); + // CHECK: = alloc::alloc::__rust_dealloc({{.+}}, move [[SIZE]], move [[E]]) -> + std::ptr::drop_in_place(ptr) +} diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff index 027c71dfaae..c2d144c98c3 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff @@ -110,9 +110,16 @@ + nop; return; } -+ } -+ + } + +- ALLOC0 (size: 43, align: 1) { + ALLOC0 (size: 8, align: 4) { + 00 00 00 00 __ __ __ __ │ ....░░░░ ++ } ++ ++ ALLOC1 (size: 43, align: 1) { + 0x00 │ 63 61 6c 6c 65 64 20 60 52 65 73 75 6c 74 3a 3a │ called `Result:: + 0x10 │ 75 6e 77 72 61 70 28 29 60 20 6f 6e 20 61 6e 20 │ unwrap()` on an + 0x20 │ 60 45 72 72 60 20 76 61 6c 75 65 │ `Err` value } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff index ebf305a6f1b..8641d2d6fa8 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff @@ -110,9 +110,16 @@ + nop; return; } -+ } -+ + } + +- ALLOC0 (size: 43, align: 1) { + ALLOC0 (size: 16, align: 8) { + 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░ ++ } ++ ++ ALLOC1 (size: 43, align: 1) { + 0x00 │ 63 61 6c 6c 65 64 20 60 52 65 73 75 6c 74 3a 3a │ called `Result:: + 0x10 │ 75 6e 77 72 61 70 28 29 60 20 6f 6e 20 61 6e 20 │ unwrap()` on an + 0x20 │ 60 45 72 72 60 20 76 61 6c 75 65 │ `Err` value } diff --git a/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir index d41135c6a4f..2d6f82f6137 100644 --- a/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir @@ -4,6 +4,8 @@ fn issue_77355_opt(_1: Foo) -> u64 { debug num => _1; let mut _0: u64; let mut _2: isize; + scope 1 { + } bb0: { _2 = discriminant(_1); diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff index 354e0988a00..1ba5e47b81b 100644 --- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff @@ -34,3 +34,15 @@ } } + ALLOC0 (size: 5, align: 1) { + 77 6f 72 6c 64 │ world + } + + ALLOC1 (size: 5, align: 1) { + 74 6f 77 65 6c │ towel + } + + ALLOC2 (size: 5, align: 1) { + 68 65 6c 6c 6f │ hello + } + diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff index 354e0988a00..1ba5e47b81b 100644 --- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff @@ -34,3 +34,15 @@ } } + ALLOC0 (size: 5, align: 1) { + 77 6f 72 6c 64 │ world + } + + ALLOC1 (size: 5, align: 1) { + 74 6f 77 65 6c │ towel + } + + ALLOC2 (size: 5, align: 1) { + 68 65 6c 6c 6f │ hello + } + diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff index 5cf37dc97cb..e0fabe5a90e 100644 --- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff @@ -45,3 +45,15 @@ } } + ALLOC0 (size: 5, align: 1) { + 77 6f 72 6c 64 │ world + } + + ALLOC1 (size: 5, align: 1) { + 74 6f 77 65 6c │ towel + } + + ALLOC2 (size: 5, align: 1) { + 68 65 6c 6c 6f │ hello + } + diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff index bdcf086e8d9..26799ae6629 100644 --- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff @@ -45,3 +45,15 @@ } } + ALLOC0 (size: 5, align: 1) { + 77 6f 72 6c 64 │ world + } + + ALLOC1 (size: 5, align: 1) { + 74 6f 77 65 6c │ towel + } + + ALLOC2 (size: 5, align: 1) { + 68 65 6c 6c 6f │ hello + } + diff --git a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff index 77c7c1a9012..ecd89d14ace 100644 --- a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff @@ -75,3 +75,7 @@ } } + ALLOC0 (size: 1, align: 1) { + 61 │ a + } + diff --git a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff index ed54a38f70b..610a1a4624f 100644 --- a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff @@ -113,3 +113,19 @@ } } + ALLOC0 (size: 1, align: 1) { + 44 │ D + } + + ALLOC1 (size: 1, align: 1) { + 43 │ C + } + + ALLOC2 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC3 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff index ed54a38f70b..610a1a4624f 100644 --- a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff @@ -113,3 +113,19 @@ } } + ALLOC0 (size: 1, align: 1) { + 44 │ D + } + + ALLOC1 (size: 1, align: 1) { + 43 │ C + } + + ALLOC2 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC3 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-abort.diff index ea6cdbfbe66..97c71762f22 100644 --- a/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-abort.diff @@ -41,3 +41,11 @@ } } + ALLOC0 (size: 1, align: 1) { + 45 │ E + } + + ALLOC1 (size: 1, align: 1) { + 44 │ D + } + diff --git a/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-unwind.diff index ea6cdbfbe66..97c71762f22 100644 --- a/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.custom_discriminant.UnreachableEnumBranching.panic-unwind.diff @@ -41,3 +41,11 @@ } } + ALLOC0 (size: 1, align: 1) { + 45 │ E + } + + ALLOC1 (size: 1, align: 1) { + 44 │ D + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff index be934ac688b..7e798abcd4e 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff @@ -51,3 +51,15 @@ } } + ALLOC0 (size: 1, align: 1) { + 43 │ C + } + + ALLOC1 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC2 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff index be934ac688b..7e798abcd4e 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff @@ -51,3 +51,15 @@ } } + ALLOC0 (size: 1, align: 1) { + 43 │ C + } + + ALLOC1 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC2 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-abort.diff index a6d6e0861b1..ac9b047624b 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-abort.diff @@ -42,3 +42,11 @@ } } + ALLOC0 (size: 1, align: 1) { + 45 │ E + } + + ALLOC1 (size: 1, align: 1) { + 44 │ D + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-unwind.diff index a6d6e0861b1..ac9b047624b 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t2.UnreachableEnumBranching.panic-unwind.diff @@ -42,3 +42,11 @@ } } + ALLOC0 (size: 1, align: 1) { + 45 │ E + } + + ALLOC1 (size: 1, align: 1) { + 44 │ D + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff index 120061841a0..9e85e56c583 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff @@ -51,3 +51,15 @@ } } + ALLOC0 (size: 1, align: 1) { + 43 │ C + } + + ALLOC1 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC2 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff index 120061841a0..9e85e56c583 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff @@ -51,3 +51,15 @@ } } + ALLOC0 (size: 1, align: 1) { + 43 │ C + } + + ALLOC1 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC2 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff index b86814d6119..e83c6131fa5 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff @@ -46,3 +46,15 @@ } } + ALLOC0 (size: 2, align: 1) { + 43 44 │ CD + } + + ALLOC1 (size: 6, align: 1) { + 42 28 69 33 32 29 │ B(i32) + } + + ALLOC2 (size: 6, align: 1) { + 41 28 69 33 32 29 │ A(i32) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff index b86814d6119..e83c6131fa5 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff @@ -46,3 +46,15 @@ } } + ALLOC0 (size: 2, align: 1) { + 43 44 │ CD + } + + ALLOC1 (size: 6, align: 1) { + 42 28 69 33 32 29 │ B(i32) + } + + ALLOC2 (size: 6, align: 1) { + 41 28 69 33 32 29 │ A(i32) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff index 424ac6ba651..33e33ebddec 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff @@ -60,3 +60,19 @@ } } + ALLOC0 (size: 6, align: 1) { + 42 28 69 33 32 29 │ B(i32) + } + + ALLOC1 (size: 6, align: 1) { + 41 28 69 33 32 29 │ A(i32) + } + + ALLOC2 (size: 1, align: 1) { + 44 │ D + } + + ALLOC3 (size: 1, align: 1) { + 43 │ C + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff index 424ac6ba651..33e33ebddec 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff @@ -60,3 +60,19 @@ } } + ALLOC0 (size: 6, align: 1) { + 42 28 69 33 32 29 │ B(i32) + } + + ALLOC1 (size: 6, align: 1) { + 41 28 69 33 32 29 │ A(i32) + } + + ALLOC2 (size: 1, align: 1) { + 44 │ D + } + + ALLOC3 (size: 1, align: 1) { + 43 │ C + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff index 17e01f38f4e..d11c07c4ba3 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff @@ -73,3 +73,23 @@ } } + ALLOC0 (size: 9, align: 1) { + 41 28 6f 74 68 65 72 29 44 │ A(other)D + } + + ALLOC1 (size: 4, align: 1) { + 41 28 32 29 │ A(2) + } + + ALLOC2 (size: 4, align: 1) { + 41 28 31 29 │ A(1) + } + + ALLOC3 (size: 6, align: 1) { + 42 28 69 33 32 29 │ B(i32) + } + + ALLOC4 (size: 1, align: 1) { + 43 │ C + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff index 17e01f38f4e..d11c07c4ba3 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff @@ -73,3 +73,23 @@ } } + ALLOC0 (size: 9, align: 1) { + 41 28 6f 74 68 65 72 29 44 │ A(other)D + } + + ALLOC1 (size: 4, align: 1) { + 41 28 32 29 │ A(2) + } + + ALLOC2 (size: 4, align: 1) { + 41 28 31 29 │ A(1) + } + + ALLOC3 (size: 6, align: 1) { + 42 28 69 33 32 29 │ B(i32) + } + + ALLOC4 (size: 1, align: 1) { + 43 │ C + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff index 2de1f77eeec..ae1ca6efd43 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff @@ -64,3 +64,19 @@ } } + ALLOC0 (size: 4, align: 1) { + 42 28 54 29 │ B(T) + } + + ALLOC1 (size: 4, align: 1) { + 41 28 54 29 │ A(T) + } + + ALLOC2 (size: 1, align: 1) { + 44 │ D + } + + ALLOC3 (size: 1, align: 1) { + 43 │ C + } + diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff index 5afb78c58a3..1e660036e46 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff @@ -68,3 +68,19 @@ } } + ALLOC0 (size: 4, align: 1) { + 42 28 54 29 │ B(T) + } + + ALLOC1 (size: 4, align: 1) { + 41 28 54 29 │ A(T) + } + + ALLOC2 (size: 1, align: 1) { + 44 │ D + } + + ALLOC3 (size: 1, align: 1) { + 43 │ C + } + diff --git a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff index 5c08648fac3..c24bd7e7446 100644 --- a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff @@ -51,3 +51,15 @@ } } + ALLOC0 (size: 1, align: 1) { + 43 │ C + } + + ALLOC1 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC2 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff index 5c08648fac3..c24bd7e7446 100644 --- a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff @@ -51,3 +51,15 @@ } } + ALLOC0 (size: 1, align: 1) { + 43 │ C + } + + ALLOC1 (size: 8, align: 1) { + 42 28 45 6d 70 74 79 29 │ B(Empty) + } + + ALLOC2 (size: 8, align: 1) { + 41 28 45 6d 70 74 79 29 │ A(Empty) + } + diff --git a/tests/pretty/asm.pp b/tests/pretty/asm.pp index e6c9545f51e..dca28f99a37 100644 --- a/tests/pretty/asm.pp +++ b/tests/pretty/asm.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ pretty-mode:expanded //@ pp-exact:asm.pp //@ only-x86_64 diff --git a/tests/pretty/cast-lt.pp b/tests/pretty/cast-lt.pp index f6155c9d827..e82636edca7 100644 --- a/tests/pretty/cast-lt.pp +++ b/tests/pretty/cast-lt.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ pretty-compare-only //@ pretty-mode:expanded //@ pp-exact:cast-lt.pp diff --git a/tests/pretty/dollar-crate.pp b/tests/pretty/dollar-crate.pp index 561a9500aaa..31a55ec2bda 100644 --- a/tests/pretty/dollar-crate.pp +++ b/tests/pretty/dollar-crate.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ pretty-compare-only //@ pretty-mode:expanded //@ pp-exact:dollar-crate.pp diff --git a/tests/pretty/expanded-and-path-remap-80832.pp b/tests/pretty/expanded-and-path-remap-80832.pp index 5b3922bb329..6206498e4a2 100644 --- a/tests/pretty/expanded-and-path-remap-80832.pp +++ b/tests/pretty/expanded-and-path-remap-80832.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; // Test for issue 80832 // //@ pretty-mode:expanded diff --git a/tests/pretty/format-args-str-escape.pp b/tests/pretty/format-args-str-escape.pp index 277b608475c..d0bd7cf0c72 100644 --- a/tests/pretty/format-args-str-escape.pp +++ b/tests/pretty/format-args-str-escape.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ pretty-compare-only //@ pretty-mode:expanded //@ pp-exact:format-args-str-escape.pp diff --git a/tests/pretty/hir-delegation.pp b/tests/pretty/hir-delegation.pp index e452cee6365..f8ad02f2fcc 100644 --- a/tests/pretty/hir-delegation.pp +++ b/tests/pretty/hir-delegation.pp @@ -4,10 +4,10 @@ #![allow(incomplete_features)] #![feature(fn_delegation)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; fn b<C>(e: C) { } diff --git a/tests/pretty/hir-fn-params.pp b/tests/pretty/hir-fn-params.pp index 3799c8a3c3b..fb4ea0304e5 100644 --- a/tests/pretty/hir-fn-params.pp +++ b/tests/pretty/hir-fn-params.pp @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-fn-params.pp diff --git a/tests/pretty/hir-fn-variadic.pp b/tests/pretty/hir-fn-variadic.pp index b6bc8e95127..c0f5b7069a2 100644 --- a/tests/pretty/hir-fn-variadic.pp +++ b/tests/pretty/hir-fn-variadic.pp @@ -3,10 +3,10 @@ //@ pp-exact:hir-fn-variadic.pp #![feature(c_variadic)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; extern "C" { unsafe fn foo(x: i32, va1: ...); diff --git a/tests/pretty/hir-if-else.pp b/tests/pretty/hir-if-else.pp index 200e34ac4f5..af5d31b07cb 100644 --- a/tests/pretty/hir-if-else.pp +++ b/tests/pretty/hir-if-else.pp @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-if-else.pp diff --git a/tests/pretty/hir-lifetimes.pp b/tests/pretty/hir-lifetimes.pp index 58de6d81915..00c052d3f79 100644 --- a/tests/pretty/hir-lifetimes.pp +++ b/tests/pretty/hir-lifetimes.pp @@ -5,10 +5,10 @@ // This tests the pretty-printing of lifetimes in lots of ways. #![allow(unused)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; struct Foo<'a> { x: &'a u32, diff --git a/tests/pretty/hir-pretty-attr.pp b/tests/pretty/hir-pretty-attr.pp index db7489c1264..01bfe2c0954 100644 --- a/tests/pretty/hir-pretty-attr.pp +++ b/tests/pretty/hir-pretty-attr.pp @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-pretty-attr.pp diff --git a/tests/pretty/hir-pretty-loop.pp b/tests/pretty/hir-pretty-loop.pp index 15f1677885a..a0830c5188a 100644 --- a/tests/pretty/hir-pretty-loop.pp +++ b/tests/pretty/hir-pretty-loop.pp @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-pretty-loop.pp diff --git a/tests/pretty/hir-struct-expr.pp b/tests/pretty/hir-struct-expr.pp index f85d17542df..bb222dc2e5f 100644 --- a/tests/pretty/hir-struct-expr.pp +++ b/tests/pretty/hir-struct-expr.pp @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-struct-expr.pp diff --git a/tests/pretty/if-else.pp b/tests/pretty/if-else.pp index d4ff02c5441..f29b693e571 100644 --- a/tests/pretty/if-else.pp +++ b/tests/pretty/if-else.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ pretty-compare-only //@ pretty-mode:expanded //@ pp-exact:if-else.pp diff --git a/tests/pretty/issue-12590-c.pp b/tests/pretty/issue-12590-c.pp index 691738a89ed..0df095b0ee5 100644 --- a/tests/pretty/issue-12590-c.pp +++ b/tests/pretty/issue-12590-c.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ pretty-compare-only //@ pretty-mode:expanded //@ pp-exact:issue-12590-c.pp diff --git a/tests/pretty/issue-4264.pp b/tests/pretty/issue-4264.pp index eb808f7122a..1344923f4c4 100644 --- a/tests/pretty/issue-4264.pp +++ b/tests/pretty/issue-4264.pp @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ pretty-compare-only //@ pretty-mode:hir,typed //@ pp-exact:issue-4264.pp diff --git a/tests/pretty/issue-85089.pp b/tests/pretty/issue-85089.pp index f4e0eb3dd5f..28a85bdf4ad 100644 --- a/tests/pretty/issue-85089.pp +++ b/tests/pretty/issue-85089.pp @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; // Test to print lifetimes on HIR pretty-printing. //@ pretty-compare-only diff --git a/tests/pretty/never-pattern.pp b/tests/pretty/never-pattern.pp index 923ad9b82c7..1ce332ea506 100644 --- a/tests/pretty/never-pattern.pp +++ b/tests/pretty/never-pattern.pp @@ -7,10 +7,10 @@ #![allow(incomplete_features)] #![feature(never_patterns)] #![feature(never_type)] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; fn f(x: Result<u32, !>) { _ = match x { Ok(x) => x, Err(!) , }; } diff --git a/tests/pretty/pin-ergonomics-hir.pp b/tests/pretty/pin-ergonomics-hir.pp index 212e0e174da..beca5988017 100644 --- a/tests/pretty/pin-ergonomics-hir.pp +++ b/tests/pretty/pin-ergonomics-hir.pp @@ -4,10 +4,10 @@ #![feature(pin_ergonomics)] #![allow(dead_code, incomplete_features)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; use std::pin::Pin; diff --git a/tests/pretty/postfix-match/precedence.pp b/tests/pretty/postfix-match/precedence.pp index 2052b445a2b..b6ff45daea1 100644 --- a/tests/pretty/postfix-match/precedence.pp +++ b/tests/pretty/postfix-match/precedence.pp @@ -1,10 +1,10 @@ #![feature(prelude_import)] #![no_std] #![feature(postfix_match)] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; use std::ops::Add; diff --git a/tests/pretty/shebang-at-top.pp b/tests/pretty/shebang-at-top.pp index a2797252636..197def4a154 100644 --- a/tests/pretty/shebang-at-top.pp +++ b/tests/pretty/shebang-at-top.pp @@ -1,10 +1,10 @@ #!/usr/bin/env rust #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ pretty-mode:expanded //@ pp-exact:shebang-at-top.pp //@ pretty-compare-only diff --git a/tests/pretty/tests-are-sorted.pp b/tests/pretty/tests-are-sorted.pp index d6a2c0ff979..9e1566b2eff 100644 --- a/tests/pretty/tests-are-sorted.pp +++ b/tests/pretty/tests-are-sorted.pp @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ compile-flags: --crate-type=lib --test --remap-path-prefix={{src-base}}/=/the/src/ --remap-path-prefix={{src-base}}\=/the/src/ //@ pretty-compare-only //@ pretty-mode:expanded diff --git a/tests/run-make/crate-loading-crate-depends-on-itself/foo.stderr b/tests/run-make/crate-loading-crate-depends-on-itself/foo.stderr index 7f131153540..9433a0ba00e 100644 --- a/tests/run-make/crate-loading-crate-depends-on-itself/foo.stderr +++ b/tests/run-make/crate-loading-crate-depends-on-itself/foo.stderr @@ -7,19 +7,19 @@ error[E0277]: the trait bound `foo::Struct: Trait` is not satisfied note: there are multiple different versions of crate `foo` in the dependency graph --> foo-current.rs:7:1 | -4 | extern crate foo; + 4 | extern crate foo; | ----------------- one version of crate `foo` used here, as a direct dependency of the current crate -5 | -6 | pub struct Struct; + 5 | + 6 | pub struct Struct; | ----------------- this type implements the required trait -7 | pub trait Trait {} + 7 | pub trait Trait {} | ^^^^^^^^^^^^^^^ this is the required trait | ::: foo-prev.rs:X:Y | -4 | pub struct Struct; + 4 | pub struct Struct; | ----------------- this type doesn't implement the required trait -5 | pub trait Trait {} + 5 | pub trait Trait {} | --------------- this is the found trait = note: two types coming from two different versions of the same crate are different types even if they look the same = help: you can use `cargo tree` to explore your dependency tree diff --git a/tests/run-make/link-cfg/rmake.rs b/tests/run-make/link-cfg/rmake.rs index 732de5dbd0b..18577fb836d 100644 --- a/tests/run-make/link-cfg/rmake.rs +++ b/tests/run-make/link-cfg/rmake.rs @@ -12,6 +12,7 @@ //@ ignore-cross-compile // Reason: the compiled binary is executed +//@ needs-llvm-components: x86 use run_make_support::{bare_rustc, build_native_dynamic_lib, build_native_static_lib, run, rustc}; diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs index 57b68c65930..9ea706af503 100644 --- a/tests/run-make/linker-warning/rmake.rs +++ b/tests/run-make/linker-warning/rmake.rs @@ -64,7 +64,9 @@ fn main() { .normalize(r#"/rustc[^/_-]*/"#, "/rustc/") .normalize("libpanic_abort", "libpanic_unwind") .normalize( - regex::escape(run_make_support::build_root().to_str().unwrap()), + regex::escape( + run_make_support::build_root().canonicalize().unwrap().to_str().unwrap(), + ), "/build-root", ) .normalize(r#""[^"]*\/symbols.o""#, "\"/symbols.o\"") diff --git a/tests/run-make/mismatching-target-triples/rmake.rs b/tests/run-make/mismatching-target-triples/rmake.rs index 6f41eac8cda..1bbe945e0da 100644 --- a/tests/run-make/mismatching-target-triples/rmake.rs +++ b/tests/run-make/mismatching-target-triples/rmake.rs @@ -4,6 +4,7 @@ // now replaced by a clearer normal error message. This test checks that this aforementioned // error message is used. // See https://github.com/rust-lang/rust/issues/10814 +//@ needs-llvm-components: x86 use run_make_support::rustc; diff --git a/tests/run-make/musl-default-linking/rmake.rs b/tests/run-make/musl-default-linking/rmake.rs index 017444cfcdd..7bb54e2739c 100644 --- a/tests/run-make/musl-default-linking/rmake.rs +++ b/tests/run-make/musl-default-linking/rmake.rs @@ -4,6 +4,7 @@ use run_make_support::{rustc, serde_json}; // Per https://github.com/rust-lang/compiler-team/issues/422, // we should be trying to move these targets to dynamically link // musl libc by default. +//@ needs-llvm-components: aarch64 arm mips powerpc riscv systemz x86 static LEGACY_STATIC_LINKING_TARGETS: &[&'static str] = &[ "aarch64-unknown-linux-musl", "arm-unknown-linux-musleabi", diff --git a/tests/run-make/rustdoc-dep-info/after.md b/tests/run-make/rustdoc-dep-info/after.md new file mode 100644 index 00000000000..10d4b4c4116 --- /dev/null +++ b/tests/run-make/rustdoc-dep-info/after.md @@ -0,0 +1 @@ +meow! :3 diff --git a/tests/run-make/rustdoc-dep-info/before.html b/tests/run-make/rustdoc-dep-info/before.html new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/tests/run-make/rustdoc-dep-info/before.html diff --git a/tests/run-make/rustdoc-dep-info/extend.css b/tests/run-make/rustdoc-dep-info/extend.css new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/tests/run-make/rustdoc-dep-info/extend.css diff --git a/tests/run-make/rustdoc-dep-info/rmake.rs b/tests/run-make/rustdoc-dep-info/rmake.rs index db7a00a5ce2..625f81fd428 100644 --- a/tests/run-make/rustdoc-dep-info/rmake.rs +++ b/tests/run-make/rustdoc-dep-info/rmake.rs @@ -9,13 +9,26 @@ use run_make_support::{path, rfs, rustdoc}; fn main() { // We're only emitting dep info, so we shouldn't be running static analysis to // figure out that this program is erroneous. - rustdoc().input("lib.rs").arg("-Zunstable-options").emit("dep-info").run(); + // Ensure that all kinds of input reading flags end up in dep-info. + rustdoc() + .input("lib.rs") + .arg("-Zunstable-options") + .arg("--html-before-content=before.html") + .arg("--markdown-after-content=after.md") + .arg("--extend-css=extend.css") + .arg("--theme=theme.css") + .emit("dep-info") + .run(); let content = rfs::read_to_string("foo.d"); assert_contains(&content, "lib.rs:"); assert_contains(&content, "foo.rs:"); assert_contains(&content, "bar.rs:"); assert_contains(&content, "doc.md:"); + assert_contains(&content, "after.md:"); + assert_contains(&content, "before.html:"); + assert_contains(&content, "extend.css:"); + assert_contains(&content, "theme.css:"); // Now we check that we can provide a file name to the `dep-info` argument. rustdoc().input("lib.rs").arg("-Zunstable-options").emit("dep-info=bla.d").run(); diff --git a/tests/run-make/rustdoc-dep-info/theme.css b/tests/run-make/rustdoc-dep-info/theme.css new file mode 100644 index 00000000000..459daffa9a1 --- /dev/null +++ b/tests/run-make/rustdoc-dep-info/theme.css @@ -0,0 +1 @@ +/* This is not a valid theme but that doesn't really matter */ diff --git a/tests/run-make/rustdoc-target-modifiers/c.rs b/tests/run-make/rustdoc-target-modifiers/c.rs new file mode 100644 index 00000000000..287d0bbd725 --- /dev/null +++ b/tests/run-make/rustdoc-target-modifiers/c.rs @@ -0,0 +1,7 @@ +#![allow(internal_features)] +#![feature(lang_items, no_core)] +#![no_core] + +fn f() { + d::f(); +} diff --git a/tests/run-make/rustdoc-target-modifiers/d.rs b/tests/run-make/rustdoc-target-modifiers/d.rs new file mode 100644 index 00000000000..6cbff06079e --- /dev/null +++ b/tests/run-make/rustdoc-target-modifiers/d.rs @@ -0,0 +1,12 @@ +#![allow(internal_features)] +#![feature(lang_items, no_core)] +#![no_core] + +#[lang = "pointee_sized"] +pub trait PointeeSized {} +#[lang = "meta_sized"] +pub trait MetaSized: PointeeSized {} +#[lang = "sized"] +pub trait Sized: MetaSized {} + +pub fn f() {} diff --git a/tests/run-make/rustdoc-target-modifiers/rmake.rs b/tests/run-make/rustdoc-target-modifiers/rmake.rs new file mode 100644 index 00000000000..ee522501fd2 --- /dev/null +++ b/tests/run-make/rustdoc-target-modifiers/rmake.rs @@ -0,0 +1,28 @@ +//! Test that target modifiers are taken into account by `rustdoc`. +//! +//! Otherwise, `rustdoc` errors when trying to generate documentation +//! using dependencies (e.g. `core`) that set a target modifier. +//! +//! Please see https://github.com/rust-lang/rust/issues/144521. + +use run_make_support::{rustc, rustdoc}; + +fn main() { + rustc() + .input("d.rs") + .edition("2024") + .crate_type("rlib") + .emit("metadata") + .sysroot("/dev/null") + .target("aarch64-unknown-none-softfloat") + .arg("-Zfixed-x18") + .run(); + + rustdoc() + .input("c.rs") + .crate_type("rlib") + .extern_("d", "libd.rmeta") + .target("aarch64-unknown-none-softfloat") + .arg("-Zfixed-x18") + .run(); +} diff --git a/tests/run-make/rustdoc-target-spec-json-path/rmake.rs b/tests/run-make/rustdoc-target-spec-json-path/rmake.rs index fe9587f5022..d43aa9b90ac 100644 --- a/tests/run-make/rustdoc-target-spec-json-path/rmake.rs +++ b/tests/run-make/rustdoc-target-spec-json-path/rmake.rs @@ -1,4 +1,5 @@ // Test that rustdoc will properly canonicalize the target spec json path just like rustc. +//@ needs-llvm-components: x86 use run_make_support::{cwd, rustc, rustdoc}; diff --git a/tests/run-make/rustdoc-target-spec-json-path/target.json b/tests/run-make/rustdoc-target-spec-json-path/target.json index c478f1196fa..d7e4cac57ae 100644 --- a/tests/run-make/rustdoc-target-spec-json-path/target.json +++ b/tests/run-make/rustdoc-target-spec-json-path/target.json @@ -6,7 +6,6 @@ "dynamic-linking": true, "env": "gnu", "executables": true, - "has-elf-tls": true, "has-rpath": true, "linker-is-gnu": true, "llvm-target": "x86_64-unknown-linux-gnu", diff --git a/tests/run-make/target-specs/endianness-mismatch.json b/tests/run-make/target-specs/endianness-mismatch.json index 431053ea99b..cc03becc59a 100644 --- a/tests/run-make/target-specs/endianness-mismatch.json +++ b/tests/run-make/target-specs/endianness-mismatch.json @@ -5,7 +5,6 @@ "llvm-target": "x86_64-unknown-linux-gnu", "target-endian": "big", "target-pointer-width": "64", - "target-c-int-width": "32", "arch": "x86_64", "os": "linux" } diff --git a/tests/run-make/target-specs/my-awesome-platform.json b/tests/run-make/target-specs/my-awesome-platform.json index 1673ef7bd54..d41038b84a8 100644 --- a/tests/run-make/target-specs/my-awesome-platform.json +++ b/tests/run-make/target-specs/my-awesome-platform.json @@ -4,8 +4,6 @@ "llvm-target": "i686-unknown-linux-gnu", "target-endian": "little", "target-pointer-width": "32", - "target-c-int-width": "32", "arch": "x86", - "os": "linux", - "morestack": false + "os": "linux" } diff --git a/tests/run-make/target-specs/my-incomplete-platform.json b/tests/run-make/target-specs/my-incomplete-platform.json index ceaa25cdf2f..8bdc4108f49 100644 --- a/tests/run-make/target-specs/my-incomplete-platform.json +++ b/tests/run-make/target-specs/my-incomplete-platform.json @@ -3,8 +3,6 @@ "linker-flavor": "gcc", "target-endian": "little", "target-pointer-width": "32", - "target-c-int-width": "32", "arch": "x86", - "os": "foo", - "morestack": false + "os": "foo" } diff --git a/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json index 0cafce15a9f..27833f1abdd 100644 --- a/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json +++ b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json @@ -5,8 +5,6 @@ "llvm-target": "x86_64-unknown-linux-gnu", "target-endian": "little", "target-pointer-width": "64", - "target-c-int-width": "32", "arch": "x86_64", - "os": "linux", - "morestack": false + "os": "linux" } diff --git a/tests/run-make/target-specs/require-explicit-cpu.json b/tests/run-make/target-specs/require-explicit-cpu.json index 5cbb9573b3f..9744bca168e 100644 --- a/tests/run-make/target-specs/require-explicit-cpu.json +++ b/tests/run-make/target-specs/require-explicit-cpu.json @@ -4,7 +4,6 @@ "llvm-target": "i686-unknown-linux-gnu", "target-endian": "little", "target-pointer-width": "32", - "target-c-int-width": "32", "arch": "x86", "os": "linux", "need-explicit-cpu": true diff --git a/tests/run-make/target-specs/rmake.rs b/tests/run-make/target-specs/rmake.rs index 9184e5f772f..7c30a5b21b3 100644 --- a/tests/run-make/target-specs/rmake.rs +++ b/tests/run-make/target-specs/rmake.rs @@ -4,12 +4,11 @@ // with the target flag's bundle of new features to check that compilation either succeeds while // using them correctly, or fails with the right error message when using them improperly. // See https://github.com/rust-lang/rust/pull/16156 +//@ needs-llvm-components: x86 use run_make_support::{diff, rfs, rustc}; fn main() { - rustc().input("foo.rs").target("my-awesome-platform.json").crate_type("lib").emit("asm").run(); - assert!(!rfs::read_to_string("foo.s").contains("morestack")); rustc() .input("foo.rs") .target("my-invalid-platform.json") @@ -19,7 +18,7 @@ fn main() { .input("foo.rs") .target("my-incomplete-platform.json") .run_fail() - .assert_stderr_contains("Field llvm-target"); + .assert_stderr_contains("missing field `llvm-target`"); rustc() .env("RUST_TARGET_PATH", ".") .input("foo.rs") diff --git a/tests/run-make/uefi-qemu/rmake.rs b/tests/run-make/uefi-qemu/rmake.rs new file mode 100644 index 00000000000..55d42fba5e7 --- /dev/null +++ b/tests/run-make/uefi-qemu/rmake.rs @@ -0,0 +1,84 @@ +//! This test builds and runs a basic UEFI application on QEMU for various targets. +//! +//! You must have the relevant OVMF or AAVMF firmware installed for this to work. +//! +//! Requires: qemu-system-x86_64, qemu-system-aarch64 +//! OVMF/AAVMF firmware +//! +//! Note: test assumes `/uefi_qemu_test` exists and is a self-contained crate. + +//@ only-uefi + +use std::path::Path; + +use run_make_support::{cargo, cmd, path, rfs}; + +fn main() { + let target = run_make_support::target(); + + let (boot_filename, ovmf_dir, ovmf_code_name, ovmf_vars_name, qemu, machine, cpu) = + match target.as_str() { + "aarch64-unknown-uefi" => ( + "bootaa64.efi", + Path::new("/usr/share/AAVMF"), + "AAVMF_CODE.fd", + "AAVMF_VARS.fd", + "qemu-system-aarch64", + "virt", + "cortex-a72", + ), + "i686-unknown-uefi" => ( + "bootia32.efi", + Path::new("/usr/share/OVMF"), + "OVMF32_CODE_4M.secboot.fd", + "OVMF32_VARS_4M.fd", + "qemu-system-x86_64", + "q35", + "qemu64", + ), + "x86_64-unknown-uefi" => ( + "bootx64.efi", + Path::new("/usr/share/OVMF"), + "OVMF_CODE_4M.fd", + "OVMF_VARS_4M.fd", + "qemu-system-x86_64", + "q35", + "qemu64", + ), + _ => panic!("unsupported target {target}"), + }; + + let tmp = std::env::temp_dir(); + let test_crate = tmp.join("uefi_qemu_test"); + rfs::copy_dir_all(path("uefi_qemu_test"), &test_crate); + + cargo().args(&["build", "--target", &target]).current_dir(&test_crate).run(); + + // Prepare ESP + let esp = test_crate.join("esp"); + let boot = esp.join("efi/boot"); + rfs::create_dir_all(&boot); + + let src_efi = test_crate.join("target").join(&target).join("debug/uefi_qemu_test.efi"); + let dst_efi = boot.join(boot_filename); + rfs::copy(&src_efi, &dst_efi); + + // Copy OVMF files + let code = ovmf_dir.join(ovmf_code_name); + let vars_src = ovmf_dir.join(ovmf_vars_name); + let vars_dst = tmp.join("vars.fd"); + rfs::copy(&vars_src, &vars_dst); + + let output = cmd(qemu) + .args(["-machine", machine]) + .args(["-cpu", cpu]) + .args(["-display", "none"]) + .args(["-serial", "stdio"]) + .args(["-drive", &format!("if=pflash,format=raw,readonly=on,file={}", code.display())]) + .args(["-drive", &format!("if=pflash,format=raw,readonly=off,file={}", vars_dst.display())]) + .args(["-drive", &format!("format=raw,file=fat:rw:{}", esp.display())]) + .run() + .stdout_utf8(); + + assert!(output.contains("Hello World!"), "invalid output for {target}:\n{output}"); +} diff --git a/tests/run-make/uefi-qemu/uefi_qemu_test/Cargo.lock b/tests/run-make/uefi-qemu/uefi_qemu_test/Cargo.lock new file mode 100644 index 00000000000..8b6a664ad93 --- /dev/null +++ b/tests/run-make/uefi-qemu/uefi_qemu_test/Cargo.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "uefi_qemu_test" +version = "0.0.0" +dependencies = [ + "r-efi", +] diff --git a/tests/run-make/uefi-qemu/uefi_qemu_test/Cargo.toml b/tests/run-make/uefi-qemu/uefi_qemu_test/Cargo.toml new file mode 100644 index 00000000000..1a8d0d94368 --- /dev/null +++ b/tests/run-make/uefi-qemu/uefi_qemu_test/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "uefi_qemu_test" +version = "0.0.0" +edition = "2021" + +[workspace] +resolver = "2" + +[dependencies] +r-efi = "5.2.0" diff --git a/tests/run-make/uefi-qemu/uefi_qemu_test/src/main.rs b/tests/run-make/uefi-qemu/uefi_qemu_test/src/main.rs new file mode 100644 index 00000000000..f8e1212a9f6 --- /dev/null +++ b/tests/run-make/uefi-qemu/uefi_qemu_test/src/main.rs @@ -0,0 +1,39 @@ +// Code is adapted from this hello world example: +// https://doc.rust-lang.org/nightly/rustc/platform-support/unknown-uefi.html + +#![no_main] +#![no_std] + +use core::{panic, ptr}; + +use r_efi::efi::{Char16, Handle, RESET_SHUTDOWN, Status, SystemTable}; + +#[panic_handler] +fn panic_handler(_info: &panic::PanicInfo) -> ! { + loop {} +} + +#[export_name = "efi_main"] +pub extern "C" fn main(_h: Handle, st: *mut SystemTable) -> Status { + let s = b"Hello World!\n\0".map(|c| u16::from(c)); + + // Print "Hello World!". + let r = unsafe { ((*(*st).con_out).output_string)((*st).con_out, s.as_ptr() as *mut Char16) }; + if r.is_error() { + return r; + } + + // Shut down. + unsafe { + ((*((*st).runtime_services)).reset_system)( + RESET_SHUTDOWN, + Status::SUCCESS, + 0, + ptr::null_mut(), + ); + } + + // This should never be reached because `reset_system` should never + // return, so fail with an error if we get here. + Status::UNSUPPORTED +} diff --git a/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr b/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr index bfc1e919404..ce65557c2c4 100644 --- a/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr +++ b/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr @@ -15,7 +15,7 @@ error: unknown attribute `standalone` note: the lint level is defined here --> $DIR/standalone-warning-2024.rs:9:9 | -9 | #![deny(warnings)] + 9 | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]` diff --git a/tests/rustdoc/extern/extern-html-alias.rs b/tests/rustdoc/extern/extern-html-alias.rs new file mode 100644 index 00000000000..3ff782d3963 --- /dev/null +++ b/tests/rustdoc/extern/extern-html-alias.rs @@ -0,0 +1,9 @@ +//@ compile-flags:-Z unstable-options --extern-html-root-url externs_name=https://renamed.example.com --extern-html-root-url empty=https://bad.invalid +//@ aux-crate:externs_name=empty.rs +//@ edition: 2018 + +extern crate externs_name as renamed; + +//@ has extern_html_alias/index.html +//@ has - '//a/@href' 'https://renamed.example.com/empty/index.html' +pub use renamed as yet_different_name; diff --git a/tests/rustdoc/extern/extern-html-fallback.rs b/tests/rustdoc/extern/extern-html-fallback.rs new file mode 100644 index 00000000000..ddac9bf713c --- /dev/null +++ b/tests/rustdoc/extern/extern-html-fallback.rs @@ -0,0 +1,14 @@ +//@ compile-flags:-Z unstable-options --extern-html-root-url yet_another_name=https://bad.invalid --extern-html-root-url renamed_privately=https://bad.invalid --extern-html-root-url renamed_locally=https://bad.invalid --extern-html-root-url empty=https://localhost +//@ aux-crate:externs_name=empty.rs +//@ edition: 2018 + +mod m { + pub extern crate externs_name as renamed_privately; +} + +// renaming within the crate's source code is not supposed to affect CLI flags +extern crate externs_name as renamed_locally; + +//@ has extern_html_fallback/index.html +//@ has - '//a/@href' 'https://localhost/empty/index.html' +pub use crate::renamed_locally as yet_another_name; diff --git a/tests/ui/SUMMARY.md b/tests/ui/README.md index 1aeb0fcfbea..66c1bb905a7 100644 --- a/tests/ui/SUMMARY.md +++ b/tests/ui/README.md @@ -412,6 +412,10 @@ These tests revolve around command-line flags which change the way error/warning Exercises `#[diagnostic::*]` namespaced attributes. See [RFC 3368 Diagnostic attribute namespace](https://github.com/rust-lang/rfcs/blob/master/text/3368-diagnostic-attribute-namespace.md). +## `tests/ui/diagnostics-infra` + +This directory contains tests and infrastructure related to the diagnostics system, including support for translatable diagnostics + ## `tests/ui/diagnostic-width/`: `--diagnostic-width` Everything to do with `--diagnostic-width`. @@ -650,10 +654,6 @@ Tests on range patterns where one of the bounds is not a direct value. Tests for the standard library collection [`std::collections::HashMap`](https://doc.rust-lang.org/std/collections/struct.HashMap.html). -## `tests/ui/hello_world/` - -Tests that the basic hello-world program is not somehow broken. - ## `tests/ui/higher-ranked/` Tests for higher-ranked trait bounds. @@ -1233,6 +1233,10 @@ Exercises sanitizer support. See [Sanitizer | The rustc book](https://doc.rust-l Tests with erroneous ways of using `self`, such as using `this.x` syntax as seen in other languages, having it not be the first argument, or using it in a non-associated function (no `impl` or `trait`). It also contains correct uses of `self` which have previously been observed to cause ICEs. +## `tests/ui/self-profile/`: self-profiling + +Tests related to the self-profiler (`-Zself-profile`) functionality of rustc. + ## `tests/ui/sepcomp/`: Separate Compilation In this directory, multiple crates are compiled, but some of them have `inline` functions, meaning they must be inlined into a different crate despite having been compiled separately. @@ -1277,9 +1281,9 @@ See [Tracking issue for specialization (RFC 1210) #31844](https://github.com/rus Stability attributes used internally by the standard library: `#[stable()]` and `#[unstable()]`. -## `tests/ui/stable-mir-print/` +## `tests/ui/rustc_public-ir-print/` -Some tests for pretty printing of StableMIR. +Some tests for pretty printing of rustc_public's IR. ## `tests/ui/stack-protector/`: `-Z stack-protector` command line flag diff --git a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs index 1b0f0608fc6..7b7ca2f6cc6 100644 --- a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs +++ b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs @@ -2,6 +2,7 @@ //@ ignore-android no libc //@ ignore-emscripten no libc //@ ignore-sgx no libc +//@ ignore-backends: gcc //@ only-linux //@ compile-flags:-C panic=abort //@ aux-build:helper.rs diff --git a/tests/ui/allocator/no_std-alloc-error-handler-default.rs b/tests/ui/allocator/no_std-alloc-error-handler-default.rs index 51ecf1a6731..5a6c0b33d51 100644 --- a/tests/ui/allocator/no_std-alloc-error-handler-default.rs +++ b/tests/ui/allocator/no_std-alloc-error-handler-default.rs @@ -2,6 +2,7 @@ //@ ignore-android no libc //@ ignore-emscripten no libc //@ ignore-sgx no libc +//@ ignore-backends: gcc //@ only-linux //@ compile-flags:-C panic=abort //@ aux-build:helper.rs diff --git a/tests/ui/asm/may_unwind.rs b/tests/ui/asm/may_unwind.rs index 1d4f50d5fe8..0fef317a2cf 100644 --- a/tests/ui/asm/may_unwind.rs +++ b/tests/ui/asm/may_unwind.rs @@ -1,6 +1,7 @@ //@ run-pass //@ needs-asm-support //@ needs-unwind +//@ ignore-backends: gcc #![feature(asm_unwind)] diff --git a/tests/ui/asm/named-asm-labels.rs b/tests/ui/asm/named-asm-labels.rs index 996fb82a944..e78553fd775 100644 --- a/tests/ui/asm/named-asm-labels.rs +++ b/tests/ui/asm/named-asm-labels.rs @@ -171,12 +171,10 @@ fn main() { } } -// Trigger on naked fns too, even though they can't be inlined, reusing a -// label or LTO can cause labels to break +// Don't trigger on naked functions. #[unsafe(naked)] pub extern "C" fn foo() -> i32 { naked_asm!(".Lfoo: mov rax, {}; ret;", "nop", const 1) - //~^ ERROR avoid using named labels } // Make sure that non-naked attributes *do* still let the lint happen @@ -190,7 +188,18 @@ pub extern "C" fn bar() { pub extern "C" fn aaa() { fn _local() {} - naked_asm!(".Laaa: nop; ret;") //~ ERROR avoid using named labels + naked_asm!(".Laaa: nop; ret;") +} + +#[unsafe(naked)] +pub extern "C" fn bbb<'a>(a: &'a u32) { + naked_asm!(".Lbbb: nop; ret;") +} + +#[unsafe(naked)] +pub extern "C" fn ccc<T>(a: &T) { + naked_asm!(".Lccc: nop; ret;") + //~^ ERROR avoid using named labels } pub fn normal() { @@ -200,7 +209,7 @@ pub fn normal() { pub extern "C" fn bbb() { fn _very_local() {} - naked_asm!(".Lbbb: nop; ret;") //~ ERROR avoid using named labels + naked_asm!(".Lbbb: nop; ret;") } fn _local2() {} @@ -230,3 +239,10 @@ fn closures() { // Don't trigger on global asm global_asm!("aaaaaaaa: nop"); + +trait Foo { + #[unsafe(naked)] + extern "C" fn bbb<'a>(a: &'a u32) { + naked_asm!(".Lbbb: nop; ret;") //~ ERROR avoid using named labels + } +} diff --git a/tests/ui/asm/named-asm-labels.stderr b/tests/ui/asm/named-asm-labels.stderr index cd7e7a08c1d..9ba9e14de3a 100644 --- a/tests/ui/asm/named-asm-labels.stderr +++ b/tests/ui/asm/named-asm-labels.stderr @@ -475,16 +475,7 @@ LL | #[warn(named_asm_labels)] | ^^^^^^^^^^^^^^^^ error: avoid using named labels in inline assembly - --> $DIR/named-asm-labels.rs:178:17 - | -LL | naked_asm!(".Lfoo: mov rax, {}; ret;", "nop", const 1) - | ^^^^^ - | - = help: only local labels of the form `<number>:` should be used in inline asm - = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information - -error: avoid using named labels in inline assembly - --> $DIR/named-asm-labels.rs:185:20 + --> $DIR/named-asm-labels.rs:183:20 | LL | unsafe { asm!(".Lbar: mov rax, {}; ret;", "nop", const 1, options(noreturn)) } | ^^^^^ @@ -493,49 +484,49 @@ LL | unsafe { asm!(".Lbar: mov rax, {}; ret;", "nop", const 1, options(noret = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information error: avoid using named labels in inline assembly - --> $DIR/named-asm-labels.rs:193:17 + --> $DIR/named-asm-labels.rs:201:17 | -LL | naked_asm!(".Laaa: nop; ret;") +LL | naked_asm!(".Lccc: nop; ret;") | ^^^^^ | = help: only local labels of the form `<number>:` should be used in inline asm = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information error: avoid using named labels in inline assembly - --> $DIR/named-asm-labels.rs:203:21 + --> $DIR/named-asm-labels.rs:221:15 | -LL | naked_asm!(".Lbbb: nop; ret;") - | ^^^^^ +LL | asm!("closure1: nop"); + | ^^^^^^^^ | = help: only local labels of the form `<number>:` should be used in inline asm = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information error: avoid using named labels in inline assembly - --> $DIR/named-asm-labels.rs:212:15 + --> $DIR/named-asm-labels.rs:225:15 | -LL | asm!("closure1: nop"); +LL | asm!("closure2: nop"); | ^^^^^^^^ | = help: only local labels of the form `<number>:` should be used in inline asm = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information error: avoid using named labels in inline assembly - --> $DIR/named-asm-labels.rs:216:15 + --> $DIR/named-asm-labels.rs:235:19 | -LL | asm!("closure2: nop"); - | ^^^^^^^^ +LL | asm!("closure3: nop"); + | ^^^^^^^^ | = help: only local labels of the form `<number>:` should be used in inline asm = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information error: avoid using named labels in inline assembly - --> $DIR/named-asm-labels.rs:226:19 + --> $DIR/named-asm-labels.rs:246:21 | -LL | asm!("closure3: nop"); - | ^^^^^^^^ +LL | naked_asm!(".Lbbb: nop; ret;") + | ^^^^^ | = help: only local labels of the form `<number>:` should be used in inline asm = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information -error: aborting due to 56 previous errors; 1 warning emitted +error: aborting due to 55 previous errors; 1 warning emitted diff --git a/tests/ui/asm/unpretty-expanded.stdout b/tests/ui/asm/unpretty-expanded.stdout index 7ba1702dfed..7678f6bc345 100644 --- a/tests/ui/asm/unpretty-expanded.stdout +++ b/tests/ui/asm/unpretty-expanded.stdout @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ needs-asm-support //@ check-pass //@ compile-flags: -Zunpretty=expanded diff --git a/tests/ui/asm/x86_64/may_unwind.rs b/tests/ui/asm/x86_64/may_unwind.rs index d3a2916df9d..9657f49ab30 100644 --- a/tests/ui/asm/x86_64/may_unwind.rs +++ b/tests/ui/asm/x86_64/may_unwind.rs @@ -2,6 +2,7 @@ //@ run-pass //@ needs-asm-support //@ needs-unwind +//@ ignore-backends: gcc #![feature(asm_unwind)] diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout index 87667553837..7499df5be5d 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout +++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout @@ -1,8 +1,8 @@ #![feature(prelude_import)] -#[prelude_import] -use std::prelude::rust_2021::*; #[macro_use] extern crate std; +#[prelude_import] +use std::prelude::rust_2021::*; //@ edition: 2021 //@ compile-flags: -Zunpretty=expanded //@ check-pass diff --git a/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.rs b/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.rs index c8bb0ebd574..49e46f44cb2 100644 --- a/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.rs +++ b/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.rs @@ -1,4 +1,4 @@ -// Regression test for issue #105056. +// issue: <https://github.com/rust-lang/rust/issues/105056> //@ edition: 2021 fn f(_: impl Trait<T = Copy>) {} @@ -23,4 +23,11 @@ type Obj = dyn Trait<T = Clone>; trait Trait { type T; } +// Don't suggest assoc ty bounds when we have parenthesized args (the underlying assoc type +// binding `Output` isn't introduced by `=` but by `->`, suggesting `:` wouldn't be valid). +// issue: <https://github.com/rust-lang/rust/issues/140543> +fn i(_: impl Fn() -> std::fmt::Debug) {} +//~^ ERROR expected a type, found a trait +//~| HELP you can add the `dyn` keyword if you want a trait object + fn main() {} diff --git a/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr b/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr index 6eb8fabb185..ea9f25f0719 100644 --- a/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr +++ b/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr @@ -57,6 +57,17 @@ help: you can add the `dyn` keyword if you want a trait object LL | type Obj = dyn Trait<T = dyn Clone>; | +++ -error: aborting due to 4 previous errors +error[E0782]: expected a type, found a trait + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:29:22 + | +LL | fn i(_: impl Fn() -> std::fmt::Debug) {} + | ^^^^^^^^^^^^^^^ + | +help: you can add the `dyn` keyword if you want a trait object + | +LL | fn i(_: impl Fn() -> dyn std::fmt::Debug) {} + | +++ + +error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0782`. diff --git a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr index 03fa220b0bf..3fe1431fda7 100644 --- a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr +++ b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr @@ -1,14 +1,13 @@ error[E0507]: cannot move out of `x` which is behind a mutable reference --> $DIR/closure-shim-borrowck-error.rs:11:18 | +LL | fn hello(x: Ty) { + | -- move occurs because `x` has type `Ty`, which does not implement the `Copy` trait LL | needs_fn_mut(async || { | ^^^^^^^^ `x` is moved here LL | LL | x.hello(); - | - - | | - | variable moved due to use in coroutine - | move occurs because `x` has type `Ty`, which does not implement the `Copy` trait + | - variable moved due to use in coroutine | note: if `Ty` implemented `Clone`, you could clone the value --> $DIR/closure-shim-borrowck-error.rs:17:1 diff --git a/tests/ui/async-await/async-closures/move-out-of-ref.stderr b/tests/ui/async-await/async-closures/move-out-of-ref.stderr index 8a63515a8a9..d443dc9d483 100644 --- a/tests/ui/async-await/async-closures/move-out-of-ref.stderr +++ b/tests/ui/async-await/async-closures/move-out-of-ref.stderr @@ -1,8 +1,11 @@ error[E0507]: cannot move out of `*x` which is behind a shared reference --> $DIR/move-out-of-ref.rs:9:9 | +LL | fn hello(x: &Ty) { + | --- move occurs because `*x` has type `Ty`, which does not implement the `Copy` trait +LL | let c = async || { LL | *x; - | ^^ move occurs because `*x` has type `Ty`, which does not implement the `Copy` trait + | ^^ `*x` is moved here | note: if `Ty` implemented `Clone`, you could clone the value --> $DIR/move-out-of-ref.rs:5:1 diff --git a/tests/ui/async-await/deep-futures-are-freeze.rs b/tests/ui/async-await/deep-futures-are-freeze.rs index c4300163db1..79dbc033bf7 100644 --- a/tests/ui/async-await/deep-futures-are-freeze.rs +++ b/tests/ui/async-await/deep-futures-are-freeze.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ build-pass //@ compile-flags: -Copt-level=s -Clto=fat //@ no-prefer-dynamic diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs index 4bafb39f600..d6180bb2f45 100644 --- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs +++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ edition: 2021 //@ known-bug: #108309 diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr index 62cca41f6cf..3d82f572a1a 100644 --- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr +++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr @@ -1,11 +1,11 @@ error[E0053]: method `foo` has an incompatible type for trait - --> $DIR/dont-project-to-specializable-projection.rs:13:5 + --> $DIR/dont-project-to-specializable-projection.rs:14:5 | LL | default async fn foo(_: T) -> &'static str { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found future | note: type in trait - --> $DIR/dont-project-to-specializable-projection.rs:9:5 + --> $DIR/dont-project-to-specializable-projection.rs:10:5 | LL | async fn foo(_: T) -> &'static str; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | async fn foo(_: T) -> &'static str; found signature `fn(_) -> impl Future<Output = &'static str>` error: async associated function in trait cannot be specialized - --> $DIR/dont-project-to-specializable-projection.rs:13:5 + --> $DIR/dont-project-to-specializable-projection.rs:14:5 | LL | default async fn foo(_: T) -> &'static str { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ LL | default async fn foo(_: T) -> &'static str { = note: specialization behaves in inconsistent and surprising ways with async functions in traits, and for now is disallowed error[E0599]: no method named `poll` found for struct `Pin<&mut impl Future<Output = ()>>` in the current scope - --> $DIR/dont-project-to-specializable-projection.rs:48:28 + --> $DIR/dont-project-to-specializable-projection.rs:49:28 | LL | match fut.as_mut().poll(ctx) { | ^^^^ method not found in `Pin<&mut impl Future<Output = ()>>` diff --git a/tests/ui/async-await/issue-64130-non-send-future-diags.stderr b/tests/ui/async-await/issue-64130-non-send-future-diags.stderr index d28807e223b..beaf8e9c96d 100644 --- a/tests/ui/async-await/issue-64130-non-send-future-diags.stderr +++ b/tests/ui/async-await/issue-64130-non-send-future-diags.stderr @@ -4,12 +4,12 @@ error: future cannot be sent between threads safely LL | is_send(foo()); | ^^^^^ future returned by `foo` is not `Send` | - = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, u32>` + = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `std::sync::MutexGuard<'_, u32>` note: future is not `Send` as this value is used across an await --> $DIR/issue-64130-non-send-future-diags.rs:17:11 | LL | let g = x.lock().unwrap(); - | - has type `MutexGuard<'_, u32>` which is not `Send` + | - has type `std::sync::MutexGuard<'_, u32>` which is not `Send` LL | baz().await; | ^^^^^ await occurs here, with `g` maybe used later note: required by a bound in `is_send` diff --git a/tests/ui/async-await/issue-71137.stderr b/tests/ui/async-await/issue-71137.stderr index 8739c22a310..d567e3f2063 100644 --- a/tests/ui/async-await/issue-71137.stderr +++ b/tests/ui/async-await/issue-71137.stderr @@ -4,12 +4,12 @@ error: future cannot be sent between threads safely LL | fake_spawn(wrong_mutex()); | ^^^^^^^^^^^^^ future returned by `wrong_mutex` is not `Send` | - = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, i32>` + = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `std::sync::MutexGuard<'_, i32>` note: future is not `Send` as this value is used across an await --> $DIR/issue-71137.rs:14:26 | LL | let mut guard = m.lock().unwrap(); - | --------- has type `MutexGuard<'_, i32>` which is not `Send` + | --------- has type `std::sync::MutexGuard<'_, i32>` which is not `Send` LL | (async { "right"; }).await; | ^^^^^ await occurs here, with `mut guard` maybe used later note: required by a bound in `fake_spawn` diff --git a/tests/ui/async-await/issues/issue-67893.rs b/tests/ui/async-await/issues/issue-67893.rs index 73cce38c94a..2020abe7a5a 100644 --- a/tests/ui/async-await/issues/issue-67893.rs +++ b/tests/ui/async-await/issues/issue-67893.rs @@ -7,5 +7,5 @@ fn g(_: impl Send) {} fn main() { g(issue_67893::run()) - //~^ ERROR `MutexGuard<'_, ()>` cannot be sent between threads safely + //~^ ERROR `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely } diff --git a/tests/ui/async-await/issues/issue-67893.stderr b/tests/ui/async-await/issues/issue-67893.stderr index c01237255b8..34f28dd53c7 100644 --- a/tests/ui/async-await/issues/issue-67893.stderr +++ b/tests/ui/async-await/issues/issue-67893.stderr @@ -1,8 +1,8 @@ -error[E0277]: `MutexGuard<'_, ()>` cannot be sent between threads safely +error[E0277]: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely --> $DIR/issue-67893.rs:9:7 | LL | g(issue_67893::run()) - | - ^^^^^^^^^^^^^^^^^^ `MutexGuard<'_, ()>` cannot be sent between threads safely + | - ^^^^^^^^^^^^^^^^^^ `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely | | | required by a bound introduced by this call | @@ -11,7 +11,7 @@ LL | g(issue_67893::run()) LL | pub async fn run() { | ------------------ within this `impl Future<Output = ()>` | - = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` + = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `std::sync::MutexGuard<'_, ()>` note: required because it's used within this `async` fn body --> $DIR/auxiliary/issue_67893.rs:9:20 | diff --git a/tests/ui/attributes/invalid-macro-use.rs b/tests/ui/attributes/invalid-macro-use.rs new file mode 100644 index 00000000000..cfb13fd183c --- /dev/null +++ b/tests/ui/attributes/invalid-macro-use.rs @@ -0,0 +1,53 @@ +#![deny(unused_attributes)] +//~^ NOTE the lint level is defined here + +#[macro_use = 5] +//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` +extern crate std as s1; + +#[macro_use(5)] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE expected a valid identifier here +extern crate std as s2; + +#[macro_use(a = "b")] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE didn't expect any arguments here +extern crate std as s3; + +#[macro_use(a(b))] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE didn't expect any arguments here +extern crate std as s4; + +#[macro_use(a::b)] +//~^ ERROR malformed `macro_use` attribute input +//~| NOTE expected a valid identifier here +extern crate std as s5; + +#[macro_use(a)] +//~^ ERROR unused attribute +#[macro_use] +//~^ NOTE attribute also specified here +extern crate std as s6; + +#[macro_use] +//~^ NOTE attribute also specified here +#[macro_use(a)] +//~^ ERROR unused attribute +extern crate std as s7; + +#[macro_use] +//~^ NOTE attribute also specified here +#[macro_use] +//~^ ERROR unused attribute +extern crate std as s8; + +// This is fine, both are importing different names +#[macro_use(a)] +//~^ ERROR imported macro not found +#[macro_use(b)] +//~^ ERROR imported macro not found +extern crate std as s9; + +fn main() {} diff --git a/tests/ui/attributes/invalid-macro-use.stderr b/tests/ui/attributes/invalid-macro-use.stderr new file mode 100644 index 00000000000..4f5db5c558a --- /dev/null +++ b/tests/ui/attributes/invalid-macro-use.stderr @@ -0,0 +1,131 @@ +error[E0469]: imported macro not found + --> $DIR/invalid-macro-use.rs:47:13 + | +LL | #[macro_use(a)] + | ^ + +error[E0469]: imported macro not found + --> $DIR/invalid-macro-use.rs:49:13 + | +LL | #[macro_use(b)] + | ^ + +error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` + --> $DIR/invalid-macro-use.rs:4:1 + | +LL | #[macro_use = 5] + | ^^^^^^^^^^^^^^^^ + +error[E0539]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:8:1 + | +LL | #[macro_use(5)] + | ^^^^^^^^^^^^-^^ + | | + | expected a valid identifier here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(5)] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(5)] +LL + #[macro_use] + | + +error[E0565]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:13:1 + | +LL | #[macro_use(a = "b")] + | ^^^^^^^^^^^^^^-----^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(a = "b")] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(a = "b")] +LL + #[macro_use] + | + +error[E0565]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:18:1 + | +LL | #[macro_use(a(b))] + | ^^^^^^^^^^^^^---^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(a(b))] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(a(b))] +LL + #[macro_use] + | + +error[E0539]: malformed `macro_use` attribute input + --> $DIR/invalid-macro-use.rs:23:1 + | +LL | #[macro_use(a::b)] + | ^^^^^^^^^^^^----^^ + | | + | expected a valid identifier here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(a::b)] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(a::b)] +LL + #[macro_use] + | + +error: unused attribute + --> $DIR/invalid-macro-use.rs:28:1 + | +LL | #[macro_use(a)] + | ^^^^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/invalid-macro-use.rs:30:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ +note: the lint level is defined here + --> $DIR/invalid-macro-use.rs:1:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/invalid-macro-use.rs:36:1 + | +LL | #[macro_use(a)] + | ^^^^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/invalid-macro-use.rs:34:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/invalid-macro-use.rs:42:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/invalid-macro-use.rs:40:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error: aborting due to 10 previous errors + +Some errors have detailed explanations: E0469, E0539, E0565. +For more information about an error, try `rustc --explain E0469`. diff --git a/tests/ui/attributes/malformed-attrs.rs b/tests/ui/attributes/malformed-attrs.rs index d4c6ecaa189..2a8b7b41e58 100644 --- a/tests/ui/attributes/malformed-attrs.rs +++ b/tests/ui/attributes/malformed-attrs.rs @@ -208,7 +208,7 @@ static mut TLS: u8 = 42; #[no_link()] //~^ ERROR malformed #[macro_use = 1] -//~^ ERROR malformed +//~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` extern crate wloop; //~^ ERROR can't find crate for `wloop` [E0463] diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index de53af851a3..814a1e5f691 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -43,12 +43,6 @@ error: malformed `no_sanitize` attribute input LL | #[no_sanitize] | ^^^^^^^^^^^^^^ help: must be of the form: `#[no_sanitize(address, kcfi, memory, thread)]` -error: malformed `proc_macro` attribute input - --> $DIR/malformed-attrs.rs:100:1 - | -LL | #[proc_macro = 18] - | ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]` - error: malformed `instruction_set` attribute input --> $DIR/malformed-attrs.rs:107:1 | @@ -67,18 +61,6 @@ error: malformed `coroutine` attribute input LL | #[coroutine = 63] || {} | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[coroutine]` -error: malformed `proc_macro_attribute` attribute input - --> $DIR/malformed-attrs.rs:117:1 - | -LL | #[proc_macro_attribute = 19] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]` - -error: malformed `proc_macro_derive` attribute input - --> $DIR/malformed-attrs.rs:124:1 - | -LL | #[proc_macro_derive] - | ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` - error: malformed `must_not_suspend` attribute input --> $DIR/malformed-attrs.rs:133:1 | @@ -154,21 +136,6 @@ error: malformed `no_link` attribute input LL | #[no_link()] | ^^^^^^^^^^^^ help: must be of the form: `#[no_link]` -error: malformed `macro_use` attribute input - --> $DIR/malformed-attrs.rs:210:1 - | -LL | #[macro_use = 1] - | ^^^^^^^^^^^^^^^^ - | -help: the following are the possible correct uses - | -LL - #[macro_use = 1] -LL + #[macro_use(name1, name2, ...)] - | -LL - #[macro_use = 1] -LL + #[macro_use] - | - error: malformed `macro_export` attribute input --> $DIR/malformed-attrs.rs:215:1 | @@ -469,6 +436,24 @@ LL | #[no_implicit_prelude = 23] | | didn't expect any arguments here | help: must be of the form: `#[no_implicit_prelude]` +error[E0565]: malformed `proc_macro` attribute input + --> $DIR/malformed-attrs.rs:100:1 + | +LL | #[proc_macro = 18] + | ^^^^^^^^^^^^^----^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro]` + +error[E0565]: malformed `proc_macro_attribute` attribute input + --> $DIR/malformed-attrs.rs:117:1 + | +LL | #[proc_macro_attribute = 19] + | ^^^^^^^^^^^^^^^^^^^^^^^----^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_attribute]` + error[E0539]: malformed `must_use` attribute input --> $DIR/malformed-attrs.rs:120:1 | @@ -486,6 +471,15 @@ LL - #[must_use = 1] LL + #[must_use] | +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/malformed-attrs.rs:124:1 + | +LL | #[proc_macro_derive] + | ^^^^^^^^^^^^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` + error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input --> $DIR/malformed-attrs.rs:129:1 | @@ -567,6 +561,12 @@ LL | #[non_exhaustive = 1] | | didn't expect any arguments here | help: must be of the form: `#[non_exhaustive]` +error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` + --> $DIR/malformed-attrs.rs:210:1 + | +LL | #[macro_use = 1] + | ^^^^^^^^^^^^^^^^ + error[E0565]: malformed `type_const` attribute input --> $DIR/malformed-attrs.rs:144:5 | diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs index 2f17d9620b4..bd136e64d3f 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs @@ -12,6 +12,7 @@ pub fn b() {} #[proc_macro_derive(unsafe(Foo))] //~^ ERROR attribute is only usable with crates of the `proc-macro` crate type //~| ERROR: expected identifier, found keyword `unsafe` +//~| ERROR malformed `proc_macro_derive` attribute input pub fn c() {} #[unsafe(proc_macro_attribute)] diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr index 25b83a26e17..884e7663c85 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr @@ -1,11 +1,11 @@ error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:26:16 + --> $DIR/proc-unsafe-attributes.rs:27:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:26:16 + --> $DIR/proc-unsafe-attributes.rs:27:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument @@ -40,7 +40,7 @@ LL | #[proc_macro_derive(r#unsafe(Foo))] | ++ error: `proc_macro_attribute` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:17:3 + --> $DIR/proc-unsafe-attributes.rs:18:3 | LL | #[unsafe(proc_macro_attribute)] | ^^^^^^ this is not an unsafe attribute @@ -48,7 +48,7 @@ LL | #[unsafe(proc_macro_attribute)] = note: extraneous unsafe is not allowed in attributes error: `allow` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:22:3 + --> $DIR/proc-unsafe-attributes.rs:23:3 | LL | #[unsafe(allow(dead_code))] | ^^^^^^ this is not an unsafe attribute @@ -56,7 +56,7 @@ LL | #[unsafe(allow(dead_code))] = note: extraneous unsafe is not allowed in attributes error: `allow` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:26:3 + --> $DIR/proc-unsafe-attributes.rs:27:3 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^ this is not an unsafe attribute @@ -64,7 +64,7 @@ LL | #[unsafe(allow(unsafe(dead_code)))] = note: extraneous unsafe is not allowed in attributes error: expected identifier, found keyword `unsafe` - --> $DIR/proc-unsafe-attributes.rs:26:16 + --> $DIR/proc-unsafe-attributes.rs:27:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^ expected identifier, found keyword @@ -93,13 +93,13 @@ LL | #[proc_macro_derive(unsafe(Foo))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/proc-unsafe-attributes.rs:17:1 + --> $DIR/proc-unsafe-attributes.rs:18:1 | LL | #[unsafe(proc_macro_attribute)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:26:16 + --> $DIR/proc-unsafe-attributes.rs:27:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument @@ -107,15 +107,24 @@ LL | #[unsafe(allow(unsafe(dead_code)))] = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:26:16 + --> $DIR/proc-unsafe-attributes.rs:27:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +error[E0565]: malformed `proc_macro_derive` attribute input + --> $DIR/proc-unsafe-attributes.rs:12:1 + | +LL | #[proc_macro_derive(unsafe(Foo))] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^-----^^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` + error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:26:16 + --> $DIR/proc-unsafe-attributes.rs:27:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument @@ -123,13 +132,14 @@ LL | #[unsafe(allow(unsafe(dead_code)))] = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:26:16 + --> $DIR/proc-unsafe-attributes.rs:27:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 17 previous errors +error: aborting due to 18 previous errors -For more information about this error, try `rustc --explain E0452`. +Some errors have detailed explanations: E0452, E0565. +For more information about an error, try `rustc --explain E0452`. diff --git a/tests/ui/backtrace/dylib-dep.rs b/tests/ui/backtrace/dylib-dep.rs index a41931ad548..05fdb9afef8 100644 --- a/tests/ui/backtrace/dylib-dep.rs +++ b/tests/ui/backtrace/dylib-dep.rs @@ -8,6 +8,7 @@ //@ ignore-fuchsia Backtraces not symbolized //@ ignore-musl musl doesn't support dynamic libraries (at least when the original test was written). //@ needs-unwind +//@ ignore-backends: gcc //@ compile-flags: -g -Copt-level=0 -Cstrip=none -Cforce-frame-pointers=yes //@ ignore-emscripten Requires custom symbolization code //@ aux-crate: dylib_dep_helper=dylib-dep-helper.rs diff --git a/tests/ui/backtrace/std-backtrace.rs b/tests/ui/backtrace/std-backtrace.rs index 7ccbd46152b..b81bdee44e4 100644 --- a/tests/ui/backtrace/std-backtrace.rs +++ b/tests/ui/backtrace/std-backtrace.rs @@ -13,9 +13,9 @@ use std::str; fn main() { let args: Vec<String> = env::args().collect(); if args.len() >= 2 && args[1] == "force" { - println!("stack backtrace:\n{}", std::backtrace::Backtrace::force_capture()); + println!("{}", std::backtrace::Backtrace::force_capture()); } else if args.len() >= 2 { - println!("stack backtrace:\n{}", std::backtrace::Backtrace::capture()); + println!("{}", std::backtrace::Backtrace::capture()); } else { runtest(&args[0]); println!("test ok"); @@ -28,7 +28,6 @@ fn runtest(me: &str) { let p = Command::new(me).arg("a").env("RUST_BACKTRACE", "1").output().unwrap(); assert!(p.status.success()); - assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n")); assert!(String::from_utf8_lossy(&p.stdout).contains("backtrace::main")); let p = Command::new(me).arg("a").env("RUST_BACKTRACE", "0").output().unwrap(); @@ -46,7 +45,6 @@ fn runtest(me: &str) { .output() .unwrap(); assert!(p.status.success()); - assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n")); let p = Command::new(me) .arg("a") @@ -64,9 +62,7 @@ fn runtest(me: &str) { .output() .unwrap(); assert!(p.status.success()); - assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n")); let p = Command::new(me).arg("force").output().unwrap(); assert!(p.status.success()); - assert!(String::from_utf8_lossy(&p.stdout).contains("stack backtrace:\n")); } diff --git a/tests/ui/borrowck/borrowck-in-static.stderr b/tests/ui/borrowck/borrowck-in-static.stderr index 745b02ae21b..9bcf64dd62e 100644 --- a/tests/ui/borrowck/borrowck-in-static.stderr +++ b/tests/ui/borrowck/borrowck-in-static.stderr @@ -2,9 +2,11 @@ error[E0507]: cannot move out of `x`, a captured variable in an `Fn` closure --> $DIR/borrowck-in-static.rs:5:17 | LL | let x = Box::new(0); - | - captured outer variable + | - ----------- move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | Box::new(|| x) - | -- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | -- ^ `x` is moved here | | | captured by this `Fn` closure | diff --git a/tests/ui/borrowck/borrowck-move-by-capture.stderr b/tests/ui/borrowck/borrowck-move-by-capture.stderr index 58d5e90e990..732af1593d6 100644 --- a/tests/ui/borrowck/borrowck-move-by-capture.stderr +++ b/tests/ui/borrowck/borrowck-move-by-capture.stderr @@ -2,14 +2,14 @@ error[E0507]: cannot move out of `bar`, a captured variable in an `FnMut` closur --> $DIR/borrowck-move-by-capture.rs:9:29 | LL | let bar: Box<_> = Box::new(3); - | --- captured outer variable + | --- ------ move occurs because `bar` has type `Box<isize>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | let _g = to_fn_mut(|| { | -- captured by this `FnMut` closure LL | let _h = to_fn_once(move || -> isize { *bar }); - | ^^^^^^^^^^^^^^^^ ---- - | | | - | | variable moved due to use in closure - | | move occurs because `bar` has type `Box<isize>`, which does not implement the `Copy` trait + | ^^^^^^^^^^^^^^^^ ---- variable moved due to use in closure + | | | `bar` is moved here | help: consider cloning the value before moving it into the closure diff --git a/tests/ui/borrowck/borrowck-partial-reinit-1.stderr b/tests/ui/borrowck/borrowck-partial-reinit-1.stderr index 65f2bd6cfbd..d261f3ac572 100644 --- a/tests/ui/borrowck/borrowck-partial-reinit-1.stderr +++ b/tests/ui/borrowck/borrowck-partial-reinit-1.stderr @@ -8,6 +8,15 @@ LL | drop(t); | - value moved here LL | t.b = Some(u); | ^^^ value assigned here after move + | +note: if `Test2` implemented `Clone`, you could clone the value + --> $DIR/borrowck-partial-reinit-1.rs:3:1 + | +LL | struct Test2 { + | ^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(t); + | - you could clone this value error[E0382]: assign of moved value: `t` --> $DIR/borrowck-partial-reinit-1.rs:33:5 @@ -19,6 +28,15 @@ LL | drop(t); | - value moved here LL | t.0 = Some(u); | ^^^ value assigned here after move + | +note: if `Test3` implemented `Clone`, you could clone the value + --> $DIR/borrowck-partial-reinit-1.rs:7:1 + | +LL | struct Test3(Option<Test>); + | ^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(t); + | - you could clone this value error: aborting due to 2 previous errors diff --git a/tests/ui/borrowck/borrowck-partial-reinit-2.stderr b/tests/ui/borrowck/borrowck-partial-reinit-2.stderr index e25ca082b7b..dde70eb444e 100644 --- a/tests/ui/borrowck/borrowck-partial-reinit-2.stderr +++ b/tests/ui/borrowck/borrowck-partial-reinit-2.stderr @@ -7,6 +7,15 @@ LL | let mut u = Test { a: 2, b: Some(Box::new(t))}; | - value moved here LL | t.b = Some(Box::new(u)); | ^^^ value assigned here after move + | +note: if `Test` implemented `Clone`, you could clone the value + --> $DIR/borrowck-partial-reinit-2.rs:1:1 + | +LL | struct Test { + | ^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let mut u = Test { a: 2, b: Some(Box::new(t))}; + | - you could clone this value error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/borrowck-union-move-assign.stderr b/tests/ui/borrowck/borrowck-union-move-assign.stderr index 8c0239a3ae9..8721481dc1d 100644 --- a/tests/ui/borrowck/borrowck-union-move-assign.stderr +++ b/tests/ui/borrowck/borrowck-union-move-assign.stderr @@ -7,6 +7,15 @@ LL | let a = u.a; | --- value moved here LL | let a = u.a; | ^^^ value used here after move + | +note: if `U` implemented `Clone`, you could clone the value + --> $DIR/borrowck-union-move-assign.rs:7:1 + | +LL | union U { + | ^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.a; + | --- you could clone this value error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/borrowck-union-move.stderr b/tests/ui/borrowck/borrowck-union-move.stderr index 731607fbdd1..0bae7ac5227 100644 --- a/tests/ui/borrowck/borrowck-union-move.stderr +++ b/tests/ui/borrowck/borrowck-union-move.stderr @@ -7,6 +7,15 @@ LL | let a = u.n1; | ---- value moved here LL | let a = u.n1; | ^^^^ value used here after move + | +note: if `Unn` implemented `Clone`, you could clone the value + --> $DIR/borrowck-union-move.rs:7:1 + | +LL | union Unn { + | ^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.n1; + | ---- you could clone this value error[E0382]: use of moved value: `u` --> $DIR/borrowck-union-move.rs:31:21 @@ -17,6 +26,15 @@ LL | let a = u.n1; | ---- value moved here LL | let a = u; | ^ value used here after move + | +note: if `Unn` implemented `Clone`, you could clone the value + --> $DIR/borrowck-union-move.rs:7:1 + | +LL | union Unn { + | ^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.n1; + | ---- you could clone this value error[E0382]: use of moved value: `u` --> $DIR/borrowck-union-move.rs:36:21 @@ -27,6 +45,15 @@ LL | let a = u.n1; | ---- value moved here LL | let a = u.n2; | ^^^^ value used here after move + | +note: if `Unn` implemented `Clone`, you could clone the value + --> $DIR/borrowck-union-move.rs:7:1 + | +LL | union Unn { + | ^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.n1; + | ---- you could clone this value error[E0382]: use of moved value: `u` --> $DIR/borrowck-union-move.rs:63:21 @@ -37,6 +64,15 @@ LL | let a = u.n; | --- value moved here LL | let a = u.n; | ^^^ value used here after move + | +note: if `Ucn` implemented `Clone`, you could clone the value + --> $DIR/borrowck-union-move.rs:15:1 + | +LL | union Ucn { + | ^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.n; + | --- you could clone this value error[E0382]: use of moved value: `u` --> $DIR/borrowck-union-move.rs:68:21 @@ -47,6 +83,15 @@ LL | let a = u.n; | --- value moved here LL | let a = u.c; | ^^^ value used here after move + | +note: if `Ucn` implemented `Clone`, you could clone the value + --> $DIR/borrowck-union-move.rs:15:1 + | +LL | union Ucn { + | ^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.n; + | --- you could clone this value error[E0382]: use of moved value: `u` --> $DIR/borrowck-union-move.rs:83:21 @@ -57,6 +102,15 @@ LL | let a = u.n; | --- value moved here LL | let a = u; | ^ value used here after move + | +note: if `Ucn` implemented `Clone`, you could clone the value + --> $DIR/borrowck-union-move.rs:15:1 + | +LL | union Ucn { + | ^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.n; + | --- you could clone this value error: aborting due to 6 previous errors diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr index 4e19fd81735..c55923097fc 100644 --- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr +++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr @@ -4,7 +4,7 @@ warning: creating a mutable reference to mutable static LL | let sfoo: *mut Foo = &mut SFOO; | ^^^^^^^^^ mutable reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw mut` instead to create a raw pointer diff --git a/tests/ui/issues/issue-11192.rs b/tests/ui/borrowck/closure-borrow-conflict-11192.rs index 1a3d8c9fe58..dff70d62d6f 100644 --- a/tests/ui/issues/issue-11192.rs +++ b/tests/ui/borrowck/closure-borrow-conflict-11192.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/11192 + struct Foo { x: isize } diff --git a/tests/ui/issues/issue-11192.stderr b/tests/ui/borrowck/closure-borrow-conflict-11192.stderr index a8a18c49549..f1df635276b 100644 --- a/tests/ui/issues/issue-11192.stderr +++ b/tests/ui/borrowck/closure-borrow-conflict-11192.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as mutable - --> $DIR/issue-11192.rs:20:10 + --> $DIR/closure-borrow-conflict-11192.rs:22:10 | LL | let mut test = |foo: &Foo| { | ----------- mutable borrow occurs here diff --git a/tests/ui/borrowck/issue-103624.stderr b/tests/ui/borrowck/issue-103624.stderr index 603055beadc..af65deb16dc 100644 --- a/tests/ui/borrowck/issue-103624.stderr +++ b/tests/ui/borrowck/issue-103624.stderr @@ -2,13 +2,16 @@ error[E0507]: cannot move out of `self.b`, as `self` is a captured variable in a --> $DIR/issue-103624.rs:16:13 | LL | async fn foo(&self) { - | ----- captured outer variable + | ----- + | | + | captured outer variable + | move occurs because `self.b` has type `StructB`, which does not implement the `Copy` trait LL | let bar = self.b.bar().await; LL | spawn_blocking(move || { | ------- captured by this `Fn` closure LL | LL | self.b; - | ^^^^^^ move occurs because `self.b` has type `StructB`, which does not implement the `Copy` trait + | ^^^^^^ `self.b` is moved here | note: if `StructB` implemented `Clone`, you could clone the value --> $DIR/issue-103624.rs:23:1 diff --git a/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.stderr b/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.stderr index b188766e221..167fd6b227f 100644 --- a/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.stderr +++ b/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.stderr @@ -17,6 +17,15 @@ LL | drop(u); | - value moved here LL | u.0 = S(1); | ^^^^^^^^^^ value partially assigned here after move + | +note: if `Tpair` implemented `Clone`, you could clone the value + --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:6:1 + | +LL | struct Tpair(S, i32); + | ^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(u); + | - you could clone this value error[E0382]: assign to part of moved value: `v` --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:31:9 @@ -27,6 +36,15 @@ LL | drop(v); | - value moved here LL | v.x = S(1); | ^^^^^^^^^^ value partially assigned here after move + | +note: if `Spair` implemented `Clone`, you could clone the value + --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:7:1 + | +LL | struct Spair { x: S, y: i32 } + | ^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(v); + | - you could clone this value error: aborting due to 3 previous errors diff --git a/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out.stderr b/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out.stderr index 774b6cf0ea6..78c5040e52a 100644 --- a/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out.stderr +++ b/tests/ui/borrowck/issue-54499-field-mutation-of-moved-out.stderr @@ -50,6 +50,15 @@ LL | drop(u); | - value moved here LL | u.0 = S(1); | ^^^^^^^^^^ value partially assigned here after move + | +note: if `Tpair` implemented `Clone`, you could clone the value + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:6:1 + | +LL | struct Tpair(S, i32); + | ^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(u); + | - you could clone this value error[E0594]: cannot assign to `u.1`, as `u` is not declared as mutable --> $DIR/issue-54499-field-mutation-of-moved-out.rs:27:9 @@ -82,6 +91,15 @@ LL | drop(v); | - value moved here LL | v.x = S(1); | ^^^^^^^^^^ value partially assigned here after move + | +note: if `Spair` implemented `Clone`, you could clone the value + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:7:1 + | +LL | struct Spair { x: S, y: i32 } + | ^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(v); + | - you could clone this value error[E0594]: cannot assign to `v.y`, as `v` is not declared as mutable --> $DIR/issue-54499-field-mutation-of-moved-out.rs:38:9 diff --git a/tests/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr b/tests/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr index 121c2e870e7..5a0d353a481 100644 --- a/tests/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr +++ b/tests/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr @@ -4,6 +4,14 @@ error[E0507]: cannot move out of `*array` which is behind a shared reference LL | *array | ^^^^^^ move occurs because `*array` has type `Vec<Value>`, which does not implement the `Copy` trait | +note: if `Value` implemented `Clone`, you could clone the value + --> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:4:1 + | +LL | struct Value; + | ^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | *array + | ------ you could clone this value help: consider removing the dereference here | LL - *array diff --git a/tests/ui/borrowck/liberated-region-from-outer-closure.rs b/tests/ui/borrowck/liberated-region-from-outer-closure.rs new file mode 100644 index 00000000000..dcc6370b4a1 --- /dev/null +++ b/tests/ui/borrowck/liberated-region-from-outer-closure.rs @@ -0,0 +1,12 @@ +// Regression test for <https://github.com/rust-lang/rust/issues/144608>. + +fn example<T: Copy>(x: T) -> impl FnMut(&mut ()) { + move |_: &mut ()| { + move || needs_static_lifetime(x); + //~^ ERROR the parameter type `T` may not live long enough + } +} + +fn needs_static_lifetime<T: 'static>(obj: T) {} + +fn main() {} diff --git a/tests/ui/borrowck/liberated-region-from-outer-closure.stderr b/tests/ui/borrowck/liberated-region-from-outer-closure.stderr new file mode 100644 index 00000000000..98b45ac499d --- /dev/null +++ b/tests/ui/borrowck/liberated-region-from-outer-closure.stderr @@ -0,0 +1,17 @@ +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/liberated-region-from-outer-closure.rs:5:17 + | +LL | move || needs_static_lifetime(x); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | the parameter type `T` must be valid for the static lifetime... + | ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound + | +LL | fn example<T: Copy + 'static>(x: T) -> impl FnMut(&mut ()) { + | +++++++++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0310`. diff --git a/tests/ui/c-variadic/same-program-multiple-abis.rs b/tests/ui/c-variadic/same-program-multiple-abis.rs new file mode 100644 index 00000000000..b21accb999e --- /dev/null +++ b/tests/ui/c-variadic/same-program-multiple-abis.rs @@ -0,0 +1,112 @@ +#![feature(extended_varargs_abi_support)] +//@ run-pass +//@ only-x86_64 + +// Check that multiple c-variadic calling conventions can be used in the same program. +// +// Clang and gcc reject defining functions with a non-default calling convention and a variable +// argument list, so C programs that use multiple c-variadic calling conventions are unlikely +// to come up. Here we validate that our codegen backends do in fact generate correct code. + +extern "sysv64" { + fn variadic_sysv64(_: u32, _: ...) -> u32; +} + +extern "win64" { + fn variadic_win64(_: u32, _: ...) -> u32; +} + +fn main() { + unsafe { + assert_eq!(variadic_win64(1, 2, 3), 1 + 2 + 3); + assert_eq!(variadic_sysv64(1, 2, 3), 1 + 2 + 3); + } +} + +// This assembly was generated using https://godbolt.org/z/dbTGanoh6, and corresponds to the +// following code compiled for the `x86_64-unknown-linux-gnu` and `x86_64-pc-windows-gnu` +// targets, respectively: +// +// ```rust +// #![feature(c_variadic)] +// +// #[unsafe(no_mangle)] +// unsafe extern "C" fn variadic(a: u32, mut args: ...) -> u32 { +// let b = args.arg::<u32>(); +// let c = args.arg::<u32>(); +// +// a + b + c +// } +// ``` +core::arch::global_asm!( + r#" +{variadic_sysv64}: + sub rsp, 88 + test al, al + je .LBB0_7 + movaps xmmword ptr [rsp - 48], xmm0 + movaps xmmword ptr [rsp - 32], xmm1 + movaps xmmword ptr [rsp - 16], xmm2 + movaps xmmword ptr [rsp], xmm3 + movaps xmmword ptr [rsp + 16], xmm4 + movaps xmmword ptr [rsp + 32], xmm5 + movaps xmmword ptr [rsp + 48], xmm6 + movaps xmmword ptr [rsp + 64], xmm7 +.LBB0_7: + mov qword ptr [rsp - 88], rsi + mov qword ptr [rsp - 80], rdx + mov qword ptr [rsp - 72], rcx + mov qword ptr [rsp - 64], r8 + mov qword ptr [rsp - 56], r9 + movabs rax, 206158430216 + mov qword ptr [rsp - 120], rax + lea rax, [rsp + 96] + mov qword ptr [rsp - 112], rax + lea rax, [rsp - 96] + mov qword ptr [rsp - 104], rax + mov edx, 8 + cmp rdx, 41 + jae .LBB0_1 + mov rax, qword ptr [rsp - 104] + mov ecx, 8 + add rcx, 8 + mov dword ptr [rsp - 120], ecx + mov eax, dword ptr [rax + rdx] + cmp edx, 32 + ja .LBB0_2 + add rcx, qword ptr [rsp - 104] + add edx, 16 + mov dword ptr [rsp - 120], edx + add eax, edi + add eax, dword ptr [rcx] + add rsp, 88 + ret +.LBB0_1: + mov rax, qword ptr [rsp - 112] + lea rcx, [rax + 8] + mov qword ptr [rsp - 112], rcx + mov eax, dword ptr [rax] +.LBB0_2: + mov rcx, qword ptr [rsp - 112] + lea rdx, [rcx + 8] + mov qword ptr [rsp - 112], rdx + add eax, edi + add eax, dword ptr [rcx] + add rsp, 88 + ret + +{variadic_win64}: + push rax + mov qword ptr [rsp + 40], r9 + mov qword ptr [rsp + 24], rdx + mov qword ptr [rsp + 32], r8 + lea rax, [rsp + 40] + mov qword ptr [rsp], rax + lea eax, [rdx + rcx] + add eax, r8d + pop rcx + ret + "#, + variadic_win64 = sym variadic_win64, + variadic_sysv64 = sym variadic_sysv64, +); diff --git a/tests/ui/c-variadic/variadic-ffi-1.rs b/tests/ui/c-variadic/variadic-ffi-1.rs index cd8f2a951ef..2baa00a079a 100644 --- a/tests/ui/c-variadic/variadic-ffi-1.rs +++ b/tests/ui/c-variadic/variadic-ffi-1.rs @@ -12,6 +12,11 @@ extern "stdcall" { //~^ ERROR: C-variadic functions with the "stdcall" calling convention are not supported } +fn baz(f: extern "Rust" fn(usize, ...)) { + //~^ ERROR: C-variadic functions with the "Rust" calling convention are not supported + f(22, 44); +} + extern "C" { fn foo(f: isize, x: u8, ...); } diff --git a/tests/ui/c-variadic/variadic-ffi-1.stderr b/tests/ui/c-variadic/variadic-ffi-1.stderr index a49fc0ce126..981b021276d 100644 --- a/tests/ui/c-variadic/variadic-ffi-1.stderr +++ b/tests/ui/c-variadic/variadic-ffi-1.stderr @@ -4,14 +4,20 @@ error[E0045]: C-variadic functions with the "stdcall" calling convention are not LL | fn printf(_: *const u8, ...); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention +error[E0045]: C-variadic functions with the "Rust" calling convention are not supported + --> $DIR/variadic-ffi-1.rs:15:11 + | +LL | fn baz(f: extern "Rust" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention + error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied - --> $DIR/variadic-ffi-1.rs:23:9 + --> $DIR/variadic-ffi-1.rs:28:9 | LL | foo(); | ^^^-- two arguments of type `isize` and `u8` are missing | note: function defined here - --> $DIR/variadic-ffi-1.rs:16:8 + --> $DIR/variadic-ffi-1.rs:21:8 | LL | fn foo(f: isize, x: u8, ...); | ^^^ - - @@ -21,13 +27,13 @@ LL | foo(/* isize */, /* u8 */); | +++++++++++++++++++++ error[E0060]: this function takes at least 2 arguments but 1 argument was supplied - --> $DIR/variadic-ffi-1.rs:24:9 + --> $DIR/variadic-ffi-1.rs:29:9 | LL | foo(1); | ^^^--- argument #2 of type `u8` is missing | note: function defined here - --> $DIR/variadic-ffi-1.rs:16:8 + --> $DIR/variadic-ffi-1.rs:21:8 | LL | fn foo(f: isize, x: u8, ...); | ^^^ - @@ -37,7 +43,7 @@ LL | foo(1, /* u8 */); | ++++++++++ error[E0308]: mismatched types - --> $DIR/variadic-ffi-1.rs:26:56 + --> $DIR/variadic-ffi-1.rs:31:56 | LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; | ------------------------------------- ^^^ expected non-variadic fn, found variadic function @@ -48,7 +54,7 @@ LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; found fn item `unsafe extern "C" fn(_, _, ...) {foo}` error[E0308]: mismatched types - --> $DIR/variadic-ffi-1.rs:27:54 + --> $DIR/variadic-ffi-1.rs:32:54 | LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; | ----------------------------------- ^^^ expected variadic fn, found non-variadic function @@ -59,7 +65,7 @@ LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; found fn item `extern "C" fn(_, _) {bar}` error[E0617]: can't pass `f32` to variadic function - --> $DIR/variadic-ffi-1.rs:29:19 + --> $DIR/variadic-ffi-1.rs:34:19 | LL | foo(1, 2, 3f32); | ^^^^ @@ -70,7 +76,7 @@ LL | foo(1, 2, 3f32 as c_double); | +++++++++++ error[E0617]: can't pass `bool` to variadic function - --> $DIR/variadic-ffi-1.rs:30:19 + --> $DIR/variadic-ffi-1.rs:35:19 | LL | foo(1, 2, true); | ^^^^ @@ -81,7 +87,7 @@ LL | foo(1, 2, true as c_int); | ++++++++ error[E0617]: can't pass `i8` to variadic function - --> $DIR/variadic-ffi-1.rs:31:19 + --> $DIR/variadic-ffi-1.rs:36:19 | LL | foo(1, 2, 1i8); | ^^^ @@ -92,7 +98,7 @@ LL | foo(1, 2, 1i8 as c_int); | ++++++++ error[E0617]: can't pass `u8` to variadic function - --> $DIR/variadic-ffi-1.rs:32:19 + --> $DIR/variadic-ffi-1.rs:37:19 | LL | foo(1, 2, 1u8); | ^^^ @@ -103,7 +109,7 @@ LL | foo(1, 2, 1u8 as c_uint); | +++++++++ error[E0617]: can't pass `i16` to variadic function - --> $DIR/variadic-ffi-1.rs:33:19 + --> $DIR/variadic-ffi-1.rs:38:19 | LL | foo(1, 2, 1i16); | ^^^^ @@ -114,7 +120,7 @@ LL | foo(1, 2, 1i16 as c_int); | ++++++++ error[E0617]: can't pass `u16` to variadic function - --> $DIR/variadic-ffi-1.rs:34:19 + --> $DIR/variadic-ffi-1.rs:39:19 | LL | foo(1, 2, 1u16); | ^^^^ @@ -124,7 +130,7 @@ help: cast the value to `c_uint` LL | foo(1, 2, 1u16 as c_uint); | +++++++++ -error: aborting due to 11 previous errors +error: aborting due to 12 previous errors Some errors have detailed explanations: E0045, E0060, E0308, E0617. For more information about an error, try `rustc --explain E0045`. diff --git a/tests/ui/c-variadic/variadic-ffi-2-arm.rs b/tests/ui/c-variadic/variadic-ffi-2-arm.rs deleted file mode 100644 index 3b0a71007a0..00000000000 --- a/tests/ui/c-variadic/variadic-ffi-2-arm.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ only-arm -//@ build-pass -#![feature(extended_varargs_abi_support)] - -fn aapcs(f: extern "aapcs" fn(usize, ...)) { - f(22, 44); -} - -fn main() {} diff --git a/tests/ui/c-variadic/variadic-ffi-2.rs b/tests/ui/c-variadic/variadic-ffi-2.rs deleted file mode 100644 index adfd9bfa279..00000000000 --- a/tests/ui/c-variadic/variadic-ffi-2.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![feature(extended_varargs_abi_support)] - -fn baz(f: extern "Rust" fn(usize, ...)) { - //~^ ERROR: C-variadic functions with the "Rust" calling convention are not supported - f(22, 44); -} - -#[cfg(target_arch = "x86_64")] -fn sysv(f: extern "sysv64" fn(usize, ...)) { - f(22, 44); -} -#[cfg(target_arch = "x86_64")] -fn win(f: extern "win64" fn(usize, ...)) { - f(22, 44); -} -#[cfg(any( - target_arch = "arm", - target_arch = "aarch64", - target_arch = "riscv32", - target_arch = "riscv64", - target_arch = "x86", - target_arch = "x86_64" -))] -fn efiapi(f: extern "efiapi" fn(usize, ...)) { - f(22, 44); -} - -fn main() {} diff --git a/tests/ui/c-variadic/variadic-ffi-2.stderr b/tests/ui/c-variadic/variadic-ffi-2.stderr deleted file mode 100644 index 2ac0a9f5ea2..00000000000 --- a/tests/ui/c-variadic/variadic-ffi-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0045]: C-variadic functions with the "Rust" calling convention are not supported - --> $DIR/variadic-ffi-2.rs:3:11 - | -LL | fn baz(f: extern "Rust" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0045`. diff --git a/tests/ui/issues/issue-4333.rs b/tests/ui/cast/trait-object-cast-segfault-4333.rs index dccaa6f68bd..24e86d4d930 100644 --- a/tests/ui/issues/issue-4333.rs +++ b/tests/ui/cast/trait-object-cast-segfault-4333.rs @@ -7,3 +7,5 @@ pub fn main() { let stdout = &mut io::stdout() as &mut dyn io::Write; stdout.write(b"Hello!"); } + +// https://github.com/rust-lang/rust/issues/4333 diff --git a/tests/ui/cfg/cfg-panic-abort.rs b/tests/ui/cfg/cfg-panic-abort.rs index 448fde21086..b39888573b3 100644 --- a/tests/ui/cfg/cfg-panic-abort.rs +++ b/tests/ui/cfg/cfg-panic-abort.rs @@ -1,6 +1,7 @@ //@ build-pass //@ compile-flags: -C panic=abort //@ no-prefer-dynamic +//@ ignore-backends: gcc #[cfg(panic = "unwind")] pub fn bad() -> i32 { } diff --git a/tests/ui/issues/issue-11085.rs b/tests/ui/cfg/conditional-compilation-struct-11085.rs index c3f13199b30..cd6dded54d3 100644 --- a/tests/ui/issues/issue-11085.rs +++ b/tests/ui/cfg/conditional-compilation-struct-11085.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/11085 + //@ run-pass #![allow(dead_code)] diff --git a/tests/ui/cfg/conditional-compile-arch.rs b/tests/ui/cfg/conditional-compile-arch.rs index 594d9344561..f1680547407 100644 --- a/tests/ui/cfg/conditional-compile-arch.rs +++ b/tests/ui/cfg/conditional-compile-arch.rs @@ -38,3 +38,6 @@ pub fn main() { } #[cfg(target_arch = "loongarch64")] pub fn main() { } + +#[cfg(target_arch = "arm64ec")] +pub fn main() { } diff --git a/tests/ui/check-cfg/my-awesome-platform.json b/tests/ui/check-cfg/my-awesome-platform.json index 03b08b727bd..4c16d06c7b7 100644 --- a/tests/ui/check-cfg/my-awesome-platform.json +++ b/tests/ui/check-cfg/my-awesome-platform.json @@ -4,7 +4,6 @@ "arch": "x86_64", "target-endian": "little", "target-pointer-width": "64", - "target-c-int-width": "32", "os": "ericos", "linker-flavor": "ld.lld", "linker": "rust-lld", diff --git a/tests/ui/closures/2229_closure_analysis/issue-90465.stderr b/tests/ui/closures/2229_closure_analysis/issue-90465.stderr index ccca24764e4..94bbd79cbb4 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-90465.stderr +++ b/tests/ui/closures/2229_closure_analysis/issue-90465.stderr @@ -10,7 +10,7 @@ LL | let _ = f0; LL | } | - in Rust 2018, `f0` is dropped here along with the closure, but in Rust 2021 `f0` is not part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/issue-90465.rs:3:9 | diff --git a/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2018.stderr b/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2018.stderr index 394629c0001..057960ec014 100644 --- a/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2018.stderr +++ b/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2018.stderr @@ -26,6 +26,15 @@ LL | E::Number(_) if let E::String(s) = *value => { } ... LL | let x = value; | ^^^^^ value used here after move + | +note: if `E` implemented `Clone`, you could clone the value + --> $DIR/if-let-guards-errors.rs:32:1 + | +LL | E::Number(_) if let E::String(s) = *value => { } + | ------ you could clone this value +... +LL | enum E { + | ^^^^^^ consider implementing `Clone` for this type error: aborting due to 2 previous errors diff --git a/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2021.stderr b/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2021.stderr index 5672845019b..4a6e3908827 100644 --- a/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2021.stderr +++ b/tests/ui/closures/2229_closure_analysis/match/if-let-guards-errors.e2021.stderr @@ -26,6 +26,15 @@ LL | E::Number(_) if let E::String(s) = *value => { } ... LL | let x = value; | ^^^^^ value used here after move + | +note: if `E` implemented `Clone`, you could clone the value + --> $DIR/if-let-guards-errors.rs:32:1 + | +LL | E::Number(_) if let E::String(s) = *value => { } + | ------ you could clone this value +... +LL | enum E { + | ^^^^^^ consider implementing `Clone` for this type error: aborting due to 2 previous errors diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr index fdcada468e0..b981ef69b4f 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr @@ -7,7 +7,7 @@ LL | thread::spawn(move || unsafe { LL | *fptr.0 = 20; | ------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0` | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/auto_traits.rs:2:9 | @@ -34,7 +34,7 @@ LL | thread::spawn(move || unsafe { LL | *fptr.0.0 = 20; | --------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0` | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `fptr` to be fully captured | LL ~ thread::spawn(move || { let _ = &fptr; unsafe { @@ -56,7 +56,7 @@ LL | let f_1 = f.1; LL | } | - in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `f` to be fully captured | LL ~ let c = || { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr b/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr index bb17e3a34af..c49b1d2d0e0 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr @@ -15,7 +15,7 @@ LL | | println!("{:?}", x); LL | | }); | |______- in this macro invocation | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/closure-body-macro-fragment.rs:4:9 | diff --git a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr index a0795c12928..3381b9e334b 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr @@ -10,7 +10,7 @@ LL | let _t = t.0; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/insignificant_drop_attr_migrations.rs:3:9 | @@ -34,7 +34,7 @@ LL | let _t = t.1; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t` to be fully captured | LL ~ let c = move || { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr b/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr index 7ea5136d119..7d90b7bf72b 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/macro.stderr @@ -7,7 +7,7 @@ LL | let _ = || dbg!(a.0); LL | } | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/macro.rs:5:9 | diff --git a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr index 94526487e67..7d937f51249 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr @@ -10,7 +10,7 @@ LL | let _t = t.0; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/migrations_rustfix.rs:2:9 | @@ -31,7 +31,7 @@ LL | let c = || t.0; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t` to be fully captured | LL | let c = || { let _ = &t; t.0 }; diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr index 2b76deca377..6a9266ecc54 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr @@ -10,7 +10,7 @@ LL | let result = panic::catch_unwind(move || { LL | f.0() | --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0` | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/mir_calls_to_shims.rs:4:9 | diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr index 138778ff5d7..81ffe866c83 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr @@ -13,7 +13,7 @@ LL | let _f_2 = f2.1; LL | } | - in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/multi_diagnostics.rs:2:9 | @@ -34,7 +34,7 @@ LL | let c = || { LL | let _f_1 = f1.0; | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `f1` to be fully captured | LL ~ let c = || { @@ -56,7 +56,7 @@ LL | LL | let _f_2 = f1.2; | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2` | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `f1` to be fully captured | LL ~ let c = || { @@ -81,7 +81,7 @@ LL | } | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `f1` to be fully captured | LL ~ let c = || { @@ -104,7 +104,7 @@ LL | LL | *fptr2.0 = 20; | -------- in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0` | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `fptr1`, `fptr2` to be fully captured | LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr b/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr index eff26a4d6f5..5fb7675207f 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/precise.stderr @@ -10,7 +10,7 @@ LL | let _t = t.0; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/precise.rs:3:9 | @@ -44,7 +44,7 @@ LL | } | in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure | in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `u` to be fully captured | LL ~ let c = || { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr index 54ad20f8983..3f4d38aefe7 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr @@ -20,7 +20,7 @@ LL | } | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure | in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/significant_drop.rs:2:9 | @@ -50,7 +50,7 @@ LL | } | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t`, `t1` to be fully captured | LL ~ let c = || { @@ -69,7 +69,7 @@ LL | let _t = t.0; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t` to be fully captured | LL ~ let c = || { @@ -88,7 +88,7 @@ LL | let _t = t.0; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t` to be fully captured | LL ~ let c = || { @@ -107,7 +107,7 @@ LL | let _t = t.0; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t` to be fully captured | LL ~ let c = || { @@ -126,7 +126,7 @@ LL | let _t = t.1; LL | } | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t` to be fully captured | LL ~ let c = || { @@ -150,7 +150,7 @@ LL | } | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `t1`, `t` to be fully captured | LL ~ let c = move || { @@ -169,7 +169,7 @@ LL | tuple.0; LL | } | - in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `tuple` to be fully captured | LL ~ let c = || { @@ -188,7 +188,7 @@ LL | tuple.0; LL | }; | - in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `tuple` to be fully captured | LL ~ let c = || { @@ -204,7 +204,7 @@ LL | let _c = || tup.0; LL | } | - in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `tup` to be fully captured | LL | let _c = || { let _ = &tup; tup.0 }; diff --git a/tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs b/tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs index a4646d67c68..40d838b7e8e 100644 --- a/tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs +++ b/tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs @@ -1,4 +1,6 @@ //@ run-pass +//@ ignore-backends: gcc + #![allow(dead_code)] // check that we don't have linear stack usage with multiple calls to `push` diff --git a/tests/ui/issues/issue-36278-prefix-nesting.rs b/tests/ui/codegen/dynamic-size-of-prefix-correctly-36278.rs index 3f2ca7a2460..78c0129faa1 100644 --- a/tests/ui/issues/issue-36278-prefix-nesting.rs +++ b/tests/ui/codegen/dynamic-size-of-prefix-correctly-36278.rs @@ -18,3 +18,5 @@ fn main() { size_of_unsized = mem::size_of_val::<Ack<_>>(&y); assert_eq!(size_of_sized, size_of_unsized); } + +// https://github.com/rust-lang/rust/issues/36278 diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/inline1.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/inline1.rs index d13fd4b63b3..53e29e75781 100644 --- a/tests/ui/codegen/equal-pointers-unequal/as-cast/inline1.rs +++ b/tests/ui/codegen/equal-pointers-unequal/as-cast/inline1.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/inline2.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/inline2.rs index 5ec3c7cbdf5..47639762e7a 100644 --- a/tests/ui/codegen/equal-pointers-unequal/as-cast/inline2.rs +++ b/tests/ui/codegen/equal-pointers-unequal/as-cast/inline2.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs index 97a875f15bc..70cbb9a52f7 100644 --- a/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs +++ b/tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/zero.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/zero.rs index 731c5b67882..694fb34828c 100644 --- a/tests/ui/codegen/equal-pointers-unequal/as-cast/zero.rs +++ b/tests/ui/codegen/equal-pointers-unequal/as-cast/zero.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 diff --git a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline1.rs b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline1.rs index cdf07eade87..ade32663d48 100644 --- a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline1.rs +++ b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline1.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 diff --git a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline2.rs b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline2.rs index 94739708ab8..d8feaeee4fa 100644 --- a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline2.rs +++ b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline2.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 diff --git a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault.rs b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault.rs index b163c282d93..ad1d7b56c8c 100644 --- a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault.rs +++ b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 diff --git a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/zero.rs b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/zero.rs index b7824f53d77..a50369b46cb 100644 --- a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/zero.rs +++ b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/zero.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 diff --git a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline1.rs b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline1.rs index 5f4ee731f7d..0b5b2df9f0e 100644 --- a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline1.rs +++ b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline1.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 diff --git a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline2.rs b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline2.rs index 0f838af1fb1..1812a1163f0 100644 --- a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline2.rs +++ b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline2.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 diff --git a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs index fea41e03612..637f0042ada 100644 --- a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs +++ b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 diff --git a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/zero.rs b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/zero.rs index 20ed991ed3d..5879b3f4f4f 100644 --- a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/zero.rs +++ b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/zero.rs @@ -1,6 +1,7 @@ //@ known-bug: #107975 //@ compile-flags: -Copt-level=2 //@ run-pass +//@ ignore-backends: gcc // Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 diff --git a/tests/ui/codegen/mismatched-data-layout.json b/tests/ui/codegen/mismatched-data-layout.json index 7adc8832524..f8c510c1863 100644 --- a/tests/ui/codegen/mismatched-data-layout.json +++ b/tests/ui/codegen/mismatched-data-layout.json @@ -4,7 +4,6 @@ "arch": "x86_64", "target-endian": "little", "target-pointer-width": "64", - "target-c-int-width": "32", "os": "none", "linker-flavor": "ld.lld", "linker": "rust-lld", diff --git a/tests/ui/codegen/mismatched-data-layouts.rs b/tests/ui/codegen/mismatched-data-layouts.rs index 6428b8c5247..ea1457148a5 100644 --- a/tests/ui/codegen/mismatched-data-layouts.rs +++ b/tests/ui/codegen/mismatched-data-layouts.rs @@ -5,6 +5,7 @@ //@ compile-flags: --crate-type=lib --target={{src-base}}/codegen/mismatched-data-layout.json -Z unstable-options //@ normalize-stderr: "`, `[A-Za-z0-9-:]*`" -> "`, `normalized data layout`" //@ normalize-stderr: "layout, `[A-Za-z0-9-:]*`" -> "layout, `normalized data layout`" +//@ normalize-stderr: "`mismatched-data-layout-\d+`" -> "`mismatched-data-layout-<hash>`" #![feature(lang_items, no_core, auto_traits)] #![no_core] diff --git a/tests/ui/codegen/mismatched-data-layouts.stderr b/tests/ui/codegen/mismatched-data-layouts.stderr index b7d5d82bee0..d1117564d5b 100644 --- a/tests/ui/codegen/mismatched-data-layouts.stderr +++ b/tests/ui/codegen/mismatched-data-layouts.stderr @@ -1,4 +1,4 @@ -error: data-layout for target `mismatched-data-layout-7193370089426056427`, `normalized data layout`, differs from LLVM target's `x86_64-unknown-none-gnu` default layout, `normalized data layout` +error: data-layout for target `mismatched-data-layout-<hash>`, `normalized data layout`, differs from LLVM target's `x86_64-unknown-none-gnu` default layout, `normalized data layout` error: aborting due to 1 previous error diff --git a/tests/ui/codemap_tests/unicode.expanded.stdout b/tests/ui/codemap_tests/unicode.expanded.stdout index c88035de044..af375108b47 100644 --- a/tests/ui/codemap_tests/unicode.expanded.stdout +++ b/tests/ui/codemap_tests/unicode.expanded.stdout @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ revisions: normal expanded //@[expanded] check-pass //@[expanded]compile-flags: -Zunpretty=expanded diff --git a/tests/ui/issues/issue-11205.rs b/tests/ui/coercion/trait-object-arrays-11205.rs index 8530514f0ed..45d69dce323 100644 --- a/tests/ui/issues/issue-11205.rs +++ b/tests/ui/coercion/trait-object-arrays-11205.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/11205 + //@ run-pass #![allow(dead_code)] diff --git a/tests/ui/compiletest-self-test/ui-testing-optout.stderr b/tests/ui/compiletest-self-test/ui-testing-optout.stderr index 652c472c0bc..f1d03eab14a 100644 --- a/tests/ui/compiletest-self-test/ui-testing-optout.stderr +++ b/tests/ui/compiletest-self-test/ui-testing-optout.stderr @@ -16,7 +16,7 @@ error[E0412]: cannot find type `D` in this scope error[E0412]: cannot find type `F` in this scope --> $DIR/ui-testing-optout.rs:92:10 | -4 | type A = B; + 4 | type A = B; | ----------- similarly named type alias `A` defined here ... 92 | type E = F; diff --git a/tests/ui/const-generics/defaults/pretty-printing-ast.stdout b/tests/ui/const-generics/defaults/pretty-printing-ast.stdout index b6cb7fa09c8..030fcec9cf2 100644 --- a/tests/ui/const-generics/defaults/pretty-printing-ast.stdout +++ b/tests/ui/const-generics/defaults/pretty-printing-ast.stdout @@ -6,10 +6,10 @@ //@ edition: 2015 #![crate_type = "lib"] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; trait Foo<const KIND : bool = true> {} diff --git a/tests/ui/issues/issue-39211.rs b/tests/ui/const-generics/generic-parameter-in-const-expression-39211.rs index ab86afc3410..b2566e54471 100644 --- a/tests/ui/issues/issue-39211.rs +++ b/tests/ui/const-generics/generic-parameter-in-const-expression-39211.rs @@ -12,3 +12,5 @@ fn m<M: Mat>() { } fn main() { } + +// https://github.com/rust-lang/rust/issues/39211 diff --git a/tests/ui/issues/issue-39211.stderr b/tests/ui/const-generics/generic-parameter-in-const-expression-39211.stderr index 2124bc667ff..2a80aff834a 100644 --- a/tests/ui/issues/issue-39211.stderr +++ b/tests/ui/const-generics/generic-parameter-in-const-expression-39211.stderr @@ -1,5 +1,5 @@ error: constant expression depends on a generic parameter - --> $DIR/issue-39211.rs:9:17 + --> $DIR/generic-parameter-in-const-expression-39211.rs:9:17 | LL | let a = [3; M::Row::DIM]; | ^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | let a = [3; M::Row::DIM]; = note: this may fail depending on what value the parameter takes error: constant expression depends on a generic parameter - --> $DIR/issue-39211.rs:9:13 + --> $DIR/generic-parameter-in-const-expression-39211.rs:9:13 | LL | let a = [3; M::Row::DIM]; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/const-generics/generic_const_exprs/auxiliary/feature-attribute-missing-in-dependent-crate-ice-aux.rs b/tests/ui/const-generics/generic_const_exprs/auxiliary/feature-attribute-missing-in-dependent-crate-ice-aux.rs new file mode 100644 index 00000000000..3902454c14c --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/auxiliary/feature-attribute-missing-in-dependent-crate-ice-aux.rs @@ -0,0 +1,9 @@ +#![feature(generic_const_exprs)] + +pub struct Error(()); + +pub trait FromSlice: Sized { + const SIZE: usize = std::mem::size_of::<Self>(); + + fn validate_slice(bytes: &[[u8; Self::SIZE]]) -> Result<(), Error>; +} diff --git a/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.rs b/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.rs new file mode 100644 index 00000000000..b9537014767 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.rs @@ -0,0 +1,19 @@ +//! Regression test to ensure that using the `generic_const_exprs` feature in a library crate +//! without enabling it in a dependent crate does not lead to an ICE. +//! +//! Issue: <https://github.com/rust-lang/rust/issues/129882> + +//@ aux-build:feature-attribute-missing-in-dependent-crate-ice-aux.rs + +extern crate feature_attribute_missing_in_dependent_crate_ice_aux as aux; + +struct Wrapper<const F: usize>(i64); + +impl<const F: usize> aux::FromSlice for Wrapper<F> { + fn validate_slice(_: &[[u8; Self::SIZE]]) -> Result<(), aux::Error> { + //~^ ERROR generic `Self` types are currently not permitted in anonymous constants + Ok(()) + } +} + +fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.stderr b/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.stderr new file mode 100644 index 00000000000..5c330665142 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.stderr @@ -0,0 +1,14 @@ +error: generic `Self` types are currently not permitted in anonymous constants + --> $DIR/feature-attribute-missing-in-dependent-crate-ice.rs:13:33 + | +LL | fn validate_slice(_: &[[u8; Self::SIZE]]) -> Result<(), aux::Error> { + | ^^^^ + | +note: not a concrete type + --> $DIR/feature-attribute-missing-in-dependent-crate-ice.rs:12:41 + | +LL | impl<const F: usize> aux::FromSlice for Wrapper<F> { + | ^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr index fa12dd14753..364fecb96ea 100644 --- a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr +++ b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.neg.stderr @@ -10,8 +10,14 @@ note: required by a bound in `ct_unused_0::AliasConstUnused` LL | type AliasConstUnused<T: Copy> = (T, I32<{ DATA }>); | ^^^^ required by this bound in `AliasConstUnused` +error[E0080]: entering unreachable code + --> $DIR/type-alias-bounds.rs:29:52 + | +LL | type AliasConstUnused where String: Copy = I32<{ 0; 0 }>; + | ^^^^^^^^ evaluation of `ct_unused_1::AliasConstUnused::{constant#0}` failed here + error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:31:12 + --> $DIR/type-alias-bounds.rs:32:12 | LL | let _: AliasConstUnused; | ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` @@ -23,41 +29,42 @@ LL | type AliasConstUnused where String: Copy = I32<{ 0; 0 }>; | ^^^^ required by this bound in `AliasConstUnused` error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:39:12 + --> $DIR/type-alias-bounds.rs:40:12 | LL | let _: AliasFnUnused<String>; | ^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `AliasFnUnused` - --> $DIR/type-alias-bounds.rs:36:27 + --> $DIR/type-alias-bounds.rs:37:27 | LL | type AliasFnUnused<T: Copy> = (T, I32<{ code() }>); | ^^^^ required by this bound in `AliasFnUnused` error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:57:12 + --> $DIR/type-alias-bounds.rs:58:12 | LL | let _: AliasAssocConstUsed<String>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `AliasAssocConstUsed` - --> $DIR/type-alias-bounds.rs:55:41 + --> $DIR/type-alias-bounds.rs:56:41 | LL | type AliasAssocConstUsed<T: Trait + Copy> = I32<{ T::DATA }>; | ^^^^ required by this bound in `AliasAssocConstUsed` error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/type-alias-bounds.rs:65:12 + --> $DIR/type-alias-bounds.rs:66:12 | LL | let _: AliasFnUsed<String>; | ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `AliasFnUsed` - --> $DIR/type-alias-bounds.rs:62:33 + --> $DIR/type-alias-bounds.rs:63:33 | LL | type AliasFnUsed<T: Trait + Copy> = I32<{ code::<T>() }>; | ^^^^ required by this bound in `AliasFnUsed` -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors -For more information about this error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0080, E0277. +For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs index f16e646129c..775b28f8c73 100644 --- a/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs +++ b/tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs @@ -27,6 +27,7 @@ fn ct_unused_0() { fn ct_unused_1() { #[allow(trivial_bounds)] type AliasConstUnused where String: Copy = I32<{ 0; 0 }>; + //[neg]~^ ERROR entering unreachable code #[cfg(neg)] let _: AliasConstUnused; //[neg]~^ ERROR the trait bound `String: Copy` is not satisfied diff --git a/tests/ui/const-generics/min_const_generics/macro-fail-const.rs b/tests/ui/const-generics/min_const_generics/macro-fail-const.rs new file mode 100644 index 00000000000..619d6de7ad2 --- /dev/null +++ b/tests/ui/const-generics/min_const_generics/macro-fail-const.rs @@ -0,0 +1,23 @@ +trait Marker<const N: usize> {} +struct Example<const N: usize>; +impl<const N: usize> Marker<N> for Example<N> {} + +fn make_marker() -> impl Marker<gimme_a_const!(marker)> { + //~^ ERROR: type provided when a constant was expected + //~| ERROR: type provided when a constant was expected + Example::<gimme_a_const!(marker)> + //~^ ERROR: type provided when a constant was expected +} + +fn main() { + let _ok = Example::<{ + #[macro_export] + macro_rules! gimme_a_const { + ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} + //~^ ERROR expected type + //~| ERROR expected type + } + gimme_a_const!(run) + }>; + let _ok = Example::<{gimme_a_const!(marker)}>; +} diff --git a/tests/ui/const-generics/min_const_generics/macro-fail-const.stderr b/tests/ui/const-generics/min_const_generics/macro-fail-const.stderr new file mode 100644 index 00000000000..2d8cb50834b --- /dev/null +++ b/tests/ui/const-generics/min_const_generics/macro-fail-const.stderr @@ -0,0 +1,51 @@ +error: expected type, found `{` + --> $DIR/macro-fail-const.rs:16:27 + | +LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { + | ---------------------- + | | + | this macro call doesn't expand to a type + | in this macro invocation +... +LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} + | ^ expected type + | + = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: expected type, found `{` + --> $DIR/macro-fail-const.rs:16:27 + | +LL | Example::<gimme_a_const!(marker)> + | ---------------------- + | | + | this macro call doesn't expand to a type + | in this macro invocation +... +LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} + | ^ expected type + | + = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0747]: type provided when a constant was expected + --> $DIR/macro-fail-const.rs:5:33 + | +LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0747]: type provided when a constant was expected + --> $DIR/macro-fail-const.rs:5:33 + | +LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0747]: type provided when a constant was expected + --> $DIR/macro-fail-const.rs:8:13 + | +LL | Example::<gimme_a_const!(marker)> + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0747`. diff --git a/tests/ui/const-generics/min_const_generics/macro-fail.rs b/tests/ui/const-generics/min_const_generics/macro-fail.rs index 8cfa5293cc2..ada9400b2a3 100644 --- a/tests/ui/const-generics/min_const_generics/macro-fail.rs +++ b/tests/ui/const-generics/min_const_generics/macro-fail.rs @@ -12,10 +12,7 @@ trait Marker<const N: usize> {} impl<const N: usize> Marker<N> for Example<N> {} fn make_marker() -> impl Marker<gimme_a_const!(marker)> { - //~^ ERROR: type provided when a constant was expected - //~| ERROR: type provided when a constant was expected Example::<gimme_a_const!(marker)> - //~^ ERROR: type provided when a constant was expected } fn from_marker(_: impl Marker<{ @@ -35,9 +32,7 @@ fn main() { }>; let _fail = Example::<external_macro!()>; - //~^ ERROR: type provided when a constant let _fail = Example::<gimme_a_const!()>; - //~^ ERROR unexpected end of macro invocation - //~| ERROR: type provided when a constant was expected + //~^ ERROR: unexpected end of macro invocation } diff --git a/tests/ui/const-generics/min_const_generics/macro-fail.stderr b/tests/ui/const-generics/min_const_generics/macro-fail.stderr index 34764982bb0..b1d766cbfb6 100644 --- a/tests/ui/const-generics/min_const_generics/macro-fail.stderr +++ b/tests/ui/const-generics/min_const_generics/macro-fail.stderr @@ -1,5 +1,5 @@ error: expected type, found `{` - --> $DIR/macro-fail.rs:30:27 + --> $DIR/macro-fail.rs:27:27 | LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { | ---------------------- @@ -13,7 +13,7 @@ LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected type, found `{` - --> $DIR/macro-fail.rs:30:27 + --> $DIR/macro-fail.rs:27:27 | LL | Example::<gimme_a_const!(marker)> | ---------------------- @@ -41,7 +41,7 @@ LL | let _fail = Example::<external_macro!()>; = note: this error originates in the macro `external_macro` (in Nightly builds, run with -Z macro-backtrace for more info) error: unexpected end of macro invocation - --> $DIR/macro-fail.rs:40:25 + --> $DIR/macro-fail.rs:36:25 | LL | macro_rules! gimme_a_const { | -------------------------- when calling this macro @@ -50,43 +50,10 @@ LL | let _fail = Example::<gimme_a_const!()>; | ^^^^^^^^^^^^^^^^ missing tokens in macro arguments | note: while trying to match meta-variable `$rusty:ident` - --> $DIR/macro-fail.rs:30:8 + --> $DIR/macro-fail.rs:27:8 | LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} | ^^^^^^^^^^^^^ -error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:14:33 - | -LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { - | ^^^^^^^^^^^^^^^^^^^^^^ - -error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:14:33 - | -LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:17:13 - | -LL | Example::<gimme_a_const!(marker)> - | ^^^^^^^^^^^^^^^^^^^^^^ - -error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:37:25 - | -LL | let _fail = Example::<external_macro!()>; - | ^^^^^^^^^^^^^^^^^ - -error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:40:25 - | -LL | let _fail = Example::<gimme_a_const!()>; - | ^^^^^^^^^^^^^^^^ - -error: aborting due to 9 previous errors +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0747`. diff --git a/tests/ui/consts/const-eval/const_panic_stability.e2018.stderr b/tests/ui/consts/const-eval/const_panic_stability.e2018.stderr index 3553a18d388..b3ccd2459aa 100644 --- a/tests/ui/consts/const-eval/const_panic_stability.e2018.stderr +++ b/tests/ui/consts/const-eval/const_panic_stability.e2018.stderr @@ -5,7 +5,7 @@ LL | panic!({ "foo" }); | ^^^^^^^^^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> = note: `#[warn(non_fmt_panics)]` on by default help: add a "{}" format string to `Display` the message | diff --git a/tests/ui/consts/const-eval/parse_ints.rs b/tests/ui/consts/const-eval/parse_ints.rs index 409fae9e51d..6a7e157ea50 100644 --- a/tests/ui/consts/const-eval/parse_ints.rs +++ b/tests/ui/consts/const-eval/parse_ints.rs @@ -1,3 +1,5 @@ +//@ ignore-backends: gcc + const _OK: () = match i32::from_str_radix("-1234", 10) { Ok(x) => assert!(x == -1234), Err(_) => panic!(), diff --git a/tests/ui/consts/const-eval/parse_ints.stderr b/tests/ui/consts/const-eval/parse_ints.stderr index 7e529c03725..9c9d083e7ca 100644 --- a/tests/ui/consts/const-eval/parse_ints.stderr +++ b/tests/ui/consts/const-eval/parse_ints.stderr @@ -1,5 +1,5 @@ error[E0080]: evaluation panicked: from_ascii_radix: radix must lie in the range `[2, 36]` - --> $DIR/parse_ints.rs:5:24 + --> $DIR/parse_ints.rs:7:24 | LL | const _TOO_LOW: () = { u64::from_str_radix("12345ABCD", 1); }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_TOO_LOW` failed inside this call @@ -11,7 +11,7 @@ note: inside `core::num::<impl u64>::from_ascii_radix` = note: this error originates in the macro `from_str_int_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation panicked: from_ascii_radix: radix must lie in the range `[2, 36]` - --> $DIR/parse_ints.rs:6:25 + --> $DIR/parse_ints.rs:8:25 | LL | const _TOO_HIGH: () = { u64::from_str_radix("12345ABCD", 37); }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_TOO_HIGH` failed inside this call diff --git a/tests/ui/consts/const-unsized.rs b/tests/ui/consts/const-unsized.rs index e8af3323ceb..4140563fa40 100644 --- a/tests/ui/consts/const-unsized.rs +++ b/tests/ui/consts/const-unsized.rs @@ -10,14 +10,10 @@ const CONST_FOO: str = *"foo"; static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); //~^ ERROR the size for values of type -//~| ERROR cannot move out of a shared reference static STATIC_BAR: str = *"bar"; //~^ ERROR the size for values of type -//~| ERROR cannot move out of a shared reference fn main() { println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR); - //~^ ERROR: cannot move a value of type `str` - //~| ERROR: cannot move a value of type `dyn Debug + Sync` } diff --git a/tests/ui/consts/const-unsized.stderr b/tests/ui/consts/const-unsized.stderr index c92fbc17f9c..a37a6df71f8 100644 --- a/tests/ui/consts/const-unsized.stderr +++ b/tests/ui/consts/const-unsized.stderr @@ -26,7 +26,7 @@ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); = note: statics and constants must have a statically known size error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/const-unsized.rs:15:1 + --> $DIR/const-unsized.rs:14:1 | LL | static STATIC_BAR: str = *"bar"; | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -46,31 +46,7 @@ error[E0507]: cannot move out of a shared reference LL | const CONST_FOO: str = *"foo"; | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait -error[E0507]: cannot move out of a shared reference - --> $DIR/const-unsized.rs:11:37 - | -LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait - -error[E0507]: cannot move out of a shared reference - --> $DIR/const-unsized.rs:15:26 - | -LL | static STATIC_BAR: str = *"bar"; - | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait - -error[E0161]: cannot move a value of type `dyn Debug + Sync` - --> $DIR/const-unsized.rs:20:38 - | -LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR); - | ^^^^^^^ the size of `dyn Debug + Sync` cannot be statically determined - -error[E0161]: cannot move a value of type `str` - --> $DIR/const-unsized.rs:20:48 - | -LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR); - | ^^^^^^^^^ the size of `str` cannot be statically determined - -error: aborting due to 10 previous errors +error: aborting due to 6 previous errors -Some errors have detailed explanations: E0161, E0277, E0507. -For more information about an error, try `rustc --explain E0161`. +Some errors have detailed explanations: E0277, E0507. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/consts/const_cmp_type_id.rs b/tests/ui/consts/const_cmp_type_id.rs index db2d50f4d22..8c21f7b1a5a 100644 --- a/tests/ui/consts/const_cmp_type_id.rs +++ b/tests/ui/consts/const_cmp_type_id.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ compile-flags: -Znext-solver #![feature(const_type_id, const_trait_impl, const_cmp)] diff --git a/tests/ui/consts/const_cmp_type_id.stderr b/tests/ui/consts/const_cmp_type_id.stderr index 540eec5098b..05b94caef79 100644 --- a/tests/ui/consts/const_cmp_type_id.stderr +++ b/tests/ui/consts/const_cmp_type_id.stderr @@ -1,5 +1,5 @@ error[E0015]: cannot call non-const operator in constants - --> $DIR/const_cmp_type_id.rs:10:18 + --> $DIR/const_cmp_type_id.rs:11:18 | LL | let _a = TypeId::of::<u8>() < TypeId::of::<u16>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/const_let_assign2.stderr b/tests/ui/consts/const_let_assign2.stderr index 1bb560437b6..e8bed6d0724 100644 --- a/tests/ui/consts/const_let_assign2.stderr +++ b/tests/ui/consts/const_let_assign2.stderr @@ -4,7 +4,7 @@ warning: creating a mutable reference to mutable static LL | let ptr = unsafe { &mut BB }; | ^^^^^^^ mutable reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw mut` instead to create a raw pointer diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.stderr b/tests/ui/consts/const_refs_to_static-ice-121413.stderr index 1263deebf76..e354110f293 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.stderr +++ b/tests/ui/consts/const_refs_to_static-ice-121413.stderr @@ -16,7 +16,7 @@ LL | static FOO: Sync = AtomicUsize::new(0); | ^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/consts/const_transmute_type_id6.rs b/tests/ui/consts/const_transmute_type_id6.rs new file mode 100644 index 00000000000..668eb0bb2b0 --- /dev/null +++ b/tests/ui/consts/const_transmute_type_id6.rs @@ -0,0 +1,16 @@ +//! Test that we do not ICE and that we do report an error +//! when placing non-TypeId provenance into a TypeId. + +#![feature(const_trait_impl, const_cmp)] + +use std::any::TypeId; +use std::mem::transmute; + +const X: bool = { + let a = (); + let id: TypeId = unsafe { transmute([&raw const a; 16 / size_of::<*const ()>()]) }; + id == id + //~^ ERROR: invalid `TypeId` value: not all bytes carry type id metadata +}; + +fn main() {} diff --git a/tests/ui/consts/const_transmute_type_id6.stderr b/tests/ui/consts/const_transmute_type_id6.stderr new file mode 100644 index 00000000000..f5d90256e7c --- /dev/null +++ b/tests/ui/consts/const_transmute_type_id6.stderr @@ -0,0 +1,15 @@ +error[E0080]: invalid `TypeId` value: not all bytes carry type id metadata + --> $DIR/const_transmute_type_id6.rs:12:5 + | +LL | id == id + | ^^^^^^^^ evaluation of `X` failed inside this call + | +note: inside `<TypeId as PartialEq>::eq` + --> $SRC_DIR/core/src/any.rs:LL:COL +note: inside `<TypeId as PartialEq>::eq::compiletime` + --> $SRC_DIR/core/src/any.rs:LL:COL + = note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `crate::intrinsics::const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/issue-73976-monomorphic.rs b/tests/ui/consts/issue-73976-monomorphic.rs index 5f364cd995e..f43823fa155 100644 --- a/tests/ui/consts/issue-73976-monomorphic.rs +++ b/tests/ui/consts/issue-73976-monomorphic.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ check-pass // // This test is complement to the test in issue-73976-polymorphic.rs. diff --git a/tests/ui/consts/issue-94675.rs b/tests/ui/consts/issue-94675.rs index 22791e7d15e..f2ddc928d12 100644 --- a/tests/ui/consts/issue-94675.rs +++ b/tests/ui/consts/issue-94675.rs @@ -1,3 +1,5 @@ +//@ ignore-backends: gcc + #![feature(const_trait_impl)] struct Foo<'a> { diff --git a/tests/ui/consts/issue-94675.stderr b/tests/ui/consts/issue-94675.stderr index 608ce0cfef0..d7664de5c07 100644 --- a/tests/ui/consts/issue-94675.stderr +++ b/tests/ui/consts/issue-94675.stderr @@ -1,17 +1,17 @@ error[E0277]: the trait bound `Vec<usize>: [const] Index<_>` is not satisfied - --> $DIR/issue-94675.rs:9:9 + --> $DIR/issue-94675.rs:11:9 | LL | self.bar[0] = baz.len(); | ^^^^^^^^^^^ error[E0277]: the trait bound `Vec<usize>: [const] IndexMut<usize>` is not satisfied - --> $DIR/issue-94675.rs:9:9 + --> $DIR/issue-94675.rs:11:9 | LL | self.bar[0] = baz.len(); | ^^^^^^^^^^^ error[E0277]: the trait bound `Vec<usize>: [const] Index<usize>` is not satisfied - --> $DIR/issue-94675.rs:9:9 + --> $DIR/issue-94675.rs:11:9 | LL | self.bar[0] = baz.len(); | ^^^^^^^^^^^ diff --git a/tests/ui/consts/issue-miri-1910.rs b/tests/ui/consts/issue-miri-1910.rs index 6eae885ea8a..78587bbb4dd 100644 --- a/tests/ui/consts/issue-miri-1910.rs +++ b/tests/ui/consts/issue-miri-1910.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ error-pattern unable to turn pointer into raw bytes //@ normalize-stderr: "alloc[0-9]+\+0x[a-z0-9]+" -> "ALLOC" diff --git a/tests/ui/consts/issue-miri-1910.stderr b/tests/ui/consts/issue-miri-1910.stderr index 140b1861bb4..2b6e079e380 100644 --- a/tests/ui/consts/issue-miri-1910.stderr +++ b/tests/ui/consts/issue-miri-1910.stderr @@ -1,5 +1,5 @@ error[E0080]: unable to turn pointer into integer - --> $DIR/issue-miri-1910.rs:7:5 + --> $DIR/issue-miri-1910.rs:8:5 | LL | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `C` failed here diff --git a/tests/ui/consts/missing_span_in_backtrace.rs b/tests/ui/consts/missing_span_in_backtrace.rs index 893dc321604..4f3f9aa6ada 100644 --- a/tests/ui/consts/missing_span_in_backtrace.rs +++ b/tests/ui/consts/missing_span_in_backtrace.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ compile-flags: -Z ui-testing=no use std::{ diff --git a/tests/ui/consts/missing_span_in_backtrace.stderr b/tests/ui/consts/missing_span_in_backtrace.stderr index de4acbffa28..0ac1e281107 100644 --- a/tests/ui/consts/missing_span_in_backtrace.stderr +++ b/tests/ui/consts/missing_span_in_backtrace.stderr @@ -1,11 +1,11 @@ error[E0080]: unable to copy parts of a pointer from memory at ALLOC0 - --> $DIR/missing_span_in_backtrace.rs:14:9 + --> $DIR/missing_span_in_backtrace.rs:15:9 | -14 | / ptr::swap_nonoverlapping( -15 | | &mut ptr1 as *mut _ as *mut MaybeUninit<u8>, -16 | | &mut ptr2 as *mut _ as *mut MaybeUninit<u8>, -17 | | mem::size_of::<&i32>(), -18 | | ); +15 | / ptr::swap_nonoverlapping( +16 | | &mut ptr1 as *mut _ as *mut MaybeUninit<u8>, +17 | | &mut ptr2 as *mut _ as *mut MaybeUninit<u8>, +18 | | mem::size_of::<&i32>(), +19 | | ); | |_________^ evaluation of `X` failed inside this call | = help: this code performed an operation that depends on the underlying bytes representing a pointer diff --git a/tests/ui/consts/try-operator.rs b/tests/ui/consts/try-operator.rs index 59d9fcb1cbd..cd0bf8ea571 100644 --- a/tests/ui/consts/try-operator.rs +++ b/tests/ui/consts/try-operator.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ run-pass #![feature(try_trait_v2)] diff --git a/tests/ui/coroutine/layout-error.rs b/tests/ui/coroutine/layout-error.rs index 6cf32134025..7f6714542c1 100644 --- a/tests/ui/coroutine/layout-error.rs +++ b/tests/ui/coroutine/layout-error.rs @@ -17,6 +17,7 @@ impl<F: Future> Task<F> { } pub type F = impl Future; + #[define_opaque(F)] fn foo() where diff --git a/tests/ui/coroutine/layout-error.stderr b/tests/ui/coroutine/layout-error.stderr index 91e35216435..f3b3843de89 100644 --- a/tests/ui/coroutine/layout-error.stderr +++ b/tests/ui/coroutine/layout-error.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `Foo` in this scope - --> $DIR/layout-error.rs:26:17 + --> $DIR/layout-error.rs:27:17 | LL | let a = Foo; | ^^^ not found in this scope diff --git a/tests/ui/coroutine/panic-drops-resume.rs b/tests/ui/coroutine/panic-drops-resume.rs index b23666b7885..ee58dab3e37 100644 --- a/tests/ui/coroutine/panic-drops-resume.rs +++ b/tests/ui/coroutine/panic-drops-resume.rs @@ -2,6 +2,7 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] diff --git a/tests/ui/coroutine/panic-drops.rs b/tests/ui/coroutine/panic-drops.rs index 8c2cf560f2a..c8ac401372f 100644 --- a/tests/ui/coroutine/panic-drops.rs +++ b/tests/ui/coroutine/panic-drops.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] diff --git a/tests/ui/coroutine/panic-safe.rs b/tests/ui/coroutine/panic-safe.rs index 6b9b4cb33c3..cee2afacb61 100644 --- a/tests/ui/coroutine/panic-safe.rs +++ b/tests/ui/coroutine/panic-safe.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-unwind - +//@ ignore-backends: gcc #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] diff --git a/tests/ui/coroutine/postfix-yield-after-cast.rs b/tests/ui/coroutine/postfix-yield-after-cast.rs new file mode 100644 index 00000000000..472efb9f513 --- /dev/null +++ b/tests/ui/coroutine/postfix-yield-after-cast.rs @@ -0,0 +1,10 @@ +// Regression test for <https://github.com/rust-lang/rust/issues/144527>. + +#![feature(yield_expr, coroutines)] + +fn main() { + #[coroutine] || { + 0 as u8.yield + //~^ ERROR cast cannot be followed by `.yield` + }; +} diff --git a/tests/ui/coroutine/postfix-yield-after-cast.stderr b/tests/ui/coroutine/postfix-yield-after-cast.stderr new file mode 100644 index 00000000000..a4de064fdf8 --- /dev/null +++ b/tests/ui/coroutine/postfix-yield-after-cast.stderr @@ -0,0 +1,13 @@ +error: cast cannot be followed by `.yield` + --> $DIR/postfix-yield-after-cast.rs:7:9 + | +LL | 0 as u8.yield + | ^^^^^^^ + | +help: try surrounding the expression in parentheses + | +LL | (0 as u8).yield + | + + + +error: aborting due to 1 previous error + diff --git a/tests/ui/coroutine/resume-after-return.rs b/tests/ui/coroutine/resume-after-return.rs index 7028e1e81e5..f566bd37d3d 100644 --- a/tests/ui/coroutine/resume-after-return.rs +++ b/tests/ui/coroutine/resume-after-return.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ run-pass //@ needs-unwind diff --git a/tests/ui/coroutine/unwind-abort-mix.rs b/tests/ui/coroutine/unwind-abort-mix.rs index 517c6613e3d..175c2928a80 100644 --- a/tests/ui/coroutine/unwind-abort-mix.rs +++ b/tests/ui/coroutine/unwind-abort-mix.rs @@ -6,6 +6,7 @@ //@ aux-build:unwind-aux.rs //@ compile-flags: -Cpanic=abort //@ needs-unwind +//@ ignore-backends: gcc extern crate unwind_aux; pub fn main() { diff --git a/tests/ui/issues/auxiliary/issue-2472-b.rs b/tests/ui/cross-crate/auxiliary/exporting-impl-from-root-causes-ice-2472-b.rs index 0d151520fe0..0d151520fe0 100644 --- a/tests/ui/issues/auxiliary/issue-2472-b.rs +++ b/tests/ui/cross-crate/auxiliary/exporting-impl-from-root-causes-ice-2472-b.rs diff --git a/tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs b/tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs new file mode 100644 index 00000000000..86d637b579d --- /dev/null +++ b/tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs @@ -0,0 +1,15 @@ +//@ run-pass +//@ aux-build:exporting-impl-from-root-causes-ice-2472-b.rs + + +extern crate exporting_impl_from_root_causes_ice_2472_b as lib; + +use lib::{S, T}; + +pub fn main() { + let s = S(()); + s.foo(); + s.bar(); +} + +// https://github.com/rust-lang/rust/issues/2472 diff --git a/tests/ui/delegation/fn-header.rs b/tests/ui/delegation/fn-header.rs index 9de0d549f20..608aef8d968 100644 --- a/tests/ui/delegation/fn-header.rs +++ b/tests/ui/delegation/fn-header.rs @@ -1,6 +1,7 @@ //@ check-pass //@ edition:2018 //@ aux-crate:fn_header_aux=fn-header-aux.rs +//@ ignore-backends: gcc #![feature(c_variadic)] #![feature(fn_delegation)] diff --git a/tests/ui/issues/issue-34229.rs b/tests/ui/derives/invalid-derive-comparison-34229.rs index 13e627a492f..d77ca78dc81 100644 --- a/tests/ui/issues/issue-34229.rs +++ b/tests/ui/derives/invalid-derive-comparison-34229.rs @@ -3,3 +3,5 @@ //~^ ERROR can't compare `Comparable` fn main() {} + +// https://github.com/rust-lang/rust/issues/34229 diff --git a/tests/ui/issues/issue-34229.stderr b/tests/ui/derives/invalid-derive-comparison-34229.stderr index 2385284de0b..e3a9970670e 100644 --- a/tests/ui/issues/issue-34229.stderr +++ b/tests/ui/derives/invalid-derive-comparison-34229.stderr @@ -1,5 +1,5 @@ error[E0277]: can't compare `Comparable` with `Comparable` - --> $DIR/issue-34229.rs:2:46 + --> $DIR/invalid-derive-comparison-34229.rs:2:46 | LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable); | ---------- ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable` diff --git a/tests/ui/deriving/built-in-proc-macro-scope.stdout b/tests/ui/deriving/built-in-proc-macro-scope.stdout index 2697618ab00..4fbce5edb81 100644 --- a/tests/ui/deriving/built-in-proc-macro-scope.stdout +++ b/tests/ui/deriving/built-in-proc-macro-scope.stdout @@ -6,10 +6,10 @@ //@ edition:2015 #![feature(derive_coerce_pointee)] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; #[macro_use] extern crate another_proc_macro; diff --git a/tests/ui/deriving/deriving-all-codegen.stdout b/tests/ui/deriving/deriving-all-codegen.stdout index fa8f249373d..0e4bfa30257 100644 --- a/tests/ui/deriving/deriving-all-codegen.stdout +++ b/tests/ui/deriving/deriving-all-codegen.stdout @@ -17,10 +17,10 @@ #![crate_type = "lib"] #![allow(dead_code)] #![allow(deprecated)] -#[prelude_import] -use std::prelude::rust_2021::*; #[macro_use] extern crate std; +#[prelude_import] +use std::prelude::rust_2021::*; // Empty struct. struct Empty; diff --git a/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout index 84f8e9a3195..89300a5c6d0 100644 --- a/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout +++ b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout @@ -4,10 +4,10 @@ //@ compile-flags: -Zunpretty=expanded //@ edition: 2015 #![feature(derive_coerce_pointee)] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; use std::marker::CoercePointee; pub trait MyTrait<T: ?Sized> {} diff --git a/tests/ui/deriving/proc-macro-attribute-mixing.stdout b/tests/ui/deriving/proc-macro-attribute-mixing.stdout index faa9c0218a3..b81110682d6 100644 --- a/tests/ui/deriving/proc-macro-attribute-mixing.stdout +++ b/tests/ui/deriving/proc-macro-attribute-mixing.stdout @@ -12,10 +12,10 @@ //@ edition: 2015 #![feature(derive_coerce_pointee)] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; #[macro_use] extern crate another_proc_macro; diff --git a/tests/ui/diagnostics-infra/primary-fluent-bundle-missing.rs b/tests/ui/diagnostics-infra/primary-fluent-bundle-missing.rs new file mode 100644 index 00000000000..f2965778431 --- /dev/null +++ b/tests/ui/diagnostics-infra/primary-fluent-bundle-missing.rs @@ -0,0 +1,24 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/106755 + +//@ compile-flags:-Ztranslate-lang=en_US + +#![feature(negative_impls)] +#![feature(marker_trait_attr)] + +#[marker] +trait MyTrait {} + +struct TestType<T>(::std::marker::PhantomData<T>); + +unsafe impl<T: MyTrait + 'static> Send for TestType<T> {} + +impl<T: MyTrait> !Send for TestType<T> {} +//~^ ERROR found both positive and negative implementation +//~| ERROR `!Send` impl requires `T: MyTrait` but the struct it is implemented for does not + +unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations + +impl !Send for TestType<i32> {} +//~^ ERROR `!Send` impls cannot be specialized + +fn main() {} diff --git a/tests/ui/issues/issue-106755.stderr b/tests/ui/diagnostics-infra/primary-fluent-bundle-missing.stderr index da6b8c5c563..1dc31e161a7 100644 --- a/tests/ui/issues/issue-106755.stderr +++ b/tests/ui/diagnostics-infra/primary-fluent-bundle-missing.stderr @@ -1,5 +1,5 @@ error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`: - --> $DIR/issue-106755.rs:13:1 + --> $DIR/primary-fluent-bundle-missing.rs:15:1 | LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {} | ------------------------------------------------------ positive implementation here @@ -8,7 +8,7 @@ LL | impl<T: MyTrait> !Send for TestType<T> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>` - --> $DIR/issue-106755.rs:17:1 + --> $DIR/primary-fluent-bundle-missing.rs:19:1 | LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {} | ------------------------------------------------------ first implementation here @@ -17,26 +17,26 @@ LL | unsafe impl<T: 'static> Send for TestType<T> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>` error[E0367]: `!Send` impl requires `T: MyTrait` but the struct it is implemented for does not - --> $DIR/issue-106755.rs:13:9 + --> $DIR/primary-fluent-bundle-missing.rs:15:9 | LL | impl<T: MyTrait> !Send for TestType<T> {} | ^^^^^^^ | note: the implementor must specify the same requirement - --> $DIR/issue-106755.rs:9:1 + --> $DIR/primary-fluent-bundle-missing.rs:11:1 | LL | struct TestType<T>(::std::marker::PhantomData<T>); | ^^^^^^^^^^^^^^^^^^ error[E0366]: `!Send` impls cannot be specialized - --> $DIR/issue-106755.rs:19:1 + --> $DIR/primary-fluent-bundle-missing.rs:21:1 | LL | impl !Send for TestType<i32> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `i32` is not a generic parameter note: use the same sequence of generic lifetime, type and const parameters as the struct definition - --> $DIR/issue-106755.rs:9:1 + --> $DIR/primary-fluent-bundle-missing.rs:11:1 | LL | struct TestType<T>(::std::marker::PhantomData<T>); | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr b/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr index ed6e5c3e0c0..416ff358d53 100644 --- a/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr +++ b/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr @@ -186,7 +186,7 @@ LL | type H = Fn(u8) -> (u8)::Output; | ^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/issues/issue-10734.rs b/tests/ui/drop/conditional-drop-10734.rs index 6d815aeca07..25f492bf9e0 100644 --- a/tests/ui/issues/issue-10734.rs +++ b/tests/ui/drop/conditional-drop-10734.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10734 + //@ run-pass #![allow(non_upper_case_globals)] diff --git a/tests/ui/issues/issue-9446.rs b/tests/ui/drop/drop-immediate-non-box-ty-9446.rs index a6ea91e8785..ad3f7b64aa9 100644 --- a/tests/ui/issues/issue-9446.rs +++ b/tests/ui/drop/drop-immediate-non-box-ty-9446.rs @@ -28,3 +28,5 @@ pub fn main() { Wrapper::new("Bob".to_string()).say_hi(); } } + +// https://github.com/rust-lang/rust/issues/9446 diff --git a/tests/ui/drop/drop-order-comparisons.e2021.stderr b/tests/ui/drop/drop-order-comparisons.e2021.stderr index 15a3f274514..d928403d2e3 100644 --- a/tests/ui/drop/drop-order-comparisons.e2021.stderr +++ b/tests/ui/drop/drop-order-comparisons.e2021.stderr @@ -27,7 +27,7 @@ LL | | }, e.mark(3), e.ok(4)); | `#1` will be dropped later as of Edition 2024 | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#3` invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -75,7 +75,7 @@ LL | | }, e.mark(1), e.ok(4)); | `#1` will be dropped later as of Edition 2024 | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#2` invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -107,7 +107,7 @@ LL | | }, e.mark(1), e.ok(4)); | `#1` will be dropped later as of Edition 2024 | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#2` invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -139,7 +139,7 @@ LL | | }, e.mark(2), e.ok(3)); | `#1` will be dropped later as of Edition 2024 | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#2` invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -171,7 +171,7 @@ LL | | }, e.mark(2), e.ok(3)); | `#1` will be dropped later as of Edition 2024 | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#2` invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -193,7 +193,7 @@ LL | _ = (if let Ok(_) = e.ok(4).as_ref() { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -223,7 +223,7 @@ LL | _ = (if let Ok(_) = e.err(4).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -252,7 +252,7 @@ LL | if let Ok(_) = e.err(4).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -281,7 +281,7 @@ LL | if let true = e.err(9).is_ok() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -310,7 +310,7 @@ LL | if let Ok(_v) = e.err(8) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -339,7 +339,7 @@ LL | if let Ok(_) = e.err(7) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -368,7 +368,7 @@ LL | if let Ok(_) = e.err(6).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -397,7 +397,7 @@ LL | if let Ok(_v) = e.err(5) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -426,7 +426,7 @@ LL | if let Ok(_) = e.err(4) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | @@ -455,7 +455,7 @@ LL | if let Ok(_) = e.err(4).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/drop-order-comparisons.rs:504:1 | diff --git a/tests/ui/drop/dynamic-drop-async.rs b/tests/ui/drop/dynamic-drop-async.rs index e7a32d3c24e..64de6995c7a 100644 --- a/tests/ui/drop/dynamic-drop-async.rs +++ b/tests/ui/drop/dynamic-drop-async.rs @@ -6,6 +6,7 @@ //@ run-pass //@ needs-unwind //@ edition:2018 +//@ ignore-backends: gcc #![allow(unused)] diff --git a/tests/ui/drop/dynamic-drop.rs b/tests/ui/drop/dynamic-drop.rs index b695b5702d9..1bd75e1852c 100644 --- a/tests/ui/drop/dynamic-drop.rs +++ b/tests/ui/drop/dynamic-drop.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] #![feature(if_let_guard)] diff --git a/tests/ui/drop/lint-if-let-rescope-gated.edition2021.stderr b/tests/ui/drop/lint-if-let-rescope-gated.edition2021.stderr index 0d6974d516b..5f04273d336 100644 --- a/tests/ui/drop/lint-if-let-rescope-gated.edition2021.stderr +++ b/tests/ui/drop/lint-if-let-rescope-gated.edition2021.stderr @@ -7,7 +7,7 @@ LL | if let Some(_value) = Droppy.get() { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope-gated.rs:14:1 | diff --git a/tests/ui/drop/lint-if-let-rescope-with-macro.stderr b/tests/ui/drop/lint-if-let-rescope-with-macro.stderr index a0afb8eddb5..63e30f1ab92 100644 --- a/tests/ui/drop/lint-if-let-rescope-with-macro.stderr +++ b/tests/ui/drop/lint-if-let-rescope-with-macro.stderr @@ -14,7 +14,7 @@ LL | | }; | |_____- in this macro invocation | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope-with-macro.rs:22:1 | diff --git a/tests/ui/drop/lint-if-let-rescope.stderr b/tests/ui/drop/lint-if-let-rescope.stderr index ca2416efcb1..7cab7339fe1 100644 --- a/tests/ui/drop/lint-if-let-rescope.stderr +++ b/tests/ui/drop/lint-if-let-rescope.stderr @@ -7,7 +7,7 @@ LL | if let Some(_value) = droppy().get() { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope.rs:11:1 | @@ -47,7 +47,7 @@ LL | } else if let Some(_value) = droppy().get() { | -------- this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope.rs:11:1 | @@ -89,7 +89,7 @@ LL | } else if let Some(_value) = droppy().get() { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope.rs:11:1 | @@ -120,7 +120,7 @@ LL | if let Some(1) = { if let Some(_value) = Droppy.get() { Some(1) } else | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope.rs:11:1 | @@ -146,7 +146,7 @@ LL | if (if let Some(_value) = droppy().get() { true } else { false }) { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope.rs:11:1 | @@ -172,7 +172,7 @@ LL | } else if (((if let Some(_value) = droppy().get() { true } else { false | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope.rs:11:1 | @@ -198,7 +198,7 @@ LL | while (if let Some(_value) = droppy().get() { false } else { true }) { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> note: value invokes this custom destructor --> $DIR/lint-if-let-rescope.rs:11:1 | @@ -224,7 +224,7 @@ LL | if let Some(_value) = Some((droppy(), ()).1) {} else {} | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html> help: the value is now dropped here in Edition 2024 --> $DIR/lint-if-let-rescope.rs:97:51 | diff --git a/tests/ui/drop/lint-tail-expr-drop-order-borrowck.stderr b/tests/ui/drop/lint-tail-expr-drop-order-borrowck.stderr index a55e366dd0b..2eeda8ac387 100644 --- a/tests/ui/drop/lint-tail-expr-drop-order-borrowck.stderr +++ b/tests/ui/drop/lint-tail-expr-drop-order-borrowck.stderr @@ -7,7 +7,7 @@ LL | let _ = { String::new().as_str() }.len(); | this temporary value will be dropped at the end of the block | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: the lint level is defined here --> $DIR/lint-tail-expr-drop-order-borrowck.rs:6:9 | @@ -23,7 +23,7 @@ LL | f(unsafe { String::new().as_str() }.len()); | this temporary value will be dropped at the end of the block | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> error: relative drop order changing in Rust 2024 --> $DIR/lint-tail-expr-drop-order-borrowck.rs:31:9 @@ -35,7 +35,7 @@ LL | &mut || 0 | borrow later used here | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> error: relative drop order changing in Rust 2024 --> $DIR/lint-tail-expr-drop-order-borrowck.rs:43:9 @@ -46,7 +46,7 @@ LL | g({ &f() }); | borrow later used by call | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> error: aborting due to 4 previous errors diff --git a/tests/ui/drop/lint-tail-expr-drop-order.stderr b/tests/ui/drop/lint-tail-expr-drop-order.stderr index e124e9874d0..c69c58aa1ab 100644 --- a/tests/ui/drop/lint-tail-expr-drop-order.stderr +++ b/tests/ui/drop/lint-tail-expr-drop-order.stderr @@ -17,7 +17,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#1` invokes this custom destructor --> $DIR/lint-tail-expr-drop-order.rs:10:1 | @@ -54,7 +54,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#1` invokes this custom destructor --> $DIR/lint-tail-expr-drop-order.rs:10:1 | @@ -86,7 +86,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#1` invokes this custom destructor --> $DIR/lint-tail-expr-drop-order.rs:10:1 | @@ -118,7 +118,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#1` invokes this custom destructor --> $DIR/lint-tail-expr-drop-order.rs:10:1 | @@ -145,7 +145,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> = note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages error: relative drop order changing in Rust 2024 @@ -167,7 +167,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#1` invokes this custom destructor --> $DIR/lint-tail-expr-drop-order.rs:10:1 | @@ -199,7 +199,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#1` invokes this custom destructor --> $DIR/lint-tail-expr-drop-order.rs:193:5 | @@ -231,7 +231,7 @@ LL | )); | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#1` invokes this custom destructor --> $DIR/lint-tail-expr-drop-order.rs:10:1 | diff --git a/tests/ui/drop/tail_expr_drop_order-on-coroutine-unwind.stderr b/tests/ui/drop/tail_expr_drop_order-on-coroutine-unwind.stderr index 7bf452e2496..94977185ced 100644 --- a/tests/ui/drop/tail_expr_drop_order-on-coroutine-unwind.stderr +++ b/tests/ui/drop/tail_expr_drop_order-on-coroutine-unwind.stderr @@ -23,7 +23,7 @@ LL | } | - now the temporary value is dropped here, before the local variables in the block or statement | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html> note: `#2` invokes this custom destructor --> $DIR/tail_expr_drop_order-on-coroutine-unwind.rs:9:1 | diff --git a/tests/ui/issues/issue-10802.rs b/tests/ui/drop/trait-object-drop-10802.rs index eca701ce98c..a8a955ad833 100644 --- a/tests/ui/issues/issue-10802.rs +++ b/tests/ui/drop/trait-object-drop-10802.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10802 + //@ run-pass #![allow(dead_code)] diff --git a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr index b811ef40c26..687799c6688 100644 --- a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr +++ b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr @@ -5,7 +5,7 @@ LL | fn id<F>(f: Copy) -> usize { | ^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -19,7 +19,7 @@ LL | fn id<F>(f: Copy) -> usize { | ^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/dyn-compatibility/avoid-ice-on-warning-3.old.stderr b/tests/ui/dyn-compatibility/avoid-ice-on-warning-3.old.stderr index 8b4f3f52ee9..4cfac943375 100644 --- a/tests/ui/dyn-compatibility/avoid-ice-on-warning-3.old.stderr +++ b/tests/ui/dyn-compatibility/avoid-ice-on-warning-3.old.stderr @@ -5,7 +5,7 @@ LL | trait B { fn f(a: A) -> A; } | ^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -19,7 +19,7 @@ LL | trait B { fn f(a: A) -> A; } | ^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | trait B { fn f(a: A) -> dyn A; } @@ -32,7 +32,7 @@ LL | trait A { fn g(b: B) -> B; } | ^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | trait A { fn g(b: dyn B) -> B; } @@ -45,7 +45,7 @@ LL | trait A { fn g(b: B) -> B; } | ^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | trait A { fn g(b: B) -> dyn B; } @@ -58,7 +58,7 @@ LL | trait B { fn f(a: A) -> A; } | ^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | @@ -100,7 +100,7 @@ LL | trait A { fn g(b: B) -> B; } | ^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/dyn-compatibility/avoid-ice-on-warning.old.stderr b/tests/ui/dyn-compatibility/avoid-ice-on-warning.old.stderr index dbfe91e1811..4645b35f8f1 100644 --- a/tests/ui/dyn-compatibility/avoid-ice-on-warning.old.stderr +++ b/tests/ui/dyn-compatibility/avoid-ice-on-warning.old.stderr @@ -23,7 +23,7 @@ LL | fn call_this<F>(f: F) : Fn(&str) + call_that {} | ^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/dyn-compatibility/bare-trait-dont-suggest-dyn.old.stderr b/tests/ui/dyn-compatibility/bare-trait-dont-suggest-dyn.old.stderr index 7be6cb0d03b..3cbdd19111d 100644 --- a/tests/ui/dyn-compatibility/bare-trait-dont-suggest-dyn.old.stderr +++ b/tests/ui/dyn-compatibility/bare-trait-dont-suggest-dyn.old.stderr @@ -5,7 +5,7 @@ LL | fn ord_prefer_dot(s: String) -> Ord { | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/bare-trait-dont-suggest-dyn.rs:5:9 | diff --git a/tests/ui/dyn-compatibility/taint-const-eval.rs b/tests/ui/dyn-compatibility/taint-const-eval.rs index a5c01e1791e..3d1b3b8fe61 100644 --- a/tests/ui/dyn-compatibility/taint-const-eval.rs +++ b/tests/ui/dyn-compatibility/taint-const-eval.rs @@ -6,6 +6,5 @@ trait Qux { static FOO: &(dyn Qux + Sync) = "desc"; //~^ ERROR the trait `Qux` is not dyn compatible -//~| ERROR the trait `Qux` is not dyn compatible fn main() {} diff --git a/tests/ui/dyn-compatibility/taint-const-eval.stderr b/tests/ui/dyn-compatibility/taint-const-eval.stderr index 585c1f012c7..e4be9870fdc 100644 --- a/tests/ui/dyn-compatibility/taint-const-eval.stderr +++ b/tests/ui/dyn-compatibility/taint-const-eval.stderr @@ -21,30 +21,6 @@ help: alternatively, consider constraining `bar` so it does not apply to trait o LL | fn bar() where Self: Sized; | +++++++++++++++++ -error[E0038]: the trait `Qux` is not dyn compatible - --> $DIR/taint-const-eval.rs:7:15 - | -LL | static FOO: &(dyn Qux + Sync) = "desc"; - | ^^^^^^^^^^^^^^ `Qux` is not dyn compatible - | -note: for a trait to be dyn compatible it needs to allow building a vtable - for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility> - --> $DIR/taint-const-eval.rs:4:8 - | -LL | trait Qux { - | --- this trait is not dyn compatible... -LL | fn bar(); - | ^^^ ...because associated function `bar` has no `self` parameter - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: consider turning `bar` into a method by giving it a `&self` argument - | -LL | fn bar(&self); - | +++++ -help: alternatively, consider constraining `bar` so it does not apply to trait objects - | -LL | fn bar() where Self: Sized; - | +++++++++++++++++ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/dyn-keyword/dyn-2018-edition-lint.stderr b/tests/ui/dyn-keyword/dyn-2018-edition-lint.stderr index b930815d13b..b034c5dac16 100644 --- a/tests/ui/dyn-keyword/dyn-2018-edition-lint.stderr +++ b/tests/ui/dyn-keyword/dyn-2018-edition-lint.stderr @@ -5,7 +5,7 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) { | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/dyn-2018-edition-lint.rs:2:8 | @@ -23,7 +23,7 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) { | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) { @@ -36,7 +36,7 @@ LL | let _x: &SomeTrait = todo!(); | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let _x: &dyn SomeTrait = todo!(); diff --git a/tests/ui/dyn-keyword/dyn-angle-brackets.stderr b/tests/ui/dyn-keyword/dyn-angle-brackets.stderr index 6a29dab0486..30069633cf5 100644 --- a/tests/ui/dyn-keyword/dyn-angle-brackets.stderr +++ b/tests/ui/dyn-keyword/dyn-angle-brackets.stderr @@ -5,7 +5,7 @@ LL | <fmt::Debug>::fmt(self, f) | ^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/dyn-angle-brackets.rs:4:9 | diff --git a/tests/ui/editions/edition-keywords-2018-2015-parsing.rs b/tests/ui/editions/edition-keywords-2018-2015-parsing.rs index f8d2755b9d7..df473946317 100644 --- a/tests/ui/editions/edition-keywords-2018-2015-parsing.rs +++ b/tests/ui/editions/edition-keywords-2018-2015-parsing.rs @@ -26,7 +26,7 @@ pub fn check_async() { module::async(); //~ ERROR expected identifier, found keyword `async` module::r#async(); // OK - let _recovery_witness: () = 0; //~ ERROR mismatched types + let _recovery_witness: () = 0; // not emitted because of the macro parsing error } //~? ERROR macro expansion ends with an incomplete expression diff --git a/tests/ui/editions/edition-keywords-2018-2015-parsing.stderr b/tests/ui/editions/edition-keywords-2018-2015-parsing.stderr index 34f5c7d3084..4d69df9fff8 100644 --- a/tests/ui/editions/edition-keywords-2018-2015-parsing.stderr +++ b/tests/ui/editions/edition-keywords-2018-2015-parsing.stderr @@ -61,14 +61,5 @@ error: macro expansion ends with an incomplete expression: expected one of `move LL | if passes_tt!(async) == 1 {} | ^ expected one of `move`, `use`, `{`, `|`, or `||` -error[E0308]: mismatched types - --> $DIR/edition-keywords-2018-2015-parsing.rs:29:33 - | -LL | let _recovery_witness: () = 0; - | -- ^ expected `()`, found integer - | | - | expected due to this - -error: aborting due to 7 previous errors +error: aborting due to 6 previous errors -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/editions/edition-keywords-2018-2018-parsing.rs b/tests/ui/editions/edition-keywords-2018-2018-parsing.rs index f4438472a0e..34aaf16b4ae 100644 --- a/tests/ui/editions/edition-keywords-2018-2018-parsing.rs +++ b/tests/ui/editions/edition-keywords-2018-2018-parsing.rs @@ -36,8 +36,6 @@ pub fn check_async() { if local_passes_tt!(r#async) == 1 {} // OK module::async(); //~ ERROR expected identifier, found keyword `async` module::r#async(); // OK - - let _recovery_witness: () = 0; //~ ERROR mismatched types } //~? ERROR macro expansion ends with an incomplete expression diff --git a/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr b/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr index dd3f4938c74..753dac605a3 100644 --- a/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr +++ b/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr @@ -73,14 +73,5 @@ error: macro expansion ends with an incomplete expression: expected one of `move LL | if local_passes_tt!(async) == 1 {} | ^ expected one of `move`, `use`, `{`, `|`, or `||` -error[E0308]: mismatched types - --> $DIR/edition-keywords-2018-2018-parsing.rs:40:33 - | -LL | let _recovery_witness: () = 0; - | -- ^ expected `()`, found integer - | | - | expected due to this - -error: aborting due to 9 previous errors +error: aborting due to 8 previous errors -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/editions/never-type-fallback-breaking.e2021.stderr b/tests/ui/editions/never-type-fallback-breaking.e2021.stderr index 6b84a64fffe..e30c0adb79d 100644 --- a/tests/ui/editions/never-type-fallback-breaking.e2021.stderr +++ b/tests/ui/editions/never-type-fallback-breaking.e2021.stderr @@ -5,7 +5,7 @@ LL | fn m() { | ^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:22:17 @@ -25,7 +25,7 @@ LL | fn q() -> Option<()> { | ^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:37:5 @@ -44,7 +44,7 @@ LL | fn meow() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `(): From<!>` will fail --> $DIR/never-type-fallback-breaking.rs:50:5 @@ -63,7 +63,7 @@ LL | pub fn fallback_return() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:62:19 @@ -82,7 +82,7 @@ LL | fn fully_apit() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:76:17 @@ -104,7 +104,7 @@ LL | fn m() { | ^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:22:17 @@ -125,7 +125,7 @@ LL | fn q() -> Option<()> { | ^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:37:5 @@ -146,7 +146,7 @@ LL | fn meow() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `(): From<!>` will fail --> $DIR/never-type-fallback-breaking.rs:50:5 @@ -167,7 +167,7 @@ LL | pub fn fallback_return() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:62:19 @@ -188,7 +188,7 @@ LL | fn fully_apit() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/never-type-fallback-breaking.rs:76:17 diff --git a/tests/ui/entry-point/auxiliary/main_functions.rs b/tests/ui/entry-point/auxiliary/main_functions.rs index cc7992a42c1..ab4a09b6331 100644 --- a/tests/ui/entry-point/auxiliary/main_functions.rs +++ b/tests/ui/entry-point/auxiliary/main_functions.rs @@ -1 +1,4 @@ pub fn boilerplate() {} + +#[inline] +pub fn local_codegen() {} diff --git a/tests/ui/entry-point/imported_main_local_codegen.rs b/tests/ui/entry-point/imported_main_local_codegen.rs new file mode 100644 index 00000000000..1e46c109373 --- /dev/null +++ b/tests/ui/entry-point/imported_main_local_codegen.rs @@ -0,0 +1,11 @@ +//@ run-pass +//@ aux-build:main_functions.rs +//@ compile-flags: -Ccodegen-units=1024 + +// This is a regression test for https://github.com/rust-lang/rust/issues/144052. +// Entrypoint functions call each other in ways that CGU partitioning doesn't know about. So there +// is a special check to not internalize any of them. But internalizing them can be okay if there +// are few enough CGUs, so we use a lot of CGUs in this test to hit the bad case. + +extern crate main_functions; +pub use main_functions::local_codegen as main; diff --git a/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs b/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs index a6e5f70fdef..6bbafbf1434 100644 --- a/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs +++ b/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs @@ -1,8 +1,17 @@ -#![crate_type="lib"] +#![crate_type = "lib"] +// Test that if any variant is non-unit, +// we need a repr. enum Enum { -//~^ ERROR `#[repr(inttype)]` must be specified - Unit = 1, - Tuple() = 2, - Struct{} = 3, + //~^ ERROR `#[repr(inttype)]` must be specified + Unit = 1, + Tuple(), + Struct {}, +} + +// Test that if any non-unit variant has an explicit +// discriminant we need a repr. +enum Enum2 { + //~^ ERROR `#[repr(inttype)]` must be specified + Tuple() = 2, } diff --git a/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr b/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr index 3b718c6465b..35c0208951a 100644 --- a/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr +++ b/tests/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr @@ -1,9 +1,23 @@ -error[E0732]: `#[repr(inttype)]` must be specified - --> $DIR/arbitrary_enum_discriminant-no-repr.rs:3:1 +error[E0732]: `#[repr(inttype)]` must be specified for enums with explicit discriminants and non-unit variants + --> $DIR/arbitrary_enum_discriminant-no-repr.rs:5:1 | LL | enum Enum { | ^^^^^^^^^ +LL | +LL | Unit = 1, + | - explicit discriminant specified here +LL | Tuple(), + | ----- non-unit discriminant declared here -error: aborting due to 1 previous error +error[E0732]: `#[repr(inttype)]` must be specified for enums with explicit discriminants and non-unit variants + --> $DIR/arbitrary_enum_discriminant-no-repr.rs:14:1 + | +LL | enum Enum2 { + | ^^^^^^^^^^ +LL | +LL | Tuple() = 2, + | - explicit discriminant on non-unit variant specified here + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0732`. diff --git a/tests/ui/enum-discriminant/wrapping_niche.rs b/tests/ui/enum-discriminant/wrapping_niche.rs new file mode 100644 index 00000000000..8097414be68 --- /dev/null +++ b/tests/ui/enum-discriminant/wrapping_niche.rs @@ -0,0 +1,24 @@ +//! Test that we produce the same niche range no +//! matter of signendess if the discriminants are the same. + +#![feature(rustc_attrs)] + +#[repr(u16)] +#[rustc_layout(debug)] +enum UnsignedAroundZero { + //~^ ERROR: layout_of + A = 65535, + B = 0, + C = 1, +} + +#[repr(i16)] +#[rustc_layout(debug)] +enum SignedAroundZero { + //~^ ERROR: layout_of + A = -1, + B = 0, + C = 1, +} + +fn main() {} diff --git a/tests/ui/enum-discriminant/wrapping_niche.stderr b/tests/ui/enum-discriminant/wrapping_niche.stderr new file mode 100644 index 00000000000..e3e1755e14d --- /dev/null +++ b/tests/ui/enum-discriminant/wrapping_niche.stderr @@ -0,0 +1,238 @@ +error: layout_of(UnsignedAroundZero) = Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + false, + ), + valid_range: (..=1) | (65535..), + }, + ), + fields: Arbitrary { + offsets: [ + Size(0 bytes), + ], + memory_index: [ + 0, + ], + }, + largest_niche: Some( + Niche { + offset: Size(0 bytes), + value: Int( + I16, + false, + ), + valid_range: (..=1) | (65535..), + }, + ), + uninhabited: false, + variants: Multiple { + tag: Initialized { + value: Int( + I16, + false, + ), + valid_range: (..=1) | (65535..), + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 9885373149222004003, + }, + Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 1, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 9885373149222004003, + }, + Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 2, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 9885373149222004003, + }, + ], + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 2648004449468912780, + } + --> $DIR/wrapping_niche.rs:8:1 + | +LL | enum UnsignedAroundZero { + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: layout_of(SignedAroundZero) = Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Scalar( + Initialized { + value: Int( + I16, + true, + ), + valid_range: (..=1) | (65535..), + }, + ), + fields: Arbitrary { + offsets: [ + Size(0 bytes), + ], + memory_index: [ + 0, + ], + }, + largest_niche: Some( + Niche { + offset: Size(0 bytes), + value: Int( + I16, + true, + ), + valid_range: (..=1) | (65535..), + }, + ), + uninhabited: false, + variants: Multiple { + tag: Initialized { + value: Int( + I16, + true, + ), + valid_range: (..=1) | (65535..), + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 2684536712112553499, + }, + Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 1, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 2684536712112553499, + }, + Layout { + size: Size(2 bytes), + align: AbiAlign { + abi: Align(2 bytes), + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 2, + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 2684536712112553499, + }, + ], + }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), + randomization_seed: 10738146848450213996, + } + --> $DIR/wrapping_niche.rs:17:1 + | +LL | enum SignedAroundZero { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/issues/issue-32326.rs b/tests/ui/enum/recursive-enum-memory-32326.rs index e928c66e2cc..6b8b04a7c91 100644 --- a/tests/ui/issues/issue-32326.rs +++ b/tests/ui/enum/recursive-enum-memory-32326.rs @@ -8,3 +8,5 @@ enum Expr { //~ ERROR E0072 } fn main() { } + +// https://github.com/rust-lang/rust/issues/32326 diff --git a/tests/ui/issues/issue-32326.stderr b/tests/ui/enum/recursive-enum-memory-32326.stderr index 1989a915cc1..0260a6758ed 100644 --- a/tests/ui/issues/issue-32326.stderr +++ b/tests/ui/enum/recursive-enum-memory-32326.stderr @@ -1,5 +1,5 @@ error[E0072]: recursive type `Expr` has infinite size - --> $DIR/issue-32326.rs:5:1 + --> $DIR/recursive-enum-memory-32326.rs:5:1 | LL | enum Expr { | ^^^^^^^^^ diff --git a/tests/ui/ergonomic-clones/closure/rfc2229-migration.stderr b/tests/ui/ergonomic-clones/closure/rfc2229-migration.stderr index b980be6cb86..f4f3e518014 100644 --- a/tests/ui/ergonomic-clones/closure/rfc2229-migration.stderr +++ b/tests/ui/ergonomic-clones/closure/rfc2229-migration.stderr @@ -10,7 +10,7 @@ LL | let x = a.0; LL | } | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html> note: the lint level is defined here --> $DIR/rfc2229-migration.rs:5:9 | diff --git a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr index 7f3022c2923..0004ea82fac 100644 --- a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr +++ b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr @@ -5,7 +5,7 @@ LL | let _ = MyIterator::next; | ^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/errors/remap-path-prefix-sysroot.rs b/tests/ui/errors/remap-path-prefix-sysroot.rs index 5e2e4fab51d..f4a2766ff4c 100644 --- a/tests/ui/errors/remap-path-prefix-sysroot.rs +++ b/tests/ui/errors/remap-path-prefix-sysroot.rs @@ -2,7 +2,7 @@ //@ compile-flags: -g -Ztranslate-remapped-path-to-local-path=yes //@ [with-remap]compile-flags: --remap-path-prefix={{rust-src-base}}=remapped //@ [with-remap]compile-flags: --remap-path-prefix={{src-base}}=remapped-tests-ui -//@ [without-remap]compile-flags: +// [without-remap] no extra compile-flags // The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically // as the remapped revision will not begin with $SRC_DIR_REAL, diff --git a/tests/ui/errors/wrong-target-spec.rs b/tests/ui/errors/wrong-target-spec.rs index a3a0e05d826..1a976888112 100644 --- a/tests/ui/errors/wrong-target-spec.rs +++ b/tests/ui/errors/wrong-target-spec.rs @@ -2,6 +2,7 @@ // checks that such invalid target specs are rejected by the compiler. // See https://github.com/rust-lang/rust/issues/33329 +// ignore-tidy-target-specific-tests //@ needs-llvm-components: x86 //@ compile-flags: --target x86_64_unknown-linux-musl diff --git a/tests/ui/issues/issue-10764.rs b/tests/ui/extern/extern-rust-fn-type-error-10764.rs index bb915f58d9d..f172f6e6b7d 100644 --- a/tests/ui/issues/issue-10764.rs +++ b/tests/ui/extern/extern-rust-fn-type-error-10764.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10764 + fn f(_: extern "Rust" fn()) {} extern "C" fn bar() {} diff --git a/tests/ui/issues/issue-10764.stderr b/tests/ui/extern/extern-rust-fn-type-error-10764.stderr index f3bd0100a72..fa72d7dd6b2 100644 --- a/tests/ui/issues/issue-10764.stderr +++ b/tests/ui/extern/extern-rust-fn-type-error-10764.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-10764.rs:4:15 + --> $DIR/extern-rust-fn-type-error-10764.rs:6:15 | LL | fn main() { f(bar) } | - ^^^ expected "Rust" fn, found "C" fn @@ -9,7 +9,7 @@ LL | fn main() { f(bar) } = note: expected fn pointer `fn()` found fn item `extern "C" fn() {bar}` note: function defined here - --> $DIR/issue-10764.rs:1:4 + --> $DIR/extern-rust-fn-type-error-10764.rs:3:4 | LL | fn f(_: extern "Rust" fn()) {} | ^ --------------------- diff --git a/tests/ui/issues/issue-10877.rs b/tests/ui/extern/foreign-fn-pattern-error-10877.rs index 15a383175b9..9a047d4f34e 100644 --- a/tests/ui/issues/issue-10877.rs +++ b/tests/ui/extern/foreign-fn-pattern-error-10877.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10877 + struct Foo { x: isize, } diff --git a/tests/ui/issues/issue-10877.stderr b/tests/ui/extern/foreign-fn-pattern-error-10877.stderr index bd3797cba55..cab7b6ab06b 100644 --- a/tests/ui/issues/issue-10877.stderr +++ b/tests/ui/extern/foreign-fn-pattern-error-10877.stderr @@ -1,23 +1,23 @@ error[E0130]: patterns aren't allowed in foreign function declarations - --> $DIR/issue-10877.rs:5:12 + --> $DIR/foreign-fn-pattern-error-10877.rs:7:12 | LL | fn foo(1: ()); | ^ pattern not allowed in foreign function error[E0130]: patterns aren't allowed in foreign function declarations - --> $DIR/issue-10877.rs:7:12 + --> $DIR/foreign-fn-pattern-error-10877.rs:9:12 | LL | fn bar((): isize); | ^^ pattern not allowed in foreign function error[E0130]: patterns aren't allowed in foreign function declarations - --> $DIR/issue-10877.rs:9:12 + --> $DIR/foreign-fn-pattern-error-10877.rs:11:12 | LL | fn baz(Foo { x }: isize); | ^^^^^^^^^ pattern not allowed in foreign function error[E0130]: patterns aren't allowed in foreign function declarations - --> $DIR/issue-10877.rs:11:12 + --> $DIR/foreign-fn-pattern-error-10877.rs:13:12 | LL | fn qux((x, y): ()); | ^^^^^^ pattern not allowed in foreign function diff --git a/tests/ui/extern/issue-36122-accessing-externed-dst.rs b/tests/ui/extern/issue-36122-accessing-externed-dst.rs index 9fb7780e3d7..5f886ff5737 100644 --- a/tests/ui/extern/issue-36122-accessing-externed-dst.rs +++ b/tests/ui/extern/issue-36122-accessing-externed-dst.rs @@ -3,5 +3,4 @@ fn main() { static symbol: [usize]; //~ ERROR: the size for values of type } println!("{}", symbol[0]); - //~^ ERROR: extern static is unsafe } diff --git a/tests/ui/extern/issue-36122-accessing-externed-dst.stderr b/tests/ui/extern/issue-36122-accessing-externed-dst.stderr index 8007c3f13e5..c617cf4e61b 100644 --- a/tests/ui/extern/issue-36122-accessing-externed-dst.stderr +++ b/tests/ui/extern/issue-36122-accessing-externed-dst.stderr @@ -7,15 +7,6 @@ LL | static symbol: [usize]; = help: the trait `Sized` is not implemented for `[usize]` = note: statics and constants must have a statically known size -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-36122-accessing-externed-dst.rs:5:20 - | -LL | println!("{}", symbol[0]); - | ^^^^^^ use of extern static - | - = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0133, E0277. -For more information about an error, try `rustc --explain E0133`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs index 9740eaaf1e9..b93cb2ea006 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs @@ -57,7 +57,7 @@ // see gated-link-args.rs // see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700" // (cannot easily test gating of crate-level #[no_std]; but non crate-level is below at "2600") -#![proc_macro_derive()] //~ WARN `#[proc_macro_derive]` only has an effect +#![proc_macro_derive(Test)] //~ WARN `#[proc_macro_derive]` only has an effect #![doc = "2400"] #![cold] //~ WARN attribute should be applied to a function //~^ WARN this was previously accepted diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr index 9016ca1efa7..8bac1f6155e 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr @@ -367,12 +367,6 @@ warning: `#[should_panic]` only has an effect on functions LL | #![should_panic] | ^^^^^^^^^^^^^^^^ -warning: `#[proc_macro_derive]` only has an effect on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1 - | -LL | #![proc_macro_derive()] - | ^^^^^^^^^^^^^^^^^^^^^^^ - warning: attribute should be applied to an `extern` block with non-Rust ABI --> $DIR/issue-43106-gating-of-builtin-attrs.rs:64:1 | @@ -409,6 +403,12 @@ warning: `#[must_use]` has no effect when applied to a module LL | #![must_use] | ^^^^^^^^^^^^ +warning: `#[proc_macro_derive]` only has an effect on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1 + | +LL | #![proc_macro_derive(Test)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + warning: attribute should be applied to a function definition --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1 | diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs index 6a7ef793924..0438152ff35 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.rs @@ -13,7 +13,7 @@ mod macro_escape { //~^ ERROR arguments to `macro_use` are not allowed here #[macro_use = "2700"] struct S; - //~^ ERROR malformed `macro_use` attribute + //~^ ERROR valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` #[macro_use] fn f() { } diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr index 8987b87f84e..4da71766837 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr @@ -16,20 +16,11 @@ error: arguments to `macro_use` are not allowed here LL | #![macro_use(my_macro)] | ^^^^^^^^^^^^^^^^^^^^^^^ -error: malformed `macro_use` attribute input +error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]` --> $DIR/issue-43106-gating-of-macro_use.rs:15:5 | LL | #[macro_use = "2700"] struct S; | ^^^^^^^^^^^^^^^^^^^^^ - | -help: the following are the possible correct uses - | -LL - #[macro_use = "2700"] struct S; -LL + #[macro_use(name1, name2, ...)] struct S; - | -LL - #[macro_use = "2700"] struct S; -LL + #[macro_use] struct S; - | error: aborting due to 4 previous errors diff --git a/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.rs b/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.rs index a94ffd602ef..392880e1b3b 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.rs @@ -7,27 +7,27 @@ // signal errors, making it incompatible with the "warnings only" // nature of issue-43106-gating-of-builtin-attrs.rs -#[proc_macro_derive()] +#[proc_macro_derive(Test)] //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions mod proc_macro_derive1 { - mod inner { #![proc_macro_derive()] } + mod inner { #![proc_macro_derive(Test)] } // (no error issued here if there was one on outer module) } mod proc_macro_derive2 { - mod inner { #![proc_macro_derive()] } + mod inner { #![proc_macro_derive(Test)] } //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions - #[proc_macro_derive()] fn f() { } + #[proc_macro_derive(Test)] fn f() { } //~^ ERROR the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` - #[proc_macro_derive()] struct S; + #[proc_macro_derive(Test)] struct S; //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions - #[proc_macro_derive()] type T = S; + #[proc_macro_derive(Test)] type T = S; //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions - #[proc_macro_derive()] impl S { } + #[proc_macro_derive(Test)] impl S { } //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions } diff --git a/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr b/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr index e202b472d9c..537032d777f 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr @@ -1,38 +1,38 @@ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:10:1 | -LL | #[proc_macro_derive()] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive(Test)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:18:17 | -LL | mod inner { #![proc_macro_derive()] } - | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![proc_macro_derive(Test)] } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:21:5 | -LL | #[proc_macro_derive()] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive(Test)] fn f() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:24:5 | -LL | #[proc_macro_derive()] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive(Test)] struct S; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:27:5 | -LL | #[proc_macro_derive()] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive(Test)] type T = S; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:30:5 | -LL | #[proc_macro_derive()] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive(Test)] impl S { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/tests/ui/float/target-has-reliable-nightly-float.rs b/tests/ui/float/target-has-reliable-nightly-float.rs index ad8600fc635..399f101f49a 100644 --- a/tests/ui/float/target-has-reliable-nightly-float.rs +++ b/tests/ui/float/target-has-reliable-nightly-float.rs @@ -19,8 +19,10 @@ pub fn has_f128() {} pub fn has_f128_math() {} fn main() { - if cfg!(target_arch = "aarch64") && cfg!(target_os = "linux") { - // Aarch64+Linux is one target that has support for all features, so use it to spot + if cfg!(target_arch = "aarch64") && + cfg!(target_os = "linux") && + cfg!(not(target_env = "musl")) { + // Aarch64+GNU+Linux is one target that has support for all features, so use it to spot // check that the compiler does indeed enable these gates. assert!(cfg!(target_has_reliable_f16)); diff --git a/tests/ui/issues/auxiliary/issue-18514.rs b/tests/ui/generics/auxiliary/generic-impl-method-match-autoderef-18514.rs index 20c8e60ee45..20c8e60ee45 100644 --- a/tests/ui/issues/auxiliary/issue-18514.rs +++ b/tests/ui/generics/auxiliary/generic-impl-method-match-autoderef-18514.rs diff --git a/tests/ui/issues/issue-18514.rs b/tests/ui/generics/generic-impl-method-match-autoderef-18514.rs index 89f58d3988d..3520e936209 100644 --- a/tests/ui/issues/issue-18514.rs +++ b/tests/ui/generics/generic-impl-method-match-autoderef-18514.rs @@ -5,12 +5,14 @@ // expression that autoderefs through an overloaded generic deref // impl. -//@ aux-build:issue-18514.rs +//@ aux-build:generic-impl-method-match-autoderef-18514.rs -extern crate issue_18514 as ice; +extern crate generic_impl_method_match_autoderef_18514 as ice; use ice::{Tr, St}; fn main() { let st: St<()> = St(vec![]); st.tr(); } + +// https://github.com/rust-lang/rust/issues/18514 diff --git a/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr index 418f9acf589..46b677202ef 100644 --- a/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr +++ b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr @@ -5,7 +5,7 @@ LL | fn ice() -> impl AsRef<Fn(&())> { | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -19,7 +19,7 @@ LL | fn ice() -> impl AsRef<Fn(&())> { | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.stderr b/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.stderr index 35fff9ef170..980ddedc255 100644 --- a/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.stderr +++ b/tests/ui/impl-trait/precise-capturing/overcaptures-2024-machine-applicable.stderr @@ -5,7 +5,7 @@ LL | fn named<'a>(x: &'a i32) -> impl Sized { *x } | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024-machine-applicable.rs:9:10 | diff --git a/tests/ui/impl-trait/precise-capturing/overcaptures-2024.stderr b/tests/ui/impl-trait/precise-capturing/overcaptures-2024.stderr index 3f8511a21a0..dc9f1c218d9 100644 --- a/tests/ui/impl-trait/precise-capturing/overcaptures-2024.stderr +++ b/tests/ui/impl-trait/precise-capturing/overcaptures-2024.stderr @@ -5,7 +5,7 @@ LL | fn named<'a>(x: &'a i32) -> impl Sized { *x } | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:7:10 | @@ -29,7 +29,7 @@ LL | fn implicit(x: &i32) -> impl Sized { *x } | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:11:16 | @@ -48,7 +48,7 @@ LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self } | ^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:17:24 | @@ -67,7 +67,7 @@ LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {} | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:29:23 | @@ -86,7 +86,7 @@ LL | fn apit(_: &impl Sized) -> impl Sized {} | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:33:12 | @@ -111,7 +111,7 @@ LL | fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {} | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:37:16 | @@ -136,7 +136,7 @@ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {} | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:41:19 | @@ -155,7 +155,7 @@ LL | pub fn parens(x: &i32) -> &impl Clone { x } | ^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html> note: specifically, this lifetime is in scope but not mentioned in the type's bounds --> $DIR/overcaptures-2024.rs:45:18 | diff --git a/tests/ui/issues/issue-10806.rs b/tests/ui/imports/use-declaration-no-path-segment-prefix.rs index 31315dc7c93..f7fbc084ebf 100644 --- a/tests/ui/issues/issue-10806.rs +++ b/tests/ui/imports/use-declaration-no-path-segment-prefix.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10806 + //@ edition: 2015 //@ run-pass #![allow(unused_imports)] diff --git a/tests/ui/issues/issue-10718.rs b/tests/ui/inference/fnonce-closure-call.rs index 68ac0bbe49f..262a193609f 100644 --- a/tests/ui/issues/issue-10718.rs +++ b/tests/ui/inference/fnonce-closure-call.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10718 + //@ run-pass fn f<F:FnOnce()>(p: F) { diff --git a/tests/ui/issues/issue-10436.rs b/tests/ui/inference/generic-type-inference-10436.rs index 672aa2464dc..456a9b86c34 100644 --- a/tests/ui/issues/issue-10436.rs +++ b/tests/ui/inference/generic-type-inference-10436.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10436 + //@ run-pass fn works<T>(x: T) -> Vec<T> { vec![x] } diff --git a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs index 346a94c37dd..cdf8aa85482 100644 --- a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs +++ b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs @@ -4,6 +4,7 @@ //@ revisions: default strict //@ [strict]compile-flags: -Zstrict-init-checks //@ needs-subprocess +//@ ignore-backends: gcc #![allow(deprecated, invalid_value)] #![feature(never_type)] diff --git a/tests/ui/issues/issue-10767.rs b/tests/ui/issues/issue-10767.rs deleted file mode 100644 index 2060d15b4c7..00000000000 --- a/tests/ui/issues/issue-10767.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ run-pass - -pub fn main() { - fn f() { - } - let _: Box<fn()> = Box::new(f as fn()); -} diff --git a/tests/ui/issues/issue-14875.rs b/tests/ui/issues/issue-14875.rs index 235d255716f..e330c64a335 100644 --- a/tests/ui/issues/issue-14875.rs +++ b/tests/ui/issues/issue-14875.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc // Check that values are not leaked when a dtor panics (#14875) diff --git a/tests/ui/issues/issue-2472.rs b/tests/ui/issues/issue-2472.rs deleted file mode 100644 index f8f539ed1d1..00000000000 --- a/tests/ui/issues/issue-2472.rs +++ /dev/null @@ -1,13 +0,0 @@ -//@ run-pass -//@ aux-build:issue-2472-b.rs - - -extern crate issue_2472_b; - -use issue_2472_b::{S, T}; - -pub fn main() { - let s = S(()); - s.foo(); - s.bar(); -} diff --git a/tests/ui/issues/issue-28344.stderr b/tests/ui/issues/issue-28344.stderr index 7bc965536e9..dfd4951f172 100644 --- a/tests/ui/issues/issue-28344.stderr +++ b/tests/ui/issues/issue-28344.stderr @@ -5,7 +5,7 @@ LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); | ^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -25,7 +25,7 @@ LL | let g = BitXor::bitor; | ^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let g = <dyn BitXor>::bitor; diff --git a/tests/ui/issues/issue-29948.rs b/tests/ui/issues/issue-29948.rs index 77e1f6807d9..77a3885da04 100644 --- a/tests/ui/issues/issue-29948.rs +++ b/tests/ui/issues/issue-29948.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc use std::panic; diff --git a/tests/ui/issues/issue-39367.stderr b/tests/ui/issues/issue-39367.stderr index df21c09983e..65076375e96 100644 --- a/tests/ui/issues/issue-39367.stderr +++ b/tests/ui/issues/issue-39367.stderr @@ -9,7 +9,7 @@ LL | | (Box::new(__static_ref_initialize())); LL | | }); | |______________^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives = note: `#[warn(static_mut_refs)]` on by default diff --git a/tests/ui/issues/issue-4335.stderr b/tests/ui/issues/issue-4335.stderr index 14b5cfa9f9a..42ac6322564 100644 --- a/tests/ui/issues/issue-4335.stderr +++ b/tests/ui/issues/issue-4335.stderr @@ -2,9 +2,11 @@ error[E0507]: cannot move out of `*v`, as `v` is a captured variable in an `FnMu --> $DIR/issue-4335.rs:6:20 | LL | fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> { - | - captured outer variable + | - ----- move occurs because `*v` has type `T`, which does not implement the `Copy` trait + | | + | captured outer variable LL | id(Box::new(|| *v)) - | -- ^^ move occurs because `*v` has type `T`, which does not implement the `Copy` trait + | -- ^^ `*v` is moved here | | | captured by this `FnMut` closure | diff --git a/tests/ui/issues/issue-49544.rs b/tests/ui/issues/issue-49544.rs deleted file mode 100644 index bb052501f8b..00000000000 --- a/tests/ui/issues/issue-49544.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ aux-build:issue-49544.rs -//@ check-pass - -extern crate issue_49544; -use issue_49544::foo; - -fn main() { - let _ = foo(); -} diff --git a/tests/ui/issues/issue-58734.stderr b/tests/ui/issues/issue-58734.stderr index e5dad000b51..c246d1fc111 100644 --- a/tests/ui/issues/issue-58734.stderr +++ b/tests/ui/issues/issue-58734.stderr @@ -5,7 +5,7 @@ LL | Trait::nonexistent(()); | ^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/issues/issue-86756.stderr b/tests/ui/issues/issue-86756.stderr index 0f68b764850..b650b32c2a3 100644 --- a/tests/ui/issues/issue-86756.stderr +++ b/tests/ui/issues/issue-86756.stderr @@ -19,7 +19,7 @@ LL | eq::<dyn, Foo> | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/issues/auxiliary/issue-49544.rs b/tests/ui/iterators/auxiliary/iterator-adapter-undeclared-type-49544.rs index f8b3a3fba1e..f8b3a3fba1e 100644 --- a/tests/ui/issues/auxiliary/issue-49544.rs +++ b/tests/ui/iterators/auxiliary/iterator-adapter-undeclared-type-49544.rs diff --git a/tests/ui/iterators/into-iter-on-arrays-2018.stderr b/tests/ui/iterators/into-iter-on-arrays-2018.stderr index d4055c74f7c..8818ef80f76 100644 --- a/tests/ui/iterators/into-iter-on-arrays-2018.stderr +++ b/tests/ui/iterators/into-iter-on-arrays-2018.stderr @@ -5,7 +5,7 @@ LL | let _: Iter<'_, i32> = array.into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> = note: `#[warn(array_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | @@ -25,7 +25,7 @@ LL | let _: Iter<'_, i32> = Box::new(array).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-2018.rs:22:43 @@ -34,7 +34,7 @@ LL | let _: Iter<'_, i32> = Rc::new(array).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-2018.rs:25:41 @@ -43,7 +43,7 @@ LL | let _: Iter<'_, i32> = Array(array).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-2018.rs:32:24 @@ -52,7 +52,7 @@ LL | for _ in [1, 2, 3].into_iter() {} | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL - for _ in [1, 2, 3].into_iter() {} diff --git a/tests/ui/iterators/into-iter-on-arrays-lint.stderr b/tests/ui/iterators/into-iter-on-arrays-lint.stderr index fb8fe79c7c9..a9dfa5819c1 100644 --- a/tests/ui/iterators/into-iter-on-arrays-lint.stderr +++ b/tests/ui/iterators/into-iter-on-arrays-lint.stderr @@ -5,7 +5,7 @@ LL | small.into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> = note: `#[warn(array_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | @@ -25,7 +25,7 @@ LL | [1, 2].into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL - [1, 2].into_iter(); @@ -44,7 +44,7 @@ LL | big.into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL - big.into_iter(); @@ -63,7 +63,7 @@ LL | [0u8; 33].into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL - [0u8; 33].into_iter(); @@ -82,7 +82,7 @@ LL | Box::new(small).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:27:22 @@ -91,7 +91,7 @@ LL | Box::new([1, 2]).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:30:19 @@ -100,7 +100,7 @@ LL | Box::new(big).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:33:25 @@ -109,7 +109,7 @@ LL | Box::new([0u8; 33]).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:37:31 @@ -118,7 +118,7 @@ LL | Box::new(Box::new(small)).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:40:32 @@ -127,7 +127,7 @@ LL | Box::new(Box::new([1, 2])).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:43:29 @@ -136,7 +136,7 @@ LL | Box::new(Box::new(big)).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:46:35 @@ -145,7 +145,7 @@ LL | Box::new(Box::new([0u8; 33])).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> warning: 12 warnings emitted diff --git a/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr b/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr index 7a5a2be5ef0..a0c1432756d 100644 --- a/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr +++ b/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr @@ -5,7 +5,7 @@ LL | let _: Iter<'_, i32> = boxed_slice.into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> = note: `#[warn(boxed_slice_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | @@ -25,7 +25,7 @@ LL | let _: Iter<'_, i32> = Box::new(boxed_slice.clone()).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> warning: this method call resolves to `<&Box<[T]> as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<Box<[T]> as IntoIterator>::into_iter` in Rust 2024 --> $DIR/into-iter-on-boxed-slices-2021.rs:22:57 @@ -34,7 +34,7 @@ LL | let _: Iter<'_, i32> = Rc::new(boxed_slice.clone()).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> warning: this method call resolves to `<&Box<[T]> as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<Box<[T]> as IntoIterator>::into_iter` in Rust 2024 --> $DIR/into-iter-on-boxed-slices-2021.rs:25:55 @@ -43,7 +43,7 @@ LL | let _: Iter<'_, i32> = Array(boxed_slice.clone()).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> warning: this method call resolves to `<&Box<[T]> as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<Box<[T]> as IntoIterator>::into_iter` in Rust 2024 --> $DIR/into-iter-on-boxed-slices-2021.rs:32:48 @@ -52,7 +52,7 @@ LL | for _ in (Box::new([1, 2, 3]) as Box<[_]>).into_iter() {} | ^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL - for _ in (Box::new([1, 2, 3]) as Box<[_]>).into_iter() {} diff --git a/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr b/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr index 6762ed28d36..377455d6a26 100644 --- a/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr +++ b/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr @@ -5,7 +5,7 @@ LL | boxed.into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> = note: `#[warn(boxed_slice_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | @@ -25,7 +25,7 @@ LL | Box::new(boxed.clone()).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> warning: this method call resolves to `<&Box<[T]> as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<Box<[T]> as IntoIterator>::into_iter` in Rust 2024 --> $DIR/into-iter-on-boxed-slices-lint.rs:16:39 @@ -34,7 +34,7 @@ LL | Box::new(Box::new(boxed.clone())).into_iter(); | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> warning: 3 warnings emitted diff --git a/tests/ui/iterators/iter-sum-overflow-debug.rs b/tests/ui/iterators/iter-sum-overflow-debug.rs index 32efc925a45..974282b0379 100644 --- a/tests/ui/iterators/iter-sum-overflow-debug.rs +++ b/tests/ui/iterators/iter-sum-overflow-debug.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc //@ compile-flags: -C debug_assertions=yes use std::panic; diff --git a/tests/ui/iterators/iter-sum-overflow-overflow-checks.rs b/tests/ui/iterators/iter-sum-overflow-overflow-checks.rs index 8fffd19e2be..aba6f9a188f 100644 --- a/tests/ui/iterators/iter-sum-overflow-overflow-checks.rs +++ b/tests/ui/iterators/iter-sum-overflow-overflow-checks.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc //@ compile-flags: -C overflow-checks use std::panic; diff --git a/tests/ui/iterators/iterator-adapter-undeclared-type-49544.rs b/tests/ui/iterators/iterator-adapter-undeclared-type-49544.rs new file mode 100644 index 00000000000..f2532ceb1ba --- /dev/null +++ b/tests/ui/iterators/iterator-adapter-undeclared-type-49544.rs @@ -0,0 +1,11 @@ +//@ aux-build:iterator-adapter-undeclared-type-49544.rs +//@ check-pass + +extern crate iterator_adapter_undeclared_type_49544 as lib; +use lib::foo; + +fn main() { + let _ = foo(); +} + +// https://github.com/rust-lang/rust/issues/49544 diff --git a/tests/ui/layout/issue-84108.rs b/tests/ui/layout/issue-84108.rs index 974d5310f6b..33884617acb 100644 --- a/tests/ui/layout/issue-84108.rs +++ b/tests/ui/layout/issue-84108.rs @@ -14,5 +14,3 @@ const BAR: (&Path, [u8], usize) = ("hello", [], 42); static BAZ: ([u8], usize) = ([], 0); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time -//~| ERROR the size for values of type `[u8]` cannot be known at compilation time -//~| ERROR mismatched types diff --git a/tests/ui/layout/issue-84108.stderr b/tests/ui/layout/issue-84108.stderr index e296abfc3b5..62a6ae341fa 100644 --- a/tests/ui/layout/issue-84108.stderr +++ b/tests/ui/layout/issue-84108.stderr @@ -57,26 +57,7 @@ LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42); = note: expected slice `[u8]` found array `[_; 0]` -error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> $DIR/issue-84108.rs:15:13 - | -LL | static BAZ: ([u8], usize) = ([], 0); - | ^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[u8]` - = note: only the last element of a tuple may have a dynamically sized type - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0308]: mismatched types - --> $DIR/issue-84108.rs:15:30 - | -LL | static BAZ: ([u8], usize) = ([], 0); - | ^^ expected `[u8]`, found `[_; 0]` - | - = note: expected slice `[u8]` - found array `[_; 0]` - -error: aborting due to 8 previous errors +error: aborting due to 6 previous errors Some errors have detailed explanations: E0277, E0308, E0412. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs index 4423b83e24d..8015a2fe081 100644 --- a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs +++ b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs @@ -5,7 +5,8 @@ where str: Sized, { [(); { let _a: Option<str> = None; 0 }]; - //~^ ERROR the type `Option<str>` has an unknown layout + //~^ ERROR entering unreachable code + //~| NOTE evaluation of `return_str::{constant#0}` failed here } fn main() {} diff --git a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr index 43fe9e3a7a7..cad73b603c1 100644 --- a/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr +++ b/tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr @@ -1,8 +1,8 @@ -error[E0080]: the type `Option<str>` has an unknown layout - --> $DIR/uncomputable-due-to-trivial-bounds-ice-135138.rs:7:16 +error[E0080]: entering unreachable code + --> $DIR/uncomputable-due-to-trivial-bounds-ice-135138.rs:7:10 | LL | [(); { let _a: Option<str> = None; 0 }]; - | ^^ evaluation of `return_str::{constant#0}` failed here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `return_str::{constant#0}` failed here error: aborting due to 1 previous error diff --git a/tests/ui/layout/unknown-when-no-type-parameter.rs b/tests/ui/layout/unknown-when-no-type-parameter.rs index f787998868d..8579593c65c 100644 --- a/tests/ui/layout/unknown-when-no-type-parameter.rs +++ b/tests/ui/layout/unknown-when-no-type-parameter.rs @@ -9,9 +9,8 @@ where (): Project, { [(); size_of::<<() as Project>::Assoc>()]; - //~^ ERROR the type `<() as Project>::Assoc` has an unknown layout - //~| NOTE inside `std::mem::size_of::<<() as Project>::Assoc>` - //~| NOTE failed inside this call + //~^ ERROR entering unreachable code + //~| NOTE evaluation of `foo::{constant#0}` failed here } fn main() {} diff --git a/tests/ui/layout/unknown-when-no-type-parameter.stderr b/tests/ui/layout/unknown-when-no-type-parameter.stderr index 9bb42c46ec3..7c382c7a855 100644 --- a/tests/ui/layout/unknown-when-no-type-parameter.stderr +++ b/tests/ui/layout/unknown-when-no-type-parameter.stderr @@ -1,11 +1,8 @@ -error[E0080]: the type `<() as Project>::Assoc` has an unknown layout +error[E0080]: entering unreachable code --> $DIR/unknown-when-no-type-parameter.rs:11:10 | LL | [(); size_of::<<() as Project>::Assoc>()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `foo::{constant#0}` failed inside this call - | -note: inside `std::mem::size_of::<<() as Project>::Assoc>` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `foo::{constant#0}` failed here error: aborting due to 1 previous error diff --git a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs index 54f339711d5..da11804c226 100644 --- a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs +++ b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.rs @@ -6,7 +6,8 @@ where str: std::ptr::Pointee<Metadata = str>, { [(); { let _a: Option<&str> = None; 0 }]; - //~^ ERROR the type `str` has an unknown layout + //~^ ERROR entering unreachable code + //~| NOTE evaluation of `return_str::{constant#0}` failed here } fn main() {} diff --git a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr index fd9eedc9267..888e2574119 100644 --- a/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr +++ b/tests/ui/layout/unknown-when-ptr-metadata-is-DST.stderr @@ -1,8 +1,8 @@ -error[E0080]: the type `str` has an unknown layout - --> $DIR/unknown-when-ptr-metadata-is-DST.rs:8:16 +error[E0080]: entering unreachable code + --> $DIR/unknown-when-ptr-metadata-is-DST.rs:8:10 | LL | [(); { let _a: Option<&str> = None; 0 }]; - | ^^ evaluation of `return_str::{constant#0}` failed here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `return_str::{constant#0}` failed here error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-10396.rs b/tests/ui/lifetimes/array-pattern-matching-10396.rs index 082216d557c..5fc141bc460 100644 --- a/tests/ui/issues/issue-10396.rs +++ b/tests/ui/lifetimes/array-pattern-matching-10396.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10396 + //@ check-pass #![allow(dead_code)] #[derive(Debug)] diff --git a/tests/ui/issues/issue-10291.rs b/tests/ui/lifetimes/closure-lifetime-bounds-10291.rs index 31b9e124046..42dc6c2cafa 100644 --- a/tests/ui/issues/issue-10291.rs +++ b/tests/ui/lifetimes/closure-lifetime-bounds-10291.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10291 + fn test<'x>(x: &'x isize) { drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { x diff --git a/tests/ui/issues/issue-10291.stderr b/tests/ui/lifetimes/closure-lifetime-bounds-10291.stderr index 68ed9a0de5d..34f8ca40871 100644 --- a/tests/ui/issues/issue-10291.stderr +++ b/tests/ui/lifetimes/closure-lifetime-bounds-10291.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-10291.rs:3:9 + --> $DIR/closure-lifetime-bounds-10291.rs:5:9 | LL | fn test<'x>(x: &'x isize) { | -- lifetime `'x` defined here diff --git a/tests/ui/issues/issue-11374.rs b/tests/ui/lifetimes/container-lifetime-error-11374.rs index 60ee256c65a..59d13d04e46 100644 --- a/tests/ui/issues/issue-11374.rs +++ b/tests/ui/lifetimes/container-lifetime-error-11374.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/11374 + use std::io::{self, Read}; use std::vec; diff --git a/tests/ui/issues/issue-11374.stderr b/tests/ui/lifetimes/container-lifetime-error-11374.stderr index 3ae5cfc79f8..a29b5ae137c 100644 --- a/tests/ui/issues/issue-11374.stderr +++ b/tests/ui/lifetimes/container-lifetime-error-11374.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-11374.rs:27:15 + --> $DIR/container-lifetime-error-11374.rs:29:15 | LL | c.read_to(v); | ------- ^ expected `&mut [u8]`, found `Vec<_>` @@ -9,7 +9,7 @@ LL | c.read_to(v); = note: expected mutable reference `&mut [u8]` found struct `Vec<_>` note: method defined here - --> $DIR/issue-11374.rs:13:12 + --> $DIR/container-lifetime-error-11374.rs:15:12 | LL | pub fn read_to(&mut self, vec: &mut [u8]) { | ^^^^^^^ -------------- @@ -19,7 +19,7 @@ LL | c.read_to(&mut v); | ++++ error[E0515]: cannot return value referencing local variable `r` - --> $DIR/issue-11374.rs:20:5 + --> $DIR/container-lifetime-error-11374.rs:22:5 | LL | Container::wrap(&mut r as &mut dyn io::Read) | ^^^^^^^^^^^^^^^^------^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-10228.rs b/tests/ui/lifetimes/enum-lifetime-container-10228.rs index a59ccf926f9..ebbefb619c6 100644 --- a/tests/ui/issues/issue-10228.rs +++ b/tests/ui/lifetimes/enum-lifetime-container-10228.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10228 + //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] diff --git a/tests/ui/issues/issue-10412.rs b/tests/ui/lifetimes/keyword-self-lifetime-error-10412.rs index 68ce0c2ea3c..a5b303df2fd 100644 --- a/tests/ui/issues/issue-10412.rs +++ b/tests/ui/lifetimes/keyword-self-lifetime-error-10412.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10412 + trait Serializable<'self, T> { //~^ ERROR lifetimes cannot use keyword names fn serialize(val: &'self T) -> Vec<u8>; //~ ERROR lifetimes cannot use keyword names diff --git a/tests/ui/issues/issue-10412.stderr b/tests/ui/lifetimes/keyword-self-lifetime-error-10412.stderr index c74ba1306cc..236bdf1ac85 100644 --- a/tests/ui/issues/issue-10412.stderr +++ b/tests/ui/lifetimes/keyword-self-lifetime-error-10412.stderr @@ -1,47 +1,47 @@ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:1:20 + --> $DIR/keyword-self-lifetime-error-10412.rs:3:20 | LL | trait Serializable<'self, T> { | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:3:24 + --> $DIR/keyword-self-lifetime-error-10412.rs:5:24 | LL | fn serialize(val: &'self T) -> Vec<u8>; | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:4:37 + --> $DIR/keyword-self-lifetime-error-10412.rs:6:37 | LL | fn deserialize(repr: &[u8]) -> &'self T; | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:7:6 + --> $DIR/keyword-self-lifetime-error-10412.rs:9:6 | LL | impl<'self> Serializable<str> for &'self str { | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:7:36 + --> $DIR/keyword-self-lifetime-error-10412.rs:9:36 | LL | impl<'self> Serializable<str> for &'self str { | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:11:24 + --> $DIR/keyword-self-lifetime-error-10412.rs:13:24 | LL | fn serialize(val: &'self str) -> Vec<u8> { | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:15:37 + --> $DIR/keyword-self-lifetime-error-10412.rs:17:37 | LL | fn deserialize(repr: &[u8]) -> &'self str { | ^^^^^ error[E0726]: implicit elided lifetime not allowed here - --> $DIR/issue-10412.rs:7:13 + --> $DIR/keyword-self-lifetime-error-10412.rs:9:13 | LL | impl<'self> Serializable<str> for &'self str { | ^^^^^^^^^^^^^^^^^ expected lifetime parameter diff --git a/tests/ui/issues/issue-10902.rs b/tests/ui/lifetimes/tuple-struct-vs-struct-with-fields-borrowck-10902.rs index 7cdf8808aa0..97c0d0bf554 100644 --- a/tests/ui/issues/issue-10902.rs +++ b/tests/ui/lifetimes/tuple-struct-vs-struct-with-fields-borrowck-10902.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10902 + //@ check-pass #![allow(dead_code)] diff --git a/tests/ui/linkage-attr/incompatible-flavor.rs b/tests/ui/linkage-attr/incompatible-flavor.rs index 7f583f47e2f..4711343f9c9 100644 --- a/tests/ui/linkage-attr/incompatible-flavor.rs +++ b/tests/ui/linkage-attr/incompatible-flavor.rs @@ -1,5 +1,5 @@ //@ compile-flags: --target=x86_64-unknown-linux-gnu -C linker-flavor=msvc --crate-type=rlib -//@ needs-llvm-components: +//@ needs-llvm-components: x86 #![feature(no_core)] #![no_core] diff --git a/tests/ui/linkage-attr/raw-dylib/elf/empty.rs b/tests/ui/linkage-attr/raw-dylib/elf/empty.rs new file mode 100644 index 00000000000..2e48a5f0526 --- /dev/null +++ b/tests/ui/linkage-attr/raw-dylib/elf/empty.rs @@ -0,0 +1,11 @@ +//@ only-x86_64-unknown-linux-gnu +//@ needs-dynamic-linking +//@ build-pass + +#![allow(incomplete_features)] +#![feature(raw_dylib_elf)] + +#[link(name = "hack", kind = "raw-dylib")] +unsafe extern "C" {} + +fn main() {} diff --git a/tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs b/tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs new file mode 100644 index 00000000000..57492ed2d0e --- /dev/null +++ b/tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs @@ -0,0 +1,80 @@ +//@ only-x86_64-unknown-linux-gnu +//@ needs-dynamic-linking +//@ run-pass +//@ compile-flags: -Cpanic=abort +//@ edition: 2024 + +#![allow(incomplete_features)] +#![feature(raw_dylib_elf)] +#![no_std] +#![no_main] + +use core::ffi::{c_char, c_int}; + +extern "C" fn callback( + _fpath: *const c_char, + _sb: *const (), + _tflag: c_int, + _ftwbuf: *const (), +) -> c_int { + 0 +} + +// `libc.so` is a linker script that provides the paths to `libc.so.6` and `libc_nonshared.a`. +// In earlier versions of glibc, `libc_nonshared.a` provides the symbols `__libc_csu_init` and +// `__libc_csu_fini` required by `Scrt1.o`. +#[link(name = "c_nonshared", kind = "static")] +unsafe extern "C" {} + +#[link(name = "libc.so.6", kind = "raw-dylib", modifiers = "+verbatim")] +unsafe extern "C" { + #[link_name = "nftw@GLIBC_2.2.5"] + unsafe fn nftw_2_2_5( + dirpath: *const c_char, + f: extern "C" fn(*const c_char, *const (), c_int, *const ()) -> c_int, + nopenfd: c_int, + flags: c_int, + ) -> c_int; + #[link_name = "nftw@GLIBC_2.3.3"] + unsafe fn nftw_2_3_3( + dirpath: *const c_char, + f: extern "C" fn(*const c_char, *const (), c_int, *const ()) -> c_int, + nopenfd: c_int, + flags: c_int, + ) -> c_int; + #[link_name = "exit@GLIBC_2.2.5"] + safe fn exit(status: i32) -> !; + unsafe fn __libc_start_main() -> c_int; +} + +#[unsafe(no_mangle)] +extern "C" fn main() -> ! { + unsafe { + // The old `nftw` does not check whether unknown flags are set. + let res = nftw_2_2_5(c".".as_ptr(), callback, 20, 1 << 30); + assert_eq!(res, 0); + } + unsafe { + // The new `nftw` does. + let res = nftw_2_3_3(c".".as_ptr(), callback, 20, 1 << 30); + assert_eq!(res, -1); + } + exit(0); +} + +#[cfg(not(test))] +#[panic_handler] +fn panic_handler(_: &core::panic::PanicInfo<'_>) -> ! { + exit(1); +} + +#[unsafe(no_mangle)] +extern "C" fn rust_eh_personality( + _version: i32, + _actions: i32, + _exception_class: u64, + _exception_object: *mut (), + _context: *mut (), +) -> i32 { + exit(1); +} diff --git a/tests/ui/linkage-attr/raw-dylib/elf/malformed-link-name.rs b/tests/ui/linkage-attr/raw-dylib/elf/malformed-link-name.rs new file mode 100644 index 00000000000..46e3798284b --- /dev/null +++ b/tests/ui/linkage-attr/raw-dylib/elf/malformed-link-name.rs @@ -0,0 +1,20 @@ +//@ only-elf +//@ needs-dynamic-linking +//@ check-fail + +#![feature(raw_dylib_elf)] +#![allow(incomplete_features)] + +#[link(name = "libc.so.6", kind = "raw-dylib", modifiers = "+verbatim")] +unsafe extern "C" { + #[link_name = "exit@"] + pub safe fn exit_0(status: i32) -> !; //~ ERROR link name must be well-formed if link kind is `raw-dylib` + #[link_name = "@GLIBC_2.2.5"] + pub safe fn exit_1(status: i32) -> !; //~ ERROR link name must be well-formed if link kind is `raw-dylib` + #[link_name = "ex\0it@GLIBC_2.2.5"] + pub safe fn exit_2(status: i32) -> !; //~ ERROR link name must be well-formed if link kind is `raw-dylib` + #[link_name = "exit@@GLIBC_2.2.5"] + pub safe fn exit_3(status: i32) -> !; //~ ERROR link name must be well-formed if link kind is `raw-dylib` +} + +fn main() {} diff --git a/tests/ui/linkage-attr/raw-dylib/elf/malformed-link-name.stderr b/tests/ui/linkage-attr/raw-dylib/elf/malformed-link-name.stderr new file mode 100644 index 00000000000..5a979e7a3b1 --- /dev/null +++ b/tests/ui/linkage-attr/raw-dylib/elf/malformed-link-name.stderr @@ -0,0 +1,26 @@ +error: link name must be well-formed if link kind is `raw-dylib` + --> $DIR/malformed-link-name.rs:11:5 + | +LL | pub safe fn exit_0(status: i32) -> !; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: link name must be well-formed if link kind is `raw-dylib` + --> $DIR/malformed-link-name.rs:13:5 + | +LL | pub safe fn exit_1(status: i32) -> !; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: link name must be well-formed if link kind is `raw-dylib` + --> $DIR/malformed-link-name.rs:15:5 + | +LL | pub safe fn exit_2(status: i32) -> !; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: link name must be well-formed if link kind is `raw-dylib` + --> $DIR/malformed-link-name.rs:17:5 + | +LL | pub safe fn exit_3(status: i32) -> !; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/tests/ui/linkage-attr/unstable-flavor.rs b/tests/ui/linkage-attr/unstable-flavor.rs index 6aa9efb58d1..5412e248f34 100644 --- a/tests/ui/linkage-attr/unstable-flavor.rs +++ b/tests/ui/linkage-attr/unstable-flavor.rs @@ -4,9 +4,9 @@ // //@ revisions: bpf ptx //@ [bpf] compile-flags: --target=bpfel-unknown-none -C linker-flavor=bpf --crate-type=rlib -//@ [bpf] needs-llvm-components: +//@ [bpf] needs-llvm-components: bpf //@ [ptx] compile-flags: --target=nvptx64-nvidia-cuda -C linker-flavor=ptx --crate-type=rlib -//@ [ptx] needs-llvm-components: +//@ [ptx] needs-llvm-components: nvptx #![feature(no_core)] #![no_core] diff --git a/tests/ui/lint/bare-trait-objects-path.stderr b/tests/ui/lint/bare-trait-objects-path.stderr index 25f3e857806..8da63a9c546 100644 --- a/tests/ui/lint/bare-trait-objects-path.stderr +++ b/tests/ui/lint/bare-trait-objects-path.stderr @@ -5,7 +5,7 @@ LL | Dyn::func(); | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -19,7 +19,7 @@ LL | ::Dyn::func(); | ^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | <dyn (::Dyn)>::func(); @@ -32,7 +32,7 @@ LL | Dyn::CONST; | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | <dyn Dyn>::CONST; @@ -45,7 +45,7 @@ LL | let _: Dyn::Ty; | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let _: <dyn Dyn>::Ty; diff --git a/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr index a1aa29dd697..2be7416711e 100644 --- a/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr @@ -5,7 +5,7 @@ LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: requested on the command line with `--force-warn bare-trait-objects` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/lint/force-warn/cap-lints-allow.stderr b/tests/ui/lint/force-warn/cap-lints-allow.stderr index 0d10a43a14d..92bcde11415 100644 --- a/tests/ui/lint/force-warn/cap-lints-allow.stderr +++ b/tests/ui/lint/force-warn/cap-lints-allow.stderr @@ -5,7 +5,7 @@ LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: requested on the command line with `--force-warn bare-trait-objects` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr index d1b764b3414..74b34de90f1 100644 --- a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr @@ -5,7 +5,7 @@ LL | 0...100 => true, | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility` warning: 1 warning emitted diff --git a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr index d52bd67e36a..5bfbc9599bc 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr @@ -5,7 +5,7 @@ LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr index 22483a3d874..dabf12be5ff 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr @@ -5,7 +5,7 @@ LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr index aa183b9ba54..23a3a9107a1 100644 --- a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr +++ b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr @@ -5,7 +5,7 @@ LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/lint/inclusive-range-pattern-syntax.stderr b/tests/ui/lint/inclusive-range-pattern-syntax.stderr index ed9fa0d4101..a41082bb13b 100644 --- a/tests/ui/lint/inclusive-range-pattern-syntax.stderr +++ b/tests/ui/lint/inclusive-range-pattern-syntax.stderr @@ -5,7 +5,7 @@ LL | 1...2 => {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/inclusive-range-pattern-syntax.rs:4:9 | @@ -19,7 +19,7 @@ LL | &1...2 => {} | ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> warning: 2 warnings emitted diff --git a/tests/ui/lint/lint-attr-everywhere-early.stderr b/tests/ui/lint/lint-attr-everywhere-early.stderr index fac0eb4faff..2389b698c83 100644 --- a/tests/ui/lint/lint-attr-everywhere-early.stderr +++ b/tests/ui/lint/lint-attr-everywhere-early.stderr @@ -391,7 +391,7 @@ LL | Match{f1: 0...100} => {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/lint-attr-everywhere-early.rs:138:16 | @@ -489,7 +489,7 @@ LL | f1: 0...100, | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/lint-attr-everywhere-early.rs:174:20 | diff --git a/tests/ui/issues/issue-10853.rs b/tests/ui/lint/missing-doc-unsugard-doc-attr-10853.rs index 4c22393d9c0..ec13ae99787 100644 --- a/tests/ui/issues/issue-10853.rs +++ b/tests/ui/lint/missing-doc-unsugard-doc-attr-10853.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10853 + //@ check-pass #![deny(missing_docs)] diff --git a/tests/ui/lint/must_not_suspend/mutex.rs b/tests/ui/lint/must_not_suspend/mutex.rs index d14f7130b4c..8dd4cc17615 100644 --- a/tests/ui/lint/must_not_suspend/mutex.rs +++ b/tests/ui/lint/must_not_suspend/mutex.rs @@ -5,7 +5,7 @@ async fn other() {} pub async fn uhoh(m: std::sync::Mutex<()>) { - let _guard = m.lock().unwrap(); //~ ERROR `MutexGuard` held across + let _guard = m.lock().unwrap(); //~ ERROR `std::sync::MutexGuard` held across other().await; } diff --git a/tests/ui/lint/must_not_suspend/mutex.stderr b/tests/ui/lint/must_not_suspend/mutex.stderr index ca53a753150..0db1f2575b1 100644 --- a/tests/ui/lint/must_not_suspend/mutex.stderr +++ b/tests/ui/lint/must_not_suspend/mutex.stderr @@ -1,4 +1,4 @@ -error: `MutexGuard` held across a suspend point, but should not be +error: `std::sync::MutexGuard` held across a suspend point, but should not be --> $DIR/mutex.rs:8:9 | LL | let _guard = m.lock().unwrap(); diff --git a/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout b/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout index d63abea9230..80abac44ca8 100644 --- a/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout +++ b/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; // This ensures that ICEs like rust#94953 don't happen //@ check-pass //@ compile-flags: -Z unpretty=expanded diff --git a/tests/ui/lint/static-mut-refs.e2021.stderr b/tests/ui/lint/static-mut-refs.e2021.stderr index 320e0cee8e8..75a7e60690c 100644 --- a/tests/ui/lint/static-mut-refs.e2021.stderr +++ b/tests/ui/lint/static-mut-refs.e2021.stderr @@ -4,7 +4,7 @@ warning: creating a shared reference to mutable static LL | let _y = &X; | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw const` instead to create a raw pointer @@ -18,7 +18,7 @@ warning: creating a mutable reference to mutable static LL | let _y = &mut X; | ^^^^^^ mutable reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | @@ -31,7 +31,7 @@ warning: creating a shared reference to mutable static LL | let ref _a = X; | ^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a shared reference to mutable static @@ -40,7 +40,7 @@ warning: creating a shared reference to mutable static LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -53,7 +53,7 @@ warning: creating a shared reference to mutable static LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -66,7 +66,7 @@ warning: creating a shared reference to mutable static LL | foo(&X); | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -79,7 +79,7 @@ warning: creating a shared reference to mutable static LL | let _ = Z.len(); | ^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a shared reference to mutable static @@ -88,7 +88,7 @@ warning: creating a shared reference to mutable static LL | let _ = format!("{:?}", Z); | ^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a shared reference to mutable static @@ -97,7 +97,7 @@ warning: creating a shared reference to mutable static LL | let _v = &A.value; | ^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -110,7 +110,7 @@ warning: creating a shared reference to mutable static LL | let _s = &A.s.value; | ^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -123,7 +123,7 @@ warning: creating a shared reference to mutable static LL | let ref _v = A.value; | ^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a mutable reference to mutable static @@ -135,7 +135,7 @@ LL | &mut ($x.0) LL | let _x = bar!(FOO); | --------- in this macro invocation | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives = note: this warning originates in the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/lint/static-mut-refs.e2024.stderr b/tests/ui/lint/static-mut-refs.e2024.stderr index bf7ffc62ce1..42a96bafc88 100644 --- a/tests/ui/lint/static-mut-refs.e2024.stderr +++ b/tests/ui/lint/static-mut-refs.e2024.stderr @@ -4,7 +4,7 @@ error: creating a shared reference to mutable static LL | let _y = &X; | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives = note: `#[deny(static_mut_refs)]` on by default help: use `&raw const` instead to create a raw pointer @@ -18,7 +18,7 @@ error: creating a mutable reference to mutable static LL | let _y = &mut X; | ^^^^^^ mutable reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | @@ -31,7 +31,7 @@ error: creating a shared reference to mutable static LL | let ref _a = X; | ^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives error: creating a shared reference to mutable static @@ -40,7 +40,7 @@ error: creating a shared reference to mutable static LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -53,7 +53,7 @@ error: creating a shared reference to mutable static LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -66,7 +66,7 @@ error: creating a shared reference to mutable static LL | foo(&X); | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -79,7 +79,7 @@ error: creating a shared reference to mutable static LL | let _ = Z.len(); | ^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives error: creating a shared reference to mutable static @@ -88,7 +88,7 @@ error: creating a shared reference to mutable static LL | let _ = format!("{:?}", Z); | ^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives error: creating a shared reference to mutable static @@ -97,7 +97,7 @@ error: creating a shared reference to mutable static LL | let _v = &A.value; | ^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -110,7 +110,7 @@ error: creating a shared reference to mutable static LL | let _s = &A.s.value; | ^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -123,7 +123,7 @@ error: creating a shared reference to mutable static LL | let ref _v = A.value; | ^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives error: creating a mutable reference to mutable static @@ -135,7 +135,7 @@ LL | &mut ($x.0) LL | let _x = bar!(FOO); | --------- in this macro invocation | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives = note: this error originates in the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/lint/unused/unused-attr-duplicate.stderr b/tests/ui/lint/unused/unused-attr-duplicate.stderr index ecc1b7ff5a4..e277f5203c6 100644 --- a/tests/ui/lint/unused/unused-attr-duplicate.stderr +++ b/tests/ui/lint/unused/unused-attr-duplicate.stderr @@ -16,18 +16,6 @@ LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ error: unused attribute - --> $DIR/unused-attr-duplicate.rs:37:1 - | -LL | #[macro_use] - | ^^^^^^^^^^^^ help: remove this attribute - | -note: attribute also specified here - --> $DIR/unused-attr-duplicate.rs:36:1 - | -LL | #[macro_use] - | ^^^^^^^^^^^^ - -error: unused attribute --> $DIR/unused-attr-duplicate.rs:55:1 | LL | #[should_panic(expected = "values don't match")] @@ -129,6 +117,18 @@ LL | #[macro_export] | ^^^^^^^^^^^^^^^ error: unused attribute + --> $DIR/unused-attr-duplicate.rs:37:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ help: remove this attribute + | +note: attribute also specified here + --> $DIR/unused-attr-duplicate.rs:36:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error: unused attribute --> $DIR/unused-attr-duplicate.rs:47:1 | LL | #[path = "bar.rs"] diff --git a/tests/ui/lint/unused/unused-attr-macro-rules.stderr b/tests/ui/lint/unused/unused-attr-macro-rules.stderr index 4698e381425..1e1211af5e2 100644 --- a/tests/ui/lint/unused/unused-attr-macro-rules.stderr +++ b/tests/ui/lint/unused/unused-attr-macro-rules.stderr @@ -1,8 +1,8 @@ -error: `#[macro_use]` only has an effect on `extern crate` and modules - --> $DIR/unused-attr-macro-rules.rs:7:1 +error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` + --> $DIR/unused-attr-macro-rules.rs:9:1 | -LL | #[macro_use] - | ^^^^^^^^^^^^ +LL | #[recursion_limit="1"] + | ^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/unused-attr-macro-rules.rs:1:9 @@ -10,11 +10,11 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/unused-attr-macro-rules.rs:9:1 +error: `#[macro_use]` only has an effect on `extern crate` and modules + --> $DIR/unused-attr-macro-rules.rs:7:1 | -LL | #[recursion_limit="1"] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[macro_use] + | ^^^^^^^^^^^^ error: `#[path]` only has an effect on modules --> $DIR/unused-attr-macro-rules.rs:8:1 diff --git a/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.fixed b/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.fixed new file mode 100644 index 00000000000..4b0bca3d44a --- /dev/null +++ b/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.fixed @@ -0,0 +1,12 @@ +//@ run-rustfix + +#![deny(unused_parens)] +#![allow(warnings)] +trait MyTrait {} + +fn foo(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait) + Send + Sync>) {} + +//~v ERROR unnecessary parentheses around type +fn bar(_: Box<dyn FnMut(&mut u32) -> &mut dyn MyTrait>) {} + +fn main() {} diff --git a/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.rs b/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.rs new file mode 100644 index 00000000000..4eefd3dc81a --- /dev/null +++ b/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.rs @@ -0,0 +1,12 @@ +//@ run-rustfix + +#![deny(unused_parens)] +#![allow(warnings)] +trait MyTrait {} + +fn foo(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait) + Send + Sync>) {} + +//~v ERROR unnecessary parentheses around type +fn bar(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait)>) {} + +fn main() {} diff --git a/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.stderr b/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.stderr new file mode 100644 index 00000000000..89455e3db73 --- /dev/null +++ b/tests/ui/lint/unused/unused-parens-false-positive-issue-143653.stderr @@ -0,0 +1,19 @@ +error: unnecessary parentheses around type + --> $DIR/unused-parens-false-positive-issue-143653.rs:10:43 + | +LL | fn bar(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait)>) {} + | ^ ^ + | +note: the lint level is defined here + --> $DIR/unused-parens-false-positive-issue-143653.rs:3:9 + | +LL | #![deny(unused_parens)] + | ^^^^^^^^^^^^^ +help: remove these parentheses + | +LL - fn bar(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait)>) {} +LL + fn bar(_: Box<dyn FnMut(&mut u32) -> &mut dyn MyTrait>) {} + | + +error: aborting due to 1 previous error + diff --git a/tests/ui/loop-match/suggest-const-item.rs b/tests/ui/loop-match/suggest-const-item.rs new file mode 100644 index 00000000000..f921b430b8c --- /dev/null +++ b/tests/ui/loop-match/suggest-const-item.rs @@ -0,0 +1,174 @@ +#![allow(incomplete_features)] +#![feature(loop_match)] +#![feature(generic_const_items)] +#![crate_type = "lib"] + +const fn const_fn() -> i32 { + 1 +} + +#[unsafe(no_mangle)] +fn suggest_const_block<const N: i32>() -> i32 { + let mut state = 0; + #[loop_match] + loop { + state = 'blk: { + match state { + 0 => { + #[const_continue] + break 'blk const_fn(); + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + 1 => { + #[const_continue] + break 'blk const { const_fn() }; + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + 2 => { + #[const_continue] + break 'blk N; + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + _ => { + #[const_continue] + break 'blk 1 + 1; + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + } + } + } + state +} + +struct S; + +impl S { + const M: usize = 42; + + fn g() { + let mut state = 0; + #[loop_match] + loop { + state = 'blk: { + match state { + 0 => { + #[const_continue] + break 'blk Self::M; + } + _ => panic!(), + } + } + } + } +} + +trait T { + const N: usize; + + fn f() { + let mut state = 0; + #[loop_match] + loop { + state = 'blk: { + match state { + 0 => { + #[const_continue] + break 'blk Self::N; + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + _ => panic!(), + } + } + } + } +} + +impl T for S { + const N: usize = 1; +} + +impl S { + fn h() { + let mut state = 0; + #[loop_match] + loop { + state = 'blk: { + match state { + 0 => { + #[const_continue] + break 'blk Self::N; + } + _ => panic!(), + } + } + } + } +} + +trait T2<U> { + const L: u32; + + fn p() { + let mut state = 0; + #[loop_match] + loop { + state = 'blk: { + match state { + 0 => { + #[const_continue] + break 'blk Self::L; + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + _ => panic!(), + } + } + } + } +} + +const SIZE_OF<T>: usize = size_of::<T>(); + +fn q<T>() { + let mut state = 0; + #[loop_match] + loop { + state = 'blk: { + match state { + 0 => { + #[const_continue] + break 'blk SIZE_OF::<T>; + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + _ => panic!(), + } + } + } +} + +trait Trait<T> { + const X: usize = 9000; + const Y: usize = size_of::<T>(); +} + +impl<T> Trait<T> for () {} + +fn r<T>() { + let mut state = 0; + #[loop_match] + loop { + state = 'blk: { + match state { + 0 => { + #[const_continue] + break 'blk <() as Trait<T>>::X; + } + 1 => { + #[const_continue] + break 'blk <() as Trait<T>>::Y; + //~^ ERROR could not determine the target branch for this `#[const_continue]` + } + _ => panic!(), + } + } + } +} diff --git a/tests/ui/loop-match/suggest-const-item.stderr b/tests/ui/loop-match/suggest-const-item.stderr new file mode 100644 index 00000000000..787474479ad --- /dev/null +++ b/tests/ui/loop-match/suggest-const-item.stderr @@ -0,0 +1,58 @@ +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:19:32 + | +LL | break 'blk const_fn(); + | ^^^^^^^^^^ this value must be a literal or a monomorphic const + | + = help: try extracting the expression into a `const` item + +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:24:32 + | +LL | break 'blk const { const_fn() }; + | ^^^^^^^^^^^^^^^^^^^^ `const` blocks may use generics, and are not evaluated early enough + | + = help: try extracting the expression into a `const` item + +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:29:32 + | +LL | break 'blk N; + | ^ constant parameters may use generics, and are not evaluated early enough + | + = help: try extracting the expression into a `const` item + +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:34:32 + | +LL | break 'blk 1 + 1; + | ^^^^^ this value must be a literal or a monomorphic const + | + = help: try extracting the expression into a `const` item + +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:76:36 + | +LL | break 'blk Self::N; + | ^^^^^^^ this value is too generic + +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:119:36 + | +LL | break 'blk Self::L; + | ^^^^^^^ this value is too generic + +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:139:32 + | +LL | break 'blk SIZE_OF::<T>; + | ^^^^^^^^^^^^ this value is too generic + +error: could not determine the target branch for this `#[const_continue]` + --> $DIR/suggest-const-item.rs:167:32 + | +LL | break 'blk <() as Trait<T>>::Y; + | ^^^^^^^^^^^^^^^^^^^ this value is too generic + +error: aborting due to 8 previous errors + diff --git a/tests/ui/loop-match/upvar-scrutinee.rs b/tests/ui/loop-match/upvar-scrutinee.rs new file mode 100644 index 00000000000..a93e3a0e59a --- /dev/null +++ b/tests/ui/loop-match/upvar-scrutinee.rs @@ -0,0 +1,81 @@ +#![allow(incomplete_features)] +#![feature(loop_match)] + +#[derive(Clone, Copy)] +enum State { + A, + B, +} + +fn main() { + let mut state = State::A; + + #[loop_match] + loop { + state = 'blk: { + match state { + State::A => { + #[const_continue] + break 'blk State::B; + } + State::B => { + return; + } + } + } + } + + || { + #[loop_match] + loop { + state = 'blk: { + match state { + //~^ ERROR invalid match on `#[loop_match]` state + State::A => { + #[const_continue] + break 'blk State::B; + } + State::B => { + return; + } + } + } + } + }; + + || { + let mut state = state; + #[loop_match] + loop { + state = 'blk: { + match state { + State::A => { + #[const_continue] + break 'blk State::B; + } + State::B => { + return; + } + } + } + } + }; + + move || { + #[loop_match] + loop { + state = 'blk: { + match state { + //~^ ERROR invalid match on `#[loop_match]` state + State::A => { + #[const_continue] + break 'blk State::B; + } + State::B => { + return; + } + } + } + } + }; +} diff --git a/tests/ui/loop-match/upvar-scrutinee.stderr b/tests/ui/loop-match/upvar-scrutinee.stderr new file mode 100644 index 00000000000..b7a0a90193d --- /dev/null +++ b/tests/ui/loop-match/upvar-scrutinee.stderr @@ -0,0 +1,18 @@ +error: invalid match on `#[loop_match]` state + --> $DIR/upvar-scrutinee.rs:32:23 + | +LL | match state { + | ^^^^^ + | + = note: a local variable must be the scrutinee within a `#[loop_match]` + +error: invalid match on `#[loop_match]` state + --> $DIR/upvar-scrutinee.rs:68:23 + | +LL | match state { + | ^^^^^ + | + = note: a local variable must be the scrutinee within a `#[loop_match]` + +error: aborting due to 2 previous errors + diff --git a/tests/ui/lto/all-crates.rs b/tests/ui/lto/all-crates.rs index ceabf9f05df..fa17684dcff 100644 --- a/tests/ui/lto/all-crates.rs +++ b/tests/ui/lto/all-crates.rs @@ -2,6 +2,7 @@ //@ compile-flags: -Clto=thin //@ no-prefer-dynamic +//@ ignore-backends: gcc fn main() { println!("hello!"); diff --git a/tests/ui/lto/lto-thin-rustc-loads-linker-plugin.rs b/tests/ui/lto/lto-thin-rustc-loads-linker-plugin.rs index a38d0e2b2e3..8579fd599f7 100644 --- a/tests/ui/lto/lto-thin-rustc-loads-linker-plugin.rs +++ b/tests/ui/lto/lto-thin-rustc-loads-linker-plugin.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ compile-flags: -C lto=thin //@ aux-build:lto-rustc-loads-linker-plugin.rs //@ run-pass diff --git a/tests/ui/lto/thin-lto-inlines2.rs b/tests/ui/lto/thin-lto-inlines2.rs index 735557ab491..4c7b9278b08 100644 --- a/tests/ui/lto/thin-lto-inlines2.rs +++ b/tests/ui/lto/thin-lto-inlines2.rs @@ -4,6 +4,7 @@ //@ aux-build:thin-lto-inlines-aux.rs //@ no-prefer-dynamic //@ ignore-emscripten can't inspect instructions on emscripten +//@ ignore-backends: gcc // We want to assert here that ThinLTO will inline across codegen units. There's // not really a great way to do that in general so we sort of hack around it by diff --git a/tests/ui/macros/expr_2021_cargo_fix_edition.stderr b/tests/ui/macros/expr_2021_cargo_fix_edition.stderr index a2c281d9c0a..795d99449c2 100644 --- a/tests/ui/macros/expr_2021_cargo_fix_edition.stderr +++ b/tests/ui/macros/expr_2021_cargo_fix_edition.stderr @@ -5,7 +5,7 @@ LL | ($e:expr) => { | ^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see Migration Guide <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/macro-fragment-specifiers.html> + = note: for more information, see Migration Guide <https://doc.rust-lang.org/edition-guide/rust-2024/macro-fragment-specifiers.html> note: the lint level is defined here --> $DIR/expr_2021_cargo_fix_edition.rs:4:9 | @@ -23,7 +23,7 @@ LL | ($($i:expr)*) => { }; | ^^^^ | = warning: this changes meaning in Rust 2024 - = note: for more information, see Migration Guide <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/macro-fragment-specifiers.html> + = note: for more information, see Migration Guide <https://doc.rust-lang.org/edition-guide/rust-2024/macro-fragment-specifiers.html> help: to keep the existing behavior, use the `expr_2021` fragment specifier | LL | ($($i:expr_2021)*) => { }; diff --git a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout index 7c41225f95e..ba93384644d 100644 --- a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout +++ b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir //@ edition: 2015 diff --git a/tests/ui/issues/issue-34418.rs b/tests/ui/macros/macro-invocation-with-curly-braces-34418.rs index 0dcefb01935..46dbdd35ef6 100644 --- a/tests/ui/issues/issue-34418.rs +++ b/tests/ui/macros/macro-invocation-with-curly-braces-34418.rs @@ -17,3 +17,5 @@ fn g() { } fn main() {} + +// https://github.com/rust-lang/rust/issues/34418 diff --git a/tests/ui/macros/macro-or-patterns-back-compat.stderr b/tests/ui/macros/macro-or-patterns-back-compat.stderr index e04dfefa4e8..67794f0a8b2 100644 --- a/tests/ui/macros/macro-or-patterns-back-compat.stderr +++ b/tests/ui/macros/macro-or-patterns-back-compat.stderr @@ -5,7 +5,7 @@ LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/or-patterns-macro-rules.html> note: the lint level is defined here --> $DIR/macro-or-patterns-back-compat.rs:4:9 | @@ -19,7 +19,7 @@ LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/or-patterns-macro-rules.html> error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro --> $DIR/macro-or-patterns-back-compat.rs:19:21 @@ -28,7 +28,7 @@ LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/or-patterns-macro-rules.html> error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro --> $DIR/macro-or-patterns-back-compat.rs:23:26 @@ -37,7 +37,7 @@ LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { | ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/or-patterns-macro-rules.html> error: aborting due to 4 previous errors diff --git a/tests/ui/macros/macro-use-all-and-none.stderr b/tests/ui/macros/macro-use-all-and-none.stderr index 00b10dccd00..a5efb065a21 100644 --- a/tests/ui/macros/macro-use-all-and-none.stderr +++ b/tests/ui/macros/macro-use-all-and-none.stderr @@ -1,10 +1,9 @@ warning: unused attribute - --> $DIR/macro-use-all-and-none.rs:7:1 + --> $DIR/macro-use-all-and-none.rs:7:12 | LL | #[macro_use()] - | ^^^^^^^^^^^^^^ help: remove this attribute + | ^^ help: remove this attribute | - = note: attribute `macro_use` with an empty list has no effect note: the lint level is defined here --> $DIR/macro-use-all-and-none.rs:4:9 | diff --git a/tests/ui/macros/macro-use-bad-args-1.rs b/tests/ui/macros/macro-use-bad-args-1.rs index ec0b64a1095..bfc19981804 100644 --- a/tests/ui/macros/macro-use-bad-args-1.rs +++ b/tests/ui/macros/macro-use-bad-args-1.rs @@ -1,6 +1,6 @@ #![no_std] -#[macro_use(foo(bar))] //~ ERROR bad macro import +#[macro_use(foo(bar))] //~ ERROR malformed `macro_use` attribute input extern crate std; fn main() {} diff --git a/tests/ui/macros/macro-use-bad-args-1.stderr b/tests/ui/macros/macro-use-bad-args-1.stderr index 6d2f159a574..2f43d0997df 100644 --- a/tests/ui/macros/macro-use-bad-args-1.stderr +++ b/tests/ui/macros/macro-use-bad-args-1.stderr @@ -1,9 +1,20 @@ -error[E0466]: bad macro import - --> $DIR/macro-use-bad-args-1.rs:3:13 +error[E0565]: malformed `macro_use` attribute input + --> $DIR/macro-use-bad-args-1.rs:3:1 | LL | #[macro_use(foo(bar))] - | ^^^^^^^^ + | ^^^^^^^^^^^^^^^-----^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(foo(bar))] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(foo(bar))] +LL + #[macro_use] + | error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0466`. +For more information about this error, try `rustc --explain E0565`. diff --git a/tests/ui/macros/macro-use-bad-args-2.rs b/tests/ui/macros/macro-use-bad-args-2.rs index c5f8f62c186..e328b6285d9 100644 --- a/tests/ui/macros/macro-use-bad-args-2.rs +++ b/tests/ui/macros/macro-use-bad-args-2.rs @@ -1,6 +1,6 @@ #![no_std] -#[macro_use(foo="bar")] //~ ERROR bad macro import +#[macro_use(foo="bar")] //~ ERROR malformed `macro_use` attribute input extern crate std; fn main() {} diff --git a/tests/ui/macros/macro-use-bad-args-2.stderr b/tests/ui/macros/macro-use-bad-args-2.stderr index 364f3da6e15..d7b03c93588 100644 --- a/tests/ui/macros/macro-use-bad-args-2.stderr +++ b/tests/ui/macros/macro-use-bad-args-2.stderr @@ -1,9 +1,20 @@ -error[E0466]: bad macro import - --> $DIR/macro-use-bad-args-2.rs:3:13 +error[E0565]: malformed `macro_use` attribute input + --> $DIR/macro-use-bad-args-2.rs:3:1 | LL | #[macro_use(foo="bar")] - | ^^^^^^^^^ + | ^^^^^^^^^^^^^^^------^^ + | | + | didn't expect any arguments here + | +help: try changing it to one of the following valid forms of the attribute + | +LL - #[macro_use(foo="bar")] +LL + #[macro_use(name1, name2, ...)] + | +LL - #[macro_use(foo="bar")] +LL + #[macro_use] + | error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0466`. +For more information about this error, try `rustc --explain E0565`. diff --git a/tests/ui/macros/non-fmt-panic.stderr b/tests/ui/macros/non-fmt-panic.stderr index 30b63cb46e2..83410d36586 100644 --- a/tests/ui/macros/non-fmt-panic.stderr +++ b/tests/ui/macros/non-fmt-panic.stderr @@ -74,7 +74,7 @@ LL | assert!(false, S); | ^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | assert!(false, "{}", S); @@ -87,7 +87,7 @@ LL | assert!(false, 123); | ^^^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | assert!(false, "{}", 123); @@ -100,7 +100,7 @@ LL | assert!(false, Some(123)); | ^^^^^^^^^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{:?}" format string to use the `Debug` implementation of `Option<i32>` | LL | assert!(false, "{:?}", Some(123)); @@ -125,7 +125,7 @@ LL | panic!(C); | ^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | panic!("{}", C); @@ -138,7 +138,7 @@ LL | panic!(S); | ^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | panic!("{}", S); @@ -151,7 +151,7 @@ LL | unreachable!(S); | ^ | = note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | unreachable!("{}", S); @@ -164,7 +164,7 @@ LL | unreachable!(S); | ^ | = note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | unreachable!("{}", S); @@ -177,7 +177,7 @@ LL | std::panic!(123); | ^^^ | = note: this usage of `std::panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | std::panic!("{}", 123); @@ -195,7 +195,7 @@ LL | core::panic!(&*"abc"); | ^^^^^^^ | = note: this usage of `core::panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | core::panic!("{}", &*"abc"); @@ -208,7 +208,7 @@ LL | panic!(Some(123)); | ^^^^^^^^^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{:?}" format string to use the `Debug` implementation of `Option<i32>` | LL | panic!("{:?}", Some(123)); @@ -262,7 +262,7 @@ LL | panic!(a!()); | ^^^^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | panic!("{}", a!()); @@ -280,7 +280,7 @@ LL | unreachable!(a!()); | ^^^^ | = note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | unreachable!("{}", a!()); @@ -293,7 +293,7 @@ LL | panic!(format!("{}", 1)); | ^^^^^^^^^^^^^^^^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> = note: the `panic!()` macro supports formatting, so there's no need for the `format!()` macro here help: remove the `format!(..)` macro call | @@ -308,7 +308,7 @@ LL | unreachable!(format!("{}", 1)); | ^^^^^^^^^^^^^^^^ | = note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> = note: the `unreachable!()` macro supports formatting, so there's no need for the `format!()` macro here help: remove the `format!(..)` macro call | @@ -323,7 +323,7 @@ LL | assert!(false, format!("{}", 1)); | ^^^^^^^^^^^^^^^^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> = note: the `assert!()` macro supports formatting, so there's no need for the `format!()` macro here help: remove the `format!(..)` macro call | @@ -338,7 +338,7 @@ LL | debug_assert!(false, format!("{}", 1)); | ^^^^^^^^^^^^^^^^ | = note: this usage of `debug_assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> = note: the `debug_assert!()` macro supports formatting, so there's no need for the `format!()` macro here help: remove the `format!(..)` macro call | @@ -353,7 +353,7 @@ LL | panic![123]; | ^^^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | panic!["{}", 123]; @@ -371,7 +371,7 @@ LL | panic!{123}; | ^^^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | panic!{"{}", 123}; @@ -391,7 +391,7 @@ LL | panic!(v); | help: use std::panic::panic_any instead: `std::panic::panic_any` | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:79:20 @@ -400,7 +400,7 @@ LL | assert!(false, v); | ^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:83:12 @@ -409,7 +409,7 @@ LL | panic!(v); | ^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{:?}" format string to use the `Debug` implementation of `T` | LL | panic!("{:?}", v); @@ -427,7 +427,7 @@ LL | assert!(false, v); | ^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{:?}" format string to use the `Debug` implementation of `T` | LL | assert!(false, "{:?}", v); @@ -440,7 +440,7 @@ LL | panic!(v); | ^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | panic!("{}", v); @@ -458,7 +458,7 @@ LL | assert!(false, v); | ^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | assert!(false, "{}", v); @@ -471,7 +471,7 @@ LL | panic!(v); | ^ | = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | panic!("{}", v); @@ -489,7 +489,7 @@ LL | assert!(false, v); | ^ | = note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html> help: add a "{}" format string to `Display` the message | LL | assert!(false, "{}", v); diff --git a/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout b/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout index 33193c78334..e29655faabe 100644 --- a/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout +++ b/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout @@ -5,10 +5,10 @@ //@ edition: 2015 #![feature(core_intrinsics, generic_assert)] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; fn arbitrary_consuming_method_for_demonstration_purposes() { let elem = 1i32; diff --git a/tests/ui/macros/trace-macro.rs b/tests/ui/macros/trace-macro.rs index ecc6aabe8ca..a85f8f42e7a 100644 --- a/tests/ui/macros/trace-macro.rs +++ b/tests/ui/macros/trace-macro.rs @@ -3,4 +3,7 @@ fn main() { println!("Hello, World!"); + //~^ NOTE trace_macro + //~| NOTE expanding `println! + //~| NOTE to `{ } diff --git a/tests/ui/issues/issue-106755.rs b/tests/ui/marker_trait_attr/conflicting-send-impls-for-marker-trait-106755.rs index d7e7122ebda..891b8c1f74d 100644 --- a/tests/ui/issues/issue-106755.rs +++ b/tests/ui/marker_trait_attr/conflicting-send-impls-for-marker-trait-106755.rs @@ -20,3 +20,5 @@ impl !Send for TestType<i32> {} //~^ ERROR `!Send` impls cannot be specialized fn main() {} + +// https://github.com/rust-lang/rust/issues/106755 diff --git a/tests/ui/marker_trait_attr/conflicting-send-impls-for-marker-trait-106755.stderr b/tests/ui/marker_trait_attr/conflicting-send-impls-for-marker-trait-106755.stderr new file mode 100644 index 00000000000..100b3bf1ae3 --- /dev/null +++ b/tests/ui/marker_trait_attr/conflicting-send-impls-for-marker-trait-106755.stderr @@ -0,0 +1,47 @@ +error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`: + --> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:13:1 + | +LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {} + | ------------------------------------------------------ positive implementation here +LL | +LL | impl<T: MyTrait> !Send for TestType<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here + +error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>` + --> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:17:1 + | +LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {} + | ------------------------------------------------------ first implementation here +... +LL | unsafe impl<T: 'static> Send for TestType<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>` + +error[E0367]: `!Send` impl requires `T: MyTrait` but the struct it is implemented for does not + --> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:13:9 + | +LL | impl<T: MyTrait> !Send for TestType<T> {} + | ^^^^^^^ + | +note: the implementor must specify the same requirement + --> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:9:1 + | +LL | struct TestType<T>(::std::marker::PhantomData<T>); + | ^^^^^^^^^^^^^^^^^^ + +error[E0366]: `!Send` impls cannot be specialized + --> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:19:1 + | +LL | impl !Send for TestType<i32> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `i32` is not a generic parameter +note: use the same sequence of generic lifetime, type and const parameters as the struct definition + --> $DIR/conflicting-send-impls-for-marker-trait-106755.rs:9:1 + | +LL | struct TestType<T>(::std::marker::PhantomData<T>); + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0119, E0366, E0367, E0751. +For more information about an error, try `rustc --explain E0119`. diff --git a/tests/ui/issues/issue-46964.rs b/tests/ui/match/innocent-looking-match-crash-46964.rs index 6a29d91df73..c3efe874703 100644 --- a/tests/ui/issues/issue-46964.rs +++ b/tests/ui/match/innocent-looking-match-crash-46964.rs @@ -17,3 +17,5 @@ pub fn crash() -> bool { } fn main() {} + +// https://github.com/rust-lang/rust/issues/46964 diff --git a/tests/ui/match/issue-82392.stdout b/tests/ui/match/issue-82392.stdout index a0d83d962e7..d7eef049739 100644 --- a/tests/ui/match/issue-82392.stdout +++ b/tests/ui/match/issue-82392.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; // https://github.com/rust-lang/rust/issues/82329 //@ compile-flags: -Zunpretty=hir,typed //@ check-pass diff --git a/tests/ui/issues/issue-53843.rs b/tests/ui/methods/inherent-method-resolution-on-deref-type-53843.rs index d4b0b1e332b..0b2ab9afc39 100644 --- a/tests/ui/issues/issue-53843.rs +++ b/tests/ui/methods/inherent-method-resolution-on-deref-type-53843.rs @@ -24,3 +24,5 @@ fn main() { let pin = Pin(&mut unit); pin.poll(); } + +// https://github.com/rust-lang/rust/issues/53843 diff --git a/tests/ui/mir/meaningless-bound.rs b/tests/ui/mir/meaningless-bound.rs new file mode 100644 index 00000000000..c9427e7ece5 --- /dev/null +++ b/tests/ui/mir/meaningless-bound.rs @@ -0,0 +1,20 @@ +//! Regression test for #140100 and #140365 +//@compile-flags: -C opt-level=1 -Zvalidate-mir + +fn a() +where + b: Sized, + //~^ ERROR cannot find type `b` in this scope +{ + println!() +} + +fn f() -> &'static str +where + Self: Sized, + //~^ ERROR cannot find type `Self` in this scope +{ + "" +} + +fn main() {} diff --git a/tests/ui/mir/meaningless-bound.stderr b/tests/ui/mir/meaningless-bound.stderr new file mode 100644 index 00000000000..dc08def83b6 --- /dev/null +++ b/tests/ui/mir/meaningless-bound.stderr @@ -0,0 +1,19 @@ +error[E0412]: cannot find type `b` in this scope + --> $DIR/meaningless-bound.rs:6:5 + | +LL | b: Sized, + | ^ not found in this scope + +error[E0411]: cannot find type `Self` in this scope + --> $DIR/meaningless-bound.rs:14:5 + | +LL | fn f() -> &'static str + | - `Self` not allowed in a function +LL | where +LL | Self: Sized, + | ^^^^ `Self` is only available in impls, traits, and type definitions + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0411, E0412. +For more information about an error, try `rustc --explain E0411`. diff --git a/tests/ui/mir/mir_drop_order.rs b/tests/ui/mir/mir_drop_order.rs index 21d1054c422..a7a1a26a956 100644 --- a/tests/ui/mir/mir_drop_order.rs +++ b/tests/ui/mir/mir_drop_order.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc use std::cell::RefCell; use std::panic; diff --git a/tests/ui/mir/mir_let_chains_drop_order.rs b/tests/ui/mir/mir_let_chains_drop_order.rs index 8a54f21b57f..1579e298ee7 100644 --- a/tests/ui/mir/mir_let_chains_drop_order.rs +++ b/tests/ui/mir/mir_let_chains_drop_order.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc //@ edition: 2024 // See `mir_drop_order.rs` for more information diff --git a/tests/ui/mir/mir_match_guard_let_chains_drop_order.rs b/tests/ui/mir/mir_match_guard_let_chains_drop_order.rs index e98d57d1154..3196513454b 100644 --- a/tests/ui/mir/mir_match_guard_let_chains_drop_order.rs +++ b/tests/ui/mir/mir_match_guard_let_chains_drop_order.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 //@ [edition2024] edition: 2024 diff --git a/tests/ui/mir/static-by-value-dyn.rs b/tests/ui/mir/static-by-value-dyn.rs new file mode 100644 index 00000000000..f1154ef0860 --- /dev/null +++ b/tests/ui/mir/static-by-value-dyn.rs @@ -0,0 +1,14 @@ +//! Regression test for #121176 +//! KnownPanicsLint used to assert ABI compatibility in the interpreter, +//! which ICEs with unsized statics. +//@ needs-rustc-debug-assertions + +use std::fmt::Debug; + +static STATIC_1: dyn Debug + Sync = *(); +//~^ ERROR the size for values of type `(dyn Debug + Sync + 'static)` cannot be known +//~| ERROR type `()` cannot be dereferenced + +fn main() { + println!("{:?}", &STATIC_1); +} diff --git a/tests/ui/mir/static-by-value-dyn.stderr b/tests/ui/mir/static-by-value-dyn.stderr new file mode 100644 index 00000000000..25ed81326f4 --- /dev/null +++ b/tests/ui/mir/static-by-value-dyn.stderr @@ -0,0 +1,19 @@ +error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time + --> $DIR/static-by-value-dyn.rs:8:1 + | +LL | static STATIC_1: dyn Debug + Sync = *(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` + = note: statics and constants must have a statically known size + +error[E0614]: type `()` cannot be dereferenced + --> $DIR/static-by-value-dyn.rs:8:37 + | +LL | static STATIC_1: dyn Debug + Sync = *(); + | ^^^ can't be dereferenced + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0277, E0614. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/mir/static-by-value-slice.rs b/tests/ui/mir/static-by-value-slice.rs new file mode 100644 index 00000000000..af98be6a74d --- /dev/null +++ b/tests/ui/mir/static-by-value-slice.rs @@ -0,0 +1,10 @@ +//! Regression test for #140332 +//! KnownPanicsLint used to assert ABI compatibility in the interpreter, +//! which ICEs with unsized statics. + +static mut S: [i8] = ["Some thing"; 1]; +//~^ ERROR the size for values of type `[i8]` cannot be known + +fn main() { + assert_eq!(S, [0; 1]); +} diff --git a/tests/ui/mir/static-by-value-slice.stderr b/tests/ui/mir/static-by-value-slice.stderr new file mode 100644 index 00000000000..2d0592943d0 --- /dev/null +++ b/tests/ui/mir/static-by-value-slice.stderr @@ -0,0 +1,12 @@ +error[E0277]: the size for values of type `[i8]` cannot be known at compilation time + --> $DIR/static-by-value-slice.rs:5:1 + | +LL | static mut S: [i8] = ["Some thing"; 1]; + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[i8]` + = note: statics and constants must have a statically known size + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/mir/static-by-value-str.rs b/tests/ui/mir/static-by-value-str.rs new file mode 100644 index 00000000000..88b72f90819 --- /dev/null +++ b/tests/ui/mir/static-by-value-str.rs @@ -0,0 +1,15 @@ +//! Regression test for #139872 +//! KnownPanicsLint used to assert ABI compatibility in the interpreter, +//! which ICEs with unsized statics. + +enum E { + V16(u16), + V32(u32), +} + +static C: (E, u16, str) = (E::V16(0xDEAD), 0x600D, 0xBAD); +//~^ ERROR the size for values of type `str` cannot be known + +pub fn main() { + let (_, n, _) = C; +} diff --git a/tests/ui/mir/static-by-value-str.stderr b/tests/ui/mir/static-by-value-str.stderr new file mode 100644 index 00000000000..6e046e00551 --- /dev/null +++ b/tests/ui/mir/static-by-value-str.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/static-by-value-str.rs:10:1 + | +LL | static C: (E, u16, str) = (E::V16(0xDEAD), 0x600D, 0xBAD); + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `(E, u16, str)`, the trait `Sized` is not implemented for `str` + = note: required because it appears within the type `(E, u16, str)` + = note: statics and constants must have a statically known size + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/mir/unsized-extern-static.rs b/tests/ui/mir/unsized-extern-static.rs new file mode 100644 index 00000000000..386842556ba --- /dev/null +++ b/tests/ui/mir/unsized-extern-static.rs @@ -0,0 +1,13 @@ +//! Regression test for #129109 +//! MIR building used to produce erroneous constants when referring to statics of unsized type. +//@ compile-flags: -Zmir-enable-passes=+GVN -Zvalidate-mir + +extern "C" { + pub static mut symbol: [i8]; + //~^ ERROR the size for values of type `[i8]` +} + +fn main() { + println!("C", unsafe { &symbol }); + //~^ ERROR argument never used +} diff --git a/tests/ui/mir/unsized-extern-static.stderr b/tests/ui/mir/unsized-extern-static.stderr new file mode 100644 index 00000000000..93aed3549d7 --- /dev/null +++ b/tests/ui/mir/unsized-extern-static.stderr @@ -0,0 +1,20 @@ +error: argument never used + --> $DIR/unsized-extern-static.rs:11:19 + | +LL | println!("C", unsafe { &symbol }); + | --- ^^^^^^^^^^^^^^^^^^ argument never used + | | + | formatting specifier missing + +error[E0277]: the size for values of type `[i8]` cannot be known at compilation time + --> $DIR/unsized-extern-static.rs:6:5 + | +LL | pub static mut symbol: [i8]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[i8]` + = note: statics and constants must have a statically known size + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/modules/issue-107649.stderr b/tests/ui/modules/issue-107649.stderr index 802ac669a10..49d7cb4e0aa 100644 --- a/tests/ui/modules/issue-107649.stderr +++ b/tests/ui/modules/issue-107649.stderr @@ -9,8 +9,8 @@ error[E0277]: `Dummy` doesn't implement `Debug` help: consider annotating `Dummy` with `#[derive(Debug)]` --> $DIR/auxiliary/dummy_lib.rs:2:1 | -2 + #[derive(Debug)] -3 | pub struct Dummy; + 2 + #[derive(Debug)] + 3 | pub struct Dummy; | error: aborting due to 1 previous error diff --git a/tests/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr b/tests/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr index 523134a9425..51d0f85c031 100644 --- a/tests/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr +++ b/tests/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr @@ -2,9 +2,11 @@ error[E0507]: cannot move out of `i`, a captured variable in an `Fn` closure --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:9:28 | LL | let i = Box::new(3); - | - captured outer variable + | - ----------- move occurs because `i` has type `Box<usize>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | let _f = to_fn(|| test(i)); - | -- ^ move occurs because `i` has type `Box<usize>`, which does not implement the `Copy` trait + | -- ^ `i` is moved here | | | captured by this `Fn` closure | diff --git a/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr b/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr index c626796e01d..6272455cc57 100644 --- a/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr +++ b/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr @@ -8,6 +8,14 @@ LL | let mut copy: Vec<U> = map.clone().into_values().collect(); | note: `HashMap::<K, V, S>::into_values` takes ownership of the receiver `self`, which moves value --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL +note: if `Hash128_1` implemented `Clone`, you could clone the value + --> $DIR/suggest-clone-when-some-obligation-is-unmet.rs:8:1 + | +LL | pub struct Hash128_1; + | ^^^^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let mut copy: Vec<U> = map.clone().into_values().collect(); + | ----------- you could clone this value help: you could `clone` the value and consume it, if the `Hash128_1: Clone` trait bound could be satisfied | LL - let mut copy: Vec<U> = map.clone().into_values().collect(); diff --git a/tests/ui/never_type/defaulted-never-note.nofallback.stderr b/tests/ui/never_type/defaulted-never-note.nofallback.stderr index 6de323ad12c..b7df6fb7a67 100644 --- a/tests/ui/never_type/defaulted-never-note.nofallback.stderr +++ b/tests/ui/never_type/defaulted-never-note.nofallback.stderr @@ -5,7 +5,7 @@ LL | fn smeg() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: ImplementedForUnitButNotNever` will fail --> $DIR/defaulted-never-note.rs:32:9 @@ -28,7 +28,7 @@ LL | fn smeg() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: ImplementedForUnitButNotNever` will fail --> $DIR/defaulted-never-note.rs:32:9 diff --git a/tests/ui/never_type/dependency-on-fallback-to-unit.stderr b/tests/ui/never_type/dependency-on-fallback-to-unit.stderr index be8075662e0..6ee57d531fb 100644 --- a/tests/ui/never_type/dependency-on-fallback-to-unit.stderr +++ b/tests/ui/never_type/dependency-on-fallback-to-unit.stderr @@ -5,7 +5,7 @@ LL | fn def() { | ^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/dependency-on-fallback-to-unit.rs:12:19 @@ -26,7 +26,7 @@ LL | fn question_mark() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/dependency-on-fallback-to-unit.rs:22:5 @@ -48,7 +48,7 @@ LL | fn def() { | ^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/dependency-on-fallback-to-unit.rs:12:19 @@ -70,7 +70,7 @@ LL | fn question_mark() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/dependency-on-fallback-to-unit.rs:22:5 diff --git a/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr b/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr index 44ebdb43510..64a8ecdf546 100644 --- a/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr +++ b/tests/ui/never_type/diverging-fallback-control-flow.nofallback.stderr @@ -5,7 +5,7 @@ LL | fn assignment() { | ^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: UnitDefault` will fail --> $DIR/diverging-fallback-control-flow.rs:36:13 @@ -25,7 +25,7 @@ LL | fn assignment_rev() { | ^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: UnitDefault` will fail --> $DIR/diverging-fallback-control-flow.rs:50:13 @@ -47,7 +47,7 @@ LL | fn assignment() { | ^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: UnitDefault` will fail --> $DIR/diverging-fallback-control-flow.rs:36:13 @@ -68,7 +68,7 @@ LL | fn assignment_rev() { | ^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: UnitDefault` will fail --> $DIR/diverging-fallback-control-flow.rs:50:13 diff --git a/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr b/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr index 4a8dea42a4d..ec48c38b6d7 100644 --- a/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr +++ b/tests/ui/never_type/diverging-fallback-no-leak.nofallback.stderr @@ -5,7 +5,7 @@ LL | fn main() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Test` will fail --> $DIR/diverging-fallback-no-leak.rs:20:23 @@ -28,7 +28,7 @@ LL | fn main() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Test` will fail --> $DIR/diverging-fallback-no-leak.rs:20:23 diff --git a/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr b/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr index 803af39fd86..48debdd61c8 100644 --- a/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr +++ b/tests/ui/never_type/diverging-fallback-unconstrained-return.nofallback.stderr @@ -5,7 +5,7 @@ LL | fn main() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: UnitReturn` will fail --> $DIR/diverging-fallback-unconstrained-return.rs:39:23 @@ -28,7 +28,7 @@ LL | fn main() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: UnitReturn` will fail --> $DIR/diverging-fallback-unconstrained-return.rs:39:23 diff --git a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr index 365e8869897..d2d108edb4d 100644 --- a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr +++ b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr @@ -5,7 +5,7 @@ LL | fn main() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/dont-suggest-turbofish-from-expansion.rs:14:23 @@ -32,7 +32,7 @@ LL | fn main() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/dont-suggest-turbofish-from-expansion.rs:14:23 diff --git a/tests/ui/never_type/fallback-closure-ret.nofallback.stderr b/tests/ui/never_type/fallback-closure-ret.nofallback.stderr index cf19363a7d8..5651a265888 100644 --- a/tests/ui/never_type/fallback-closure-ret.nofallback.stderr +++ b/tests/ui/never_type/fallback-closure-ret.nofallback.stderr @@ -5,7 +5,7 @@ LL | fn main() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Bar` will fail --> $DIR/fallback-closure-ret.rs:24:5 @@ -28,7 +28,7 @@ LL | fn main() { | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Bar` will fail --> $DIR/fallback-closure-ret.rs:24:5 diff --git a/tests/ui/never_type/impl_trait_fallback.stderr b/tests/ui/never_type/impl_trait_fallback.stderr index 7250db127cd..36d2eae1df2 100644 --- a/tests/ui/never_type/impl_trait_fallback.stderr +++ b/tests/ui/never_type/impl_trait_fallback.stderr @@ -5,7 +5,7 @@ LL | fn should_ret_unit() -> impl T { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: T` will fail --> $DIR/impl_trait_fallback.rs:8:25 @@ -24,7 +24,7 @@ LL | fn should_ret_unit() -> impl T { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: T` will fail --> $DIR/impl_trait_fallback.rs:8:25 diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr index 945db40782e..6a85b9923d3 100644 --- a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr @@ -5,7 +5,7 @@ LL | fn test() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/lint-breaking-2024-assign-underscore.rs:13:9 @@ -32,7 +32,7 @@ LL | fn test() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail --> $DIR/lint-breaking-2024-assign-underscore.rs:13:9 diff --git a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr index c90efd27784..48734f3b3f8 100644 --- a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr +++ b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2015.stderr @@ -5,7 +5,7 @@ LL | unsafe { mem::zeroed() } | ^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -20,7 +20,7 @@ LL | core::mem::transmute(Zst) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -34,7 +34,7 @@ LL | unsafe { Union { a: () }.b } | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly warning: never type fallback affects this raw pointer dereference @@ -44,7 +44,7 @@ LL | unsafe { *ptr::from_ref(&()).cast() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -58,7 +58,7 @@ LL | unsafe { internally_create(x) } | ^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -72,7 +72,7 @@ LL | unsafe { zeroed() } | ^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -86,7 +86,7 @@ LL | let zeroed = mem::zeroed; | ^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -100,7 +100,7 @@ LL | let f = internally_create; | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -114,7 +114,7 @@ LL | S(marker::PhantomData).create_out_of_thin_air() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly warning: never type fallback affects this call to an `unsafe` function @@ -127,7 +127,7 @@ LL | msg_send!(); | ----------- in this macro invocation | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: this warning originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -141,7 +141,7 @@ LL | unsafe { mem::zeroed() } | ^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -157,7 +157,7 @@ LL | core::mem::transmute(Zst) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -173,7 +173,7 @@ LL | unsafe { Union { a: () }.b } | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default @@ -185,7 +185,7 @@ LL | unsafe { *ptr::from_ref(&()).cast() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -201,7 +201,7 @@ LL | unsafe { internally_create(x) } | ^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -217,7 +217,7 @@ LL | unsafe { zeroed() } | ^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -233,7 +233,7 @@ LL | let zeroed = mem::zeroed; | ^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -249,7 +249,7 @@ LL | let f = internally_create; | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -265,7 +265,7 @@ LL | S(marker::PhantomData).create_out_of_thin_air() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default @@ -280,7 +280,7 @@ LL | msg_send!(); | ----------- in this macro invocation | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default = note: this warning originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr index 858d7381eed..8039ef427c1 100644 --- a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr +++ b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr @@ -5,7 +5,7 @@ LL | unsafe { mem::zeroed() } | ^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -20,7 +20,7 @@ LL | core::mem::transmute(Zst) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -34,7 +34,7 @@ LL | unsafe { Union { a: () }.b } | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly error: never type fallback affects this raw pointer dereference @@ -44,7 +44,7 @@ LL | unsafe { *ptr::from_ref(&()).cast() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -58,7 +58,7 @@ LL | unsafe { internally_create(x) } | ^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -72,7 +72,7 @@ LL | unsafe { zeroed() } | ^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -86,7 +86,7 @@ LL | let zeroed = mem::zeroed; | ^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -100,7 +100,7 @@ LL | let f = internally_create; | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly help: use `()` annotations to avoid fallback changes | @@ -114,7 +114,7 @@ LL | S(marker::PhantomData).create_out_of_thin_air() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly error: never type fallback affects this call to an `unsafe` function @@ -127,7 +127,7 @@ LL | msg_send!(); | ----------- in this macro invocation | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -150,7 +150,7 @@ LL | unsafe { mem::zeroed() } | ^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -166,7 +166,7 @@ LL | core::mem::transmute(Zst) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -182,7 +182,7 @@ LL | unsafe { Union { a: () }.b } | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default @@ -194,7 +194,7 @@ LL | unsafe { *ptr::from_ref(&()).cast() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -210,7 +210,7 @@ LL | unsafe { internally_create(x) } | ^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -226,7 +226,7 @@ LL | unsafe { zeroed() } | ^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -242,7 +242,7 @@ LL | let zeroed = mem::zeroed; | ^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -258,7 +258,7 @@ LL | let f = internally_create; | ^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default help: use `()` annotations to avoid fallback changes @@ -274,7 +274,7 @@ LL | S(marker::PhantomData).create_out_of_thin_air() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default @@ -289,7 +289,7 @@ LL | msg_send!(); | ----------- in this macro invocation | = warning: this changes meaning in Rust 2024 and in a future release in all editions! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html> = help: specify the type explicitly = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default = note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr index 8268f5df236..331c6510ce7 100644 --- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr +++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr @@ -4,7 +4,7 @@ warning: creating a mutable reference to mutable static LL | S1 { a: unsafe { &mut X1 } } | ^^^^^^^ mutable reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw mut` instead to create a raw pointer diff --git a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr index a445534c8d8..2742162c821 100644 --- a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -9,6 +9,9 @@ LL | let mut closure = expect_sig(|p, y| *p = y); for<Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 mut &'^1 i32, &'^2 i32)), (), ] + = note: late-bound region is '?1 + = note: late-bound region is '?2 + = note: late-bound region is '?3 error: lifetime may not live long enough --> $DIR/escape-argument-callee.rs:26:45 diff --git a/tests/ui/nll/closure-requirements/escape-argument.stderr b/tests/ui/nll/closure-requirements/escape-argument.stderr index 7fd1cd8c3e4..22cb0367ad8 100644 --- a/tests/ui/nll/closure-requirements/escape-argument.stderr +++ b/tests/ui/nll/closure-requirements/escape-argument.stderr @@ -9,6 +9,8 @@ LL | let mut closure = expect_sig(|p, y| *p = y); for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 mut &'^1 i32, &'^1 i32)), (), ] + = note: late-bound region is '?1 + = note: late-bound region is '?2 note: no external requirements --> $DIR/escape-argument.rs:20:1 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr index 60087ec992b..134ce99014d 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr @@ -9,6 +9,8 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| { for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'?2 &'^0 u32>, std::cell::Cell<&'^1 &'?3 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)), (), ] + = note: late-bound region is '?7 + = note: late-bound region is '?8 = note: late-bound region is '?4 = note: late-bound region is '?5 = note: late-bound region is '?6 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr index 7325a9de8b2..f5527eeb2cd 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -9,6 +9,12 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'^3 &'?2 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)), (), ] + = note: late-bound region is '?5 + = note: late-bound region is '?6 + = note: late-bound region is '?7 + = note: late-bound region is '?8 + = note: late-bound region is '?9 + = note: late-bound region is '?10 = note: late-bound region is '?3 = note: late-bound region is '?4 = note: number of external vids: 5 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr index 621c1ea083b..e13653f3423 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr @@ -9,6 +9,7 @@ LL | foo(cell, |cell_a, cell_x| { for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&'^0 u32>)), (), ] + = note: late-bound region is '?2 error[E0521]: borrowed data escapes outside of closure --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:22:9 @@ -43,6 +44,7 @@ LL | foo(cell, |cell_a, cell_x| { for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&'^0 u32>)), (), ] + = note: late-bound region is '?2 = note: number of external vids: 2 = note: where '?1: '?0 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index b9365c94a1b..9e9eae98597 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -9,6 +9,11 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'^1 u32>, &'^3 std::cell::Cell<&'^4 u32>)), (), ] + = note: late-bound region is '?4 + = note: late-bound region is '?5 + = note: late-bound region is '?6 + = note: late-bound region is '?7 + = note: late-bound region is '?8 = note: late-bound region is '?2 = note: late-bound region is '?3 = note: number of external vids: 4 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index e5d2867103c..303fcd4cdfc 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -9,6 +9,12 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'?2 &'^3 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)), (), ] + = note: late-bound region is '?5 + = note: late-bound region is '?6 + = note: late-bound region is '?7 + = note: late-bound region is '?8 + = note: late-bound region is '?9 + = note: late-bound region is '?10 = note: late-bound region is '?3 = note: late-bound region is '?4 = note: number of external vids: 5 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr index a14bfb06e83..aa75b4c811c 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -9,6 +9,8 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| { for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'^1 &'?2 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)), (), ] + = note: late-bound region is '?5 + = note: late-bound region is '?6 = note: late-bound region is '?3 = note: late-bound region is '?4 = note: number of external vids: 5 diff --git a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr index 49c65d77ddd..30ee259d3dc 100644 --- a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr +++ b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr @@ -9,6 +9,8 @@ LL | |_outlives1, _outlives2, x, y| { for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'^1 &'?2 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)), (), ] + = note: late-bound region is '?4 + = note: late-bound region is '?5 = note: late-bound region is '?3 = note: number of external vids: 4 = note: where '?1: '?2 diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index f48ed2823dd..6b04e346c69 100644 --- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -9,6 +9,11 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'^1 &'?1 u32>, &'^2 std::cell::Cell<&'^3 u32>, &'^4 std::cell::Cell<&'^1 u32>)), (), ] + = note: late-bound region is '?4 + = note: late-bound region is '?5 + = note: late-bound region is '?6 + = note: late-bound region is '?7 + = note: late-bound region is '?8 = note: late-bound region is '?2 = note: late-bound region is '?3 diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index a090e94593f..ae2129c65f2 100644 --- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -9,6 +9,12 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'^1 &'?1 u32>, &'^2 std::cell::Cell<&'^3 &'?2 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)), (), ] + = note: late-bound region is '?5 + = note: late-bound region is '?6 + = note: late-bound region is '?7 + = note: late-bound region is '?8 + = note: late-bound region is '?9 + = note: late-bound region is '?10 = note: late-bound region is '?3 = note: late-bound region is '?4 diff --git a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr index bc5c04a27a3..1f1cce1e885 100644 --- a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr +++ b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr @@ -9,6 +9,8 @@ LL | expect_sig(|a, b| b); // ought to return `a` for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 i32, &'^1 i32)) -> &'^0 i32, (), ] + = note: late-bound region is '?1 + = note: late-bound region is '?2 error: lifetime may not live long enough --> $DIR/return-wrong-bound-region.rs:11:23 diff --git a/tests/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr b/tests/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr index 63f230be7d4..3363c4ea28b 100644 --- a/tests/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr +++ b/tests/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr @@ -27,6 +27,15 @@ LL | drop(d); | - value moved here LL | d.x = 10; | ^^^^^^^^ value assigned here after move + | +note: if `D` implemented `Clone`, you could clone the value + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:11:1 + | +LL | struct D { + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(d); + | - you could clone this value error[E0381]: partially assigned binding `d` isn't fully initialized --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:45:5 @@ -57,6 +66,15 @@ LL | drop(d); | - value moved here LL | d.s.y = 20; | ^^^^^^^^^^ value partially assigned here after move + | +note: if `D` implemented `Clone`, you could clone the value + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:11:1 + | +LL | struct D { + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | drop(d); + | - you could clone this value error: aborting due to 6 previous errors diff --git a/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr b/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr index fbaec8a6008..57546037006 100644 --- a/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr +++ b/tests/ui/nll/issue-52663-span-decl-captured-variable.stderr @@ -2,9 +2,11 @@ error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` --> $DIR/issue-52663-span-decl-captured-variable.rs:8:26 | LL | let x = (vec![22], vec![44]); - | - captured outer variable + | - -------------------- move occurs because `x.0` has type `Vec<i32>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | expect_fn(|| drop(x.0)); - | -- ^^^ move occurs because `x.0` has type `Vec<i32>`, which does not implement the `Copy` trait + | -- ^^^ `x.0` is moved here | | | captured by this `Fn` closure | diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index e58764354c0..396e149554c 100644 --- a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -9,6 +9,8 @@ LL | twice(cell, value, |a, b| invoke(a, b)); for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &'^0 ()>>, &'^1 T)), (), ] + = note: late-bound region is '?2 + = note: late-bound region is '?3 = note: number of external vids: 2 = note: where T: '?1 @@ -31,6 +33,8 @@ LL | twice(cell, value, |a, b| invoke(a, b)); for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &'^0 ()>>, &'^1 T)), (), ] + = note: late-bound region is '?3 + = note: late-bound region is '?4 = note: late-bound region is '?2 = note: number of external vids: 3 = note: where T: '?1 diff --git a/tests/ui/numbers-arithmetic/u128-as-f32.rs b/tests/ui/numbers-arithmetic/u128-as-f32.rs index 88579f507eb..57c82d5a24f 100644 --- a/tests/ui/numbers-arithmetic/u128-as-f32.rs +++ b/tests/ui/numbers-arithmetic/u128-as-f32.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ ignore-backends: gcc #![feature(test)] #![deny(overflowing_literals)] diff --git a/tests/ui/offset-of/offset-of-tuple-field.rs b/tests/ui/offset-of/offset-of-tuple-field.rs new file mode 100644 index 00000000000..02d41f91a25 --- /dev/null +++ b/tests/ui/offset-of/offset-of-tuple-field.rs @@ -0,0 +1,22 @@ +#![feature(builtin_syntax)] + +use std::mem::offset_of; + +fn main() { + offset_of!((u8, u8), _0); //~ ERROR no field `_0` + offset_of!((u8, u8), 01); //~ ERROR no field `01` + offset_of!((u8, u8), 1e2); //~ ERROR no field `1e2` + offset_of!((u8, u8), 1_u8); //~ ERROR no field `1_` + //~| ERROR suffixes on a tuple index + + builtin # offset_of((u8, u8), 1e2); //~ ERROR no field `1e2` + builtin # offset_of((u8, u8), _0); //~ ERROR no field `_0` + builtin # offset_of((u8, u8), 01); //~ ERROR no field `01` + builtin # offset_of((u8, u8), 1_u8); //~ ERROR no field `1_` + //~| ERROR suffixes on a tuple index + + offset_of!(((u8, u16), (u32, u16, u8)), 0.2); //~ ERROR no field `2` + offset_of!(((u8, u16), (u32, u16, u8)), 0.1e2); //~ ERROR no field `1e2` + offset_of!(((u8, u16), (u32, u16, u8)), 1.2); + offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); //~ ERROR no field `0` +} diff --git a/tests/ui/offset-of/offset-of-tuple-field.stderr b/tests/ui/offset-of/offset-of-tuple-field.stderr new file mode 100644 index 00000000000..4da0d851650 --- /dev/null +++ b/tests/ui/offset-of/offset-of-tuple-field.stderr @@ -0,0 +1,81 @@ +error: suffixes on a tuple index are invalid + --> $DIR/offset-of-tuple-field.rs:15:35 + | +LL | builtin # offset_of((u8, u8), 1_u8); + | ^^^^ invalid suffix `u8` + +error: suffixes on a tuple index are invalid + --> $DIR/offset-of-tuple-field.rs:9:26 + | +LL | offset_of!((u8, u8), 1_u8); + | ^^^^ invalid suffix `u8` + +error[E0609]: no field `_0` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:6:26 + | +LL | offset_of!((u8, u8), _0); + | ^^ + +error[E0609]: no field `01` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:7:26 + | +LL | offset_of!((u8, u8), 01); + | ^^ + +error[E0609]: no field `1e2` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:8:26 + | +LL | offset_of!((u8, u8), 1e2); + | ^^^ + +error[E0609]: no field `1_` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:9:26 + | +LL | offset_of!((u8, u8), 1_u8); + | ^^^^ + +error[E0609]: no field `1e2` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:12:35 + | +LL | builtin # offset_of((u8, u8), 1e2); + | ^^^ + +error[E0609]: no field `_0` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:13:35 + | +LL | builtin # offset_of((u8, u8), _0); + | ^^ + +error[E0609]: no field `01` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:14:35 + | +LL | builtin # offset_of((u8, u8), 01); + | ^^ + +error[E0609]: no field `1_` on type `(u8, u8)` + --> $DIR/offset-of-tuple-field.rs:15:35 + | +LL | builtin # offset_of((u8, u8), 1_u8); + | ^^^^ + +error[E0609]: no field `2` on type `(u8, u16)` + --> $DIR/offset-of-tuple-field.rs:18:47 + | +LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.2); + | ^ + +error[E0609]: no field `1e2` on type `(u8, u16)` + --> $DIR/offset-of-tuple-field.rs:19:47 + | +LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.1e2); + | ^^^ + +error[E0609]: no field `0` on type `u8` + --> $DIR/offset-of-tuple-field.rs:21:49 + | +LL | offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); + | ^ + +error: aborting due to 13 previous errors + +For more information about this error, try `rustc --explain E0609`. diff --git a/tests/ui/offset-of/offset-of-tuple.rs b/tests/ui/offset-of/offset-of-tuple.rs index e8447249441..ddbaee97b1b 100644 --- a/tests/ui/offset-of/offset-of-tuple.rs +++ b/tests/ui/offset-of/offset-of-tuple.rs @@ -3,20 +3,10 @@ use std::mem::offset_of; fn main() { - offset_of!((u8, u8), _0); //~ ERROR no field `_0` - offset_of!((u8, u8), 01); //~ ERROR no field `01` - offset_of!((u8, u8), 1e2); //~ ERROR no field `1e2` - offset_of!((u8, u8), 1_u8); //~ ERROR no field `1_` - //~| ERROR suffixes on a tuple index offset_of!((u8, u8), +1); //~ ERROR no rules expected offset_of!((u8, u8), -1); //~ ERROR offset_of expects dot-separated field and variant names offset_of!((u8, u8), 1.); //~ ERROR offset_of expects dot-separated field and variant names offset_of!((u8, u8), 1 .); //~ ERROR unexpected token: `)` - builtin # offset_of((u8, u8), 1e2); //~ ERROR no field `1e2` - builtin # offset_of((u8, u8), _0); //~ ERROR no field `_0` - builtin # offset_of((u8, u8), 01); //~ ERROR no field `01` - builtin # offset_of((u8, u8), 1_u8); //~ ERROR no field `1_` - //~| ERROR suffixes on a tuple index // We need to put these into curly braces, otherwise only one of the // errors will be emitted and the others suppressed. { builtin # offset_of((u8, u8), +1) }; //~ ERROR leading `+` is not supported @@ -27,11 +17,6 @@ fn main() { type ComplexTup = (((u8, u8), u8), u8); fn nested() { - offset_of!(((u8, u16), (u32, u16, u8)), 0.2); //~ ERROR no field `2` - offset_of!(((u8, u16), (u32, u16, u8)), 0.1e2); //~ ERROR no field `1e2` - offset_of!(((u8, u16), (u32, u16, u8)), 1.2); - offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); //~ ERROR no field `0` - // All combinations of spaces (this sends different tokens to the parser) offset_of!(ComplexTup, 0.0.1.); //~ ERROR unexpected token: `)` offset_of!(ComplexTup, 0 .0.1.); //~ ERROR unexpected token: `)` diff --git a/tests/ui/offset-of/offset-of-tuple.stderr b/tests/ui/offset-of/offset-of-tuple.stderr index 38ce49c9179..33dea9918ca 100644 --- a/tests/ui/offset-of/offset-of-tuple.stderr +++ b/tests/ui/offset-of/offset-of-tuple.stderr @@ -1,11 +1,5 @@ -error: suffixes on a tuple index are invalid - --> $DIR/offset-of-tuple.rs:18:35 - | -LL | builtin # offset_of((u8, u8), 1_u8); - | ^^^^ invalid suffix `u8` - error: leading `+` is not supported - --> $DIR/offset-of-tuple.rs:22:37 + --> $DIR/offset-of-tuple.rs:12:37 | LL | { builtin # offset_of((u8, u8), +1) }; | ^ unexpected `+` @@ -17,67 +11,61 @@ LL + { builtin # offset_of((u8, u8), 1) }; | error: offset_of expects dot-separated field and variant names - --> $DIR/offset-of-tuple.rs:23:38 + --> $DIR/offset-of-tuple.rs:13:38 | LL | { builtin # offset_of((u8, u8), 1.) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:24:40 + --> $DIR/offset-of-tuple.rs:14:40 | LL | { builtin # offset_of((u8, u8), 1 .) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:47:45 + --> $DIR/offset-of-tuple.rs:32:45 | LL | { builtin # offset_of(ComplexTup, 0.0.1.) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:48:46 + --> $DIR/offset-of-tuple.rs:33:46 | LL | { builtin # offset_of(ComplexTup, 0 .0.1.) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:49:47 + --> $DIR/offset-of-tuple.rs:34:47 | LL | { builtin # offset_of(ComplexTup, 0 . 0.1.) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:50:46 + --> $DIR/offset-of-tuple.rs:35:46 | LL | { builtin # offset_of(ComplexTup, 0. 0.1.) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:51:46 + --> $DIR/offset-of-tuple.rs:36:46 | LL | { builtin # offset_of(ComplexTup, 0.0 .1.) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:52:47 + --> $DIR/offset-of-tuple.rs:37:47 | LL | { builtin # offset_of(ComplexTup, 0.0 . 1.) }; | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:53:46 + --> $DIR/offset-of-tuple.rs:38:46 | LL | { builtin # offset_of(ComplexTup, 0.0. 1.) }; | ^ -error: suffixes on a tuple index are invalid - --> $DIR/offset-of-tuple.rs:9:26 - | -LL | offset_of!((u8, u8), 1_u8); - | ^^^^ invalid suffix `u8` - error: no rules expected `+` - --> $DIR/offset-of-tuple.rs:11:26 + --> $DIR/offset-of-tuple.rs:6:26 | LL | offset_of!((u8, u8), +1); | ^ no rules expected this token in macro call @@ -86,131 +74,64 @@ note: while trying to match meta-variable `$fields:expr` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL error: offset_of expects dot-separated field and variant names - --> $DIR/offset-of-tuple.rs:12:26 + --> $DIR/offset-of-tuple.rs:7:26 | LL | offset_of!((u8, u8), -1); | ^^ error: offset_of expects dot-separated field and variant names - --> $DIR/offset-of-tuple.rs:13:27 + --> $DIR/offset-of-tuple.rs:8:27 | LL | offset_of!((u8, u8), 1.); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:14:29 + --> $DIR/offset-of-tuple.rs:9:29 | LL | offset_of!((u8, u8), 1 .); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:36:34 + --> $DIR/offset-of-tuple.rs:21:34 | LL | offset_of!(ComplexTup, 0.0.1.); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:37:35 + --> $DIR/offset-of-tuple.rs:22:35 | LL | offset_of!(ComplexTup, 0 .0.1.); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:38:36 + --> $DIR/offset-of-tuple.rs:23:36 | LL | offset_of!(ComplexTup, 0 . 0.1.); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:39:35 + --> $DIR/offset-of-tuple.rs:24:35 | LL | offset_of!(ComplexTup, 0. 0.1.); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:40:35 + --> $DIR/offset-of-tuple.rs:25:35 | LL | offset_of!(ComplexTup, 0.0 .1.); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:41:36 + --> $DIR/offset-of-tuple.rs:26:36 | LL | offset_of!(ComplexTup, 0.0 . 1.); | ^ error: unexpected token: `)` - --> $DIR/offset-of-tuple.rs:42:35 + --> $DIR/offset-of-tuple.rs:27:35 | LL | offset_of!(ComplexTup, 0.0. 1.); | ^ -error[E0609]: no field `_0` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:6:26 - | -LL | offset_of!((u8, u8), _0); - | ^^ - -error[E0609]: no field `01` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:7:26 - | -LL | offset_of!((u8, u8), 01); - | ^^ - -error[E0609]: no field `1e2` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:8:26 - | -LL | offset_of!((u8, u8), 1e2); - | ^^^ - -error[E0609]: no field `1_` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:9:26 - | -LL | offset_of!((u8, u8), 1_u8); - | ^^^^ - -error[E0609]: no field `1e2` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:15:35 - | -LL | builtin # offset_of((u8, u8), 1e2); - | ^^^ - -error[E0609]: no field `_0` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:16:35 - | -LL | builtin # offset_of((u8, u8), _0); - | ^^ - -error[E0609]: no field `01` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:17:35 - | -LL | builtin # offset_of((u8, u8), 01); - | ^^ - -error[E0609]: no field `1_` on type `(u8, u8)` - --> $DIR/offset-of-tuple.rs:18:35 - | -LL | builtin # offset_of((u8, u8), 1_u8); - | ^^^^ - -error[E0609]: no field `2` on type `(u8, u16)` - --> $DIR/offset-of-tuple.rs:30:47 - | -LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.2); - | ^ - -error[E0609]: no field `1e2` on type `(u8, u16)` - --> $DIR/offset-of-tuple.rs:31:47 - | -LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.1e2); - | ^^^ - -error[E0609]: no field `0` on type `u8` - --> $DIR/offset-of-tuple.rs:33:49 - | -LL | offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); - | ^ - -error: aborting due to 34 previous errors +error: aborting due to 21 previous errors -For more information about this error, try `rustc --explain E0609`. diff --git a/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs b/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs index 0566d2319df..bef2d8bcff0 100644 --- a/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs +++ b/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs @@ -3,6 +3,7 @@ //@ aux-build:exit-success-if-unwind.rs //@ no-prefer-dynamic //@ needs-subprocess +//@ ignore-backends: gcc extern crate exit_success_if_unwind; diff --git a/tests/ui/panic-runtime/abort.rs b/tests/ui/panic-runtime/abort.rs index 8cdfd018a92..2a52228801f 100644 --- a/tests/ui/panic-runtime/abort.rs +++ b/tests/ui/panic-runtime/abort.rs @@ -2,6 +2,7 @@ //@ compile-flags:-C panic=abort //@ no-prefer-dynamic //@ needs-subprocess +//@ ignore-backends: gcc use std::env; use std::process::Command; diff --git a/tests/ui/panic-runtime/link-to-abort.rs b/tests/ui/panic-runtime/link-to-abort.rs index a4013f2a6cf..98718ab8342 100644 --- a/tests/ui/panic-runtime/link-to-abort.rs +++ b/tests/ui/panic-runtime/link-to-abort.rs @@ -2,6 +2,7 @@ //@ compile-flags:-C panic=abort //@ no-prefer-dynamic +//@ ignore-backends: gcc #![feature(panic_abort)] diff --git a/tests/ui/panic-runtime/lto-abort.rs b/tests/ui/panic-runtime/lto-abort.rs index cf15ae6435b..cf36cd8c810 100644 --- a/tests/ui/panic-runtime/lto-abort.rs +++ b/tests/ui/panic-runtime/lto-abort.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ run-pass //@ compile-flags:-C lto -C panic=abort //@ no-prefer-dynamic diff --git a/tests/ui/issues/issue-10638.rs b/tests/ui/parser/doc-comment-parsing.rs index c6c6939bda5..00f6b0e09a8 100644 --- a/tests/ui/issues/issue-10638.rs +++ b/tests/ui/parser/doc-comment-parsing.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10638 + //@ run-pass pub fn main() { diff --git a/tests/ui/parser/recover/recover-pat-ranges.stderr b/tests/ui/parser/recover/recover-pat-ranges.stderr index 6c17182618b..246c704d53f 100644 --- a/tests/ui/parser/recover/recover-pat-ranges.stderr +++ b/tests/ui/parser/recover/recover-pat-ranges.stderr @@ -191,7 +191,7 @@ LL | (1 + 4)...1 * 2 => (), | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(ellipsis_inclusive_range_patterns)]` on by default error: aborting due to 13 previous errors; 1 warning emitted diff --git a/tests/ui/parser/recover/recover-range-pats.stderr b/tests/ui/parser/recover/recover-range-pats.stderr index a2f3ba4dd94..1570475a098 100644 --- a/tests/ui/parser/recover/recover-range-pats.stderr +++ b/tests/ui/parser/recover/recover-range-pats.stderr @@ -339,7 +339,7 @@ LL | if let 0...3 = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/recover-range-pats.rs:6:9 | @@ -353,7 +353,7 @@ LL | if let 0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:46:13 @@ -362,7 +362,7 @@ LL | if let X...3 = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:49:13 @@ -371,7 +371,7 @@ LL | if let X...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:52:16 @@ -380,7 +380,7 @@ LL | if let true...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:55:13 @@ -389,7 +389,7 @@ LL | if let X...true = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:58:14 @@ -398,7 +398,7 @@ LL | if let .0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:62:13 @@ -407,7 +407,7 @@ LL | if let X... .0 = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:137:20 @@ -419,7 +419,7 @@ LL | mac2!(0, 1); | ----------- in this macro invocation | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0029]: only `char` and numeric types are allowed in range patterns diff --git a/tests/ui/parser/trait-object-trait-parens.stderr b/tests/ui/parser/trait-object-trait-parens.stderr index 26d388f8779..b2067547568 100644 --- a/tests/ui/parser/trait-object-trait-parens.stderr +++ b/tests/ui/parser/trait-object-trait-parens.stderr @@ -23,7 +23,7 @@ LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -48,7 +48,7 @@ LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let _: Box<dyn ?Sized + (for<'a> Trait<'a>) + (Obj)>; @@ -72,7 +72,7 @@ LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let _: Box<dyn for<'a> Trait<'a> + (Obj) + (?Sized)>; diff --git a/tests/ui/parser/unclosed-delimiter-in-dep.rs b/tests/ui/parser/unclosed-delimiter-in-dep.rs index 40f517f317e..4f0423a704f 100644 --- a/tests/ui/parser/unclosed-delimiter-in-dep.rs +++ b/tests/ui/parser/unclosed-delimiter-in-dep.rs @@ -1,3 +1,5 @@ +//@ ignore-backends: gcc + mod unclosed_delim_mod; fn main() { diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr index f19fed08917..deb14d141a9 100644 --- a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr +++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr @@ -146,6 +146,15 @@ LL | m!((ref mut borrow, mov) = tup0); ... LL | drop(&tup0); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!((ref mut borrow, mov) = tup0); + | ---- you could clone this value error[E0382]: borrow of moved value: `tup1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:76:10 @@ -161,6 +170,15 @@ LL | m!((mov, _, ref mut borrow) = tup1); ... LL | drop(&tup1); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!((mov, _, ref mut borrow) = tup1); + | ---- you could clone this value error[E0382]: borrow of moved value: `tup2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:77:10 @@ -176,6 +194,15 @@ LL | m!((ref borrow, mov) = tup2); ... LL | drop(&tup2); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!((ref borrow, mov) = tup2); + | ---- you could clone this value error[E0382]: borrow of moved value: `tup3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:78:10 @@ -191,6 +218,15 @@ LL | m!((mov, _, ref borrow) = tup3); ... LL | drop(&tup3); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!((mov, _, ref borrow) = tup3); + | ---- you could clone this value error[E0382]: borrow of moved value: `tup4` --> $DIR/move-ref-patterns-closure-captures-inside.rs:79:21 @@ -206,6 +242,15 @@ LL | m!((ref borrow, mov) = tup4); ... LL | m!((ref x, _) = &tup4); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!((ref borrow, mov) = tup4); + | ---- you could clone this value error[E0382]: borrow of moved value: `arr0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:80:10 @@ -221,6 +266,15 @@ LL | m!([mov @ .., ref borrow] = arr0); ... LL | drop(&arr0); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!([mov @ .., ref borrow] = arr0); + | ---- you could clone this value error[E0382]: borrow of moved value: `arr1` --> $DIR/move-ref-patterns-closure-captures-inside.rs:81:35 @@ -236,6 +290,15 @@ LL | m!([_, ref mut borrow @ .., _, mov] = arr1); ... LL | m!([_, mov1, mov2, mov3, _] = &arr1); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!([_, ref mut borrow @ .., _, mov] = arr1); + | ---- you could clone this value error[E0382]: borrow of moved value: `arr2` --> $DIR/move-ref-patterns-closure-captures-inside.rs:82:10 @@ -251,6 +314,15 @@ LL | m!([mov @ .., ref borrow] = arr2); ... LL | drop(&arr2); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!([mov @ .., ref borrow] = arr2); + | ---- you could clone this value error[E0382]: borrow of moved value: `arr3` --> $DIR/move-ref-patterns-closure-captures-inside.rs:83:35 @@ -265,6 +337,15 @@ LL | m!([_, ref borrow @ .., _, mov] = arr3); ... LL | m!([_, mov1, mov2, mov3, _] = &arr3); | ^^^^^ value borrowed here after move + | +note: if `S` implemented `Clone`, you could clone the value + --> $DIR/move-ref-patterns-closure-captures-inside.rs:2:5 + | +LL | struct S; // Not `Copy`. + | ^^^^^^^^ consider implementing `Clone` for this type +... +LL | m!([_, ref borrow @ .., _, mov] = arr3); + | ---- you could clone this value error[E0382]: borrow of moved value: `tup0` --> $DIR/move-ref-patterns-closure-captures-inside.rs:111:10 diff --git a/tests/ui/issues/issue-10683.rs b/tests/ui/pattern/premature-match-scrutinee-temporary-drop-10683.rs index 5657ec1864b..a4dfa56117c 100644 --- a/tests/ui/issues/issue-10683.rs +++ b/tests/ui/pattern/premature-match-scrutinee-temporary-drop-10683.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10683 + //@ run-pass static NAME: &'static str = "hello world"; diff --git a/tests/ui/privacy/associated-item-privacy-trait.stderr b/tests/ui/privacy/associated-item-privacy-trait.stderr index f79c4cff72f..4e9dfa4a835 100644 --- a/tests/ui/privacy/associated-item-privacy-trait.stderr +++ b/tests/ui/privacy/associated-item-privacy-trait.stderr @@ -75,6 +75,17 @@ LL | priv_trait::mac!(); | = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) +error: trait `PrivTr` is private + --> $DIR/associated-item-privacy-trait.rs:29:14 + | +LL | impl PrivTr for u8 {} + | ^^^^^^ private trait +... +LL | priv_trait::mac!(); + | ------------------ in this macro invocation + | + = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) + error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-trait.rs:46:21 | @@ -317,16 +328,5 @@ LL | priv_parent_substs::mac!(); | = note: this error originates in the macro `priv_parent_substs::mac` (in Nightly builds, run with -Z macro-backtrace for more info) -error: trait `PrivTr` is private - --> $DIR/associated-item-privacy-trait.rs:29:14 - | -LL | impl PrivTr for u8 {} - | ^^^^^^ private trait -... -LL | priv_trait::mac!(); - | ------------------ in this macro invocation - | - = note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info) - error: aborting due to 30 previous errors diff --git a/tests/ui/issues/issue-54062.rs b/tests/ui/privacy/private-field-access-in-mutex-54062.rs index 093d6601d4e..c957e0bc7e8 100644 --- a/tests/ui/issues/issue-54062.rs +++ b/tests/ui/privacy/private-field-access-in-mutex-54062.rs @@ -8,5 +8,7 @@ fn main() {} fn testing(test: Test) { let _ = test.comps.inner.try_lock(); - //~^ ERROR: field `inner` of struct `Mutex` is private + //~^ ERROR: field `inner` of struct `std::sync::Mutex` is private } + +// https://github.com/rust-lang/rust/issues/54062 diff --git a/tests/ui/issues/issue-54062.stderr b/tests/ui/privacy/private-field-access-in-mutex-54062.stderr index 75eef543f27..f7f84640648 100644 --- a/tests/ui/issues/issue-54062.stderr +++ b/tests/ui/privacy/private-field-access-in-mutex-54062.stderr @@ -1,5 +1,5 @@ -error[E0616]: field `inner` of struct `Mutex` is private - --> $DIR/issue-54062.rs:10:24 +error[E0616]: field `inner` of struct `std::sync::Mutex` is private + --> $DIR/private-field-access-in-mutex-54062.rs:10:24 | LL | let _ = test.comps.inner.try_lock(); | ^^^^^ private field diff --git a/tests/ui/privacy/private-in-public-warn.stderr b/tests/ui/privacy/private-in-public-warn.stderr index c2a57e3b82c..86f6be85a07 100644 --- a/tests/ui/privacy/private-in-public-warn.stderr +++ b/tests/ui/privacy/private-in-public-warn.stderr @@ -84,42 +84,6 @@ note: but type `types::Priv` is only usable at visibility `pub(self)` LL | struct Priv; | ^^^^^^^^^^^ -error: type `types::Priv` is more private than the item `types::ES` - --> $DIR/private-in-public-warn.rs:27:9 - | -LL | pub static ES: Priv; - | ^^^^^^^^^^^^^^^^^^^ static `types::ES` is reachable at visibility `pub(crate)` - | -note: but type `types::Priv` is only usable at visibility `pub(self)` - --> $DIR/private-in-public-warn.rs:9:5 - | -LL | struct Priv; - | ^^^^^^^^^^^ - -error: type `types::Priv` is more private than the item `types::ef1` - --> $DIR/private-in-public-warn.rs:28:9 - | -LL | pub fn ef1(arg: Priv); - | ^^^^^^^^^^^^^^^^^^^^^^ function `types::ef1` is reachable at visibility `pub(crate)` - | -note: but type `types::Priv` is only usable at visibility `pub(self)` - --> $DIR/private-in-public-warn.rs:9:5 - | -LL | struct Priv; - | ^^^^^^^^^^^ - -error: type `types::Priv` is more private than the item `types::ef2` - --> $DIR/private-in-public-warn.rs:29:9 - | -LL | pub fn ef2() -> Priv; - | ^^^^^^^^^^^^^^^^^^^^^ function `types::ef2` is reachable at visibility `pub(crate)` - | -note: but type `types::Priv` is only usable at visibility `pub(self)` - --> $DIR/private-in-public-warn.rs:9:5 - | -LL | struct Priv; - | ^^^^^^^^^^^ - error[E0446]: private type `types::Priv` in public interface --> $DIR/private-in-public-warn.rs:32:9 | @@ -395,6 +359,42 @@ note: but type `Priv2` is only usable at visibility `pub(self)` LL | struct Priv2; | ^^^^^^^^^^^^ +error: type `types::Priv` is more private than the item `types::ES` + --> $DIR/private-in-public-warn.rs:27:9 + | +LL | pub static ES: Priv; + | ^^^^^^^^^^^^^^^^^^^ static `types::ES` is reachable at visibility `pub(crate)` + | +note: but type `types::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:9:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ + +error: type `types::Priv` is more private than the item `types::ef1` + --> $DIR/private-in-public-warn.rs:28:9 + | +LL | pub fn ef1(arg: Priv); + | ^^^^^^^^^^^^^^^^^^^^^^ function `types::ef1` is reachable at visibility `pub(crate)` + | +note: but type `types::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:9:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ + +error: type `types::Priv` is more private than the item `types::ef2` + --> $DIR/private-in-public-warn.rs:29:9 + | +LL | pub fn ef2() -> Priv; + | ^^^^^^^^^^^^^^^^^^^^^ function `types::ef2` is reachable at visibility `pub(crate)` + | +note: but type `types::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:9:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ + warning: bounds on generic parameters in type aliases are not enforced --> $DIR/private-in-public-warn.rs:42:23 | diff --git a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs index 13f3065e442..d5065a6b55b 100644 --- a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs +++ b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.rs @@ -1,5 +1,6 @@ -// We should not emit sealed traits note, see issue #143392 +// We should not emit sealed traits note, see issue #143392 and #143121 +/// Reported in #143392 mod inner { pub trait TraitA {} @@ -10,4 +11,13 @@ struct Struct; impl inner::TraitB for Struct {} //~ ERROR the trait bound `Struct: TraitA` is not satisfied [E0277] +/// Reported in #143121 +mod x { + pub trait A {} + pub trait B: A {} + + pub struct C; + impl B for C {} //~ ERROR the trait bound `C: A` is not satisfied [E0277] +} + fn main(){} diff --git a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr index f80d985ad6e..df8016565da 100644 --- a/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr +++ b/tests/ui/privacy/sealed-traits/false-sealed-traits-note.stderr @@ -1,20 +1,37 @@ error[E0277]: the trait bound `Struct: TraitA` is not satisfied - --> $DIR/false-sealed-traits-note.rs:11:24 + --> $DIR/false-sealed-traits-note.rs:12:24 | LL | impl inner::TraitB for Struct {} | ^^^^^^ the trait `TraitA` is not implemented for `Struct` | help: this trait has no implementations, consider adding one - --> $DIR/false-sealed-traits-note.rs:4:5 + --> $DIR/false-sealed-traits-note.rs:5:5 | LL | pub trait TraitA {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `TraitB` - --> $DIR/false-sealed-traits-note.rs:6:23 + --> $DIR/false-sealed-traits-note.rs:7:23 | LL | pub trait TraitB: TraitA {} | ^^^^^^ required by this bound in `TraitB` -error: aborting due to 1 previous error +error[E0277]: the trait bound `C: A` is not satisfied + --> $DIR/false-sealed-traits-note.rs:20:16 + | +LL | impl B for C {} + | ^ the trait `A` is not implemented for `C` + | +help: this trait has no implementations, consider adding one + --> $DIR/false-sealed-traits-note.rs:16:5 + | +LL | pub trait A {} + | ^^^^^^^^^^^ +note: required by a bound in `B` + --> $DIR/false-sealed-traits-note.rs:17:18 + | +LL | pub trait B: A {} + | ^ required by this bound in `B` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/issues/issue-10545.rs b/tests/ui/privacy/struct-field-and-impl-expose-10545.rs index acd07149619..8a8c8240c2d 100644 --- a/tests/ui/issues/issue-10545.rs +++ b/tests/ui/privacy/struct-field-and-impl-expose-10545.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10545 + mod a { struct S; impl S { } diff --git a/tests/ui/issues/issue-10545.stderr b/tests/ui/privacy/struct-field-and-impl-expose-10545.stderr index 9aa04217174..ddf87d1d23a 100644 --- a/tests/ui/issues/issue-10545.stderr +++ b/tests/ui/privacy/struct-field-and-impl-expose-10545.stderr @@ -1,11 +1,11 @@ error[E0603]: struct `S` is private - --> $DIR/issue-10545.rs:6:14 + --> $DIR/struct-field-and-impl-expose-10545.rs:8:14 | LL | fn foo(_: a::S) { | ^ private struct | note: the struct `S` is defined here - --> $DIR/issue-10545.rs:2:5 + --> $DIR/struct-field-and-impl-expose-10545.rs:4:5 | LL | struct S; | ^^^^^^^^^ diff --git a/tests/ui/proc-macro/attribute.rs b/tests/ui/proc-macro/attribute.rs index 30ed8ff8247..988cdcd0403 100644 --- a/tests/ui/proc-macro/attribute.rs +++ b/tests/ui/proc-macro/attribute.rs @@ -6,68 +6,85 @@ extern crate proc_macro; use proc_macro::*; -#[proc_macro_derive] //~ ERROR malformed `proc_macro_derive` attribute +#[proc_macro_derive] +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected this to be a list pub fn foo1(input: TokenStream) -> TokenStream { input } -#[proc_macro_derive = ""] //~ ERROR malformed `proc_macro_derive` attribute +#[proc_macro_derive = ""] +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected this to be a list pub fn foo2(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d3, a, b)] -//~^ ERROR attribute must have either one or two arguments +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE the only valid argument here is `attributes` pub fn foo3(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d4, attributes(a), b)] -//~^ ERROR attribute must have either one or two arguments +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE didn't expect any arguments here pub fn foo4(input: TokenStream) -> TokenStream { input } #[proc_macro_derive("a")] -//~^ ERROR: not a meta item +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE didn't expect a literal here pub fn foo5(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d6 = "")] -//~^ ERROR: must only be one word +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE didn't expect any arguments here pub fn foo6(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(m::d7)] -//~^ ERROR: must only be one word +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected a valid identifier here pub fn foo7(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d8(a))] -//~^ ERROR: must only be one word +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE didn't expect any arguments here pub fn foo8(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(self)] -//~^ ERROR: `self` cannot be a name of derive macro +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected a valid identifier here pub fn foo9(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(PartialEq)] // OK pub fn foo10(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d11, a)] -//~^ ERROR: second argument must be `attributes` -//~| ERROR: attribute must be of form: `attributes(foo, bar)` +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE the only valid argument here is `attributes` pub fn foo11(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d12, attributes)] -//~^ ERROR: attribute must be of form: `attributes(foo, bar)` +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected this to be a list pub fn foo12(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d13, attributes("a"))] -//~^ ERROR: attribute must be a meta item, not a literal +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected a valid identifier here pub fn foo13(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d14, attributes(a = ""))] -//~^ ERROR: attribute must only be a single word +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE didn't expect any arguments here pub fn foo14(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d15, attributes(m::a))] -//~^ ERROR: attribute must only be a single word +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected a valid identifier here pub fn foo15(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d16, attributes(a(b)))] -//~^ ERROR: attribute must only be a single word +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE didn't expect any arguments here pub fn foo16(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d17, attributes(self))] -//~^ ERROR: `self` cannot be a name of derive helper attribute +//~^ ERROR malformed `proc_macro_derive` attribute +//~| NOTE expected a valid identifier here pub fn foo17(input: TokenStream) -> TokenStream { input } diff --git a/tests/ui/proc-macro/attribute.stderr b/tests/ui/proc-macro/attribute.stderr index 3269aaf7f91..db59a1fdfb3 100644 --- a/tests/ui/proc-macro/attribute.stderr +++ b/tests/ui/proc-macro/attribute.stderr @@ -1,104 +1,148 @@ -error: malformed `proc_macro_derive` attribute input +error[E0539]: malformed `proc_macro_derive` attribute input --> $DIR/attribute.rs:9:1 | LL | #[proc_macro_derive] - | ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` + | ^^^^^^^^^^^^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:12:1 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:14:1 | LL | #[proc_macro_derive = ""] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must have either one or two arguments - --> $DIR/attribute.rs:15:1 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:19:1 | LL | #[proc_macro_derive(d3, a, b)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^ + | | | + | | the only valid argument here is `attributes` + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must have either one or two arguments - --> $DIR/attribute.rs:19:1 +error[E0565]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:24:1 | LL | #[proc_macro_derive(d4, attributes(a), b)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: not a meta item - --> $DIR/attribute.rs:23:21 +error[E0565]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:29:1 | LL | #[proc_macro_derive("a")] - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^---^^ + | | | + | | didn't expect a literal here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: must only be one word - --> $DIR/attribute.rs:27:21 +error[E0565]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:34:1 | LL | #[proc_macro_derive(d6 = "")] - | ^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^----^^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: must only be one word - --> $DIR/attribute.rs:31:21 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:39:1 | LL | #[proc_macro_derive(m::d7)] - | ^^^^^ + | ^^^^^^^^^^^^^^^^^^^^-----^^ + | | | + | | expected a valid identifier here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: must only be one word - --> $DIR/attribute.rs:35:21 +error[E0565]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:44:1 | LL | #[proc_macro_derive(d8(a))] - | ^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^---^^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: `self` cannot be a name of derive macro - --> $DIR/attribute.rs:39:21 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:49:1 | LL | #[proc_macro_derive(self)] - | ^^^^ - -error: second argument must be `attributes` - --> $DIR/attribute.rs:46:26 - | -LL | #[proc_macro_derive(d11, a)] - | ^ + | ^^^^^^^^^^^^^^^^^^^^----^^ + | | | + | | expected a valid identifier here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must be of form: `attributes(foo, bar)` - --> $DIR/attribute.rs:46:26 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:57:1 | LL | #[proc_macro_derive(d11, a)] - | ^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^-^^ + | | | + | | the only valid argument here is `attributes` + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must be of form: `attributes(foo, bar)` - --> $DIR/attribute.rs:51:26 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:62:1 | LL | #[proc_macro_derive(d12, attributes)] - | ^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^----------^^ + | | | + | | expected this to be a list + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must be a meta item, not a literal - --> $DIR/attribute.rs:55:37 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:67:1 | LL | #[proc_macro_derive(d13, attributes("a"))] - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^ + | | | + | | expected a valid identifier here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must only be a single word - --> $DIR/attribute.rs:59:37 +error[E0565]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:72:1 | LL | #[proc_macro_derive(d14, attributes(a = ""))] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must only be a single word - --> $DIR/attribute.rs:63:37 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:77:1 | LL | #[proc_macro_derive(d15, attributes(m::a))] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ + | | | + | | expected a valid identifier here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: attribute must only be a single word - --> $DIR/attribute.rs:67:37 +error[E0565]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:82:1 | LL | #[proc_macro_derive(d16, attributes(a(b)))] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: `self` cannot be a name of derive helper attribute - --> $DIR/attribute.rs:71:37 +error[E0539]: malformed `proc_macro_derive` attribute input + --> $DIR/attribute.rs:87:1 | LL | #[proc_macro_derive(d17, attributes(self))] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ + | | | + | | expected a valid identifier here + | help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` -error: aborting due to 17 previous errors +error: aborting due to 16 previous errors +Some errors have detailed explanations: E0539, E0565. +For more information about an error, try `rustc --explain E0539`. diff --git a/tests/ui/proc-macro/invalid-attributes.rs b/tests/ui/proc-macro/invalid-attributes.rs index a70c73e9b8f..703defad69b 100644 --- a/tests/ui/proc-macro/invalid-attributes.rs +++ b/tests/ui/proc-macro/invalid-attributes.rs @@ -7,20 +7,32 @@ extern crate proc_macro; use proc_macro::TokenStream; -#[proc_macro = "test"] //~ ERROR malformed `proc_macro` attribute +#[proc_macro = "test"] +//~^ ERROR malformed `proc_macro` attribute +//~| NOTE didn't expect any arguments here pub fn a(a: TokenStream) -> TokenStream { a } -#[proc_macro()] //~ ERROR malformed `proc_macro` attribute +#[proc_macro()] +//~^ ERROR malformed `proc_macro` attribute +//~| NOTE didn't expect any arguments here pub fn c(a: TokenStream) -> TokenStream { a } -#[proc_macro(x)] //~ ERROR malformed `proc_macro` attribute +#[proc_macro(x)] +//~^ ERROR malformed `proc_macro` attribute +//~| NOTE didn't expect any arguments here pub fn d(a: TokenStream) -> TokenStream { a } -#[proc_macro_attribute = "test"] //~ ERROR malformed `proc_macro_attribute` attribute +#[proc_macro_attribute = "test"] +//~^ ERROR malformed `proc_macro_attribute` attribute +//~| NOTE didn't expect any arguments here pub fn e(_: TokenStream, a: TokenStream) -> TokenStream { a } -#[proc_macro_attribute()] //~ ERROR malformed `proc_macro_attribute` attribute +#[proc_macro_attribute()] +//~^ ERROR malformed `proc_macro_attribute` attribute +//~| NOTE didn't expect any arguments here pub fn g(_: TokenStream, a: TokenStream) -> TokenStream { a } -#[proc_macro_attribute(x)] //~ ERROR malformed `proc_macro_attribute` attribute +#[proc_macro_attribute(x)] +//~^ ERROR malformed `proc_macro_attribute` attribute +//~| NOTE didn't expect any arguments here pub fn h(_: TokenStream, a: TokenStream) -> TokenStream { a } diff --git a/tests/ui/proc-macro/invalid-attributes.stderr b/tests/ui/proc-macro/invalid-attributes.stderr index fe411fa5e1f..11c182ee03a 100644 --- a/tests/ui/proc-macro/invalid-attributes.stderr +++ b/tests/ui/proc-macro/invalid-attributes.stderr @@ -1,38 +1,57 @@ -error: malformed `proc_macro` attribute input +error[E0565]: malformed `proc_macro` attribute input --> $DIR/invalid-attributes.rs:10:1 | LL | #[proc_macro = "test"] - | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]` + | ^^^^^^^^^^^^^--------^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro]` -error: malformed `proc_macro` attribute input - --> $DIR/invalid-attributes.rs:13:1 +error[E0565]: malformed `proc_macro` attribute input + --> $DIR/invalid-attributes.rs:15:1 | LL | #[proc_macro()] - | ^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]` + | ^^^^^^^^^^^^--^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro]` -error: malformed `proc_macro` attribute input - --> $DIR/invalid-attributes.rs:16:1 +error[E0565]: malformed `proc_macro` attribute input + --> $DIR/invalid-attributes.rs:20:1 | LL | #[proc_macro(x)] - | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]` + | ^^^^^^^^^^^^---^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro]` -error: malformed `proc_macro_attribute` attribute input - --> $DIR/invalid-attributes.rs:19:1 +error[E0565]: malformed `proc_macro_attribute` attribute input + --> $DIR/invalid-attributes.rs:25:1 | LL | #[proc_macro_attribute = "test"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]` + | ^^^^^^^^^^^^^^^^^^^^^^^--------^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_attribute]` -error: malformed `proc_macro_attribute` attribute input - --> $DIR/invalid-attributes.rs:22:1 +error[E0565]: malformed `proc_macro_attribute` attribute input + --> $DIR/invalid-attributes.rs:30:1 | LL | #[proc_macro_attribute()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]` + | ^^^^^^^^^^^^^^^^^^^^^^--^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_attribute]` -error: malformed `proc_macro_attribute` attribute input - --> $DIR/invalid-attributes.rs:25:1 +error[E0565]: malformed `proc_macro_attribute` attribute input + --> $DIR/invalid-attributes.rs:35:1 | LL | #[proc_macro_attribute(x)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]` + | ^^^^^^^^^^^^^^^^^^^^^^---^ + | | | + | | didn't expect any arguments here + | help: must be of the form: `#[proc_macro_attribute]` error: aborting due to 6 previous errors +For more information about this error, try `rustc --explain E0565`. diff --git a/tests/ui/proc-macro/meta-macro-hygiene.stdout b/tests/ui/proc-macro/meta-macro-hygiene.stdout index 91d16eca1b0..452598c372c 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.stdout +++ b/tests/ui/proc-macro/meta-macro-hygiene.stdout @@ -16,10 +16,10 @@ Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro // in the stdout #![no_std /* 0#0 */] -#[prelude_import /* 0#1 */] -use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*; #[macro_use /* 0#1 */] extern crate core /* 0#1 */; +#[prelude_import /* 0#1 */] +use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout index 63741326e34..e10a5199f17 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout @@ -36,10 +36,10 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ #![feature /* 0#0 */(decl_macro)] #![no_std /* 0#0 */] -#[prelude_import /* 0#1 */] -use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*; #[macro_use /* 0#1 */] extern crate core /* 0#2 */; +#[prelude_import /* 0#1 */] +use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; diff --git a/tests/ui/proc-macro/quote/debug.stdout b/tests/ui/proc-macro/quote/debug.stdout index 3acb472d9c0..77c52f02a33 100644 --- a/tests/ui/proc-macro/quote/debug.stdout +++ b/tests/ui/proc-macro/quote/debug.stdout @@ -12,10 +12,10 @@ #![feature(proc_macro_quote)] #![crate_type = "proc-macro"] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate proc_macro; diff --git a/tests/ui/process/nofile-limit.rs b/tests/ui/process/nofile-limit.rs index dafc982607c..64777b51425 100644 --- a/tests/ui/process/nofile-limit.rs +++ b/tests/ui/process/nofile-limit.rs @@ -7,6 +7,8 @@ //@ only-linux //@ no-prefer-dynamic //@ compile-flags: -Ctarget-feature=+crt-static -Crpath=no -Crelocation-model=static +//@ ignore-backends: gcc + #![feature(exit_status_error)] #![feature(rustc_private)] extern crate libc; diff --git a/tests/ui/process/println-with-broken-pipe.rs b/tests/ui/process/println-with-broken-pipe.rs index fbac9b6cd95..58b83a2dd9a 100644 --- a/tests/ui/process/println-with-broken-pipe.rs +++ b/tests/ui/process/println-with-broken-pipe.rs @@ -5,6 +5,7 @@ //@ ignore-fuchsia //@ ignore-horizon //@ ignore-android +//@ ignore-backends: gcc //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC" //@ compile-flags: -Zon-broken-pipe=error diff --git a/tests/ui/range/range-inclusive-pattern-precedence.stderr b/tests/ui/range/range-inclusive-pattern-precedence.stderr index 9df20fc4545..15237b0a499 100644 --- a/tests/ui/range/range-inclusive-pattern-precedence.stderr +++ b/tests/ui/range/range-inclusive-pattern-precedence.stderr @@ -16,7 +16,7 @@ LL | &0...9 => {} | ^^^^^^ help: use `..=` for an inclusive range: `&(0..=9)` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/range-inclusive-pattern-precedence.rs:7:9 | diff --git a/tests/ui/range/range-inclusive-pattern-precedence2.stderr b/tests/ui/range/range-inclusive-pattern-precedence2.stderr index fd2fa78e92b..4c5016b8ae4 100644 --- a/tests/ui/range/range-inclusive-pattern-precedence2.stderr +++ b/tests/ui/range/range-inclusive-pattern-precedence2.stderr @@ -16,7 +16,7 @@ LL | box 0...9 => {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/range-inclusive-pattern-precedence2.rs:5:9 | diff --git a/tests/ui/issues/issue-67552.rs b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.rs index 53f0e931d60..0875d385ddc 100644 --- a/tests/ui/issues/issue-67552.rs +++ b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.rs @@ -29,3 +29,5 @@ where //~^ ERROR reached the recursion limit while instantiating } } + +// https://github.com/rust-lang/rust/issues/67552 diff --git a/tests/ui/issues/issue-67552.stderr b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.stderr index def0a29f3e5..fe005984fab 100644 --- a/tests/ui/issues/issue-67552.stderr +++ b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.stderr @@ -1,17 +1,17 @@ error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut ...>` - --> $DIR/issue-67552.rs:28:9 + --> $DIR/recursive-impl-trait-iterator-by-ref-67552.rs:28:9 | LL | rec(identity(&mut it)) | ^^^^^^^^^^^^^^^^^^^^^^ | note: `rec` defined here - --> $DIR/issue-67552.rs:21:1 + --> $DIR/recursive-impl-trait-iterator-by-ref-67552.rs:21:1 | LL | / fn rec<T>(mut it: T) LL | | where LL | | T: Iterator, | |________________^ - = note: the full type name has been written to '$TEST_BUILD_DIR/issue-67552.long-type.txt' + = note: the full type name has been written to '$TEST_BUILD_DIR/recursive-impl-trait-iterator-by-ref-67552.long-type.txt' error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-24353.rs b/tests/ui/return/early-return-with-unreachable-code-24353.rs index 369fc238d11..13add4652d9 100644 --- a/tests/ui/issues/issue-24353.rs +++ b/tests/ui/return/early-return-with-unreachable-code-24353.rs @@ -6,3 +6,5 @@ fn main() { let x = (); x } + +// https://github.com/rust-lang/rust/issues/24353 diff --git a/tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs b/tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs index bd62a644785..b1df1b191bc 100644 --- a/tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs +++ b/tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc //@ revisions: default mir-opt //@[mir-opt] compile-flags: -Zmir-opt-level=4 diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate-macro.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate-macro.rs new file mode 100644 index 00000000000..9d86ebc5331 --- /dev/null +++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate-macro.rs @@ -0,0 +1,14 @@ +// gate-test-if_let_guard + +fn main() { + macro_rules! use_expr { + ($e:expr) => { + match () { + () if $e => {} + _ => {} + } + } + } + use_expr!(let 0 = 1); + //~^ ERROR no rules expected keyword `let` +} diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate-macro.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate-macro.stderr new file mode 100644 index 00000000000..411fde890a1 --- /dev/null +++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate-macro.stderr @@ -0,0 +1,17 @@ +error: no rules expected keyword `let` + --> $DIR/feature-gate-macro.rs:12:15 + | +LL | macro_rules! use_expr { + | --------------------- when calling this macro +... +LL | use_expr!(let 0 = 1); + | ^^^ no rules expected this token in macro call + | +note: while trying to match meta-variable `$e:expr` + --> $DIR/feature-gate-macro.rs:5:10 + | +LL | ($e:expr) => { + | ^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs index b1e305834cb..eb9e5dff37e 100644 --- a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs +++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs @@ -64,8 +64,6 @@ fn _macros() { //~^ ERROR `if let` guards are experimental _ => {} } - use_expr!(let 0 = 1); - //~^ ERROR no rules expected keyword `let` } fn main() {} diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr index 19d1f4b0a57..759f1478350 100644 --- a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr +++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr @@ -149,21 +149,6 @@ LL | use_expr!((let 0 = 1)); = note: only supported directly in conditions of `if` and `while` expressions = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: no rules expected keyword `let` - --> $DIR/feature-gate.rs:67:15 - | -LL | macro_rules! use_expr { - | --------------------- when calling this macro -... -LL | use_expr!(let 0 = 1); - | ^^^ no rules expected this token in macro call - | -note: while trying to match meta-variable `$e:expr` - --> $DIR/feature-gate.rs:48:10 - | -LL | ($e:expr) => { - | ^^^^^^^ - error[E0658]: `if let` guards are experimental --> $DIR/feature-gate.rs:7:12 | @@ -230,6 +215,6 @@ LL | () if let 0 = 1 => {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>` -error: aborting due to 20 previous errors +error: aborting due to 19 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr index ea462609234..e16841b369d 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr @@ -79,7 +79,7 @@ error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and req LL | sse2(); | ^^^^^^ call to function with `#[target_feature]` | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = help: in order for the call to be safe, the context requires the following additional target feature: sse2 = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` note: an unsafe function restricts its caller, but its body is safe by default diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout index e2e45ae94ea..66ba726fb9a 100644 --- a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout +++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout @@ -1,9 +1,9 @@ #![feature(prelude_import)] #![no_std] -#[prelude_import] -use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; //@ check-pass //@ compile-flags: -Z unpretty=expanded //@ edition: 2015 diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs index 37fce2788b7..5fb9943d6c3 100644 --- a/tests/ui/runtime/backtrace-debuginfo.rs +++ b/tests/ui/runtime/backtrace-debuginfo.rs @@ -43,12 +43,13 @@ macro_rules! dump_and_die { // rust-lang/rust to test it as well, but sometimes we just gotta keep // landing PRs. // - // aarch64-msvc is broken as its backtraces are truncated. + // aarch64-msvc/arm64ec-msvc is broken as its backtraces are truncated. // See https://github.com/rust-lang/rust/issues/140489 if cfg!(any(target_os = "android", all(target_os = "linux", target_arch = "arm"), all(target_env = "msvc", target_arch = "x86"), all(target_env = "msvc", target_arch = "aarch64"), + all(target_env = "msvc", target_arch = "arm64ec"), target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd")) { diff --git a/tests/ui/runtime/on-broken-pipe/child-processes.rs b/tests/ui/runtime/on-broken-pipe/child-processes.rs index 0da2347481b..c0c8ad4e2f5 100644 --- a/tests/ui/runtime/on-broken-pipe/child-processes.rs +++ b/tests/ui/runtime/on-broken-pipe/child-processes.rs @@ -1,6 +1,7 @@ //@ revisions: default error kill inherit //@ ignore-cross-compile because aux-bin does not yet support it //@ only-unix because SIGPIPE is a unix thing +//@ ignore-backends: gcc //@ run-pass //@ aux-bin:assert-sigpipe-disposition.rs //@ aux-crate:sigpipe_utils=sigpipe-utils.rs diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs index 6be34afb560..913d3637c8f 100644 --- a/tests/ui/runtime/out-of-stack.rs +++ b/tests/ui/runtime/out-of-stack.rs @@ -19,7 +19,7 @@ extern crate libc; use std::env; use std::hint::black_box; use std::process::Command; -use std::thread; +use std::thread::Builder; fn silent_recurse() { let buf = [0u8; 1000]; @@ -56,9 +56,9 @@ fn main() { } else if args.len() > 1 && args[1] == "loud" { loud_recurse(); } else if args.len() > 1 && args[1] == "silent-thread" { - thread::spawn(silent_recurse).join(); + Builder::new().name("ferris".to_string()).spawn(silent_recurse).unwrap().join(); } else if args.len() > 1 && args[1] == "loud-thread" { - thread::spawn(loud_recurse).join(); + Builder::new().name("ferris".to_string()).spawn(loud_recurse).unwrap().join(); } else { let mut modes = vec![ "silent-thread", @@ -82,6 +82,12 @@ fn main() { let error = String::from_utf8_lossy(&silent.stderr); assert!(error.contains("has overflowed its stack"), "missing overflow message: {}", error); + + if mode.contains("thread") { + assert!(error.contains("ferris"), "missing thread name: {}", error); + } else { + assert!(error.contains("main"), "missing thread name: {}", error); + } } } } diff --git a/tests/ui/runtime/rt-explody-panic-payloads.rs b/tests/ui/runtime/rt-explody-panic-payloads.rs index d564a26ca73..1d5795f8e86 100644 --- a/tests/ui/runtime/rt-explody-panic-payloads.rs +++ b/tests/ui/runtime/rt-explody-panic-payloads.rs @@ -1,6 +1,7 @@ //@ run-pass //@ needs-unwind //@ needs-subprocess +//@ ignore-backends: gcc use std::env; use std::process::Command; diff --git a/tests/ui/rust-2021/array-into-iter-ambiguous.stderr b/tests/ui/rust-2021/array-into-iter-ambiguous.stderr index 2a724bd3072..6e510df027c 100644 --- a/tests/ui/rust-2021/array-into-iter-ambiguous.stderr +++ b/tests/ui/rust-2021/array-into-iter-ambiguous.stderr @@ -5,7 +5,7 @@ LL | let y = points.into_iter(); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyIntoIter::into_iter(points)` | = warning: this changes meaning in Rust 2021 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> note: the lint level is defined here --> $DIR/array-into-iter-ambiguous.rs:5:9 | diff --git a/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr b/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr index f38da132b5e..bbc85d5bf45 100644 --- a/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr @@ -5,7 +5,7 @@ LL | U::try_from(self) | ^^^^^^^^^^^ help: disambiguate the associated function: `<U as PyTryFrom<'_, _>>::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/future-prelude-collision-generic-trait.rs:5:9 | diff --git a/tests/ui/rust-2021/future-prelude-collision-generic.stderr b/tests/ui/rust-2021/future-prelude-collision-generic.stderr index 9893b3ebaa6..06ee6b40f11 100644 --- a/tests/ui/rust-2021/future-prelude-collision-generic.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-generic.stderr @@ -5,7 +5,7 @@ LL | Generic::from_iter(1); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic<'_, _> as MyFromIter>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/future-prelude-collision-generic.rs:5:9 | @@ -19,7 +19,7 @@ LL | Generic::<'static, i32>::from_iter(1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<'static, i32> as MyFromIter>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:34:5 @@ -28,7 +28,7 @@ LL | Generic::<'_, _>::from_iter(1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<'_, _> as MyFromIter>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: 3 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-imported.stderr b/tests/ui/rust-2021/future-prelude-collision-imported.stderr index c1d72d0df21..8f650e9ee51 100644 --- a/tests/ui/rust-2021/future-prelude-collision-imported.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-imported.stderr @@ -5,7 +5,7 @@ LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/future-prelude-collision-imported.rs:4:9 | @@ -19,7 +19,7 @@ LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `crate::m::TryIntoU32::try_into(3u8)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:53:22 @@ -28,7 +28,7 @@ LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `super::m::TryIntoU32::try_into(3u8)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:64:22 @@ -37,7 +37,7 @@ LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: 4 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-macros.stderr b/tests/ui/rust-2021/future-prelude-collision-macros.stderr index 4d4a0769958..c2d8c8540ad 100644 --- a/tests/ui/rust-2021/future-prelude-collision-macros.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-macros.stderr @@ -5,7 +5,7 @@ LL | foo!().try_into(todo!()); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyTry::try_into(foo!(), todo!())` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/future-prelude-collision-macros.rs:4:9 | @@ -19,7 +19,7 @@ LL | <bar!()>::try_from(0); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<bar!() as TryFromU8>::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: 2 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr b/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr index c0ef80fd841..73ed238e5f7 100644 --- a/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr @@ -5,7 +5,7 @@ LL | x.try_into::<usize>().or(Err("foo"))?.checked_sub(1); | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `AnnotatableTryInto::try_into::<usize>(x)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/future-prelude-collision-turbofish.rs:6:9 | @@ -19,7 +19,7 @@ LL | x.try_into::<usize>().or(Err("foo"))?; | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `AnnotatableTryInto::try_into::<usize>(x)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: 2 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision.stderr b/tests/ui/rust-2021/future-prelude-collision.stderr index cae113ff711..0b251454756 100644 --- a/tests/ui/rust-2021/future-prelude-collision.stderr +++ b/tests/ui/rust-2021/future-prelude-collision.stderr @@ -5,7 +5,7 @@ LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/future-prelude-collision.rs:4:9 | @@ -19,7 +19,7 @@ LL | let _ = u32::try_from(3u8).unwrap(); | ^^^^^^^^^^^^^ help: disambiguate the associated function: `<u32 as TryFromU8>::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:66:13 @@ -28,7 +28,7 @@ LL | let _ = <Vec<u8>>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter()); | ^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Vec<u8> as FromByteIterator>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:74:18 @@ -37,7 +37,7 @@ LL | let _: u32 = <_>::try_from(3u8).unwrap(); | ^^^^^^^^^^^^^ help: disambiguate the associated function: `<_ as TryFromU8>::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:79:18 @@ -46,7 +46,7 @@ LL | let _: u32 = (&3u8).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(*(&3u8))` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:84:18 @@ -55,7 +55,7 @@ LL | let _: u32 = 3.0.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(&3.0)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:90:18 @@ -64,7 +64,7 @@ LL | let _: u32 = mut_ptr.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(mut_ptr as *const _)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:95:13 @@ -73,7 +73,7 @@ LL | let _ = U32Alias::try_from(3u8).unwrap(); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<U32Alias as TryFromU8>::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> warning: 8 warnings emitted diff --git a/tests/ui/rust-2021/generic-type-collision.stderr b/tests/ui/rust-2021/generic-type-collision.stderr index 1ec61044f4a..c2d296822c0 100644 --- a/tests/ui/rust-2021/generic-type-collision.stderr +++ b/tests/ui/rust-2021/generic-type-collision.stderr @@ -5,7 +5,7 @@ LL | <Vec<i32>>::from_iter(None); | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Vec<i32> as MyTrait<_>>::from_iter` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/generic-type-collision.rs:4:9 | diff --git a/tests/ui/rust-2021/inherent-dyn-collision.stderr b/tests/ui/rust-2021/inherent-dyn-collision.stderr index d9e720dd9af..d582e4aedcb 100644 --- a/tests/ui/rust-2021/inherent-dyn-collision.stderr +++ b/tests/ui/rust-2021/inherent-dyn-collision.stderr @@ -5,7 +5,7 @@ LL | get_dyn_trait().try_into().unwrap() | ^^^^^^^^^^^^^^^ help: disambiguate the method call: `(&*get_dyn_trait())` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html> note: the lint level is defined here --> $DIR/inherent-dyn-collision.rs:8:9 | diff --git a/tests/ui/rust-2021/reserved-prefixes-migration.stderr b/tests/ui/rust-2021/reserved-prefixes-migration.stderr index 20914d1b9d1..8092c636877 100644 --- a/tests/ui/rust-2021/reserved-prefixes-migration.stderr +++ b/tests/ui/rust-2021/reserved-prefixes-migration.stderr @@ -5,7 +5,7 @@ LL | m2!(z"hey"); | ^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html> note: the lint level is defined here --> $DIR/reserved-prefixes-migration.rs:5:9 | @@ -23,7 +23,7 @@ LL | m2!(prefix"hey"); | ^^^^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html> help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | m2!(prefix "hey"); @@ -36,7 +36,7 @@ LL | m3!(hey#123); | ^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html> help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | m3!(hey #123); @@ -49,7 +49,7 @@ LL | m3!(hey#hey); | ^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html> help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | m3!(hey #hey); @@ -62,7 +62,7 @@ LL | #name = #kind#value | ^^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html> help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | #name = #kind #value diff --git a/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr b/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr index 0735be26652..6da2cb97082 100644 --- a/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr +++ b/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr @@ -5,7 +5,7 @@ LL | let y = points.into_iter(); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyIntoIter::into_iter(points)` | = warning: this changes meaning in Rust 2024 - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/intoiterator-box-slice.html> note: the lint level is defined here --> $DIR/box-slice-into-iter-ambiguous.rs:5:9 | diff --git a/tests/ui/rust-2024/gen-kw.e2015.stderr b/tests/ui/rust-2024/gen-kw.e2015.stderr index 3fca7b41ad2..ebb80cf2217 100644 --- a/tests/ui/rust-2024/gen-kw.e2015.stderr +++ b/tests/ui/rust-2024/gen-kw.e2015.stderr @@ -5,7 +5,7 @@ LL | fn gen() {} | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> note: the lint level is defined here --> $DIR/gen-kw.rs:4:9 | @@ -20,7 +20,7 @@ LL | let gen = r#gen; | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:19:27 @@ -29,7 +29,7 @@ LL | () => { mod test { fn gen() {} } } | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:25:9 @@ -38,7 +38,7 @@ LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:25:19 @@ -47,7 +47,7 @@ LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:33:13 @@ -56,7 +56,7 @@ LL | struct Test<'gen>(Box<Test<'gen>>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:33:28 @@ -65,7 +65,7 @@ LL | struct Test<'gen>(Box<Test<'gen>>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:33:37 @@ -74,7 +74,7 @@ LL | struct Test<'gen>(Box<Test<'gen>>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: aborting due to 8 previous errors diff --git a/tests/ui/rust-2024/gen-kw.e2018.stderr b/tests/ui/rust-2024/gen-kw.e2018.stderr index b7f2c887536..e491454d2a6 100644 --- a/tests/ui/rust-2024/gen-kw.e2018.stderr +++ b/tests/ui/rust-2024/gen-kw.e2018.stderr @@ -5,7 +5,7 @@ LL | fn gen() {} | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> note: the lint level is defined here --> $DIR/gen-kw.rs:4:9 | @@ -20,7 +20,7 @@ LL | let gen = r#gen; | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:19:27 @@ -29,7 +29,7 @@ LL | () => { mod test { fn gen() {} } } | ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:25:9 @@ -38,7 +38,7 @@ LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:25:19 @@ -47,7 +47,7 @@ LL | fn test<'gen>(_: &'gen i32) {} | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:33:13 @@ -56,7 +56,7 @@ LL | struct Test<'gen>(Box<Test<'gen>>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:33:28 @@ -65,7 +65,7 @@ LL | struct Test<'gen>(Box<Test<'gen>>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: `gen` is a keyword in the 2024 edition --> $DIR/gen-kw.rs:33:37 @@ -74,7 +74,7 @@ LL | struct Test<'gen>(Box<Test<'gen>>, &'gen ()); | ^^^^ help: you can use a raw identifier to stay compatible: `'r#gen` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html> error: aborting due to 8 previous errors diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr index 15a3fa11414..8e5c3f4eb1d 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr +++ b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr @@ -5,7 +5,7 @@ LL | core::pin::pin!(async {}).poll(&mut context()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(async {}), &mut context())` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/prelude.html> note: the lint level is defined here --> $DIR/future-poll-async-block.rs:7:9 | diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr index 633731c2a5a..70769524d2d 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr +++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr @@ -5,7 +5,7 @@ LL | core::pin::pin!(()).poll(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(()))` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/prelude.html> note: the lint level is defined here --> $DIR/future-poll-not-future-pinned.rs:7:9 | diff --git a/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr b/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr index 5865029d65d..2e88751cd8a 100644 --- a/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr +++ b/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr @@ -5,7 +5,7 @@ LL | core::pin::pin!(async {}).poll(&mut context()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(async {}), &mut context())` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/prelude.html> note: the lint level is defined here --> $DIR/in_2024_compatibility.rs:3:9 | diff --git a/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr index e67f07b4e46..690c58f85b9 100644 --- a/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr +++ b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr @@ -5,7 +5,7 @@ LL | Cat.into_future(); | ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::into_future(&Cat)` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/prelude.html> note: the lint level is defined here --> $DIR/into-future-adt.rs:7:9 | diff --git a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr index 0588f5bf3f5..4423e1272e8 100644 --- a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr +++ b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr @@ -5,7 +5,7 @@ LL | Cat.into_future(); | ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::into_future(&Cat)` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/prelude.html> note: the lint level is defined here --> $DIR/into-future-not-into-future.rs:7:9 | diff --git a/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr b/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr index bf74f6eff99..488f66bb01d 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr +++ b/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr @@ -35,7 +35,7 @@ LL | demo3!(## "foo"); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> note: the lint level is defined here --> $DIR/reserved-guarded-strings-lexing.rs:4:9 | @@ -53,7 +53,7 @@ LL | demo4!(### "foo"); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# ## "foo"); @@ -66,7 +66,7 @@ LL | demo4!(### "foo"); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(## # "foo"); @@ -79,7 +79,7 @@ LL | demo4!(## "foo"#); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# # "foo"#); @@ -92,7 +92,7 @@ LL | demo7!(### "foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(# ## "foo"###); @@ -105,7 +105,7 @@ LL | demo7!(### "foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(## # "foo"###); @@ -118,7 +118,7 @@ LL | demo7!(### "foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(### "foo"# ##); @@ -131,7 +131,7 @@ LL | demo7!(### "foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(### "foo"## #); @@ -144,7 +144,7 @@ LL | demo5!(###"foo"#); | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo5!(# ##"foo"#); @@ -157,7 +157,7 @@ LL | demo5!(###"foo"#); | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo5!(## #"foo"#); @@ -170,7 +170,7 @@ LL | demo5!(###"foo"#); | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo5!(### "foo"#); @@ -183,7 +183,7 @@ LL | demo5!(#"foo"###); | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo5!(# "foo"###); @@ -196,7 +196,7 @@ LL | demo5!(#"foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo5!(#"foo"# ##); @@ -209,7 +209,7 @@ LL | demo5!(#"foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo5!(#"foo"## #); @@ -222,7 +222,7 @@ LL | demo4!("foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"# ##); @@ -235,7 +235,7 @@ LL | demo4!("foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"## #); @@ -248,7 +248,7 @@ LL | demo4!(Ñ#""#); | ^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo4!(Ñ# ""#); @@ -261,7 +261,7 @@ LL | demo3!(🙃#""); | ^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo3!(🙃# ""); diff --git a/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr b/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr index 59f920caa95..9e6c4554281 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr +++ b/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr @@ -5,7 +5,7 @@ LL | demo3!(## "foo"); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> note: the lint level is defined here --> $DIR/reserved-guarded-strings-migration.rs:5:9 | @@ -23,7 +23,7 @@ LL | demo4!(### "foo"); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# ## "foo"); @@ -36,7 +36,7 @@ LL | demo4!(### "foo"); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(## # "foo"); @@ -49,7 +49,7 @@ LL | demo4!(## "foo"#); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# # "foo"#); @@ -62,7 +62,7 @@ LL | demo6!(### "foo"##); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo6!(# ## "foo"##); @@ -75,7 +75,7 @@ LL | demo6!(### "foo"##); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo6!(## # "foo"##); @@ -88,7 +88,7 @@ LL | demo6!(### "foo"##); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo6!(### "foo"# #); @@ -101,7 +101,7 @@ LL | demo4!("foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"# ##); @@ -114,7 +114,7 @@ LL | demo4!("foo"###); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"## #); @@ -127,7 +127,7 @@ LL | demo2!(#""); | ^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo2!(# ""); @@ -140,7 +140,7 @@ LL | demo3!(#""#); | ^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo3!(# ""#); @@ -153,7 +153,7 @@ LL | demo3!(##""); | ^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo3!(# #""); @@ -166,7 +166,7 @@ LL | demo3!(##""); | ^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo3!(## ""); @@ -179,7 +179,7 @@ LL | demo2!(#"foo"); | ^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo2!(# "foo"); @@ -192,7 +192,7 @@ LL | demo3!(##"foo"); | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo3!(# #"foo"); @@ -205,7 +205,7 @@ LL | demo3!(##"foo"); | ^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo3!(## "foo"); @@ -218,7 +218,7 @@ LL | demo3!(#"foo"#); | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo3!(# "foo"#); @@ -231,7 +231,7 @@ LL | demo4!(##"foo"#); | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo4!(# #"foo"#); @@ -244,7 +244,7 @@ LL | demo4!(##"foo"#); | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo4!(## "foo"#); @@ -257,7 +257,7 @@ LL | demo5!(##"foo"##); | ^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo5!(# #"foo"##); @@ -270,7 +270,7 @@ LL | demo5!(##"foo"##); | ^^^^^^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 | LL | demo5!(## "foo"##); @@ -283,7 +283,7 @@ LL | demo5!(##"foo"##); | ^^ | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/reserved-syntax.html> help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo5!(##"foo"# #); diff --git a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr index f0a49f5bd79..2b77f6e8e52 100644 --- a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr @@ -5,7 +5,7 @@ LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> note: the lint level is defined here --> $DIR/in_2024_compatibility.rs:1:9 | diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr index 15a48fb7159..b97176f5e0d 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr @@ -5,7 +5,7 @@ LL | tt!([no_mangle]); | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> note: the lint level is defined here --> $DIR/unsafe-attributes-fix.rs:2:9 | @@ -26,7 +26,7 @@ LL | ident!(no_mangle); | ----------------- in this macro invocation | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> = note: this error originates in the macro `ident` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | @@ -40,7 +40,7 @@ LL | meta!(no_mangle); | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> help: wrap the attribute in `unsafe(...)` | LL | meta!(unsafe(no_mangle)); @@ -53,7 +53,7 @@ LL | meta2!(export_name = "baw"); | ^^^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> help: wrap the attribute in `unsafe(...)` | LL | meta2!(unsafe(export_name = "baw")); @@ -69,7 +69,7 @@ LL | ident2!(export_name, "bars"); | ---------------------------- in this macro invocation | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> = note: this error originates in the macro `ident2` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | @@ -86,7 +86,7 @@ LL | with_cfg_attr!(); | ---------------- in this macro invocation | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> = note: this error originates in the macro `with_cfg_attr` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | @@ -100,7 +100,7 @@ LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html> help: wrap the attribute in `unsafe(...)` | LL | #[unsafe(no_mangle)] diff --git a/tests/ui/rust-2024/unsafe-env-suggestion.stderr b/tests/ui/rust-2024/unsafe-env-suggestion.stderr index 6c95d50f393..3c5ceaaaf42 100644 --- a/tests/ui/rust-2024/unsafe-env-suggestion.stderr +++ b/tests/ui/rust-2024/unsafe-env-suggestion.stderr @@ -5,7 +5,7 @@ LL | env::set_var("FOO", "BAR"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/newly-unsafe-functions.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/newly-unsafe-functions.html> note: the lint level is defined here --> $DIR/unsafe-env-suggestion.rs:3:9 | @@ -24,7 +24,7 @@ LL | env::remove_var("FOO"); | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/newly-unsafe-functions.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/newly-unsafe-functions.html> help: you can wrap the call in an `unsafe` block if you can guarantee that the environment access only happens in single-threaded code | LL + // TODO: Audit that the environment access only happens in single-threaded code. diff --git a/tests/ui/rust-2024/unsafe-env.e2021.stderr b/tests/ui/rust-2024/unsafe-env.e2021.stderr index 4a441cf43ff..a73db9fd60c 100644 --- a/tests/ui/rust-2024/unsafe-env.e2021.stderr +++ b/tests/ui/rust-2024/unsafe-env.e2021.stderr @@ -4,7 +4,7 @@ error[E0133]: call to unsafe function `unsafe_fn` is unsafe and requires unsafe LL | unsafe_fn(); | ^^^^^^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/unsafe-env.rs:8:1 diff --git a/tests/ui/rust-2024/unsafe-env.e2024.stderr b/tests/ui/rust-2024/unsafe-env.e2024.stderr index 0ee7e042946..cb48ae231f2 100644 --- a/tests/ui/rust-2024/unsafe-env.e2024.stderr +++ b/tests/ui/rust-2024/unsafe-env.e2024.stderr @@ -4,7 +4,7 @@ error[E0133]: call to unsafe function `std::env::set_var` is unsafe and requires LL | env::set_var("FOO", "BAR"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/unsafe-env.rs:8:1 @@ -23,7 +23,7 @@ error[E0133]: call to unsafe function `std::env::remove_var` is unsafe and requi LL | env::remove_var("FOO"); | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `unsafe_fn` is unsafe and requires unsafe block @@ -32,7 +32,7 @@ error[E0133]: call to unsafe function `unsafe_fn` is unsafe and requires unsafe LL | unsafe_fn(); | ^^^^^^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr index ab12da0c416..9a535fbbaf5 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr @@ -14,7 +14,7 @@ LL | | } | |_^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-extern.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-extern.html> note: the lint level is defined here --> $DIR/unsafe-extern-suggestion.rs:3:9 | diff --git a/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs b/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs index f4f383e008a..fad57198dfb 100644 --- a/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs +++ b/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs @@ -6,6 +6,7 @@ //@ edition: 2021 //@ no-prefer-dynamic //@ only-x86_64-unknown-linux-gnu +//@ ignore-backends: gcc //@ build-pass trait Iterable { diff --git a/tests/ui/sanitizer/cfi/async-closures.rs b/tests/ui/sanitizer/cfi/async-closures.rs index 351853ab1a7..9b099263000 100644 --- a/tests/ui/sanitizer/cfi/async-closures.rs +++ b/tests/ui/sanitizer/cfi/async-closures.rs @@ -4,6 +4,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/cfi/can-reveal-opaques.rs b/tests/ui/sanitizer/cfi/can-reveal-opaques.rs index 99c12d72eb5..a881c6b92b2 100644 --- a/tests/ui/sanitizer/cfi/can-reveal-opaques.rs +++ b/tests/ui/sanitizer/cfi/can-reveal-opaques.rs @@ -2,6 +2,7 @@ //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi //@ no-prefer-dynamic //@ only-x86_64-unknown-linux-gnu +//@ ignore-backends: gcc //@ build-pass // See comment below for why this test exists. diff --git a/tests/ui/sanitizer/cfi/closures.rs b/tests/ui/sanitizer/cfi/closures.rs index 424e70560db..fc9718faa28 100644 --- a/tests/ui/sanitizer/cfi/closures.rs +++ b/tests/ui/sanitizer/cfi/closures.rs @@ -3,6 +3,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/cfi/complex-receiver.rs b/tests/ui/sanitizer/cfi/complex-receiver.rs index c7b45a775ca..aac44c33227 100644 --- a/tests/ui/sanitizer/cfi/complex-receiver.rs +++ b/tests/ui/sanitizer/cfi/complex-receiver.rs @@ -5,6 +5,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/cfi/coroutine.rs b/tests/ui/sanitizer/cfi/coroutine.rs index 39a754f1036..084a521f597 100644 --- a/tests/ui/sanitizer/cfi/coroutine.rs +++ b/tests/ui/sanitizer/cfi/coroutine.rs @@ -3,6 +3,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ edition: 2024 //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi diff --git a/tests/ui/sanitizer/cfi/drop-in-place.rs b/tests/ui/sanitizer/cfi/drop-in-place.rs index 8ce2c432602..160338a5b54 100644 --- a/tests/ui/sanitizer/cfi/drop-in-place.rs +++ b/tests/ui/sanitizer/cfi/drop-in-place.rs @@ -2,6 +2,7 @@ // // FIXME(#122848): Remove only-linux when fixed. //@ only-linux +//@ ignore-backends: gcc //@ needs-sanitizer-cfi //@ compile-flags: -Clto -Copt-level=0 -Cprefer-dynamic=off -Ctarget-feature=-crt-static -Zsanitizer=cfi //@ run-pass diff --git a/tests/ui/sanitizer/cfi/drop-no-principal.rs b/tests/ui/sanitizer/cfi/drop-no-principal.rs index c1c88c8c71c..e3a46fe9d75 100644 --- a/tests/ui/sanitizer/cfi/drop-no-principal.rs +++ b/tests/ui/sanitizer/cfi/drop-no-principal.rs @@ -3,6 +3,7 @@ //@ needs-sanitizer-cfi // FIXME(#122848) Remove only-linux once OSX CFI binaries works //@ only-linux +//@ ignore-backends: gcc //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi //@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0 // FIXME(#118761) Should be run-pass once the labels on drop are compatible. diff --git a/tests/ui/sanitizer/cfi/fn-ptr.rs b/tests/ui/sanitizer/cfi/fn-ptr.rs index 505b4b8e7f0..d3209c62ddf 100644 --- a/tests/ui/sanitizer/cfi/fn-ptr.rs +++ b/tests/ui/sanitizer/cfi/fn-ptr.rs @@ -3,6 +3,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/cfi/self-ref.rs b/tests/ui/sanitizer/cfi/self-ref.rs index 3b524ac661c..b93d49296b6 100644 --- a/tests/ui/sanitizer/cfi/self-ref.rs +++ b/tests/ui/sanitizer/cfi/self-ref.rs @@ -3,6 +3,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/cfi/sized-associated-ty.rs b/tests/ui/sanitizer/cfi/sized-associated-ty.rs index f5b4e22e9d9..eefc3e2e9db 100644 --- a/tests/ui/sanitizer/cfi/sized-associated-ty.rs +++ b/tests/ui/sanitizer/cfi/sized-associated-ty.rs @@ -4,6 +4,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/cfi/supertraits.rs b/tests/ui/sanitizer/cfi/supertraits.rs index f80b3169188..f5a984b9583 100644 --- a/tests/ui/sanitizer/cfi/supertraits.rs +++ b/tests/ui/sanitizer/cfi/supertraits.rs @@ -3,6 +3,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/cfi/virtual-auto.rs b/tests/ui/sanitizer/cfi/virtual-auto.rs index 6971d516a20..e6f2ebd4b2c 100644 --- a/tests/ui/sanitizer/cfi/virtual-auto.rs +++ b/tests/ui/sanitizer/cfi/virtual-auto.rs @@ -3,6 +3,7 @@ //@ revisions: cfi kcfi // FIXME(#122848) Remove only-linux once OSX CFI binaries work //@ only-linux +//@ ignore-backends: gcc //@ [cfi] needs-sanitizer-cfi //@ [kcfi] needs-sanitizer-kcfi //@ compile-flags: -C target-feature=-crt-static diff --git a/tests/ui/sanitizer/kcfi-mangling.rs b/tests/ui/sanitizer/kcfi-mangling.rs index fde7b5451b6..ba36dc184ec 100644 --- a/tests/ui/sanitizer/kcfi-mangling.rs +++ b/tests/ui/sanitizer/kcfi-mangling.rs @@ -4,6 +4,7 @@ //@ no-prefer-dynamic //@ compile-flags: -C panic=abort -Zsanitizer=kcfi -C symbol-mangling-version=v0 //@ build-pass +//@ ignore-backends: gcc trait Foo { fn foo(&self); diff --git a/tests/ui/self-profile/pretty_print_no_ice.rs b/tests/ui/self-profile/pretty_print_no_ice.rs new file mode 100644 index 00000000000..71b15e82650 --- /dev/null +++ b/tests/ui/self-profile/pretty_print_no_ice.rs @@ -0,0 +1,14 @@ +// Checks that when we use `-Zself-profile-events=args`, it is possible to pretty print paths +// using `trimmed_def_paths` even without producing diagnostics. +// +// Issue: <https://github.com/rust-lang/rust/issues/144457>. + +//@ compile-flags: -Zself-profile={{build-base}} -Zself-profile-events=args +//@ build-pass + +use std::sync::atomic::AtomicUsize; +use std::sync::atomic::Ordering::Relaxed; + +fn main() { + AtomicUsize::new(0).load(Relaxed); +} diff --git a/tests/ui/self/self_type_keyword.rs b/tests/ui/self/self_type_keyword.rs index 96d24715edb..bd051279a72 100644 --- a/tests/ui/self/self_type_keyword.rs +++ b/tests/ui/self/self_type_keyword.rs @@ -18,8 +18,6 @@ pub fn main() { //~| ERROR cannot find unit struct, unit variant or constant `Self` ref mut Self => (), //~^ ERROR expected identifier, found keyword `Self` - Self!() => (), - //~^ ERROR cannot find macro `Self` in this scope Foo { Self } => (), //~^ ERROR expected identifier, found keyword `Self` //~| ERROR mismatched types diff --git a/tests/ui/self/self_type_keyword.stderr b/tests/ui/self/self_type_keyword.stderr index f9cde810cad..f22d04bb227 100644 --- a/tests/ui/self/self_type_keyword.stderr +++ b/tests/ui/self/self_type_keyword.stderr @@ -36,35 +36,29 @@ LL | ref mut Self => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:23:15 + --> $DIR/self_type_keyword.rs:21:15 | LL | Foo { Self } => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:31:26 + --> $DIR/self_type_keyword.rs:29:26 | LL | extern crate core as Self; | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:36:32 + --> $DIR/self_type_keyword.rs:34:32 | LL | use std::option::Option as Self; | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:41:11 + --> $DIR/self_type_keyword.rs:39:11 | LL | trait Self {} | ^^^^ expected identifier, found keyword -error: cannot find macro `Self` in this scope - --> $DIR/self_type_keyword.rs:21:9 - | -LL | Self!() => (), - | ^^^^ - error[E0531]: cannot find unit struct, unit variant or constant `Self` in this scope --> $DIR/self_type_keyword.rs:16:13 | @@ -86,7 +80,7 @@ LL | struct Bar<'Self>; = help: consider removing `'Self`, referring to it in a field, or using a marker such as `PhantomData` error[E0308]: mismatched types - --> $DIR/self_type_keyword.rs:23:9 + --> $DIR/self_type_keyword.rs:21:9 | LL | match 15 { | -- this expression has type `{integer}` @@ -95,12 +89,12 @@ LL | Foo { Self } => (), | ^^^^^^^^^^^^ expected integer, found `Foo` error[E0026]: struct `Foo` does not have a field named `Self` - --> $DIR/self_type_keyword.rs:23:15 + --> $DIR/self_type_keyword.rs:21:15 | LL | Foo { Self } => (), | ^^^^ struct `Foo` does not have this field -error: aborting due to 14 previous errors +error: aborting due to 13 previous errors Some errors have detailed explanations: E0026, E0308, E0392, E0531. For more information about an error, try `rustc --explain E0026`. diff --git a/tests/ui/self/self_type_macro_name.rs b/tests/ui/self/self_type_macro_name.rs new file mode 100644 index 00000000000..b92b23b3b4e --- /dev/null +++ b/tests/ui/self/self_type_macro_name.rs @@ -0,0 +1,6 @@ +pub fn main() { + match 15 { + Self!() => (), + //~^ ERROR cannot find macro `Self` in this scope + } +} diff --git a/tests/ui/self/self_type_macro_name.stderr b/tests/ui/self/self_type_macro_name.stderr new file mode 100644 index 00000000000..25f766b758c --- /dev/null +++ b/tests/ui/self/self_type_macro_name.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `Self` in this scope + --> $DIR/self_type_macro_name.rs:3:9 + | +LL | Self!() => (), + | ^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs index bf38a8b1720..09f5d41a87c 100644 --- a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs +++ b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs @@ -1,4 +1,6 @@ //@ run-pass +//@ ignore-backends: gcc + #![allow(non_camel_case_types)] #![feature(repr_simd, core_intrinsics)] diff --git a/tests/ui/simd/intrinsic/generic-as.rs b/tests/ui/simd/intrinsic/generic-as.rs index f9ed416b6ff..bba712e6296 100644 --- a/tests/ui/simd/intrinsic/generic-as.rs +++ b/tests/ui/simd/intrinsic/generic-as.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ ignore-backends: gcc #![feature(repr_simd, core_intrinsics)] diff --git a/tests/ui/simd/issue-17170.rs b/tests/ui/simd/issue-17170.rs index 2d13962843c..508f480a58d 100644 --- a/tests/ui/simd/issue-17170.rs +++ b/tests/ui/simd/issue-17170.rs @@ -1,4 +1,6 @@ //@ run-pass +//@ ignore-backends: gcc + #![feature(repr_simd)] #[repr(simd)] diff --git a/tests/ui/simd/issue-39720.rs b/tests/ui/simd/issue-39720.rs index 09d6142c920..41617c744d6 100644 --- a/tests/ui/simd/issue-39720.rs +++ b/tests/ui/simd/issue-39720.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ ignore-backends: gcc #![feature(repr_simd, core_intrinsics)] diff --git a/tests/ui/simd/masked-load-store.rs b/tests/ui/simd/masked-load-store.rs index da32ba611c4..bc4307fb26d 100644 --- a/tests/ui/simd/masked-load-store.rs +++ b/tests/ui/simd/masked-load-store.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ run-pass #![feature(repr_simd, core_intrinsics)] diff --git a/tests/ui/simd/repr-simd-on-enum.rs b/tests/ui/simd/repr-simd-on-enum.rs new file mode 100644 index 00000000000..49cf9e92d36 --- /dev/null +++ b/tests/ui/simd/repr-simd-on-enum.rs @@ -0,0 +1,15 @@ +// Used to ICE; see <https://github.com/rust-lang/rust/issues/121097> + +#![feature(repr_simd)] + +#[repr(simd)] //~ ERROR attribute should be applied to a struct +enum Aligned { + Zero = 0, + One = 1, +} + +fn tou8(al: Aligned) -> u8 { + al as u8 +} + +fn main() {} diff --git a/tests/ui/simd/repr-simd-on-enum.stderr b/tests/ui/simd/repr-simd-on-enum.stderr new file mode 100644 index 00000000000..6a19a16e8ea --- /dev/null +++ b/tests/ui/simd/repr-simd-on-enum.stderr @@ -0,0 +1,14 @@ +error[E0517]: attribute should be applied to a struct + --> $DIR/repr-simd-on-enum.rs:5:8 + | +LL | #[repr(simd)] + | ^^^^ +LL | / enum Aligned { +LL | | Zero = 0, +LL | | One = 1, +LL | | } + | |_- not a struct + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0517`. diff --git a/tests/ui/simd/repr_packed.rs b/tests/ui/simd/repr_packed.rs index f0c6de7c402..9cf679dc432 100644 --- a/tests/ui/simd/repr_packed.rs +++ b/tests/ui/simd/repr_packed.rs @@ -1,3 +1,4 @@ +//@ ignore-backends: gcc //@ run-pass #![feature(repr_simd, core_intrinsics)] diff --git a/tests/ui/simd/simd-bitmask-notpow2.rs b/tests/ui/simd/simd-bitmask-notpow2.rs index b9af591d1b9..991fe0d8933 100644 --- a/tests/ui/simd/simd-bitmask-notpow2.rs +++ b/tests/ui/simd/simd-bitmask-notpow2.rs @@ -2,6 +2,8 @@ // FIXME: broken codegen on big-endian (https://github.com/rust-lang/rust/issues/127205) // This should be merged into `simd-bitmask` once that's fixed. //@ ignore-endian-big +//@ ignore-backends: gcc + #![feature(repr_simd, core_intrinsics)] #[path = "../../auxiliary/minisimd.rs"] diff --git a/tests/ui/issues/issue-37534.rs b/tests/ui/sized/relaxing-default-bound-error-37534.rs index 63f6479ae2e..d30e9f92ce9 100644 --- a/tests/ui/issues/issue-37534.rs +++ b/tests/ui/sized/relaxing-default-bound-error-37534.rs @@ -3,3 +3,5 @@ struct Foo<T: ?Hash> {} //~| ERROR bound modifier `?` can only be applied to `Sized` fn main() {} + +// https://github.com/rust-lang/rust/issues/37534 diff --git a/tests/ui/issues/issue-37534.stderr b/tests/ui/sized/relaxing-default-bound-error-37534.stderr index 08607354203..8b9597f33e3 100644 --- a/tests/ui/issues/issue-37534.stderr +++ b/tests/ui/sized/relaxing-default-bound-error-37534.stderr @@ -1,5 +1,5 @@ error[E0404]: expected trait, found derive macro `Hash` - --> $DIR/issue-37534.rs:1:16 + --> $DIR/relaxing-default-bound-error-37534.rs:1:16 | LL | struct Foo<T: ?Hash> {} | ^^^^ not a trait @@ -10,7 +10,7 @@ LL + use std::hash::Hash; | error: bound modifier `?` can only be applied to `Sized` - --> $DIR/issue-37534.rs:1:15 + --> $DIR/relaxing-default-bound-error-37534.rs:1:15 | LL | struct Foo<T: ?Hash> {} | ^^^^^ diff --git a/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr b/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr index 8ead943ffe3..f656aeaa16c 100644 --- a/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr +++ b/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr @@ -1,26 +1,38 @@ -error: malformed `unstable` attribute input +error[E0539]: malformed `unstable` attribute input --> $DIR/stability-attribute-sanity-4.rs:8:5 | LL | #[unstable] - | ^^^^^^^^^^^ help: must be of the form: `#[unstable(feature = "name", reason = "...", issue = "N")]` + | ^^^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[unstable(feature = "name", reason = "...", issue = "N")]` -error: malformed `unstable` attribute input +error[E0539]: malformed `unstable` attribute input --> $DIR/stability-attribute-sanity-4.rs:11:5 | LL | #[unstable = "b"] - | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[unstable(feature = "name", reason = "...", issue = "N")]` + | ^^^^^^^^^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[unstable(feature = "name", reason = "...", issue = "N")]` -error: malformed `stable` attribute input +error[E0539]: malformed `stable` attribute input --> $DIR/stability-attribute-sanity-4.rs:14:5 | LL | #[stable] - | ^^^^^^^^^ help: must be of the form: `#[stable(feature = "name", since = "version")]` + | ^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[stable(feature = "name", since = "version")]` -error: malformed `stable` attribute input +error[E0539]: malformed `stable` attribute input --> $DIR/stability-attribute-sanity-4.rs:17:5 | LL | #[stable = "a"] - | ^^^^^^^^^^^^^^^ help: must be of the form: `#[stable(feature = "name", since = "version")]` + | ^^^^^^^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[stable(feature = "name", since = "version")]` error[E0542]: missing 'since' --> $DIR/stability-attribute-sanity-4.rs:21:5 @@ -42,5 +54,5 @@ LL | #[deprecated = "a"] error: aborting due to 7 previous errors -Some errors have detailed explanations: E0542, E0543. -For more information about an error, try `rustc --explain E0542`. +Some errors have detailed explanations: E0539, E0542, E0543. +For more information about an error, try `rustc --explain E0539`. diff --git a/tests/ui/static/issue-24446.rs b/tests/ui/static/issue-24446.rs index 830e373c189..ffd6dfabc28 100644 --- a/tests/ui/static/issue-24446.rs +++ b/tests/ui/static/issue-24446.rs @@ -1,8 +1,6 @@ fn main() { static foo: dyn Fn() -> u32 = || -> u32 { //~^ ERROR the size for values of type - //~| ERROR cannot be shared between threads safely - //~| ERROR mismatched types 0 }; } diff --git a/tests/ui/static/issue-24446.stderr b/tests/ui/static/issue-24446.stderr index ed195634f12..497ce8ccfb6 100644 --- a/tests/ui/static/issue-24446.stderr +++ b/tests/ui/static/issue-24446.stderr @@ -1,12 +1,3 @@ -error[E0277]: `(dyn Fn() -> u32 + 'static)` cannot be shared between threads safely - --> $DIR/issue-24446.rs:2:17 - | -LL | static foo: dyn Fn() -> u32 = || -> u32 { - | ^^^^^^^^^^^^^^^ `(dyn Fn() -> u32 + 'static)` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `(dyn Fn() -> u32 + 'static)` - = note: shared static variables must have a type that implements `Sync` - error[E0277]: the size for values of type `(dyn Fn() -> u32 + 'static)` cannot be known at compilation time --> $DIR/issue-24446.rs:2:5 | @@ -16,19 +7,6 @@ LL | static foo: dyn Fn() -> u32 = || -> u32 { = help: the trait `Sized` is not implemented for `(dyn Fn() -> u32 + 'static)` = note: statics and constants must have a statically known size -error[E0308]: mismatched types - --> $DIR/issue-24446.rs:2:35 - | -LL | static foo: dyn Fn() -> u32 = || -> u32 { - | ___________________________________^ -... | -LL | | }; - | |_____^ expected `dyn Fn`, found closure - | - = note: expected trait object `(dyn Fn() -> u32 + 'static)` - found closure `{closure@$DIR/issue-24446.rs:2:35: 2:44}` - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0277, E0308. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/static/static-items-cant-move.stderr b/tests/ui/static/static-items-cant-move.stderr index 1361e7089e8..7c806613c5c 100644 --- a/tests/ui/static/static-items-cant-move.stderr +++ b/tests/ui/static/static-items-cant-move.stderr @@ -3,6 +3,15 @@ error[E0507]: cannot move out of static item `BAR` | LL | test(BAR); | ^^^ move occurs because `BAR` has type `Foo`, which does not implement the `Copy` trait + | +note: if `Foo` implemented `Clone`, you could clone the value + --> $DIR/static-items-cant-move.rs:5:1 + | +LL | struct Foo { + | ^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | test(BAR); + | --- you could clone this value error: aborting due to 1 previous error diff --git a/tests/ui/statics/const_generics.rs b/tests/ui/statics/const_generics.rs index 6cc0a65f77d..1921b2c99a3 100644 --- a/tests/ui/statics/const_generics.rs +++ b/tests/ui/statics/const_generics.rs @@ -3,6 +3,7 @@ //! This is not an intentional guarantee, it just describes the status quo. //@ run-pass +//@ ignore-backends: gcc // With optimizations, LLVM will deduplicate the constant `X` whose // value is `&42` to just be a reference to the static. This is correct, // but obscures the issue we're trying to show. diff --git a/tests/ui/statics/issue-15261.stderr b/tests/ui/statics/issue-15261.stderr index d2dd762aa66..60c5fb93dba 100644 --- a/tests/ui/statics/issue-15261.stderr +++ b/tests/ui/statics/issue-15261.stderr @@ -4,7 +4,7 @@ warning: creating a shared reference to mutable static LL | static n: &'static usize = unsafe { &n_mut }; | ^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw const` instead to create a raw pointer diff --git a/tests/ui/statics/static-mut-shared-parens.stderr b/tests/ui/statics/static-mut-shared-parens.stderr index 3825e8efc42..16daee091a8 100644 --- a/tests/ui/statics/static-mut-shared-parens.stderr +++ b/tests/ui/statics/static-mut-shared-parens.stderr @@ -4,7 +4,7 @@ warning: creating a shared reference to mutable static LL | let _ = unsafe { (&TEST) as *const usize }; | ^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw const` instead to create a raw pointer @@ -18,7 +18,7 @@ warning: creating a mutable reference to mutable static LL | let _ = unsafe { (&mut TEST) as *const usize }; | ^^^^^^^^^^^ mutable reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | diff --git a/tests/ui/statics/static-mut-xc.stderr b/tests/ui/statics/static-mut-xc.stderr index 2d7a0553e92..2e5aa1b2645 100644 --- a/tests/ui/statics/static-mut-xc.stderr +++ b/tests/ui/statics/static-mut-xc.stderr @@ -4,7 +4,7 @@ warning: creating a shared reference to mutable static LL | assert_eq!(static_mut_xc::a, 3); | ^^^^^^^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives = note: `#[warn(static_mut_refs)]` on by default @@ -14,7 +14,7 @@ warning: creating a shared reference to mutable static LL | assert_eq!(static_mut_xc::a, 4); | ^^^^^^^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a shared reference to mutable static @@ -23,7 +23,7 @@ warning: creating a shared reference to mutable static LL | assert_eq!(static_mut_xc::a, 5); | ^^^^^^^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a shared reference to mutable static @@ -32,7 +32,7 @@ warning: creating a shared reference to mutable static LL | assert_eq!(static_mut_xc::a, 15); | ^^^^^^^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a shared reference to mutable static @@ -41,7 +41,7 @@ warning: creating a shared reference to mutable static LL | assert_eq!(static_mut_xc::a, -3); | ^^^^^^^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: creating a shared reference to mutable static @@ -50,7 +50,7 @@ warning: creating a shared reference to mutable static LL | static_bound(&static_mut_xc::a); | ^^^^^^^^^^^^^^^^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives help: use `&raw const` instead to create a raw pointer | @@ -63,7 +63,7 @@ warning: creating a mutable reference to mutable static LL | static_bound_set(&mut static_mut_xc::a); | ^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | diff --git a/tests/ui/statics/static-recursive.stderr b/tests/ui/statics/static-recursive.stderr index 252807e2e5d..0c3f961372b 100644 --- a/tests/ui/statics/static-recursive.stderr +++ b/tests/ui/statics/static-recursive.stderr @@ -4,7 +4,7 @@ warning: creating a shared reference to mutable static LL | static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 }; | ^^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw const` instead to create a raw pointer @@ -18,7 +18,7 @@ warning: creating a shared reference to mutable static LL | assert_eq!(S, *(S as *const *const u8)); | ^ shared reference to mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html> = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives warning: 2 warnings emitted diff --git a/tests/ui/issues/issue-11267.rs b/tests/ui/structs/mutable-unit-struct-borrow-11267.rs index 036ad1d54ed..d96c4a4e79b 100644 --- a/tests/ui/issues/issue-11267.rs +++ b/tests/ui/structs/mutable-unit-struct-borrow-11267.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/11267 + //@ run-pass // Tests that unary structs can be mutably borrowed. diff --git a/tests/ui/issues/issue-3389.rs b/tests/ui/structs/trie-node-structure-usage-3389.rs index 4e73a2cf001..1518e107944 100644 --- a/tests/ui/issues/issue-3389.rs +++ b/tests/ui/structs/trie-node-structure-usage-3389.rs @@ -24,3 +24,5 @@ pub fn main() { print_str_vector(node.content.clone()); } + +// https://github.com/rust-lang/rust/issues/3389 diff --git a/tests/ui/suggestions/enum-method-probe.fixed b/tests/ui/suggestions/enum-method-probe.fixed index e097fa8cc1d..b7fd6f112d5 100644 --- a/tests/ui/suggestions/enum-method-probe.fixed +++ b/tests/ui/suggestions/enum-method-probe.fixed @@ -56,4 +56,11 @@ fn test_option_in_unit_return() { //~| HELP consider using `Option::expect` to unwrap the `Foo` value, panicking if the value is an `Option::None` } +fn test_option_private_method() { + let res: Option<_> = Some(vec![1, 2, 3]); + res.expect("REASON").len(); + //~^ ERROR method `len` is private + //~| HELP consider using `Option::expect` to unwrap the `Vec<{integer}>` value, panicking if the value is an `Option::None` +} + fn main() {} diff --git a/tests/ui/suggestions/enum-method-probe.rs b/tests/ui/suggestions/enum-method-probe.rs index 665ee7d0aaa..cbb819b7c8c 100644 --- a/tests/ui/suggestions/enum-method-probe.rs +++ b/tests/ui/suggestions/enum-method-probe.rs @@ -56,4 +56,11 @@ fn test_option_in_unit_return() { //~| HELP consider using `Option::expect` to unwrap the `Foo` value, panicking if the value is an `Option::None` } +fn test_option_private_method() { + let res: Option<_> = Some(vec![1, 2, 3]); + res.len(); + //~^ ERROR method `len` is private + //~| HELP consider using `Option::expect` to unwrap the `Vec<{integer}>` value, panicking if the value is an `Option::None` +} + fn main() {} diff --git a/tests/ui/suggestions/enum-method-probe.stderr b/tests/ui/suggestions/enum-method-probe.stderr index 6ed14984f47..e66973d9d95 100644 --- a/tests/ui/suggestions/enum-method-probe.stderr +++ b/tests/ui/suggestions/enum-method-probe.stderr @@ -94,6 +94,23 @@ help: consider using `Option::expect` to unwrap the `Foo` value, panicking if th LL | res.expect("REASON").get(); | +++++++++++++++++ -error: aborting due to 6 previous errors +error[E0624]: method `len` is private + --> $DIR/enum-method-probe.rs:61:9 + | +LL | res.len(); + | ^^^ private method + --> $SRC_DIR/core/src/option.rs:LL:COL + | + = note: private method defined here + | +note: the method `len` exists on the type `Vec<{integer}>` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL +help: consider using `Option::expect` to unwrap the `Vec<{integer}>` value, panicking if the value is an `Option::None` + | +LL | res.expect("REASON").len(); + | +++++++++++++++++ + +error: aborting due to 7 previous errors -For more information about this error, try `rustc --explain E0599`. +Some errors have detailed explanations: E0599, E0624. +For more information about an error, try `rustc --explain E0599`. diff --git a/tests/ui/suggestions/inner_type.fixed b/tests/ui/suggestions/inner_type.fixed index 3dc939d6b5c..175a2a02acd 100644 --- a/tests/ui/suggestions/inner_type.fixed +++ b/tests/ui/suggestions/inner_type.fixed @@ -25,7 +25,7 @@ fn main() { let another_item = std::sync::Mutex::new(Struct { p: 42_u32 }); another_item.lock().unwrap().method(); - //~^ ERROR no method named `method` found for struct `Mutex` in the current scope [E0599] + //~^ ERROR no method named `method` found for struct `std::sync::Mutex` in the current scope [E0599] //~| HELP use `.lock().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired let another_item = std::sync::RwLock::new(Struct { p: 42_u32 }); diff --git a/tests/ui/suggestions/inner_type.rs b/tests/ui/suggestions/inner_type.rs index 81a05c25311..ab021414f56 100644 --- a/tests/ui/suggestions/inner_type.rs +++ b/tests/ui/suggestions/inner_type.rs @@ -25,7 +25,7 @@ fn main() { let another_item = std::sync::Mutex::new(Struct { p: 42_u32 }); another_item.method(); - //~^ ERROR no method named `method` found for struct `Mutex` in the current scope [E0599] + //~^ ERROR no method named `method` found for struct `std::sync::Mutex` in the current scope [E0599] //~| HELP use `.lock().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired let another_item = std::sync::RwLock::new(Struct { p: 42_u32 }); diff --git a/tests/ui/suggestions/inner_type.stderr b/tests/ui/suggestions/inner_type.stderr index 5ac3d04f104..67ebb5789b7 100644 --- a/tests/ui/suggestions/inner_type.stderr +++ b/tests/ui/suggestions/inner_type.stderr @@ -30,11 +30,11 @@ help: use `.borrow_mut()` to mutably borrow the `Struct<u32>`, panicking if any LL | other_item.borrow_mut().some_mutable_method(); | +++++++++++++ -error[E0599]: no method named `method` found for struct `Mutex` in the current scope +error[E0599]: no method named `method` found for struct `std::sync::Mutex` in the current scope --> $DIR/inner_type.rs:27:18 | LL | another_item.method(); - | ^^^^^^ method not found in `Mutex<Struct<u32>>` + | ^^^^^^ method not found in `std::sync::Mutex<Struct<u32>>` | note: the method `method` exists on the type `Struct<u32>` --> $DIR/inner_type.rs:9:5 diff --git a/tests/ui/suggestions/issue-116434-2015.stderr b/tests/ui/suggestions/issue-116434-2015.stderr index cad5812da66..e7173d91438 100644 --- a/tests/ui/suggestions/issue-116434-2015.stderr +++ b/tests/ui/suggestions/issue-116434-2015.stderr @@ -5,7 +5,7 @@ LL | fn foo() -> Clone; | ^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -19,7 +19,7 @@ LL | fn foo() -> Clone; | ^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | @@ -52,7 +52,7 @@ LL | fn handle() -> DbHandle; | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | fn handle() -> dyn DbHandle; @@ -65,7 +65,7 @@ LL | fn handle() -> DbHandle; | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/suggestions/issue-61963.stderr b/tests/ui/suggestions/issue-61963.stderr index ef11efe5c74..ffdeef12bb7 100644 --- a/tests/ui/suggestions/issue-61963.stderr +++ b/tests/ui/suggestions/issue-61963.stderr @@ -5,7 +5,7 @@ LL | bar: Box<Bar>, | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> note: the lint level is defined here --> $DIR/issue-61963.rs:4:9 | @@ -23,7 +23,7 @@ LL | pub struct Foo { | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | dyn pub struct Foo { diff --git a/tests/ui/suggestions/option-content-move2.stderr b/tests/ui/suggestions/option-content-move2.stderr index be97cba17b9..c73e874b403 100644 --- a/tests/ui/suggestions/option-content-move2.stderr +++ b/tests/ui/suggestions/option-content-move2.stderr @@ -2,7 +2,9 @@ error[E0507]: cannot move out of `var`, a captured variable in an `FnMut` closur --> $DIR/option-content-move2.rs:11:9 | LL | let mut var = None; - | ------- captured outer variable + | ------- ---- move occurs because `var` has type `Option<NotCopyable>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | func(|| { | -- captured by this `FnMut` closure LL | // Shouldn't suggest `move ||.as_ref()` here @@ -10,16 +12,24 @@ LL | move || { | ^^^^^^^ `var` is moved here LL | LL | var = Some(NotCopyable); - | --- - | | - | variable moved due to use in closure - | move occurs because `var` has type `Option<NotCopyable>`, which does not implement the `Copy` trait + | --- variable moved due to use in closure + | +note: if `NotCopyable` implemented `Clone`, you could clone the value + --> $DIR/option-content-move2.rs:1:1 + | +LL | struct NotCopyable; + | ^^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | var = Some(NotCopyable); + | --- you could clone this value error[E0507]: cannot move out of `var`, a captured variable in an `FnMut` closure --> $DIR/option-content-move2.rs:21:9 | LL | let mut var = None; - | ------- captured outer variable + | ------- ---- move occurs because `var` has type `Option<NotCopyableButCloneable>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | func(|| { | -- captured by this `FnMut` closure LL | // Shouldn't suggest `move ||.as_ref()` nor to `clone()` here @@ -27,10 +37,7 @@ LL | move || { | ^^^^^^^ `var` is moved here LL | LL | var = Some(NotCopyableButCloneable); - | --- - | | - | variable moved due to use in closure - | move occurs because `var` has type `Option<NotCopyableButCloneable>`, which does not implement the `Copy` trait + | --- variable moved due to use in closure error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/option-content-move3.stderr b/tests/ui/suggestions/option-content-move3.stderr index faaf8a9df9d..68c52352a65 100644 --- a/tests/ui/suggestions/option-content-move3.stderr +++ b/tests/ui/suggestions/option-content-move3.stderr @@ -26,17 +26,16 @@ error[E0507]: cannot move out of `var`, a captured variable in an `FnMut` closur --> $DIR/option-content-move3.rs:12:9 | LL | let var = NotCopyable; - | --- captured outer variable + | --- ----------- move occurs because `var` has type `NotCopyable`, which does not implement the `Copy` trait + | | + | captured outer variable LL | func(|| { | -- captured by this `FnMut` closure LL | // Shouldn't suggest `move ||.as_ref()` here LL | move || { | ^^^^^^^ `var` is moved here LL | let x = var; - | --- - | | - | variable moved due to use in closure - | move occurs because `var` has type `NotCopyable`, which does not implement the `Copy` trait + | --- variable moved due to use in closure | note: if `NotCopyable` implemented `Clone`, you could clone the value --> $DIR/option-content-move3.rs:2:1 @@ -67,17 +66,16 @@ error[E0507]: cannot move out of `var`, a captured variable in an `FnMut` closur --> $DIR/option-content-move3.rs:23:9 | LL | let var = NotCopyableButCloneable; - | --- captured outer variable + | --- ----------------------- move occurs because `var` has type `NotCopyableButCloneable`, which does not implement the `Copy` trait + | | + | captured outer variable LL | func(|| { | -- captured by this `FnMut` closure LL | // Shouldn't suggest `move ||.as_ref()` here LL | move || { | ^^^^^^^ `var` is moved here LL | let x = var; - | --- - | | - | variable moved due to use in closure - | move occurs because `var` has type `NotCopyableButCloneable`, which does not implement the `Copy` trait + | --- variable moved due to use in closure | help: consider cloning the value before moving it into the closure | diff --git a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr index 929f893e34f..d90dd201bcf 100644 --- a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr @@ -68,7 +68,7 @@ LL | impl<'a, T> Struct<T> for Trait<'a, T> {} | ^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -82,7 +82,7 @@ LL | impl<'a, T> Enum<T> for Trait<'a, T> {} | ^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | impl<'a, T> Enum<T> for dyn Trait<'a, T> {} @@ -95,7 +95,7 @@ LL | impl<'a, T> Union<T> for Trait<'a, T> {} | ^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | impl<'a, T> Union<T> for dyn Trait<'a, T> {} diff --git a/tests/ui/sync/mutexguard-sync.stderr b/tests/ui/sync/mutexguard-sync.stderr index 1501a793d5e..ab9983c1f2c 100644 --- a/tests/ui/sync/mutexguard-sync.stderr +++ b/tests/ui/sync/mutexguard-sync.stderr @@ -8,7 +8,7 @@ LL | test_sync(guard); | = help: the trait `Sync` is not implemented for `Cell<i32>` = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicI32` instead - = note: required for `MutexGuard<'_, Cell<i32>>` to implement `Sync` + = note: required for `std::sync::MutexGuard<'_, Cell<i32>>` to implement `Sync` note: required by a bound in `test_sync` --> $DIR/mutexguard-sync.rs:5:17 | diff --git a/tests/ui/target_modifiers/defaults_check.rs b/tests/ui/target_modifiers/defaults_check.rs index de72acd32bc..ce1d534fd75 100644 --- a/tests/ui/target_modifiers/defaults_check.rs +++ b/tests/ui/target_modifiers/defaults_check.rs @@ -6,7 +6,7 @@ //@ needs-llvm-components: x86 //@ revisions: ok ok_explicit error -//@[ok] compile-flags: +// [ok] no extra compile-flags //@[ok_explicit] compile-flags: -Zreg-struct-return=false //@[error] compile-flags: -Zreg-struct-return=true //@[ok] check-pass diff --git a/tests/ui/target_modifiers/incompatible_fixedx18.rs b/tests/ui/target_modifiers/incompatible_fixedx18.rs index 6c13984f608..5ba676406ee 100644 --- a/tests/ui/target_modifiers/incompatible_fixedx18.rs +++ b/tests/ui/target_modifiers/incompatible_fixedx18.rs @@ -5,7 +5,7 @@ //@ revisions:allow_match allow_mismatch error_generated //@[allow_match] compile-flags: -Zfixed-x18 //@[allow_mismatch] compile-flags: -Cunsafe-allow-abi-mismatch=fixed-x18 -//@[error_generated] compile-flags: +// [error_generated] no extra compile-flags //@[allow_mismatch] check-pass //@[allow_match] check-pass diff --git a/tests/ui/target_modifiers/incompatible_regparm.rs b/tests/ui/target_modifiers/incompatible_regparm.rs index 395c26fc2c0..e76bfc976a1 100644 --- a/tests/ui/target_modifiers/incompatible_regparm.rs +++ b/tests/ui/target_modifiers/incompatible_regparm.rs @@ -5,7 +5,7 @@ //@ revisions:allow_regparm_mismatch allow_no_value error_generated //@[allow_regparm_mismatch] compile-flags: -Cunsafe-allow-abi-mismatch=regparm //@[allow_no_value] compile-flags: -Cunsafe-allow-abi-mismatch -//@[error_generated] compile-flags: +// [error_generated] no extra compile-flags //@[allow_regparm_mismatch] check-pass #![feature(no_core)] diff --git a/tests/ui/target_modifiers/no_value_bool.rs b/tests/ui/target_modifiers/no_value_bool.rs index ceba40afa89..72130f8737c 100644 --- a/tests/ui/target_modifiers/no_value_bool.rs +++ b/tests/ui/target_modifiers/no_value_bool.rs @@ -8,7 +8,7 @@ //@ revisions: ok ok_explicit error error_explicit //@[ok] compile-flags: -Zreg-struct-return //@[ok_explicit] compile-flags: -Zreg-struct-return=true -//@[error] compile-flags: +// [error] no extra compile-flags //@[error_explicit] compile-flags: -Zreg-struct-return=false //@[ok] check-pass //@[ok_explicit] check-pass diff --git a/tests/ui/issues/issue-39089.rs b/tests/ui/trait-bounds/for-binder-placement-error-39089.rs index 822c47503af..47976bdfff4 100644 --- a/tests/ui/issues/issue-39089.rs +++ b/tests/ui/trait-bounds/for-binder-placement-error-39089.rs @@ -2,3 +2,5 @@ fn f<T: ?for<'a> Sized>() {} //~^ ERROR `for<...>` binder should be placed before trait bound modifiers fn main() {} + +// https://github.com/rust-lang/rust/issues/39089 diff --git a/tests/ui/issues/issue-39089.stderr b/tests/ui/trait-bounds/for-binder-placement-error-39089.stderr index a81010aedff..12fcbc5757f 100644 --- a/tests/ui/issues/issue-39089.stderr +++ b/tests/ui/trait-bounds/for-binder-placement-error-39089.stderr @@ -1,5 +1,5 @@ error: `for<...>` binder should be placed before trait bound modifiers - --> $DIR/issue-39089.rs:1:13 + --> $DIR/for-binder-placement-error-39089.rs:1:13 | LL | fn f<T: ?for<'a> Sized>() {} | - ^^^^ diff --git a/tests/ui/issues/issue-10456.rs b/tests/ui/traits/blanket-impl-trait-object-10456.rs index 51c740fd729..f8421431774 100644 --- a/tests/ui/issues/issue-10456.rs +++ b/tests/ui/traits/blanket-impl-trait-object-10456.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10456 + //@ check-pass pub struct Foo; diff --git a/tests/ui/traits/bound/not-on-bare-trait.stderr b/tests/ui/traits/bound/not-on-bare-trait.stderr index 9028e66fa02..69413ca96cd 100644 --- a/tests/ui/traits/bound/not-on-bare-trait.stderr +++ b/tests/ui/traits/bound/not-on-bare-trait.stderr @@ -5,7 +5,7 @@ LL | fn foo(_x: Foo + Send) { | ^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/traits/bound/on-structs-and-enums-static.rs b/tests/ui/traits/bound/on-structs-and-enums-static.rs index d734893dd7c..61e8e2ace60 100644 --- a/tests/ui/traits/bound/on-structs-and-enums-static.rs +++ b/tests/ui/traits/bound/on-structs-and-enums-static.rs @@ -6,9 +6,7 @@ struct Foo<T:Trait> { x: T, } -static X: Foo<usize> = Foo { -//~^ ERROR E0277 -//~| ERROR E0277 +static X: Foo<usize> = Foo { //~ ERROR E0277 x: 1, //~ ERROR: E0277 }; diff --git a/tests/ui/traits/bound/on-structs-and-enums-static.stderr b/tests/ui/traits/bound/on-structs-and-enums-static.stderr index 42ebcc07571..1413422794a 100644 --- a/tests/ui/traits/bound/on-structs-and-enums-static.stderr +++ b/tests/ui/traits/bound/on-structs-and-enums-static.stderr @@ -15,29 +15,11 @@ note: required by a bound in `Foo` LL | struct Foo<T:Trait> { | ^^^^^ required by this bound in `Foo` -error[E0277]: the trait bound `usize: Trait` is not satisfied - --> $DIR/on-structs-and-enums-static.rs:9:11 - | -LL | static X: Foo<usize> = Foo { - | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` - | -help: this trait has no implementations, consider adding one - --> $DIR/on-structs-and-enums-static.rs:1:1 - | -LL | trait Trait { - | ^^^^^^^^^^^ -note: required by a bound in `Foo` - --> $DIR/on-structs-and-enums-static.rs:5:14 - | -LL | struct Foo<T:Trait> { - | ^^^^^ required by this bound in `Foo` - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0277]: the trait bound `usize: Trait` is not satisfied - --> $DIR/on-structs-and-enums-static.rs:12:8 +error[E0277]: the trait bound `{integer}: Trait` is not satisfied + --> $DIR/on-structs-and-enums-static.rs:10:8 | LL | x: 1, - | ^ the trait `Trait` is not implemented for `usize` + | ^ the trait `Trait` is not implemented for `{integer}` | help: this trait has no implementations, consider adding one --> $DIR/on-structs-and-enums-static.rs:1:1 @@ -50,6 +32,6 @@ note: required by a bound in `Foo` LL | struct Foo<T:Trait> { | ^^^^^ required by this bound in `Foo` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop-fail.new_precise.stderr b/tests/ui/traits/const-traits/const-drop-fail.new_precise.stderr index 9c49ee56b0f..ff803ff889b 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.new_precise.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.new_precise.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:33:5 + --> $DIR/const-drop-fail.rs:34:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -8,13 +8,13 @@ LL | NonTrivialDrop, | ^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:35:5 + --> $DIR/const-drop-fail.rs:36:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -23,7 +23,7 @@ LL | ConstImplWithDropGlue(NonTrivialDrop), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` diff --git a/tests/ui/traits/const-traits/const-drop-fail.new_stock.stderr b/tests/ui/traits/const-traits/const-drop-fail.new_stock.stderr index 9c49ee56b0f..ff803ff889b 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.new_stock.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.new_stock.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:33:5 + --> $DIR/const-drop-fail.rs:34:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -8,13 +8,13 @@ LL | NonTrivialDrop, | ^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:35:5 + --> $DIR/const-drop-fail.rs:36:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -23,7 +23,7 @@ LL | ConstImplWithDropGlue(NonTrivialDrop), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` diff --git a/tests/ui/traits/const-traits/const-drop-fail.old_precise.stderr b/tests/ui/traits/const-traits/const-drop-fail.old_precise.stderr index 9c49ee56b0f..ff803ff889b 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.old_precise.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.old_precise.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:33:5 + --> $DIR/const-drop-fail.rs:34:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -8,13 +8,13 @@ LL | NonTrivialDrop, | ^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:35:5 + --> $DIR/const-drop-fail.rs:36:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -23,7 +23,7 @@ LL | ConstImplWithDropGlue(NonTrivialDrop), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` diff --git a/tests/ui/traits/const-traits/const-drop-fail.old_stock.stderr b/tests/ui/traits/const-traits/const-drop-fail.old_stock.stderr index 9c49ee56b0f..ff803ff889b 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.old_stock.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.old_stock.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:33:5 + --> $DIR/const-drop-fail.rs:34:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -8,13 +8,13 @@ LL | NonTrivialDrop, | ^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied - --> $DIR/const-drop-fail.rs:35:5 + --> $DIR/const-drop-fail.rs:36:5 | LL | const _: () = check($exp); | ----- required by a bound introduced by this call @@ -23,7 +23,7 @@ LL | ConstImplWithDropGlue(NonTrivialDrop), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: required by a bound in `check` - --> $DIR/const-drop-fail.rs:24:19 + --> $DIR/const-drop-fail.rs:25:19 | LL | const fn check<T: [const] Destruct>(_: T) {} | ^^^^^^^^^^^^^^^^ required by this bound in `check` diff --git a/tests/ui/traits/const-traits/const-drop-fail.rs b/tests/ui/traits/const-traits/const-drop-fail.rs index 4513d71f613..b74716f0061 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.rs +++ b/tests/ui/traits/const-traits/const-drop-fail.rs @@ -1,6 +1,7 @@ //@[new_precise] compile-flags: -Znext-solver //@[new_stock] compile-flags: -Znext-solver //@ revisions: new_stock old_stock new_precise old_precise +//@ ignore-backends: gcc #![feature(const_trait_impl, const_destruct)] #![cfg_attr(any(new_precise, old_precise), feature(const_precise_live_drops))] diff --git a/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.rs b/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.rs index a5f6ae198f6..ee04f74c8a6 100644 --- a/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.rs +++ b/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.rs @@ -13,7 +13,7 @@ macro_rules! check { compile_error!("ty"); }; (const $Trait:path) => {}; - ([const] $Trait:path) => {}; + ([const] $Trait:path) => { [const] Trait }; } check! { const Trait } diff --git a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs index 3dcdb0cad94..35e964eacec 100644 --- a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs +++ b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs @@ -4,18 +4,19 @@ // Setting the edition to 2018 since we don't regress `demo! { dyn const }` in Rust <2018. //@ edition:2018 +trait Trait {} + macro_rules! demo { - ($ty:ty) => { compile_error!("ty"); }; - //~^ ERROR ty - //~| ERROR ty - (impl $c:ident Trait) => {}; - (dyn $c:ident Trait) => {}; + (impl $c:ident Trait) => { impl $c Trait {} }; + //~^ ERROR inherent + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + (dyn $c:ident Trait) => { dyn $c Trait {} }; //~ ERROR macro expansion } demo! { impl const Trait } //~^ ERROR const trait impls are experimental demo! { dyn const Trait } -//~^ ERROR const trait impls are experimental fn main() {} diff --git a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr index b500e4858d1..af160a45f3e 100644 --- a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr +++ b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr @@ -1,27 +1,31 @@ -error: ty - --> $DIR/macro-const-trait-bound-theoretical-regression.rs:8:19 +error: macro expansion ignores keyword `dyn` and any tokens following + --> $DIR/macro-const-trait-bound-theoretical-regression.rs:14:31 | -LL | ($ty:ty) => { compile_error!("ty"); }; - | ^^^^^^^^^^^^^^^^^^^^ +LL | (dyn $c:ident Trait) => { dyn $c Trait {} }; + | ^^^ ... -LL | demo! { impl const Trait } - | -------------------------- in this macro invocation +LL | demo! { dyn const Trait } + | ------------------------- caused by the macro expansion here | - = note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: the usage of `demo!` is likely invalid in item context -error: ty - --> $DIR/macro-const-trait-bound-theoretical-regression.rs:8:19 +error: inherent impls cannot be `const` + --> $DIR/macro-const-trait-bound-theoretical-regression.rs:10:40 | -LL | ($ty:ty) => { compile_error!("ty"); }; - | ^^^^^^^^^^^^^^^^^^^^ +LL | (impl $c:ident Trait) => { impl $c Trait {} }; + | ^^^^^ inherent impl for this type ... -LL | demo! { dyn const Trait } - | ------------------------- in this macro invocation +LL | demo! { impl const Trait } + | -------------------------- + | | | + | | `const` because of this + | in this macro invocation | + = note: only trait implementations may be annotated with `const` = note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: const trait impls are experimental - --> $DIR/macro-const-trait-bound-theoretical-regression.rs:15:14 + --> $DIR/macro-const-trait-bound-theoretical-regression.rs:17:14 | LL | demo! { impl const Trait } | ^^^^^ @@ -30,16 +34,24 @@ LL | demo! { impl const Trait } = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: const trait impls are experimental - --> $DIR/macro-const-trait-bound-theoretical-regression.rs:18:13 +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/macro-const-trait-bound-theoretical-regression.rs:10:40 | -LL | demo! { dyn const Trait } - | ^^^^^ +LL | (impl $c:ident Trait) => { impl $c Trait {} }; + | ^^^^^ +... +LL | demo! { impl const Trait } + | -------------------------- in this macro invocation | - = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: `#[warn(bare_trait_objects)]` on by default + = note: this warning originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info) +help: you might have intended to implement this trait for a given type + | +LL | (impl $c:ident Trait) => { impl $c Trait for /* Type */ {} }; + | ++++++++++++++ -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/traits/const-traits/span-bug-issue-121418.stderr b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr index 92cfecd0540..f31129d9cb7 100644 --- a/tests/ui/traits/const-traits/span-bug-issue-121418.stderr +++ b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr @@ -14,8 +14,8 @@ error[E0277]: the size for values of type `(dyn T + 'static)` cannot be known at LL | pub const fn new() -> std::sync::Mutex<dyn T> {} | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `Mutex<(dyn T + 'static)>`, the trait `Sized` is not implemented for `(dyn T + 'static)` -note: required because it appears within the type `Mutex<(dyn T + 'static)>` + = help: within `std::sync::Mutex<(dyn T + 'static)>`, the trait `Sized` is not implemented for `(dyn T + 'static)` +note: required because it appears within the type `std::sync::Mutex<(dyn T + 'static)>` --> $SRC_DIR/std/src/sync/poison/mutex.rs:LL:COL = note: the return type of a function must have a statically known size @@ -27,7 +27,7 @@ LL | pub const fn new() -> std::sync::Mutex<dyn T> {} | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected struct `Mutex<(dyn T + 'static)>` + = note: expected struct `std::sync::Mutex<(dyn T + 'static)>` found unit type `()` error: aborting due to 3 previous errors diff --git a/tests/ui/issues/issue-23281.rs b/tests/ui/traits/dyn-trait-size-error-23281.rs index 72716896426..8e44b8c8799 100644 --- a/tests/ui/issues/issue-23281.rs +++ b/tests/ui/traits/dyn-trait-size-error-23281.rs @@ -10,3 +10,5 @@ struct Vec<T> { } fn main() {} + +// https://github.com/rust-lang/rust/issues/23281 diff --git a/tests/ui/issues/issue-23281.stderr b/tests/ui/traits/dyn-trait-size-error-23281.stderr index ee079f2deec..d7b791a0452 100644 --- a/tests/ui/issues/issue-23281.stderr +++ b/tests/ui/traits/dyn-trait-size-error-23281.stderr @@ -1,17 +1,17 @@ error[E0277]: the size for values of type `(dyn Fn() + 'static)` cannot be known at compilation time - --> $DIR/issue-23281.rs:4:27 + --> $DIR/dyn-trait-size-error-23281.rs:4:27 | LL | pub fn function(funs: Vec<dyn Fn() -> ()>) {} | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `(dyn Fn() + 'static)` note: required by an implicit `Sized` bound in `Vec` - --> $DIR/issue-23281.rs:8:12 + --> $DIR/dyn-trait-size-error-23281.rs:8:12 | LL | struct Vec<T> { | ^ required by the implicit `Sized` requirement on this type parameter in `Vec` help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>` - --> $DIR/issue-23281.rs:8:12 + --> $DIR/dyn-trait-size-error-23281.rs:8:12 | LL | struct Vec<T> { | ^ this could be changed to `T: ?Sized`... diff --git a/tests/ui/traits/missing-for-type-in-impl.e2015.stderr b/tests/ui/traits/missing-for-type-in-impl.e2015.stderr index c8a1329e3d0..a0bfc524252 100644 --- a/tests/ui/traits/missing-for-type-in-impl.e2015.stderr +++ b/tests/ui/traits/missing-for-type-in-impl.e2015.stderr @@ -5,7 +5,7 @@ LL | impl Foo<i64> { | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -23,7 +23,7 @@ LL | impl Foo<i64> { | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | diff --git a/tests/ui/issues/issue-10465.rs b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.rs index d899c3ffa91..d5a500900ff 100644 --- a/tests/ui/issues/issue-10465.rs +++ b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/10465 + pub mod a { pub trait A { fn foo(&self); diff --git a/tests/ui/issues/issue-10465.stderr b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.stderr index 0f46ebe505a..ffd8fd39250 100644 --- a/tests/ui/issues/issue-10465.stderr +++ b/tests/ui/traits/nested-mod-trait-method-lookup-leak-10465.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `foo` found for reference `&B` in the current scope - --> $DIR/issue-10465.rs:17:15 + --> $DIR/nested-mod-trait-method-lookup-leak-10465.rs:19:15 | LL | b.foo(); | ^^^ method not found in `&B` diff --git a/tests/ui/issues/issue-36839.rs b/tests/ui/traits/trait-associated-type-bounds-36839.rs index 654c0f6e4b5..156c063abc2 100644 --- a/tests/ui/issues/issue-36839.rs +++ b/tests/ui/traits/trait-associated-type-bounds-36839.rs @@ -19,3 +19,5 @@ impl<T> Broken for T { fn main() { let _m: &dyn Broken<Assoc=()> = &(); } + +// https://github.com/rust-lang/rust/issues/36839 diff --git a/tests/ui/issues/issue-5280.rs b/tests/ui/traits/trait-implementation-for-primitive-type-5280.rs index 66452c36776..72a4283bc7e 100644 --- a/tests/ui/issues/issue-5280.rs +++ b/tests/ui/traits/trait-implementation-for-primitive-type-5280.rs @@ -16,3 +16,5 @@ impl FontTableTagConversions for FontTableTag { pub fn main() { 5.tag_to_string(); } + +// https://github.com/rust-lang/rust/issues/5280 diff --git a/tests/ui/issues/issue-5321-immediates-with-bare-self.rs b/tests/ui/traits/trait-implementation-for-usize-5321.rs index cb35a641c5e..ab997b6627a 100644 --- a/tests/ui/issues/issue-5321-immediates-with-bare-self.rs +++ b/tests/ui/traits/trait-implementation-for-usize-5321.rs @@ -13,3 +13,5 @@ impl Fooable for usize { pub fn main() { 2.yes(); } + +// https://github.com/rust-lang/rust/issues/5321 diff --git a/tests/ui/traits/unspecified-self-in-trait-ref.stderr b/tests/ui/traits/unspecified-self-in-trait-ref.stderr index 6f5ae786de6..2e872453184 100644 --- a/tests/ui/traits/unspecified-self-in-trait-ref.stderr +++ b/tests/ui/traits/unspecified-self-in-trait-ref.stderr @@ -5,7 +5,7 @@ LL | let a = Foo::lol(); | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -25,7 +25,7 @@ LL | let b = Foo::<_>::lol(); | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let b = <dyn Foo::<_>>::lol(); @@ -44,7 +44,7 @@ LL | let c = Bar::lol(); | ^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let c = <dyn Bar>::lol(); @@ -63,7 +63,7 @@ LL | let d = Bar::<usize, _>::lol(); | ^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let d = <dyn Bar::<usize, _>>::lol(); @@ -82,7 +82,7 @@ LL | let e = Bar::<usize>::lol(); | ^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | let e = <dyn Bar::<usize>>::lol(); diff --git a/tests/ui/transmutability/enums/niche_optimization.rs b/tests/ui/transmutability/enums/niche_optimization.rs index 2436be50027..316a857662a 100644 --- a/tests/ui/transmutability/enums/niche_optimization.rs +++ b/tests/ui/transmutability/enums/niche_optimization.rs @@ -75,8 +75,8 @@ fn one_niche() { assert::is_transmutable::<OptionLike, u8>(); assert::is_transmutable::<V0, OptionLike>(); + assert::is_transmutable::<V1, OptionLike>(); assert::is_transmutable::<V254, OptionLike>(); - assert::is_transmutable::<V255, OptionLike>(); } fn one_niche_alt() { @@ -97,9 +97,9 @@ fn one_niche_alt() { }; assert::is_transmutable::<OptionLike, u8>(); - assert::is_transmutable::<V0, OptionLike>(); + assert::is_transmutable::<V1, OptionLike>(); + assert::is_transmutable::<V2, OptionLike>(); assert::is_transmutable::<V254, OptionLike>(); - assert::is_transmutable::<V255, OptionLike>(); } fn two_niche() { @@ -121,9 +121,9 @@ fn two_niche() { assert::is_transmutable::<OptionLike, u8>(); assert::is_transmutable::<V0, OptionLike>(); + assert::is_transmutable::<V1, OptionLike>(); + assert::is_transmutable::<V2, OptionLike>(); assert::is_transmutable::<V253, OptionLike>(); - assert::is_transmutable::<V254, OptionLike>(); - assert::is_transmutable::<V255, OptionLike>(); } fn no_niche() { @@ -142,7 +142,7 @@ fn no_niche() { } const _: () = { - assert!(std::mem::size_of::<OptionLike>() == 2); + assert!(std::mem::size_of::<OptionLike>() == 1); }; #[repr(C)] diff --git a/tests/ui/issues/issue-21174.rs b/tests/ui/transmutability/transmute-between-associated-types-with-lifetimers-21174.rs index 07827425116..22cb379ffda 100644 --- a/tests/ui/issues/issue-21174.rs +++ b/tests/ui/transmutability/transmute-between-associated-types-with-lifetimers-21174.rs @@ -9,3 +9,5 @@ fn foo<'a, T: Trait<'a>>(value: T::A) { } fn main() { } + +// https://github.com/rust-lang/rust/issues/21174 diff --git a/tests/ui/issues/issue-21174.stderr b/tests/ui/transmutability/transmute-between-associated-types-with-lifetimers-21174.stderr index a6b75c91352..5c0cd91cee1 100644 --- a/tests/ui/issues/issue-21174.stderr +++ b/tests/ui/transmutability/transmute-between-associated-types-with-lifetimers-21174.stderr @@ -1,5 +1,5 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/issue-21174.rs:7:30 + --> $DIR/transmute-between-associated-types-with-lifetimers-21174.rs:7:30 | LL | let new: T::B = unsafe { std::mem::transmute(value) }; | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/crashes/131507.rs b/tests/ui/trivial-bounds/everybody-copies.rs index 05b5e76bed7..3469fa1f1da 100644 --- a/tests/crashes/131507.rs +++ b/tests/ui/trivial-bounds/everybody-copies.rs @@ -1,5 +1,8 @@ -//@ known-bug: #131507 -//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir +//! Regression test for #131507 +//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir --crate-type lib +//@ build-pass + +#![expect(incomplete_features)] #![feature(non_lifetime_binders)] fn brick() diff --git a/tests/crashes/121363.rs b/tests/ui/trivial-bounds/two-sized-strs.rs index 38796342284..5cb82eac417 100644 --- a/tests/crashes/121363.rs +++ b/tests/ui/trivial-bounds/two-sized-strs.rs @@ -1,7 +1,9 @@ -//@ known-bug: #121363 +//! Regression test for #121363 //@ compile-flags: -Zmir-enable-passes=+GVN --crate-type lib +//@ build-pass #![feature(trivial_bounds)] +#![expect(trivial_bounds)] #[derive(Debug)] struct TwoStrs(str, str) diff --git a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr index 084008d8b2a..13ae6dfcaa3 100644 --- a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr +++ b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr @@ -9,36 +9,6 @@ note: ...which requires const-evaluating + checking `Alpha::V3::{constant#0}`... | LL | V3 = Self::V1 {} as u8 + 2, | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires caching mir of `Alpha::V3::{constant#0}` for CTFE... - --> $DIR/self-in-enum-definition.rs:5:10 - | -LL | V3 = Self::V1 {} as u8 + 2, - | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires elaborating drops for `Alpha::V3::{constant#0}`... - --> $DIR/self-in-enum-definition.rs:5:10 - | -LL | V3 = Self::V1 {} as u8 + 2, - | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires borrow-checking `Alpha::V3::{constant#0}`... - --> $DIR/self-in-enum-definition.rs:5:10 - | -LL | V3 = Self::V1 {} as u8 + 2, - | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires promoting constants in MIR for `Alpha::V3::{constant#0}`... - --> $DIR/self-in-enum-definition.rs:5:10 - | -LL | V3 = Self::V1 {} as u8 + 2, - | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const checking `Alpha::V3::{constant#0}`... - --> $DIR/self-in-enum-definition.rs:5:10 - | -LL | V3 = Self::V1 {} as u8 + 2, - | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires building MIR for `Alpha::V3::{constant#0}`... - --> $DIR/self-in-enum-definition.rs:5:10 - | -LL | V3 = Self::V1 {} as u8 + 2, - | ^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires computing layout of `Alpha`... = note: ...which again requires simplifying constant for the type system `Alpha::V3::{constant#0}`, completing the cycle note: cycle used when checking that `Alpha` is well-formed diff --git a/tests/ui/type-alias-impl-trait/issue-60662.stdout b/tests/ui/type-alias-impl-trait/issue-60662.stdout index 56fef852e37..7ad29c88bcf 100644 --- a/tests/ui/type-alias-impl-trait/issue-60662.stdout +++ b/tests/ui/type-alias-impl-trait/issue-60662.stdout @@ -3,10 +3,10 @@ //@ edition: 2015 #![feature(type_alias_impl_trait)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; trait Animal { } diff --git a/tests/ui/issues/issue-102964.rs b/tests/ui/type-alias/dummy-binder-102964.rs index 43ff2360076..6b6fa3ed5e3 100644 --- a/tests/ui/issues/issue-102964.rs +++ b/tests/ui/type-alias/dummy-binder-102964.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/102964 + use std::rc::Rc; type Foo<'a, T> = &'a dyn Fn(&T); type RcFoo<'a, T> = Rc<Foo<'a, T>>; diff --git a/tests/ui/issues/issue-102964.stderr b/tests/ui/type-alias/dummy-binder-102964.stderr index 0e2761f3f57..fc32cabaf71 100644 --- a/tests/ui/issues/issue-102964.stderr +++ b/tests/ui/type-alias/dummy-binder-102964.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-102964.rs:5:41 + --> $DIR/dummy-binder-102964.rs:7:41 | LL | fn bar_function<T>(function: Foo<T>) -> RcFoo<T> { | ------------ ^^^^^^^^ expected `Rc<&dyn Fn(&T)>`, found `()` diff --git a/tests/ui/issues/issue-11047.rs b/tests/ui/type-alias/static-method-type-alias-11047.rs index 6e1b2856afc..efb336fb4f7 100644 --- a/tests/ui/issues/issue-11047.rs +++ b/tests/ui/type-alias/static-method-type-alias-11047.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/11047 + //@ run-pass // Test that static methods can be invoked on `type` aliases diff --git a/tests/ui/issues/issue-14382.rs b/tests/ui/type-inference/float-type-inference-unification-14382.rs index 74d938783ae..5bf497d2eab 100644 --- a/tests/ui/issues/issue-14382.rs +++ b/tests/ui/type-inference/float-type-inference-unification-14382.rs @@ -13,3 +13,5 @@ fn main() { let m : Matrix4<f32> = translate(x); println!("m: {:?}", m); } + +// https://github.com/rust-lang/rust/issues/14382 diff --git a/tests/ui/typeck/assign-non-lval-derefmut.fixed b/tests/ui/typeck/assign-non-lval-derefmut.fixed index 6ecec574f2e..e6f97a9e86c 100644 --- a/tests/ui/typeck/assign-non-lval-derefmut.fixed +++ b/tests/ui/typeck/assign-non-lval-derefmut.fixed @@ -5,11 +5,11 @@ fn main() { *x.lock().unwrap() = 2; //~^ ERROR invalid left-hand side of assignment *x.lock().unwrap() += 1; - //~^ ERROR binary assignment operation `+=` cannot be applied to type `MutexGuard<'_, usize>` + //~^ ERROR binary assignment operation `+=` cannot be applied to type `std::sync::MutexGuard<'_, usize>` let mut y = x.lock().unwrap(); *y = 2; //~^ ERROR mismatched types *y += 1; - //~^ ERROR binary assignment operation `+=` cannot be applied to type `MutexGuard<'_, usize>` + //~^ ERROR binary assignment operation `+=` cannot be applied to type `std::sync::MutexGuard<'_, usize>` } diff --git a/tests/ui/typeck/assign-non-lval-derefmut.rs b/tests/ui/typeck/assign-non-lval-derefmut.rs index ac1be913e2a..a53a52c7e4d 100644 --- a/tests/ui/typeck/assign-non-lval-derefmut.rs +++ b/tests/ui/typeck/assign-non-lval-derefmut.rs @@ -5,11 +5,11 @@ fn main() { x.lock().unwrap() = 2; //~^ ERROR invalid left-hand side of assignment x.lock().unwrap() += 1; - //~^ ERROR binary assignment operation `+=` cannot be applied to type `MutexGuard<'_, usize>` + //~^ ERROR binary assignment operation `+=` cannot be applied to type `std::sync::MutexGuard<'_, usize>` let mut y = x.lock().unwrap(); y = 2; //~^ ERROR mismatched types y += 1; - //~^ ERROR binary assignment operation `+=` cannot be applied to type `MutexGuard<'_, usize>` + //~^ ERROR binary assignment operation `+=` cannot be applied to type `std::sync::MutexGuard<'_, usize>` } diff --git a/tests/ui/typeck/assign-non-lval-derefmut.stderr b/tests/ui/typeck/assign-non-lval-derefmut.stderr index 16fb1e9c5c3..f57b5abe2ee 100644 --- a/tests/ui/typeck/assign-non-lval-derefmut.stderr +++ b/tests/ui/typeck/assign-non-lval-derefmut.stderr @@ -11,15 +11,15 @@ help: consider dereferencing here to assign to the mutably borrowed value LL | *x.lock().unwrap() = 2; | + -error[E0368]: binary assignment operation `+=` cannot be applied to type `MutexGuard<'_, usize>` +error[E0368]: binary assignment operation `+=` cannot be applied to type `std::sync::MutexGuard<'_, usize>` --> $DIR/assign-non-lval-derefmut.rs:7:5 | LL | x.lock().unwrap() += 1; | -----------------^^^^^ | | - | cannot use `+=` on type `MutexGuard<'_, usize>` + | cannot use `+=` on type `std::sync::MutexGuard<'_, usize>` | -note: the foreign item type `MutexGuard<'_, usize>` doesn't implement `AddAssign<{integer}>` +note: the foreign item type `std::sync::MutexGuard<'_, usize>` doesn't implement `AddAssign<{integer}>` --> $SRC_DIR/std/src/sync/poison/mutex.rs:LL:COL | = note: not implement `AddAssign<{integer}>` @@ -36,22 +36,22 @@ LL | let mut y = x.lock().unwrap(); LL | y = 2; | ^ expected `MutexGuard<'_, usize>`, found integer | - = note: expected struct `MutexGuard<'_, usize>` + = note: expected struct `std::sync::MutexGuard<'_, usize>` found type `{integer}` help: consider dereferencing here to assign to the mutably borrowed value | LL | *y = 2; | + -error[E0368]: binary assignment operation `+=` cannot be applied to type `MutexGuard<'_, usize>` +error[E0368]: binary assignment operation `+=` cannot be applied to type `std::sync::MutexGuard<'_, usize>` --> $DIR/assign-non-lval-derefmut.rs:13:5 | LL | y += 1; | -^^^^^ | | - | cannot use `+=` on type `MutexGuard<'_, usize>` + | cannot use `+=` on type `std::sync::MutexGuard<'_, usize>` | -note: the foreign item type `MutexGuard<'_, usize>` doesn't implement `AddAssign<{integer}>` +note: the foreign item type `std::sync::MutexGuard<'_, usize>` doesn't implement `AddAssign<{integer}>` --> $SRC_DIR/std/src/sync/poison/mutex.rs:LL:COL | = note: not implement `AddAssign<{integer}>` diff --git a/tests/ui/typeck/deref-multi.stderr b/tests/ui/typeck/deref-multi.stderr index 02513853c48..c4fa49e43ef 100644 --- a/tests/ui/typeck/deref-multi.stderr +++ b/tests/ui/typeck/deref-multi.stderr @@ -63,7 +63,7 @@ LL | x.lock().unwrap() | ^^^^^^^^^^^^^^^^^ expected `i32`, found `MutexGuard<'_, &i32>` | = note: expected type `i32` - found struct `MutexGuard<'_, &i32>` + found struct `std::sync::MutexGuard<'_, &i32>` help: consider dereferencing the type | LL | **x.lock().unwrap() diff --git a/tests/ui/typeck/suggestions/suggest-clone-in-macro-issue-139253.rs b/tests/ui/typeck/suggestions/suggest-clone-in-macro-issue-139253.rs new file mode 100644 index 00000000000..3b3ea058630 --- /dev/null +++ b/tests/ui/typeck/suggestions/suggest-clone-in-macro-issue-139253.rs @@ -0,0 +1,19 @@ +#[derive(Debug, Clone)] +struct Struct { field: S } + +#[derive(Debug, Clone)] +struct S; + +macro_rules! expand { + ($ident:ident) => { Struct { $ident } } +} + +fn test1() { + let field = &S; + let a: Struct = dbg!(expand!(field)); //~ ERROR mismatched types [E0308] + let b: Struct = dbg!(Struct { field }); //~ ERROR mismatched types [E0308] + let c: S = dbg!(field); //~ ERROR mismatched types [E0308] + let c: S = dbg!(dbg!(field)); //~ ERROR mismatched types [E0308] +} + +fn main() {} diff --git a/tests/ui/typeck/suggestions/suggest-clone-in-macro-issue-139253.stderr b/tests/ui/typeck/suggestions/suggest-clone-in-macro-issue-139253.stderr new file mode 100644 index 00000000000..59e56f67237 --- /dev/null +++ b/tests/ui/typeck/suggestions/suggest-clone-in-macro-issue-139253.stderr @@ -0,0 +1,49 @@ +error[E0308]: mismatched types + --> $DIR/suggest-clone-in-macro-issue-139253.rs:13:34 + | +LL | let a: Struct = dbg!(expand!(field)); + | ^^^^^ expected `S`, found `&S` + | +help: consider using clone here + | +LL | let a: Struct = dbg!(expand!(field: field.clone())); + | +++++++++++++++ + +error[E0308]: mismatched types + --> $DIR/suggest-clone-in-macro-issue-139253.rs:14:35 + | +LL | let b: Struct = dbg!(Struct { field }); + | ^^^^^ expected `S`, found `&S` + | +help: consider using clone here + | +LL | let b: Struct = dbg!(Struct { field: field.clone() }); + | +++++++++++++++ + +error[E0308]: mismatched types + --> $DIR/suggest-clone-in-macro-issue-139253.rs:15:16 + | +LL | let c: S = dbg!(field); + | ^^^^^^^^^^^ expected `S`, found `&S` + | + = note: this error originates in the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider using clone here + | +LL | let c: S = dbg!(field).clone(); + | ++++++++ + +error[E0308]: mismatched types + --> $DIR/suggest-clone-in-macro-issue-139253.rs:16:16 + | +LL | let c: S = dbg!(dbg!(field)); + | ^^^^^^^^^^^^^^^^^ expected `S`, found `&S` + | + = note: this error originates in the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider using clone here + | +LL | let c: S = dbg!(dbg!(field)).clone(); + | ++++++++ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-18952.rs b/tests/ui/unboxed-closures/fn-traits-overloading-arity-18952.rs index 9fdafb1ff4a..4e3bc9b671a 100644 --- a/tests/ui/issues/issue-18952.rs +++ b/tests/ui/unboxed-closures/fn-traits-overloading-arity-18952.rs @@ -54,3 +54,5 @@ fn main() { assert_eq!(foo(1, 1), (2, 2)); assert_eq!(foo(1, 1, 1), (4, 4, 4)); } + +// https://github.com/rust-lang/rust/issues/18952 diff --git a/tests/ui/issues/issue-22789.rs b/tests/ui/unboxed-closures/unboxed-closure-call-22789.rs index 95ebe6baaa3..0bc8bed0588 100644 --- a/tests/ui/issues/issue-22789.rs +++ b/tests/ui/unboxed-closures/unboxed-closure-call-22789.rs @@ -6,3 +6,5 @@ fn main() { let k = |x: i32| { x + 1 }; Fn::call(&k, (0,)); } + +// https://github.com/rust-lang/rust/issues/22789 diff --git a/tests/ui/unboxed-closures/unboxed-closure-illegal-move.stderr b/tests/ui/unboxed-closures/unboxed-closure-illegal-move.stderr index cf4391311d0..8d9a61cb681 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-illegal-move.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-illegal-move.stderr @@ -2,9 +2,11 @@ error[E0507]: cannot move out of `x`, a captured variable in an `Fn` closure --> $DIR/unboxed-closure-illegal-move.rs:15:31 | LL | let x = Box::new(0); - | - captured outer variable + | - ----------- move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | let f = to_fn(|| drop(x)); - | -- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | -- ^ `x` is moved here | | | captured by this `Fn` closure | @@ -17,9 +19,11 @@ error[E0507]: cannot move out of `x`, a captured variable in an `FnMut` closure --> $DIR/unboxed-closure-illegal-move.rs:19:35 | LL | let x = Box::new(0); - | - captured outer variable + | - ----------- move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | let f = to_fn_mut(|| drop(x)); - | -- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | -- ^ `x` is moved here | | | captured by this `FnMut` closure | @@ -32,9 +36,11 @@ error[E0507]: cannot move out of `x`, a captured variable in an `Fn` closure --> $DIR/unboxed-closure-illegal-move.rs:28:36 | LL | let x = Box::new(0); - | - captured outer variable + | - ----------- move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | let f = to_fn(move || drop(x)); - | ------- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | ------- ^ `x` is moved here | | | captured by this `Fn` closure @@ -42,9 +48,11 @@ error[E0507]: cannot move out of `x`, a captured variable in an `FnMut` closure --> $DIR/unboxed-closure-illegal-move.rs:32:40 | LL | let x = Box::new(0); - | - captured outer variable + | - ----------- move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | | + | captured outer variable LL | let f = to_fn_mut(move || drop(x)); - | ------- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait + | ------- ^ `x` is moved here | | | captured by this `FnMut` closure diff --git a/tests/ui/uninhabited/uninhabited-transparent-return-abi.rs b/tests/ui/uninhabited/uninhabited-transparent-return-abi.rs index 2c2788a3e56..e439a82be5a 100644 --- a/tests/ui/uninhabited/uninhabited-transparent-return-abi.rs +++ b/tests/ui/uninhabited/uninhabited-transparent-return-abi.rs @@ -1,5 +1,6 @@ //@ run-pass //@ needs-unwind +//@ ignore-backends: gcc // See https://github.com/rust-lang/rust/issues/135802 enum Void {} diff --git a/tests/ui/union/union-borrow-move-parent-sibling.stderr b/tests/ui/union/union-borrow-move-parent-sibling.stderr index f8e9609cb1c..461ee407e2d 100644 --- a/tests/ui/union/union-borrow-move-parent-sibling.stderr +++ b/tests/ui/union/union-borrow-move-parent-sibling.stderr @@ -31,6 +31,15 @@ LL | let a = u.x; | --- value moved here LL | let b = u.y; | ^^^ value used here after move + | +note: if `U` implemented `Clone`, you could clone the value + --> $DIR/union-borrow-move-parent-sibling.rs:43:1 + | +LL | union U { + | ^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.x; + | --- you could clone this value error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`) --> $DIR/union-borrow-move-parent-sibling.rs:67:13 @@ -73,6 +82,15 @@ LL | let a = u.x; | --- value moved here LL | let b = u.y; | ^^^ value used here after move + | +note: if `U` implemented `Clone`, you could clone the value + --> $DIR/union-borrow-move-parent-sibling.rs:43:1 + | +LL | union U { + | ^^^^^^^ consider implementing `Clone` for this type +... +LL | let a = u.x; + | --- you could clone this value error[E0502]: cannot borrow `u` (via `u.x`) as immutable because it is also borrowed as mutable (via `u.y`) --> $DIR/union-borrow-move-parent-sibling.rs:81:13 diff --git a/tests/ui/unpretty/bad-literal.stdout b/tests/ui/unpretty/bad-literal.stdout index 06116a4ab55..1f697aff27c 100644 --- a/tests/ui/unpretty/bad-literal.stdout +++ b/tests/ui/unpretty/bad-literal.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-fail //@ edition: 2015 diff --git a/tests/ui/unpretty/debug-fmt-hir.stdout b/tests/ui/unpretty/debug-fmt-hir.stdout index dc18675ea80..9c79421e32a 100644 --- a/tests/ui/unpretty/debug-fmt-hir.stdout +++ b/tests/ui/unpretty/debug-fmt-hir.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass //@ edition: 2015 diff --git a/tests/ui/unpretty/deprecated-attr.stdout b/tests/ui/unpretty/deprecated-attr.stdout index 042c2f61bd4..26cc74c1160 100644 --- a/tests/ui/unpretty/deprecated-attr.stdout +++ b/tests/ui/unpretty/deprecated-attr.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass //@ edition: 2015 diff --git a/tests/ui/unpretty/diagnostic-attr.stdout b/tests/ui/unpretty/diagnostic-attr.stdout index 3b15a845d68..4822cf4700b 100644 --- a/tests/ui/unpretty/diagnostic-attr.stdout +++ b/tests/ui/unpretty/diagnostic-attr.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass //@ edition: 2015 diff --git a/tests/ui/unpretty/exhaustive-asm.expanded.stdout b/tests/ui/unpretty/exhaustive-asm.expanded.stdout index 92829b0ab15..9a58e4c2877 100644 --- a/tests/ui/unpretty/exhaustive-asm.expanded.stdout +++ b/tests/ui/unpretty/exhaustive-asm.expanded.stdout @@ -1,8 +1,8 @@ #![feature(prelude_import)] -#[prelude_import] -use std::prelude::rust_2024::*; #[macro_use] extern crate std; +#[prelude_import] +use std::prelude::rust_2024::*; //@ revisions: expanded hir //@[expanded]compile-flags: -Zunpretty=expanded //@[expanded]check-pass diff --git a/tests/ui/unpretty/exhaustive-asm.hir.stdout b/tests/ui/unpretty/exhaustive-asm.hir.stdout index ec9bda57331..b33b38c2cab 100644 --- a/tests/ui/unpretty/exhaustive-asm.hir.stdout +++ b/tests/ui/unpretty/exhaustive-asm.hir.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use std::prelude::rust_2024::*; -#[macro_use] -extern crate std; //@ revisions: expanded hir //@[expanded]compile-flags: -Zunpretty=expanded //@[expanded]check-pass diff --git a/tests/ui/unpretty/exhaustive.expanded.stdout b/tests/ui/unpretty/exhaustive.expanded.stdout index 53ca3c8e391..6b08f3e1cd7 100644 --- a/tests/ui/unpretty/exhaustive.expanded.stdout +++ b/tests/ui/unpretty/exhaustive.expanded.stdout @@ -29,10 +29,10 @@ #![feature(try_blocks)] #![feature(yeet_expr)] #![allow(incomplete_features)] -#[prelude_import] -use std::prelude::rust_2024::*; #[macro_use] extern crate std; +#[prelude_import] +use std::prelude::rust_2024::*; #[prelude_import] use self::prelude::*; diff --git a/tests/ui/unpretty/exhaustive.hir.stdout b/tests/ui/unpretty/exhaustive.hir.stdout index a559d51ed5d..9cfa65f5801 100644 --- a/tests/ui/unpretty/exhaustive.hir.stdout +++ b/tests/ui/unpretty/exhaustive.hir.stdout @@ -28,10 +28,10 @@ #![feature(try_blocks)] #![feature(yeet_expr)] #![allow(incomplete_features)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use std::prelude::rust_2024::*; -#[macro_use] -extern crate std; #[prelude_import] use self::prelude::*; diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout index 4af82924c7b..0792dc10e94 100644 --- a/tests/ui/unpretty/flattened-format-args.stdout +++ b/tests/ui/unpretty/flattened-format-args.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes //@ check-pass //@ edition: 2015 diff --git a/tests/ui/unpretty/interpolation-expanded.stdout b/tests/ui/unpretty/interpolation-expanded.stdout index d46b46b67f4..7284a89e7a9 100644 --- a/tests/ui/unpretty/interpolation-expanded.stdout +++ b/tests/ui/unpretty/interpolation-expanded.stdout @@ -10,10 +10,10 @@ // synthesizing parentheses indiscriminately; only where necessary. #![feature(if_let_guard)] -#[prelude_import] -use std::prelude::rust_2024::*; #[macro_use] extern crate std; +#[prelude_import] +use std::prelude::rust_2024::*; macro_rules! expr { ($expr:expr) => { $expr }; } diff --git a/tests/ui/unpretty/let-else-hir.stdout b/tests/ui/unpretty/let-else-hir.stdout index a6dd943ec1b..14270a57202 100644 --- a/tests/ui/unpretty/let-else-hir.stdout +++ b/tests/ui/unpretty/let-else-hir.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass //@ edition: 2015 diff --git a/tests/ui/unpretty/self-hir.stdout b/tests/ui/unpretty/self-hir.stdout index a9e80b1f592..b190565dcc4 100644 --- a/tests/ui/unpretty/self-hir.stdout +++ b/tests/ui/unpretty/self-hir.stdout @@ -1,7 +1,7 @@ +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass //@ edition: 2015 diff --git a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout index fd2e794fcac..c04909a7361 100644 --- a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout +++ b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout @@ -8,10 +8,10 @@ //@ compile-flags: -Zunpretty=hir,typed //@ edition: 2015 #![allow(dead_code)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; fn main() ({ } as ()) diff --git a/tests/ui/issues/issue-7246.rs b/tests/ui/unreachable-code/unreachable-bool-read-7246.rs index 7b16fa024f8..8bbaa102549 100644 --- a/tests/ui/issues/issue-7246.rs +++ b/tests/ui/unreachable-code/unreachable-bool-read-7246.rs @@ -9,3 +9,5 @@ pub unsafe fn g() { } pub fn main() {} + +// https://github.com/rust-lang/rust/issues/7246 diff --git a/tests/ui/issues/issue-7246.stderr b/tests/ui/unreachable-code/unreachable-bool-read-7246.stderr index 1fb6ab14e64..6072160cb5f 100644 --- a/tests/ui/issues/issue-7246.stderr +++ b/tests/ui/unreachable-code/unreachable-bool-read-7246.stderr @@ -1,5 +1,5 @@ error: unreachable statement - --> $DIR/issue-7246.rs:7:5 + --> $DIR/unreachable-bool-read-7246.rs:7:5 | LL | return; | ------ any code following this expression is unreachable @@ -7,13 +7,13 @@ LL | if *ptr::null() {}; | ^^^^^^^^^^^^^^^^^^^ unreachable statement | note: the lint level is defined here - --> $DIR/issue-7246.rs:1:9 + --> $DIR/unreachable-bool-read-7246.rs:1:9 | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ warning: dereferencing a null pointer - --> $DIR/issue-7246.rs:7:8 + --> $DIR/unreachable-bool-read-7246.rs:7:8 | LL | if *ptr::null() {}; | ^^^^^^^^^^^^ this code causes undefined behavior when executed diff --git a/tests/ui/unsafe-binders/moves.stderr b/tests/ui/unsafe-binders/moves.stderr index 0f976d9e845..bd480157077 100644 --- a/tests/ui/unsafe-binders/moves.stderr +++ b/tests/ui/unsafe-binders/moves.stderr @@ -16,6 +16,15 @@ LL | let binder: unsafe<> NotCopy = wrap_binder!(base); | ---- value moved here LL | drop(base); | ^^^^ value used here after move + | +note: if `NotCopyInner` implemented `Clone`, you could clone the value + --> $DIR/moves.rs:8:1 + | +LL | struct NotCopyInner; + | ^^^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let binder: unsafe<> NotCopy = wrap_binder!(base); + | ---- you could clone this value error[E0382]: use of moved value: `binder` --> $DIR/moves.rs:24:14 diff --git a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.stderr b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.stderr index a02c6041e45..8a26b45117c 100644 --- a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.stderr +++ b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.stderr @@ -4,7 +4,7 @@ warning[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe blo LL | unsf(); | ^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:8:1 diff --git a/tests/ui/issues/issue-11004.rs b/tests/ui/unsafe/raw-pointer-field-access-error.rs index 0c34554c12d..04b45b2d3c6 100644 --- a/tests/ui/issues/issue-11004.rs +++ b/tests/ui/unsafe/raw-pointer-field-access-error.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/11004 + use std::mem; struct A { x: i32, y: f64 } diff --git a/tests/ui/issues/issue-11004.stderr b/tests/ui/unsafe/raw-pointer-field-access-error.stderr index 6d157c91130..e9a205a5fa6 100644 --- a/tests/ui/issues/issue-11004.stderr +++ b/tests/ui/unsafe/raw-pointer-field-access-error.stderr @@ -1,5 +1,5 @@ error[E0609]: no field `x` on type `*mut A` - --> $DIR/issue-11004.rs:7:21 + --> $DIR/raw-pointer-field-access-error.rs:9:21 | LL | let x : i32 = n.x; | ^ unknown field @@ -10,7 +10,7 @@ LL | let x : i32 = (*n).x; | ++ + error[E0609]: no field `y` on type `*mut A` - --> $DIR/issue-11004.rs:8:21 + --> $DIR/raw-pointer-field-access-error.rs:10:21 | LL | let y : f64 = n.y; | ^ unknown field diff --git a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.stderr b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.stderr index 2ad1de5102d..458a2180a82 100644 --- a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.stderr +++ b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.stderr @@ -4,7 +4,7 @@ warning[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe blo LL | unsf(); | ^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/edition_2024_default.rs:11:1 diff --git a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/in_2024_compatibility.stderr b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/in_2024_compatibility.stderr index 54447fbc528..0c4070068d0 100644 --- a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/in_2024_compatibility.stderr +++ b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/in_2024_compatibility.stderr @@ -4,7 +4,7 @@ error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block LL | unsf(); | ^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/in_2024_compatibility.rs:6:1 diff --git a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/rfc-2585-unsafe_op_in_unsafe_fn.stderr b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/rfc-2585-unsafe_op_in_unsafe_fn.stderr index 5465c225b7e..3e43840cf6c 100644 --- a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/rfc-2585-unsafe_op_in_unsafe_fn.stderr +++ b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/rfc-2585-unsafe_op_in_unsafe_fn.stderr @@ -4,7 +4,7 @@ error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block LL | unsf(); | ^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:8:1 @@ -23,7 +23,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe block LL | *PTR; | ^^^^ dereference of raw pointer | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior error[E0133]: use of mutable static is unsafe and requires unsafe block @@ -32,7 +32,7 @@ error[E0133]: use of mutable static is unsafe and requires unsafe block LL | VOID = (); | ^^^^ use of mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior error: unnecessary `unsafe` block @@ -53,7 +53,7 @@ error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block LL | unsf(); | ^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:23:1 @@ -73,7 +73,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe block LL | *PTR; | ^^^^ dereference of raw pointer | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior error[E0133]: use of mutable static is unsafe and requires unsafe block @@ -82,7 +82,7 @@ error[E0133]: use of mutable static is unsafe and requires unsafe block LL | VOID = (); | ^^^^ use of mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior error: unnecessary `unsafe` block diff --git a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/wrapping-unsafe-block-sugg.stderr b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/wrapping-unsafe-block-sugg.stderr index b48e607c53b..f7dbf39e6f2 100644 --- a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/wrapping-unsafe-block-sugg.stderr +++ b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/wrapping-unsafe-block-sugg.stderr @@ -4,7 +4,7 @@ error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block LL | unsf(); | ^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/wrapping-unsafe-block-sugg.rs:11:1 @@ -23,7 +23,7 @@ error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block LL | unsf(); | ^^^^^^ call to unsafe function | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: dereference of raw pointer is unsafe and requires unsafe block @@ -32,7 +32,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe block LL | let y = *x; | ^^ dereference of raw pointer | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/wrapping-unsafe-block-sugg.rs:23:1 @@ -46,7 +46,7 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe block LL | y + *x | ^^ dereference of raw pointer | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior error[E0133]: use of mutable static is unsafe and requires unsafe block @@ -55,7 +55,7 @@ error[E0133]: use of mutable static is unsafe and requires unsafe block LL | let y = BAZ; | ^^^ use of mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/wrapping-unsafe-block-sugg.rs:36:1 @@ -69,7 +69,7 @@ error[E0133]: use of mutable static is unsafe and requires unsafe block LL | y + BAZ | ^^^ use of mutable static | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block @@ -81,7 +81,7 @@ LL | macro_rules! unsafe_macro { () => (unsf()) } LL | unsafe_macro!(); | --------------- in this macro invocation | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> $DIR/wrapping-unsafe-block-sugg.rs:58:1 @@ -99,7 +99,7 @@ LL | macro_rules! unsafe_macro { () => (unsf()) } LL | unsafe_macro!(); | --------------- in this macro invocation | - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/issues/issue-41229-ref-str.rs b/tests/ui/unsized/unsized-function-argument-41229.rs index fe5e6cd6ec5..9210431dc2f 100644 --- a/tests/ui/issues/issue-41229-ref-str.rs +++ b/tests/ui/unsized/unsized-function-argument-41229.rs @@ -2,3 +2,5 @@ pub fn example(ref s: str) {} //~^ ERROR the size for values of type fn main() {} + +// https://github.com/rust-lang/rust/issues/41229 diff --git a/tests/ui/issues/issue-41229-ref-str.stderr b/tests/ui/unsized/unsized-function-argument-41229.stderr index d4ef2a77725..326e5681f70 100644 --- a/tests/ui/issues/issue-41229-ref-str.stderr +++ b/tests/ui/unsized/unsized-function-argument-41229.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/issue-41229-ref-str.rs:1:23 + --> $DIR/unsized-function-argument-41229.rs:1:23 | LL | pub fn example(ref s: str) {} | ^^^ doesn't have a size known at compile-time diff --git a/tests/ui/use/use-after-move-implicity-coerced-object.stderr b/tests/ui/use/use-after-move-implicity-coerced-object.stderr index 35ede21717e..defaeef361b 100644 --- a/tests/ui/use/use-after-move-implicity-coerced-object.stderr +++ b/tests/ui/use/use-after-move-implicity-coerced-object.stderr @@ -17,6 +17,14 @@ LL | fn push(&mut self, n: Box<dyn ToString + 'static>) { | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this parameter takes ownership of the value | | | in this method +note: if `Number` implemented `Clone`, you could clone the value + --> $DIR/use-after-move-implicity-coerced-object.rs:3:1 + | +LL | struct Number { + | ^^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | l.push(n); + | - you could clone this value error: aborting due to 1 previous error diff --git a/tests/ui/hello_world/main.rs b/tests/ui/warnings/hello-world.rs index 1b687eb1373..1b687eb1373 100644 --- a/tests/ui/hello_world/main.rs +++ b/tests/ui/warnings/hello-world.rs diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr index a99728f4b66..26872f60fd3 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr @@ -5,7 +5,7 @@ LL | trait Foo<const N: Bar<2>> { | ^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> = note: `#[warn(bare_trait_objects)]` on by default help: if this is a dyn-compatible trait, use `dyn` | @@ -19,7 +19,7 @@ LL | trait Bar<const M: Foo<2>> {} | ^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> help: if this is a dyn-compatible trait, use `dyn` | LL | trait Bar<const M: dyn Foo<2>> {} diff --git a/tests/ui/wf/wf-static-type.rs b/tests/ui/wf/wf-static-type.rs index 1980c5de40c..1c35e1daf44 100644 --- a/tests/ui/wf/wf-static-type.rs +++ b/tests/ui/wf/wf-static-type.rs @@ -9,8 +9,6 @@ struct NotCopy; static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; //~^ ERROR E0277 -//~| ERROR E0277 -//~| ERROR E0277 fn main() { } diff --git a/tests/ui/wf/wf-static-type.stderr b/tests/ui/wf/wf-static-type.stderr index 53b90c69960..2fa8ae06c45 100644 --- a/tests/ui/wf/wf-static-type.stderr +++ b/tests/ui/wf/wf-static-type.stderr @@ -16,43 +16,6 @@ LL + #[derive(Copy)] LL | struct NotCopy; | -error[E0277]: the trait bound `NotCopy: Copy` is not satisfied - --> $DIR/wf-static-type.rs:10:13 - | -LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` - | - = note: required for `Option<NotCopy>` to implement `Copy` -note: required by a bound in `IsCopy` - --> $DIR/wf-static-type.rs:7:17 - | -LL | struct IsCopy<T:Copy> { t: T } - | ^^^^ required by this bound in `IsCopy` - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: consider annotating `NotCopy` with `#[derive(Copy)]` - | -LL + #[derive(Copy)] -LL | struct NotCopy; - | - -error[E0277]: the trait bound `NotCopy: Copy` is not satisfied - --> $DIR/wf-static-type.rs:10:51 - | -LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; - | ^^^^ the trait `Copy` is not implemented for `NotCopy` - | - = note: required for `Option<NotCopy>` to implement `Copy` -note: required by a bound in `IsCopy` - --> $DIR/wf-static-type.rs:7:17 - | -LL | struct IsCopy<T:Copy> { t: T } - | ^^^^ required by this bound in `IsCopy` -help: consider annotating `NotCopy` with `#[derive(Copy)]` - | -LL + #[derive(Copy)] -LL | struct NotCopy; - | - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`. |
