diff options
Diffstat (limited to 'tests')
2036 files changed, 13116 insertions, 7084 deletions
diff --git a/tests/assembly/asm/powerpc-types.rs b/tests/assembly/asm/powerpc-types.rs index 85321e5f345..aa35c4d8865 100644 --- a/tests/assembly/asm/powerpc-types.rs +++ b/tests/assembly/asm/powerpc-types.rs @@ -1,9 +1,15 @@ -//@ revisions: powerpc powerpc64 +//@ revisions: powerpc powerpc_altivec powerpc_vsx powerpc64 powerpc64_vsx //@ assembly-output: emit-asm //@[powerpc] compile-flags: --target powerpc-unknown-linux-gnu //@[powerpc] needs-llvm-components: powerpc -//@[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu +//@[powerpc_altivec] compile-flags: --target powerpc-unknown-linux-gnu -C target-feature=+altivec --cfg altivec +//@[powerpc_altivec] needs-llvm-components: powerpc +//@[powerpc_vsx] compile-flags: --target powerpc-unknown-linux-gnu -C target-feature=+altivec,+vsx --cfg altivec --cfg vsx +//@[powerpc_vsx] needs-llvm-components: powerpc +//@[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu --cfg altivec //@[powerpc64] needs-llvm-components: powerpc +//@[powerpc64_vsx] compile-flags: --target powerpc64-unknown-linux-gnu -C target-feature=+vsx --cfg altivec --cfg vsx +//@[powerpc64_vsx] needs-llvm-components: powerpc //@ compile-flags: -Zmerge-functions=disabled #![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)] @@ -11,6 +17,13 @@ #![no_core] #![allow(asm_sub_register, non_camel_case_types)] +#[cfg_attr(altivec, cfg(not(target_feature = "altivec")))] +#[cfg_attr(not(altivec), cfg(target_feature = "altivec"))] +compile_error!("altivec cfg and target feature mismatch"); +#[cfg_attr(vsx, cfg(not(target_feature = "vsx")))] +#[cfg_attr(not(vsx), cfg(target_feature = "vsx"))] +compile_error!("vsx cfg and target feature mismatch"); + #[rustc_builtin_macro] macro_rules! asm { () => {}; @@ -29,8 +42,23 @@ trait Sized {} #[lang = "copy"] trait Copy {} +impl<T: Copy, const N: usize> Copy for [T; N] {} + type ptr = *const i32; +#[repr(simd)] +pub struct i8x16([i8; 16]); +#[repr(simd)] +pub struct i16x8([i16; 8]); +#[repr(simd)] +pub struct i32x4([i32; 4]); +#[repr(simd)] +pub struct i64x2([i64; 2]); +#[repr(simd)] +pub struct f32x4([f32; 4]); +#[repr(simd)] +pub struct f64x2([f64; 2]); + impl Copy for i8 {} impl Copy for u8 {} impl Copy for i16 {} @@ -39,6 +67,13 @@ impl Copy for i64 {} impl Copy for f32 {} impl Copy for f64 {} impl Copy for ptr {} +impl Copy for i8x16 {} +impl Copy for i16x8 {} +impl Copy for i32x4 {} +impl Copy for i64x2 {} +impl Copy for f32x4 {} +impl Copy for f64x2 {} + extern "C" { fn extern_func(); static extern_static: u8; @@ -124,6 +159,94 @@ check!(reg_f32, f32, freg, "fmr"); // CHECK: #NO_APP check!(reg_f64, f64, freg, "fmr"); +// powerpc_altivec-LABEL: vreg_i8x16: +// powerpc_altivec: #APP +// powerpc_altivec: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i8x16: +// powerpc64: #APP +// powerpc64: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64: #NO_APP +#[cfg(altivec)] +check!(vreg_i8x16, i8x16, vreg, "vmr"); + +// powerpc_altivec-LABEL: vreg_i16x8: +// powerpc_altivec: #APP +// powerpc_altivec: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i16x8: +// powerpc64: #APP +// powerpc64: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64: #NO_APP +#[cfg(altivec)] +check!(vreg_i16x8, i16x8, vreg, "vmr"); + +// powerpc_altivec-LABEL: vreg_i32x4: +// powerpc_altivec: #APP +// powerpc_altivec: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i32x4: +// powerpc64: #APP +// powerpc64: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64: #NO_APP +#[cfg(altivec)] +check!(vreg_i32x4, i32x4, vreg, "vmr"); + +// powerpc_vsx-LABEL: vreg_i64x2: +// powerpc_vsx: #APP +// powerpc_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_i64x2: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check!(vreg_i64x2, i64x2, vreg, "vmr"); + +// powerpc_altivec-LABEL: vreg_f32x4: +// powerpc_altivec: #APP +// powerpc_altivec: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_f32x4: +// powerpc64: #APP +// powerpc64: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64: #NO_APP +#[cfg(altivec)] +check!(vreg_f32x4, f32x4, vreg, "vmr"); + +// powerpc_vsx-LABEL: vreg_f64x2: +// powerpc_vsx: #APP +// powerpc_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f64x2: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check!(vreg_f64x2, f64x2, vreg, "vmr"); + +// powerpc_vsx-LABEL: vreg_f32: +// powerpc_vsx: #APP +// powerpc_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f32: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check!(vreg_f32, f32, vreg, "vmr"); + +// powerpc_vsx-LABEL: vreg_f64: +// powerpc_vsx: #APP +// powerpc_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f64: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr {{[0-9]+}}, {{[0-9]+}} +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check!(vreg_f64, f64, vreg, "vmr"); + // CHECK-LABEL: reg_i8_r0: // CHECK: #APP // CHECK: mr 0, 0 @@ -197,3 +320,179 @@ check_reg!(reg_f32_f18, f32, "18", "f18", "fmr"); // CHECK: fmr 18, 18 // CHECK: #NO_APP check_reg!(reg_f64_f18, f64, "18", "f18", "fmr"); + +// powerpc_altivec-LABEL: vreg_i8x16_v0: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 0, 0 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i8x16_v0: +// powerpc64: #APP +// powerpc64: vmr 0, 0 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_i8x16_v0, i8x16, "0", "v0", "vmr"); + +// powerpc_altivec-LABEL: vreg_i16x8_v0: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 0, 0 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i16x8_v0: +// powerpc64: #APP +// powerpc64: vmr 0, 0 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_i16x8_v0, i16x8, "0", "v0", "vmr"); + +// powerpc_altivec-LABEL: vreg_i32x4_v0: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 0, 0 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i32x4_v0: +// powerpc64: #APP +// powerpc64: vmr 0, 0 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_i32x4_v0, i32x4, "0", "v0", "vmr"); + +// powerpc_vsx-LABEL: vreg_i64x2_v0: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 0, 0 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_i64x2_v0: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 0, 0 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_i64x2_v0, i64x2, "0", "v0", "vmr"); + +// powerpc_altivec-LABEL: vreg_f32x4_v0: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 0, 0 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_f32x4_v0: +// powerpc64: #APP +// powerpc64: vmr 0, 0 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_f32x4_v0, f32x4, "0", "v0", "vmr"); + +// powerpc_vsx-LABEL: vreg_f64x2_v0: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 0, 0 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f64x2_v0: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 0, 0 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_f64x2_v0, f64x2, "0", "v0", "vmr"); + +// powerpc_vsx-LABEL: vreg_f32_v0: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 0, 0 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f32_v0: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 0, 0 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_f32_v0, f32, "0", "v0", "vmr"); + +// powerpc_vsx-LABEL: vreg_f64_v0: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 0, 0 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f64_v0: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 0, 0 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_f64_v0, f64, "0", "v0", "vmr"); + +// powerpc_altivec-LABEL: vreg_i8x16_v18: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 18, 18 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i8x16_v18: +// powerpc64: #APP +// powerpc64: vmr 18, 18 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_i8x16_v18, i8x16, "18", "v18", "vmr"); + +// powerpc_altivec-LABEL: vreg_i16x8_v18: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 18, 18 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i16x8_v18: +// powerpc64: #APP +// powerpc64: vmr 18, 18 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_i16x8_v18, i16x8, "18", "v18", "vmr"); + +// powerpc_altivec-LABEL: vreg_i32x4_v18: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 18, 18 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_i32x4_v18: +// powerpc64: #APP +// powerpc64: vmr 18, 18 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_i32x4_v18, i32x4, "18", "v18", "vmr"); + +// powerpc_vsx-LABEL: vreg_i64x2_v18: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 18, 18 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_i64x2_v18: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 18, 18 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_i64x2_v18, i64x2, "18", "v18", "vmr"); + +// powerpc_altivec-LABEL: vreg_f32x4_v18: +// powerpc_altivec: #APP +// powerpc_altivec: vmr 18, 18 +// powerpc_altivec: #NO_APP +// powerpc64-LABEL: vreg_f32x4_v18: +// powerpc64: #APP +// powerpc64: vmr 18, 18 +// powerpc64: #NO_APP +#[cfg(altivec)] +check_reg!(vreg_f32x4_v18, f32x4, "18", "v18", "vmr"); + +// powerpc_vsx-LABEL: vreg_f64x2_v18: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 18, 18 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f64x2_v18: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 18, 18 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_f64x2_v18, f64x2, "18", "v18", "vmr"); + +// powerpc_vsx-LABEL: vreg_f32_v18: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 18, 18 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f32_v18: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 18, 18 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_f32_v18, f32, "18", "v18", "vmr"); + +// powerpc_vsx-LABEL: vreg_f64_v18: +// powerpc_vsx: #APP +// powerpc_vsx: vmr 18, 18 +// powerpc_vsx: #NO_APP +// powerpc64_vsx-LABEL: vreg_f64_v18: +// powerpc64_vsx: #APP +// powerpc64_vsx: vmr 18, 18 +// powerpc64_vsx: #NO_APP +#[cfg(vsx)] +check_reg!(vreg_f64_v18, f64, "18", "v18", "vmr"); diff --git a/tests/assembly/asm/s390x-types.rs b/tests/assembly/asm/s390x-types.rs index b1522198a08..3da22d6c77b 100644 --- a/tests/assembly/asm/s390x-types.rs +++ b/tests/assembly/asm/s390x-types.rs @@ -1,10 +1,13 @@ -//@ revisions: s390x +//@ revisions: s390x s390x_vector //@ assembly-output: emit-asm //@[s390x] compile-flags: --target s390x-unknown-linux-gnu //@[s390x] needs-llvm-components: systemz +//@[s390x_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector +//@[s390x_vector] needs-llvm-components: systemz //@ compile-flags: -Zmerge-functions=disabled -#![feature(no_core, lang_items, rustc_attrs, repr_simd)] +#![feature(no_core, lang_items, rustc_attrs, repr_simd, f128)] +#![cfg_attr(s390x_vector, feature(asm_experimental_reg))] #![crate_type = "rlib"] #![no_core] #![allow(asm_sub_register, non_camel_case_types)] @@ -27,16 +30,39 @@ trait Sized {} #[lang = "copy"] trait Copy {} +impl<T: Copy, const N: usize> Copy for [T; N] {} + type ptr = *const i32; +#[repr(simd)] +pub struct i8x16([i8; 16]); +#[repr(simd)] +pub struct i16x8([i16; 8]); +#[repr(simd)] +pub struct i32x4([i32; 4]); +#[repr(simd)] +pub struct i64x2([i64; 2]); +#[repr(simd)] +pub struct f32x4([f32; 4]); +#[repr(simd)] +pub struct f64x2([f64; 2]); + impl Copy for i8 {} impl Copy for u8 {} impl Copy for i16 {} impl Copy for i32 {} impl Copy for i64 {} +impl Copy for i128 {} impl Copy for f32 {} impl Copy for f64 {} +impl Copy for f128 {} impl Copy for ptr {} +impl Copy for i8x16 {} +impl Copy for i16x8 {} +impl Copy for i32x4 {} +impl Copy for i64x2 {} +impl Copy for f32x4 {} +impl Copy for f64x2 {} extern "C" { fn extern_func(); @@ -65,7 +91,6 @@ macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => { // CHECK: #APP // CHECK: brasl %r14, extern_func // CHECK: #NO_APP -#[cfg(s390x)] #[no_mangle] pub unsafe fn sym_fn_32() { asm!("brasl %r14, {}", sym extern_func); @@ -146,6 +171,90 @@ check!(reg_f64, f64, freg, "ldr"); // CHECK: #NO_APP check!(reg_ptr, ptr, reg, "lgr"); +// s390x_vector-LABEL: vreg_i8x16: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_i8x16, i8x16, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_i16x8: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_i16x8, i16x8, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_i32x4: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_i32x4, i32x4, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_i64x2: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_i64x2, i64x2, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_f32x4: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_f32x4, f32x4, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_f64x2: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_f64x2, f64x2, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_i32: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_i32, i32, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_i64: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_i64, i64, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_i128: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_i128, i128, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_f32: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_f32, f32, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_f64: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_f64, f64, vreg, "vlr"); + +// s390x_vector-LABEL: vreg_f128: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_f128, f128, vreg, "vlr"); + // CHECK-LABEL: r0_i8: // CHECK: #APP // CHECK: lr %r0, %r0 @@ -181,3 +290,87 @@ check_reg!(f0_f32, f32, "f0", "ler"); // CHECK: ldr %f0, %f0 // CHECK: #NO_APP check_reg!(f0_f64, f64, "f0", "ldr"); + +// s390x_vector-LABEL: v0_i8x16: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_i8x16, i8x16, "v0", "vlr"); + +// s390x_vector-LABEL: v0_i16x8: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_i16x8, i16x8, "v0", "vlr"); + +// s390x_vector-LABEL: v0_i32x4: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_i32x4, i32x4, "v0", "vlr"); + +// s390x_vector-LABEL: v0_i64x2: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_i64x2, i64x2, "v0", "vlr"); + +// s390x_vector-LABEL: v0_f32x4: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_f32x4, f32x4, "v0", "vlr"); + +// s390x_vector-LABEL: v0_f64x2: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_f64x2, f64x2, "v0", "vlr"); + +// s390x_vector-LABEL: v0_i32: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_i32, i32, "v0", "vlr"); + +// s390x_vector-LABEL: v0_i64: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_i64, i64, "v0", "vlr"); + +// s390x_vector-LABEL: v0_i128: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_i128, i128, "v0", "vlr"); + +// s390x_vector-LABEL: v0_f32: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_f32, f32, "v0", "vlr"); + +// s390x_vector-LABEL: v0_f64: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_f64, f64, "v0", "vlr"); + +// s390x_vector-LABEL: v0_f128: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_f128, f128, "v0", "vlr"); diff --git a/tests/assembly/breakpoint.rs b/tests/assembly/breakpoint.rs new file mode 100644 index 00000000000..e0cc2d1eebb --- /dev/null +++ b/tests/assembly/breakpoint.rs @@ -0,0 +1,14 @@ +//@ revisions: aarch64 x86_64 +//@ assembly-output: emit-asm +//@[aarch64] only-aarch64 +//@[x86_64] only-x86_64 + +#![feature(breakpoint)] +#![crate_type = "lib"] + +// CHECK-LABEL: use_bp +// aarch64: brk #0xf000 +// x86_64: int3 +pub fn use_bp() { + core::arch::breakpoint(); +} diff --git a/tests/assembly/s390x-vector-abi.rs b/tests/assembly/s390x-vector-abi.rs new file mode 100644 index 00000000000..c1935582561 --- /dev/null +++ b/tests/assembly/s390x-vector-abi.rs @@ -0,0 +1,322 @@ +//@ revisions: z10 z10_vector z13 z13_no_vector +// ignore-tidy-linelength +//@ assembly-output: emit-asm +//@ compile-flags: -O -Z merge-functions=disabled +//@[z10] compile-flags: --target s390x-unknown-linux-gnu --cfg no_vector +//@[z10] needs-llvm-components: systemz +//@[z10_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector +//@[z10_vector] needs-llvm-components: systemz +//@[z13] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 +//@[z13] needs-llvm-components: systemz +//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector --cfg no_vector +//@[z13_no_vector] needs-llvm-components: systemz + +#![feature(no_core, lang_items, repr_simd, s390x_target_feature)] +#![no_core] +#![crate_type = "lib"] +#![allow(non_camel_case_types)] + +// Cases where vector feature is disabled are rejected. +// See tests/ui/simd-abi-checks-s390x.rs for test for them. + +#[lang = "sized"] +pub trait Sized {} +#[lang = "copy"] +pub trait Copy {} +#[lang = "freeze"] +pub trait Freeze {} + +impl<T: Copy, const N: usize> Copy for [T; N] {} + +#[lang = "phantom_data"] +pub struct PhantomData<T: ?Sized>; +impl<T: ?Sized> Copy for PhantomData<T> {} + +#[repr(simd)] +pub struct i8x8([i8; 8]); +#[repr(simd)] +pub struct i8x16([i8; 16]); +#[repr(simd)] +pub struct i8x32([i8; 32]); +#[repr(C)] +pub struct Wrapper<T>(T); +#[repr(C, align(16))] +pub struct WrapperAlign16<T>(T); +#[repr(C)] +pub struct WrapperWithZst<T>(T, PhantomData<()>); +#[repr(transparent)] +pub struct TransparentWrapper<T>(T); + +impl Copy for i8 {} +impl Copy for i64 {} +impl Copy for i8x8 {} +impl Copy for i8x16 {} +impl Copy for i8x32 {} +impl<T: Copy> Copy for Wrapper<T> {} +impl<T: Copy> Copy for WrapperAlign16<T> {} +impl<T: Copy> Copy for WrapperWithZst<T> {} +impl<T: Copy> Copy for TransparentWrapper<T> {} + +// CHECK-LABEL: vector_ret_small: +// CHECK: vlrepg %v24, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + *x +} +// CHECK-LABEL: vector_ret: +// CHECK: vl %v24, 0(%r2), 3 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + *x +} +// CHECK-LABEL: vector_ret_large: +// z10: vl %v0, 16(%r3), 4 +// z10-NEXT: vl %v1, 0(%r3), 4 +// z10-NEXT: vst %v0, 16(%r2), 4 +// z10-NEXT: vst %v1, 0(%r2), 4 +// z10-NEXT: br %r14 +// z13: vl %v0, 0(%r3), 4 +// z13-NEXT: vl %v1, 16(%r3), 4 +// z13-NEXT: vst %v1, 16(%r2), 4 +// z13-NEXT: vst %v0, 0(%r2), 4 +// z13-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_ret_large(x: &i8x32) -> i8x32 { + *x +} + +// CHECK-LABEL: vector_wrapper_ret_small: +// CHECK: mvc 0(8,%r2), 0(%r3) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_ret_small(x: &Wrapper<i8x8>) -> Wrapper<i8x8> { + *x +} +// CHECK-LABEL: vector_wrapper_ret: +// CHECK: mvc 0(16,%r2), 0(%r3) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_ret(x: &Wrapper<i8x16>) -> Wrapper<i8x16> { + *x +} +// CHECK-LABEL: vector_wrapper_ret_large: +// z10: vl %v0, 16(%r3), 4 +// z10-NEXT: vl %v1, 0(%r3), 4 +// z10-NEXT: vst %v0, 16(%r2), 4 +// z10-NEXT: vst %v1, 0(%r2), 4 +// z10-NEXT: br %r14 +// z13: vl %v0, 16(%r3), 4 +// z13-NEXT: vst %v0, 16(%r2), 4 +// z13-NEXT: vl %v0, 0(%r3), 4 +// z13-NEXT: vst %v0, 0(%r2), 4 +// z13-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_ret_large(x: &Wrapper<i8x32>) -> Wrapper<i8x32> { + *x +} + +// CHECK-LABEL: vector_wrapper_padding_ret: +// CHECK: mvc 0(16,%r2), 0(%r3) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_padding_ret(x: &WrapperAlign16<i8x8>) -> WrapperAlign16<i8x8> { + *x +} + +// CHECK-LABEL: vector_wrapper_with_zst_ret_small: +// CHECK: mvc 0(8,%r2), 0(%r3) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_with_zst_ret_small( + x: &WrapperWithZst<i8x8>, +) -> WrapperWithZst<i8x8> { + *x +} +// CHECK-LABEL: vector_wrapper_with_zst_ret: +// CHECK: mvc 0(16,%r2), 0(%r3) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_with_zst_ret( + x: &WrapperWithZst<i8x16>, +) -> WrapperWithZst<i8x16> { + *x +} +// CHECK-LABEL: vector_wrapper_with_zst_ret_large: +// z10: vl %v0, 16(%r3), 4 +// z10-NEXT: vl %v1, 0(%r3), 4 +// z10-NEXT: vst %v0, 16(%r2), 4 +// z10-NEXT: vst %v1, 0(%r2), 4 +// z10-NEXT: br %r14 +// z13: vl %v0, 16(%r3), 4 +// z13-NEXT: vst %v0, 16(%r2), 4 +// z13-NEXT: vl %v0, 0(%r3), 4 +// z13-NEXT: vst %v0, 0(%r2), 4 +// z13-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_with_zst_ret_large( + x: &WrapperWithZst<i8x32>, +) -> WrapperWithZst<i8x32> { + *x +} + +// CHECK-LABEL: vector_transparent_wrapper_ret_small: +// CHECK: vlrepg %v24, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_transparent_wrapper_ret_small( + x: &TransparentWrapper<i8x8>, +) -> TransparentWrapper<i8x8> { + *x +} +// CHECK-LABEL: vector_transparent_wrapper_ret: +// CHECK: vl %v24, 0(%r2), 3 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_transparent_wrapper_ret( + x: &TransparentWrapper<i8x16>, +) -> TransparentWrapper<i8x16> { + *x +} +// CHECK-LABEL: vector_transparent_wrapper_ret_large: +// z10: vl %v0, 16(%r3), 4 +// z10-NEXT: vl %v1, 0(%r3), 4 +// z10-NEXT: vst %v0, 16(%r2), 4 +// z10-NEXT: vst %v1, 0(%r2), 4 +// z10-NEXT: br %r14 +// z13: vl %v0, 0(%r3), 4 +// z13-NEXT: vl %v1, 16(%r3), 4 +// z13-NEXT: vst %v1, 16(%r2), 4 +// z13-NEXT: vst %v0, 0(%r2), 4 +// z13-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_transparent_wrapper_ret_large( + x: &TransparentWrapper<i8x32>, +) -> TransparentWrapper<i8x32> { + *x +} + +// CHECK-LABEL: vector_arg_small: +// CHECK: vlgvg %r2, %v24, 0 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_arg_small(x: i8x8) -> i64 { + unsafe { *(&x as *const i8x8 as *const i64) } +} +// CHECK-LABEL: vector_arg: +// CHECK: vlgvg %r2, %v24, 0 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_arg(x: i8x16) -> i64 { + unsafe { *(&x as *const i8x16 as *const i64) } +} +// CHECK-LABEL: vector_arg_large: +// CHECK: lg %r2, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_arg_large(x: i8x32) -> i64 { + unsafe { *(&x as *const i8x32 as *const i64) } +} + +// CHECK-LABEL: vector_wrapper_arg_small: +// CHECK: vlgvg %r2, %v24, 0 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + unsafe { *(&x as *const Wrapper<i8x8> as *const i64) } +} +// CHECK-LABEL: vector_wrapper_arg: +// CHECK: vlgvg %r2, %v24, 0 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + unsafe { *(&x as *const Wrapper<i8x16> as *const i64) } +} +// CHECK-LABEL: vector_wrapper_arg_large: +// CHECK: lg %r2, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_arg_large(x: Wrapper<i8x32>) -> i64 { + unsafe { *(&x as *const Wrapper<i8x32> as *const i64) } +} + +// https://github.com/rust-lang/rust/pull/131586#discussion_r1837071121 +// CHECK-LABEL: vector_wrapper_padding_arg: +// CHECK: lg %r2, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_padding_arg(x: WrapperAlign16<i8x8>) -> i64 { + unsafe { *(&x as *const WrapperAlign16<i8x8> as *const i64) } +} + +// CHECK-LABEL: vector_wrapper_with_zst_arg_small: +// CHECK: .cfi_startproc +// CHECK-NOT: vlgvg +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_with_zst_arg_small(x: WrapperWithZst<i8x8>) -> i64 { + unsafe { *(&x as *const WrapperWithZst<i8x8> as *const i64) } +} +// CHECK-LABEL: vector_wrapper_with_zst_arg: +// CHECK: lg %r2, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_with_zst_arg(x: WrapperWithZst<i8x16>) -> i64 { + unsafe { *(&x as *const WrapperWithZst<i8x16> as *const i64) } +} +// CHECK-LABEL: vector_wrapper_with_zst_arg_large: +// CHECK: lg %r2, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_wrapper_with_zst_arg_large(x: WrapperWithZst<i8x32>) -> i64 { + unsafe { *(&x as *const WrapperWithZst<i8x32> as *const i64) } +} + +// CHECK-LABEL: vector_transparent_wrapper_arg_small: +// CHECK: vlgvg %r2, %v24, 0 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + unsafe { *(&x as *const TransparentWrapper<i8x8> as *const i64) } +} +// CHECK-LABEL: vector_transparent_wrapper_arg: +// CHECK: vlgvg %r2, %v24, 0 +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + unsafe { *(&x as *const TransparentWrapper<i8x16> as *const i64) } +} +// CHECK-LABEL: vector_transparent_wrapper_arg_large: +// CHECK: lg %r2, 0(%r2) +// CHECK-NEXT: br %r14 +#[cfg_attr(no_vector, target_feature(enable = "vector"))] +#[no_mangle] +unsafe extern "C" fn vector_transparent_wrapper_arg_large(x: TransparentWrapper<i8x32>) -> i64 { + unsafe { *(&x as *const TransparentWrapper<i8x32> as *const i64) } +} diff --git a/tests/assembly/x86_64-bigint-helpers.rs b/tests/assembly/x86_64-bigint-helpers.rs new file mode 100644 index 00000000000..198e5543539 --- /dev/null +++ b/tests/assembly/x86_64-bigint-helpers.rs @@ -0,0 +1,54 @@ +//@ only-x86_64 +//@ assembly-output: emit-asm +//@ compile-flags: --crate-type=lib -O -C target-cpu=x86-64-v4 +//@ compile-flags: -C llvm-args=-x86-asm-syntax=intel + +#![no_std] +#![feature(bigint_helper_methods)] + +// This checks that the `carrying_add` and `borrowing_sub` implementation successfully chain, +// to catch issues like <https://github.com/rust-lang/rust/issues/85532#issuecomment-2495119815> + +// This forces the ABI to avoid the windows-vs-linux ABI differences. + +// CHECK-LABEL: bigint_chain_carrying_add: +#[no_mangle] +pub unsafe extern "sysv64" fn bigint_chain_carrying_add( + dest: *mut u64, + src1: *const u64, + src2: *const u64, + n: usize, + mut carry: bool, +) -> bool { + // CHECK: mov [[TEMP:r..]], qword ptr [rsi + 8*[[IND:r..]] + 8] + // CHECK: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 8] + // CHECK: mov qword ptr [rdi + 8*[[IND]] + 8], [[TEMP]] + // CHECK: mov [[TEMP]], qword ptr [rsi + 8*[[IND]] + 16] + // CHECK: adc [[TEMP]], qword ptr [rdx + 8*[[IND]] + 16] + // CHECK: mov qword ptr [rdi + 8*[[IND]] + 16], [[TEMP]] + for i in 0..n { + (*dest.add(i), carry) = u64::carrying_add(*src1.add(i), *src2.add(i), carry); + } + carry +} + +// CHECK-LABEL: bigint_chain_borrowing_sub: +#[no_mangle] +pub unsafe extern "sysv64" fn bigint_chain_borrowing_sub( + dest: *mut u64, + src1: *const u64, + src2: *const u64, + n: usize, + mut carry: bool, +) -> bool { + // CHECK: mov [[TEMP:r..]], qword ptr [rsi + 8*[[IND:r..]] + 8] + // CHECK: sbb [[TEMP]], qword ptr [rdx + 8*[[IND]] + 8] + // CHECK: mov qword ptr [rdi + 8*[[IND]] + 8], [[TEMP]] + // CHECK: mov [[TEMP]], qword ptr [rsi + 8*[[IND]] + 16] + // CHECK: sbb [[TEMP]], qword ptr [rdx + 8*[[IND]] + 16] + // CHECK: mov qword ptr [rdi + 8*[[IND]] + 16], [[TEMP]] + for i in 0..n { + (*dest.add(i), carry) = u64::borrowing_sub(*src1.add(i), *src2.add(i), carry); + } + carry +} diff --git a/tests/auxiliary/minicore.rs b/tests/auxiliary/minicore.rs index 1e9f2ee59b4..c4317752920 100644 --- a/tests/auxiliary/minicore.rs +++ b/tests/auxiliary/minicore.rs @@ -45,6 +45,7 @@ impl_marker_trait!( impl<'a, T: ?Sized> Copy for &'a T {} impl<T: ?Sized> Copy for *const T {} impl<T: ?Sized> Copy for *mut T {} +impl<T: Copy, const N: usize> Copy for [T; N] {} #[lang = "phantom_data"] pub struct PhantomData<T: ?Sized>; diff --git a/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs b/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs index 3926f295742..8bb78eb788a 100644 --- a/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs +++ b/tests/codegen-units/partitioning/auxiliary/cgu_generic_function.rs @@ -11,10 +11,21 @@ pub fn foo<T>(x: T) -> (T, u32, i8) { #[inline(never)] fn bar<T>(x: T) -> (T, Struct) { let _ = not_exported_and_not_generic(0); + exported_and_generic::<u32>(0); (x, Struct(1)) } +pub static F: fn(u32) -> u32 = exported_and_generic::<u32>; + // These should not contribute to the codegen items of other crates. + +// This is generic, but it's only instantiated with a u32 argument and that instantiation is present +// in the local crate (see F above). +#[inline(never)] +pub fn exported_and_generic<T>(x: T) -> T { + x +} + #[inline(never)] pub fn exported_but_not_generic(x: i32) -> i64 { x as i64 diff --git a/tests/codegen/aarch64-softfloat.rs b/tests/codegen/aarch64-softfloat.rs new file mode 100644 index 00000000000..85380a6c472 --- /dev/null +++ b/tests/codegen/aarch64-softfloat.rs @@ -0,0 +1,48 @@ +//@ compile-flags: --target aarch64-unknown-none-softfloat -Zmerge-functions=disabled +//@ needs-llvm-components: aarch64 +#![crate_type = "lib"] +#![feature(no_core, lang_items)] +#![no_core] + +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} +impl Copy for f32 {} +impl Copy for f64 {} + +// CHECK: i64 @pass_f64_C(i64 {{[^,]*}}) +#[no_mangle] +extern "C" fn pass_f64_C(x: f64) -> f64 { + x +} + +// CHECK: i64 @pass_f32_pair_C(i64 {{[^,]*}}) +#[no_mangle] +extern "C" fn pass_f32_pair_C(x: (f32, f32)) -> (f32, f32) { + x +} + +// CHECK: [2 x i64] @pass_f64_pair_C([2 x i64] {{[^,]*}}) +#[no_mangle] +extern "C" fn pass_f64_pair_C(x: (f64, f64)) -> (f64, f64) { + x +} + +// CHECK: i64 @pass_f64_Rust(i64 {{[^,]*}}) +#[no_mangle] +fn pass_f64_Rust(x: f64) -> f64 { + x +} + +// CHECK: i64 @pass_f32_pair_Rust(i64 {{[^,]*}}) +#[no_mangle] +fn pass_f32_pair_Rust(x: (f32, f32)) -> (f32, f32) { + x +} + +// CHECK: void @pass_f64_pair_Rust(ptr {{.*}}%{{[^ ]+}}, ptr {{.*}}%{{[^ ]+}}) +#[no_mangle] +fn pass_f64_pair_Rust(x: (f64, f64)) -> (f64, f64) { + x +} diff --git a/tests/codegen/asm/aarch64-clobbers.rs b/tests/codegen/asm/aarch64-clobbers.rs new file mode 100644 index 00000000000..900e6629fd2 --- /dev/null +++ b/tests/codegen/asm/aarch64-clobbers.rs @@ -0,0 +1,51 @@ +//@ revisions: aarch64 aarch64_fixed_x18 aarch64_no_x18 aarch64_reserve_x18 arm64ec +//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu +//@[aarch64] needs-llvm-components: aarch64 +//@[aarch64_fixed_x18] compile-flags: --target aarch64-unknown-linux-gnu -Zfixed-x18 +//@[aarch64_fixed_x18] needs-llvm-components: aarch64 +//@[aarch64_no_x18] compile-flags: --target aarch64-pc-windows-msvc +//@[aarch64_no_x18] needs-llvm-components: aarch64 +// aarch64-unknown-trusty uses aarch64-unknown-unknown-musl which doesn't +// reserve x18 by default as llvm_target, and pass +reserve-x18 in target-spec. +//@[aarch64_reserve_x18] compile-flags: --target aarch64-unknown-trusty +//@[aarch64_reserve_x18] needs-llvm-components: aarch64 +//@[arm64ec] compile-flags: --target arm64ec-pc-windows-msvc +//@[arm64ec] needs-llvm-components: aarch64 +// ignore-tidy-linelength + +#![crate_type = "rlib"] +#![feature(no_core, rustc_attrs, lang_items)] +#![no_core] + +#[lang = "sized"] +trait Sized {} + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +// CHECK-LABEL: @cc_clobber +// CHECK: call void asm sideeffect "", "~{cc}"() +#[no_mangle] +pub unsafe fn cc_clobber() { + asm!("", options(nostack, nomem)); +} + +// CHECK-LABEL: @no_clobber +// CHECK: call void asm sideeffect "", ""() +#[no_mangle] +pub unsafe fn no_clobber() { + asm!("", options(nostack, nomem, preserves_flags)); +} + +// CHECK-LABEL: @clobber_abi +// aarch64: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w18},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"() +// aarch64_fixed_x18: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"() +// aarch64_no_x18: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"() +// aarch64_reserve_x18: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w13},={w14},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15},={q16},={q17},={q18},={q19},={q20},={q21},={q22},={q23},={q24},={q25},={q26},={q27},={q28},={q29},={q30},={q31},~{p0},~{p1},~{p2},~{p3},~{p4},~{p5},~{p6},~{p7},~{p8},~{p9},~{p10},~{p11},~{p12},~{p13},~{p14},~{p15},~{ffr}"() +// arm64ec: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15}"() +#[no_mangle] +pub unsafe fn clobber_abi() { + asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags)); +} diff --git a/tests/codegen/asm/arm64ec-clobbers.rs b/tests/codegen/asm/arm64ec-clobbers.rs deleted file mode 100644 index 80059331642..00000000000 --- a/tests/codegen/asm/arm64ec-clobbers.rs +++ /dev/null @@ -1,36 +0,0 @@ -//@ assembly-output: emit-asm -//@ compile-flags: --target arm64ec-pc-windows-msvc -//@ needs-llvm-components: aarch64 - -#![crate_type = "rlib"] -#![feature(no_core, rustc_attrs, lang_items)] -#![no_core] - -#[lang = "sized"] -trait Sized {} - -#[rustc_builtin_macro] -macro_rules! asm { - () => {}; -} - -// CHECK-LABEL: @cc_clobber -// CHECK: call void asm sideeffect "", "~{cc}"() -#[no_mangle] -pub unsafe fn cc_clobber() { - asm!("", options(nostack, nomem)); -} - -// CHECK-LABEL: @no_clobber -// CHECK: call void asm sideeffect "", ""() -#[no_mangle] -pub unsafe fn no_clobber() { - asm!("", options(nostack, nomem, preserves_flags)); -} - -// CHECK-LABEL: @clobber_abi -// CHECK: asm sideeffect "", "={w0},={w1},={w2},={w3},={w4},={w5},={w6},={w7},={w8},={w9},={w10},={w11},={w12},={w15},={w16},={w17},={w30},={q0},={q1},={q2},={q3},={q4},={q5},={q6},={q7},={q8},={q9},={q10},={q11},={q12},={q13},={q14},={q15}"() -#[no_mangle] -pub unsafe fn clobber_abi() { - asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags)); -} diff --git a/tests/codegen/asm/avr-clobbers.rs b/tests/codegen/asm/avr-clobbers.rs new file mode 100644 index 00000000000..6e0c75368e2 --- /dev/null +++ b/tests/codegen/asm/avr-clobbers.rs @@ -0,0 +1,43 @@ +//@ assembly-output: emit-asm +//@ compile-flags: --target avr-unknown-gnu-atmega328 +//@ needs-llvm-components: avr + +#![crate_type = "rlib"] +#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)] +#![no_core] + +#[lang = "sized"] +trait Sized {} + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +// CHECK-LABEL: @sreg_is_clobbered +// CHECK: void asm sideeffect "", "~{sreg}"() +#[no_mangle] +pub unsafe fn sreg_is_clobbered() { + asm!("", options(nostack, nomem)); +} + +// CHECK-LABEL: @sreg_is_not_clobbered_if_preserve_flags_is_used +// CHECK: void asm sideeffect "", ""() +#[no_mangle] +pub unsafe fn sreg_is_not_clobbered_if_preserve_flags_is_used() { + asm!("", options(nostack, nomem, preserves_flags)); +} + +// CHECK-LABEL: @clobber_abi +// CHECK: asm sideeffect "", "={r18},={r19},={r20},={r21},={r22},={r23},={r24},={r25},={r26},={r27},={r30},={r31},~{sreg}"() +#[no_mangle] +pub unsafe fn clobber_abi() { + asm!("", clobber_abi("C"), options(nostack, nomem)); +} + +// CHECK-LABEL: @clobber_abi_with_preserved_flags +// CHECK: asm sideeffect "", "={r18},={r19},={r20},={r21},={r22},={r23},={r24},={r25},={r26},={r27},={r30},={r31}"() +#[no_mangle] +pub unsafe fn clobber_abi_with_preserved_flags() { + asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags)); +} diff --git a/tests/codegen/asm/goto.rs b/tests/codegen/asm/goto.rs index e522d0da5b4..c40a43fbe1b 100644 --- a/tests/codegen/asm/goto.rs +++ b/tests/codegen/asm/goto.rs @@ -2,21 +2,10 @@ //@ only-x86_64 #![crate_type = "rlib"] -#![feature(asm_goto)] +#![feature(asm_goto, asm_goto_with_outputs)] use std::arch::asm; -#[no_mangle] -pub extern "C" fn panicky() {} - -struct Foo; - -impl Drop for Foo { - fn drop(&mut self) { - println!(); - } -} - // CHECK-LABEL: @asm_goto #[no_mangle] pub unsafe fn asm_goto() { @@ -38,14 +27,37 @@ pub unsafe fn asm_goto_with_outputs() -> u64 { out } +// CHECK-LABEL: @asm_goto_with_outputs_use_in_label +#[no_mangle] +pub unsafe fn asm_goto_with_outputs_use_in_label() -> u64 { + let out: u64; + // CHECK: [[RES:%[0-9]+]] = callbr i64 asm sideeffect alignstack inteldialect " + // CHECK-NEXT: to label %[[FALLTHROUGHBB:[a-b0-9]+]] [label %[[JUMPBB:[a-b0-9]+]]] + asm!("{} /* {} */", out(reg) out, label { return out; }); + // CHECK: [[JUMPBB]]: + // CHECK-NEXT: [[RET:%.+]] = phi i64 [ 1, %[[FALLTHROUGHBB]] ], [ [[RES]], %start ] + // CHECK-NEXT: ret i64 [[RET]] + 1 +} + // CHECK-LABEL: @asm_goto_noreturn #[no_mangle] pub unsafe fn asm_goto_noreturn() -> u64 { - let out: u64; // CHECK: callbr void asm sideeffect alignstack inteldialect " // CHECK-NEXT: to label %unreachable [label %[[JUMPBB:[a-b0-9]+]]] asm!("jmp {}", label { return 1; }, options(noreturn)); // CHECK: [[JUMPBB]]: // CHECK-NEXT: ret i64 1 +} + +// CHECK-LABEL: @asm_goto_noreturn_with_outputs +#[no_mangle] +pub unsafe fn asm_goto_noreturn_with_outputs() -> u64 { + let out: u64; + // CHECK: [[RES:%[0-9]+]] = callbr i64 asm sideeffect alignstack inteldialect " + // CHECK-NEXT: to label %[[FALLTHROUGHBB:[a-b0-9]+]] [label %[[JUMPBB:[a-b0-9]+]]] + asm!("mov {}, 1", "jmp {}", out(reg) out, label { return out; }); + // CHECK: [[JUMPBB]]: + // CHECK-NEXT: ret i64 [[RES]] out } diff --git a/tests/codegen/asm/hexagon-clobbers.rs b/tests/codegen/asm/hexagon-clobbers.rs new file mode 100644 index 00000000000..6bb662ead99 --- /dev/null +++ b/tests/codegen/asm/hexagon-clobbers.rs @@ -0,0 +1,37 @@ +//@ revisions: hexagon +//@[hexagon] compile-flags: --target hexagon-unknown-linux-musl +//@[hexagon] needs-llvm-components: hexagon +//@ compile-flags: -Zmerge-functions=disabled + +#![crate_type = "rlib"] +#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)] +#![no_core] + +#[lang = "sized"] +trait Sized {} + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +// CHECK-LABEL: @flags_clobber +// CHECK: call void asm sideeffect "", ""() +#[no_mangle] +pub unsafe fn flags_clobber() { + asm!("", options(nostack, nomem)); +} + +// CHECK-LABEL: @no_clobber +// CHECK: call void asm sideeffect "", ""() +#[no_mangle] +pub unsafe fn no_clobber() { + asm!("", options(nostack, nomem, preserves_flags)); +} + +// CHECK-LABEL: @p0_clobber +// CHECK: call void asm sideeffect "", "~{p0}"() +#[no_mangle] +pub unsafe fn p0_clobber() { + asm!("", out("p0") _, options(nostack, nomem, preserves_flags)); +} diff --git a/tests/codegen/asm/powerpc-clobbers.rs b/tests/codegen/asm/powerpc-clobbers.rs index e97e8300ca7..2832377cef0 100644 --- a/tests/codegen/asm/powerpc-clobbers.rs +++ b/tests/codegen/asm/powerpc-clobbers.rs @@ -7,6 +7,7 @@ //@[powerpc64le] needs-llvm-components: powerpc //@[aix64] compile-flags: --target powerpc64-ibm-aix //@[aix64] needs-llvm-components: powerpc +// ignore-tidy-linelength #![crate_type = "rlib"] #![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)] @@ -48,15 +49,23 @@ pub unsafe fn xer_clobber() { asm!("", out("xer") _, options(nostack, nomem, preserves_flags)); } +// Output format depends on the availability of altivec. // CHECK-LABEL: @v0_clobber -// CHECK: call void asm sideeffect "", "~{v0}"() +// powerpc: call void asm sideeffect "", "~{v0}"() +// powerpc64: call <4 x i32> asm sideeffect "", "=&{v0}"() +// powerpc64le: call <4 x i32> asm sideeffect "", "=&{v0}"() +// aix64: call <4 x i32> asm sideeffect "", "=&{v0}"() #[no_mangle] pub unsafe fn v0_clobber() { asm!("", out("v0") _, options(nostack, nomem, preserves_flags)); } +// Output format depends on the availability of altivec. // CHECK-LABEL: @clobber_abi -// CHECK: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"() +// powerpc: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"() +// powerpc64: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"() +// powerpc64le: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"() +// aix64: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"() #[no_mangle] pub unsafe fn clobber_abi() { asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags)); diff --git a/tests/codegen/asm/riscv-clobbers.rs b/tests/codegen/asm/riscv-clobbers.rs new file mode 100644 index 00000000000..59b2705a449 --- /dev/null +++ b/tests/codegen/asm/riscv-clobbers.rs @@ -0,0 +1,44 @@ +//@ assembly-output: emit-asm +//@ revisions: rv32i rv64i rv32e +//@[rv32i] compile-flags: --target riscv32i-unknown-none-elf +//@[rv32i] needs-llvm-components: riscv +//@[rv64i] compile-flags: --target riscv64imac-unknown-none-elf +//@[rv64i] needs-llvm-components: riscv +//@[rv32e] compile-flags: --target riscv32e-unknown-none-elf +//@[rv32e] needs-llvm-components: riscv +// ignore-tidy-linelength + +#![crate_type = "rlib"] +#![feature(no_core, rustc_attrs, lang_items)] +#![no_core] + +#[lang = "sized"] +trait Sized {} + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +// CHECK-LABEL: @flags_clobber +// CHECK: call void asm sideeffect "", "~{vtype},~{vl},~{vxsat},~{vxrm}"() +#[no_mangle] +pub unsafe fn flags_clobber() { + asm!("", options(nostack, nomem)); +} + +// CHECK-LABEL: @no_clobber +// CHECK: call void asm sideeffect "", ""() +#[no_mangle] +pub unsafe fn no_clobber() { + asm!("", options(nostack, nomem, preserves_flags)); +} + +// CHECK-LABEL: @clobber_abi +// rv32i: asm sideeffect "", "={x1},={x5},={x6},={x7},={x10},={x11},={x12},={x13},={x14},={x15},={x16},={x17},={x28},={x29},={x30},={x31},~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f28},~{f29},~{f30},~{f31},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() +// rv64i: asm sideeffect "", "={x1},={x5},={x6},={x7},={x10},={x11},={x12},={x13},={x14},={x15},={x16},={x17},={x28},={x29},={x30},={x31},~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f28},~{f29},~{f30},~{f31},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() +// rv32e: asm sideeffect "", "={x1},={x5},={x6},={x7},={x10},={x11},={x12},={x13},={x14},={x15},~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f10},~{f11},~{f12},~{f13},~{f14},~{f15},~{f16},~{f17},~{f28},~{f29},~{f30},~{f31},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() +#[no_mangle] +pub unsafe fn clobber_abi() { + asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags)); +} diff --git a/tests/codegen/async-closure-debug.rs b/tests/codegen/async-closure-debug.rs index 9cb1e623295..644df169a36 100644 --- a/tests/codegen/async-closure-debug.rs +++ b/tests/codegen/async-closure-debug.rs @@ -9,7 +9,7 @@ #![feature(async_closure)] -fn async_closure_test(upvar: &str) -> impl async Fn() + '_ { +fn async_closure_test(upvar: &str) -> impl AsyncFn() + '_ { async move || { let hello = String::from("hello"); println!("{hello}, {upvar}"); diff --git a/tests/codegen/avr/avr-func-addrspace.rs b/tests/codegen/avr/avr-func-addrspace.rs index a2dcb1c0924..7a36490fe93 100644 --- a/tests/codegen/avr/avr-func-addrspace.rs +++ b/tests/codegen/avr/avr-func-addrspace.rs @@ -86,7 +86,7 @@ pub extern "C" fn test() { // A call through the Fn trait must use address space 1. // - // CHECK: call{{.+}}addrspace(1) void @call_through_fn_trait() + // CHECK: call{{.+}}addrspace(1) void @call_through_fn_trait({{.*}}) call_through_fn_trait(&mut update_bar_value); // A call through a global variable must use address space 1. diff --git a/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs index 159ecfd0974..c0691b23275 100644 --- a/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs +++ b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs index c3858044c0c..0f6e99f9b1e 100644 --- a/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs +++ b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs @@ -3,7 +3,7 @@ // MSVC is different because of the individual allocas. //@ ignore-msvc -//@ aux-build:macro_def.rs +//@ proc-macro: macro_def.rs // Find the variable. // CHECK-DAG: ![[#var_dbg:]] = !DILocalVariable(name: "n",{{( arg: 1,)?}} scope: ![[#var_scope:]] diff --git a/tests/codegen/issues/issue-13018.rs b/tests/codegen/issues/issue-13018.rs index 66282dc4274..a29452436d2 100644 --- a/tests/codegen/issues/issue-13018.rs +++ b/tests/codegen/issues/issue-13018.rs @@ -2,7 +2,10 @@ // A drop([...].clone()) sequence on an Rc should be a no-op // In particular, no call to __rust_dealloc should be emitted -#![crate_type = "lib"] +// +// We use a cdylib since it's a leaf unit for Rust purposes, so doesn't codegen -Zshare-generics +// code. +#![crate_type = "cdylib"] use std::rc::Rc; pub fn foo(t: &Rc<Vec<usize>>) { diff --git a/tests/codegen/issues/issue-98678-async.rs b/tests/codegen/issues/issue-98678-async.rs new file mode 100644 index 00000000000..75f5d82eee5 --- /dev/null +++ b/tests/codegen/issues/issue-98678-async.rs @@ -0,0 +1,25 @@ +// This test verifies the accuracy of emitted file and line debuginfo metadata for async blocks and +// async functions. +// +//@ edition:2021 +//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true + +// ignore-tidy-linelength + +// NONMSVC-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-async.rs{{".*}}) +// MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-async.rs{{".*}}) + +// NONMSVC-DAG: !DISubprogram(name: "foo",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], +// MSVC-DAG: !DISubprogram(name: "foo",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], +pub async fn foo() -> u8 { + 5 +} + +pub fn bar() -> impl std::future::Future<Output = u8> { + // NONMSVC: !DICompositeType({{.*"}}{async_block_env#0}{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + // MSVC-DAG: !DICompositeType({{.*"}}enum2$<issue_98678_async::bar::async_block_env$0>{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + async { + let x: u8 = foo().await; + x + 5 + } +} diff --git a/tests/codegen/issues/issue-98678-closure-coroutine.rs b/tests/codegen/issues/issue-98678-closure-coroutine.rs new file mode 100644 index 00000000000..0730e56bf31 --- /dev/null +++ b/tests/codegen/issues/issue-98678-closure-coroutine.rs @@ -0,0 +1,22 @@ +// This test verifies the accuracy of emitted file and line debuginfo metadata for closures and +// coroutines. +// +//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true +#![feature(coroutines, stmt_expr_attributes)] + +// ignore-tidy-linelength + +// NONMSVC-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-closure-coroutine.rs{{".*}}) +// MSVC-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-closure-coroutine.rs{{".*}}) + +pub fn foo() { + // NONMSVC-DAG: !DICompositeType({{.*"}}{closure_env#0}{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + // MSVC-DAG: !DICompositeType({{.*"}}closure_env$0{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + let closure = |x| x; + closure(0); + + // NONMSVC-DAG: !DICompositeType({{.*"[{]}}coroutine_env#1{{[}]".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 3]], + // MSVC-DAG: !DICompositeType({{.*".*foo::}}coroutine_env$1>{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + let _coroutine = #[coroutine] + || yield 1; +} diff --git a/tests/codegen/issues/issue-98678-enum.rs b/tests/codegen/issues/issue-98678-enum.rs new file mode 100644 index 00000000000..62c6cded866 --- /dev/null +++ b/tests/codegen/issues/issue-98678-enum.rs @@ -0,0 +1,40 @@ +// This test verifies the accuracy of emitted file and line debuginfo metadata enums. +// +//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true + +// ignore-tidy-linelength + +// NONMSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-enum.rs{{".*}}) +// MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-enum.rs{{".*}}) + +// NONMSVC: !DICompositeType({{.*"}}SingleCase{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], +// MSVC: !DICompositeType({{.*"}}enum2$<issue_98678_enum::SingleCase>{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], +pub enum SingleCase { + // NONMSVC: !DIDerivedType(tag: DW_TAG_member, name: "One",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "One",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + One, +} + +// NONMSVC: !DICompositeType({{.*"}}MultipleDataCases{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], +// MSVC: !DICompositeType({{.*"}}enum2$<issue_98678_enum::MultipleDataCases>{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], +pub enum MultipleDataCases { + // NONMSVC: !DIDerivedType(tag: DW_TAG_member, name: "Case1",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Case1",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + Case1(u32), + // NONMSVC: !DIDerivedType(tag: DW_TAG_member, name: "Case2",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Case2",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + Case2(i64), +} + +// NONMSVC: !DICompositeType({{.*"}}NicheLayout{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], +// MSVC: !DICompositeType({{.*"}}enum2$<issue_98678_enum::NicheLayout>{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], +pub enum NicheLayout { + // NONMSVC: !DIDerivedType(tag: DW_TAG_member, name: "Something",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Something",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + Something(&'static u32), + // NONMSVC: !DIDerivedType(tag: DW_TAG_member, name: "Nothing",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]], + // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Nothing",{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + Nothing, +} + +pub fn foo(_: SingleCase, _: MultipleDataCases, _: NicheLayout) {} diff --git a/tests/codegen/issues/issue-98678-struct-union.rs b/tests/codegen/issues/issue-98678-struct-union.rs new file mode 100644 index 00000000000..bf2d6e731aa --- /dev/null +++ b/tests/codegen/issues/issue-98678-struct-union.rs @@ -0,0 +1,25 @@ +// This test verifies the accuracy of emitted file and line debuginfo metadata for structs and +// unions. +// +//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true + +// ignore-tidy-linelength + +// NONMSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-struct-union.rs{{".*}}) +// MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-struct-union.rs{{".*}}) + +// CHECK: !DICompositeType({{.*"}}MyType{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], +pub struct MyType { + // CHECK: !DIDerivedType({{.*"}}i{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + i: i32, +} + +// CHECK: !DICompositeType({{.*"}}MyUnion{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], +pub union MyUnion { + // CHECK: !DIDerivedType({{.*"}}i{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + i: i32, + // CHECK: !DIDerivedType({{.*"}}f{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]], + f: f32, +} + +pub fn foo(_: MyType, _: MyUnion) {} diff --git a/tests/codegen/sanitizer/no-sanitize.rs b/tests/codegen/sanitizer/no-sanitize.rs index 47d3fd83f11..2a309f6b9c6 100644 --- a/tests/codegen/sanitizer/no-sanitize.rs +++ b/tests/codegen/sanitizer/no-sanitize.rs @@ -7,6 +7,16 @@ #![crate_type = "lib"] #![feature(no_sanitize)] +// CHECK: @UNSANITIZED = constant{{.*}} no_sanitize_address +// CHECK-NOT: @__asan_global_UNSANITIZED +#[no_mangle] +#[no_sanitize(address)] +pub static UNSANITIZED: u32 = 0; + +// CHECK: @__asan_global_SANITIZED +#[no_mangle] +pub static SANITIZED: u32 = 0; + // CHECK-LABEL: ; no_sanitize::unsanitized // CHECK-NEXT: ; Function Attrs: // CHECK-NOT: sanitize_address diff --git a/tests/coverage/async_closure.cov-map b/tests/coverage/async_closure.cov-map index 4d00f0d9b33..9ff29af8e8e 100644 --- a/tests/coverage/async_closure.cov-map +++ b/tests/coverage/async_closure.cov-map @@ -1,19 +1,19 @@ Function name: async_closure::call_once::<async_closure::main::{closure#0}> -Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 01, 00, 2c] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 01, 00, 2b] Number of files: 1 - file 0 => global file 1 Number of expressions: 0 Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 44) +- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 43) Highest counter ID seen: c0 Function name: async_closure::call_once::<async_closure::main::{closure#0}>::{closure#0} -Raw bytes (14): 0x[01, 01, 00, 02, 01, 07, 2c, 01, 0e, 05, 02, 01, 00, 02] +Raw bytes (14): 0x[01, 01, 00, 02, 01, 07, 2b, 01, 0e, 05, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Counter(0)) at (prev + 7, 44) to (start + 1, 14) +- Code(Counter(0)) at (prev + 7, 43) to (start + 1, 14) - Code(Counter(1)) at (prev + 2, 1) to (start + 0, 2) Highest counter ID seen: c1 diff --git a/tests/coverage/async_closure.coverage b/tests/coverage/async_closure.coverage index fd6edf7c29e..75da1a01fc1 100644 --- a/tests/coverage/async_closure.coverage +++ b/tests/coverage/async_closure.coverage @@ -4,7 +4,7 @@ LL| |//@ aux-build: executor.rs LL| |extern crate executor; LL| | - LL| 1|async fn call_once(f: impl async FnOnce()) { + LL| 1|async fn call_once(f: impl AsyncFnOnce()) { LL| 1| f().await; LL| 1|} LL| | diff --git a/tests/coverage/async_closure.rs b/tests/coverage/async_closure.rs index c076d03eef4..cbac592d957 100644 --- a/tests/coverage/async_closure.rs +++ b/tests/coverage/async_closure.rs @@ -4,7 +4,7 @@ //@ aux-build: executor.rs extern crate executor; -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/coverage/closure.cov-map b/tests/coverage/closure.cov-map index adf4aba0c23..fa20c8cf6d7 100644 --- a/tests/coverage/closure.cov-map +++ b/tests/coverage/closure.cov-map @@ -140,17 +140,19 @@ Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) Highest counter ID seen: c1 -Function name: closure::main::{closure#18} (unused) -Raw bytes (24): 0x[01, 01, 00, 04, 00, 19, 0d, 02, 1c, 00, 02, 1d, 02, 12, 00, 02, 11, 00, 12, 00, 01, 11, 01, 0e] +Function name: closure::main::{closure#18} +Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 19, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e] Number of files: 1 - file 0 => global file 1 -Number of expressions: 0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 4 -- Code(Zero) at (prev + 25, 13) to (start + 2, 28) -- Code(Zero) at (prev + 2, 29) to (start + 2, 18) -- Code(Zero) at (prev + 2, 17) to (start + 0, 18) -- Code(Zero) at (prev + 1, 17) to (start + 1, 14) -Highest counter ID seen: (none) +- Code(Counter(0)) at (prev + 25, 13) to (start + 2, 28) +- Code(Counter(1)) at (prev + 2, 29) to (start + 2, 18) +- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 18) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 17) to (start + 1, 14) +Highest counter ID seen: c1 Function name: closure::main::{closure#19} Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 43, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e] diff --git a/tests/coverage/inline-dead.cov-map b/tests/coverage/inline-dead.cov-map index 411f16725bb..5a20de3d4d4 100644 --- a/tests/coverage/inline-dead.cov-map +++ b/tests/coverage/inline-dead.cov-map @@ -8,18 +8,18 @@ Number of file 0 mappings: 1 Highest counter ID seen: (none) Function name: inline_dead::live::<false> -Raw bytes (26): 0x[01, 01, 01, 01, 00, 04, 01, 0e, 01, 01, 09, 00, 02, 09, 00, 0f, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02] +Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 0e, 01, 01, 09, 05, 02, 09, 00, 0f, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Zero +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 14, 1) to (start + 1, 9) -- Code(Zero) at (prev + 2, 9) to (start + 0, 15) +- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 15) - Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (c0 - Zero) + = (c0 - c1) - Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c0 +Highest counter ID seen: c1 Function name: inline_dead::main Raw bytes (14): 0x[01, 01, 00, 02, 01, 04, 01, 03, 0a, 01, 06, 05, 01, 02] diff --git a/tests/coverage/issue-84561.cov-map b/tests/coverage/issue-84561.cov-map index a8ad17574ba..64870c434b3 100644 --- a/tests/coverage/issue-84561.cov-map +++ b/tests/coverage/issue-84561.cov-map @@ -59,59 +59,69 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: issue_84561::test3 -Raw bytes (375): 0x[01, 01, 31, 05, 09, 0d, 00, 15, 19, 12, 00, 15, 19, 21, 00, 1e, 00, 21, 00, 31, 00, 3d, 00, 2e, 45, 3d, 00, 42, 49, 45, 00, 3f, 51, 42, 49, 45, 00, 7a, 55, 51, 00, 7a, 55, 51, 00, 77, 5d, 7a, 55, 51, 00, 77, 61, 7a, 55, 51, 00, 72, 65, 77, 61, 7a, 55, 51, 00, 75, be, 01, c2, 01, 79, 69, 6d, 69, 6d, 69, 6d, c2, 01, 00, 69, 6d, c2, 01, 79, 69, 6d, bb, 01, 7d, 75, be, 01, c2, 01, 79, 69, 6d, b6, 01, 00, bb, 01, 7d, 75, be, 01, c2, 01, 79, 69, 6d, 33, 01, 08, 01, 03, 1c, 05, 04, 09, 01, 1c, 02, 02, 05, 04, 1f, 0d, 05, 05, 00, 1f, 06, 01, 05, 00, 1f, 15, 01, 09, 01, 1c, 12, 02, 05, 00, 1f, 0e, 01, 05, 00, 0f, 00, 00, 20, 00, 30, 21, 01, 05, 03, 0f, 00, 03, 20, 00, 30, 00, 00, 33, 00, 41, 00, 00, 4b, 00, 5a, 1e, 01, 05, 00, 0f, 00, 05, 09, 03, 10, 00, 05, 0d, 00, 1b, 00, 02, 0d, 00, 1c, 1a, 04, 09, 05, 06, 31, 06, 05, 03, 06, 22, 04, 05, 03, 06, 3d, 04, 09, 04, 06, 2e, 05, 08, 00, 0f, 45, 01, 09, 03, 0a, 2a, 05, 09, 03, 0a, 3f, 05, 08, 00, 0f, 51, 01, 09, 00, 13, 00, 03, 0d, 00, 1d, 3a, 03, 09, 00, 13, 00, 03, 0d, 00, 1d, 77, 03, 05, 00, 0f, 77, 01, 0c, 00, 13, 5d, 01, 0d, 00, 13, 56, 02, 0d, 00, 13, 72, 04, 05, 02, 13, 65, 03, 0d, 00, 13, 6e, 02, 0d, 00, 13, bb, 01, 03, 05, 00, 0f, 69, 01, 0c, 00, 13, 6d, 01, 0d, 03, 0e, 75, 04, 0d, 00, 13, c2, 01, 02, 0d, 00, 17, c2, 01, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, 92, 01, 02, 15, 00, 1b, be, 01, 04, 0d, 00, 13, 7d, 03, 09, 00, 19, b6, 01, 02, 05, 00, 0f, b2, 01, 03, 09, 00, 22, 00, 02, 05, 00, 0f, 00, 03, 09, 00, 2c, 00, 02, 01, 00, 02] +Raw bytes (414): 0x[01, 01, 3b, 05, 09, 0d, 11, 15, 19, 1e, 1d, 15, 19, 1a, 21, 1e, 1d, 15, 19, 25, 2d, 21, 25, 29, 35, 32, 29, 21, 25, 31, 39, 3d, 41, 42, 45, 3d, 41, 66, 49, 45, 4d, 63, 51, 66, 49, 45, 4d, 5e, 55, 63, 51, 66, 49, 45, 4d, 9e, 01, 55, 51, 59, 9e, 01, 55, 51, 59, 9b, 01, 5d, 9e, 01, 55, 51, 59, 9b, 01, 61, 9e, 01, 55, 51, 59, 96, 01, 65, 9b, 01, 61, 9e, 01, 55, 51, 59, 75, e2, 01, e6, 01, 79, 69, 6d, 69, 6d, 69, 6d, e6, 01, 00, 69, 6d, e6, 01, 79, 69, 6d, df, 01, 7d, 75, e2, 01, e6, 01, 79, 69, 6d, da, 01, 81, 01, df, 01, 7d, 75, e2, 01, e6, 01, 79, 69, 6d, 81, 01, 85, 01, 33, 01, 08, 01, 03, 1c, 05, 04, 09, 01, 1c, 02, 02, 05, 04, 1f, 0d, 05, 05, 00, 1f, 06, 01, 05, 00, 1f, 15, 01, 09, 01, 1c, 1e, 02, 05, 00, 1f, 1a, 01, 05, 00, 0f, 16, 00, 20, 00, 30, 21, 01, 05, 03, 0f, 25, 03, 20, 00, 30, 2d, 00, 33, 00, 41, 22, 00, 4b, 00, 5a, 32, 01, 05, 00, 0f, 29, 05, 09, 03, 10, 35, 05, 0d, 00, 1b, 2a, 02, 0d, 00, 1c, 2e, 04, 09, 05, 06, 31, 06, 05, 03, 06, 36, 04, 05, 03, 06, 3d, 04, 09, 04, 06, 42, 05, 08, 00, 0f, 45, 01, 09, 03, 0a, 3e, 05, 09, 03, 0a, 63, 05, 08, 00, 0f, 51, 01, 09, 00, 13, 59, 03, 0d, 00, 1d, 5e, 03, 09, 00, 13, 5a, 03, 0d, 00, 1d, 9b, 01, 03, 05, 00, 0f, 9b, 01, 01, 0c, 00, 13, 5d, 01, 0d, 00, 13, 7a, 02, 0d, 00, 13, 96, 01, 04, 05, 02, 13, 65, 03, 0d, 00, 13, 92, 01, 02, 0d, 00, 13, df, 01, 03, 05, 00, 0f, 69, 01, 0c, 00, 13, 6d, 01, 0d, 03, 0e, 75, 04, 0d, 00, 13, e6, 01, 02, 0d, 00, 17, e6, 01, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, b6, 01, 02, 15, 00, 1b, e2, 01, 04, 0d, 00, 13, 7d, 03, 09, 00, 19, da, 01, 02, 05, 00, 0f, d6, 01, 03, 09, 00, 22, 81, 01, 02, 05, 00, 0f, ea, 01, 03, 09, 00, 2c, 85, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => global file 1 -Number of expressions: 49 +Number of expressions: 59 - expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(3), rhs = Zero +- expression 1 operands: lhs = Counter(3), rhs = Counter(4) - expression 2 operands: lhs = Counter(5), rhs = Counter(6) -- expression 3 operands: lhs = Expression(4, Sub), rhs = Zero +- expression 3 operands: lhs = Expression(7, Sub), rhs = Counter(7) - expression 4 operands: lhs = Counter(5), rhs = Counter(6) -- expression 5 operands: lhs = Counter(8), rhs = Zero -- expression 6 operands: lhs = Expression(7, Sub), rhs = Zero -- expression 7 operands: lhs = Counter(8), rhs = Zero -- expression 8 operands: lhs = Counter(12), rhs = Zero -- expression 9 operands: lhs = Counter(15), rhs = Zero -- expression 10 operands: lhs = Expression(11, Sub), rhs = Counter(17) -- expression 11 operands: lhs = Counter(15), rhs = Zero -- expression 12 operands: lhs = Expression(16, Sub), rhs = Counter(18) -- expression 13 operands: lhs = Counter(17), rhs = Zero -- expression 14 operands: lhs = Expression(15, Add), rhs = Counter(20) -- expression 15 operands: lhs = Expression(16, Sub), rhs = Counter(18) -- expression 16 operands: lhs = Counter(17), rhs = Zero -- expression 17 operands: lhs = Expression(30, Sub), rhs = Counter(21) -- expression 18 operands: lhs = Counter(20), rhs = Zero -- expression 19 operands: lhs = Expression(30, Sub), rhs = Counter(21) -- expression 20 operands: lhs = Counter(20), rhs = Zero -- expression 21 operands: lhs = Expression(29, Add), rhs = Counter(23) -- expression 22 operands: lhs = Expression(30, Sub), rhs = Counter(21) -- expression 23 operands: lhs = Counter(20), rhs = Zero -- expression 24 operands: lhs = Expression(29, Add), rhs = Counter(24) -- expression 25 operands: lhs = Expression(30, Sub), rhs = Counter(21) -- expression 26 operands: lhs = Counter(20), rhs = Zero -- expression 27 operands: lhs = Expression(28, Sub), rhs = Counter(25) -- expression 28 operands: lhs = Expression(29, Add), rhs = Counter(24) -- expression 29 operands: lhs = Expression(30, Sub), rhs = Counter(21) -- expression 30 operands: lhs = Counter(20), rhs = Zero -- expression 31 operands: lhs = Counter(29), rhs = Expression(47, Sub) -- expression 32 operands: lhs = Expression(48, Sub), rhs = Counter(30) -- expression 33 operands: lhs = Counter(26), rhs = Counter(27) -- expression 34 operands: lhs = Counter(26), rhs = Counter(27) -- expression 35 operands: lhs = Counter(26), rhs = Counter(27) -- expression 36 operands: lhs = Expression(48, Sub), rhs = Zero -- expression 37 operands: lhs = Counter(26), rhs = Counter(27) -- expression 38 operands: lhs = Expression(48, Sub), rhs = Counter(30) -- expression 39 operands: lhs = Counter(26), rhs = Counter(27) -- expression 40 operands: lhs = Expression(46, Add), rhs = Counter(31) -- expression 41 operands: lhs = Counter(29), rhs = Expression(47, Sub) -- expression 42 operands: lhs = Expression(48, Sub), rhs = Counter(30) +- expression 5 operands: lhs = Expression(6, Sub), rhs = Counter(8) +- expression 6 operands: lhs = Expression(7, Sub), rhs = Counter(7) +- expression 7 operands: lhs = Counter(5), rhs = Counter(6) +- expression 8 operands: lhs = Counter(9), rhs = Counter(11) +- expression 9 operands: lhs = Counter(8), rhs = Counter(9) +- expression 10 operands: lhs = Counter(10), rhs = Counter(13) +- expression 11 operands: lhs = Expression(12, Sub), rhs = Counter(10) +- expression 12 operands: lhs = Counter(8), rhs = Counter(9) +- expression 13 operands: lhs = Counter(12), rhs = Counter(14) +- expression 14 operands: lhs = Counter(15), rhs = Counter(16) +- expression 15 operands: lhs = Expression(16, Sub), rhs = Counter(17) +- expression 16 operands: lhs = Counter(15), rhs = Counter(16) +- expression 17 operands: lhs = Expression(25, Sub), rhs = Counter(18) +- expression 18 operands: lhs = Counter(17), rhs = Counter(19) +- expression 19 operands: lhs = Expression(24, Add), rhs = Counter(20) +- expression 20 operands: lhs = Expression(25, Sub), rhs = Counter(18) +- expression 21 operands: lhs = Counter(17), rhs = Counter(19) +- expression 22 operands: lhs = Expression(23, Sub), rhs = Counter(21) +- expression 23 operands: lhs = Expression(24, Add), rhs = Counter(20) +- expression 24 operands: lhs = Expression(25, Sub), rhs = Counter(18) +- expression 25 operands: lhs = Counter(17), rhs = Counter(19) +- expression 26 operands: lhs = Expression(39, Sub), rhs = Counter(21) +- expression 27 operands: lhs = Counter(20), rhs = Counter(22) +- expression 28 operands: lhs = Expression(39, Sub), rhs = Counter(21) +- expression 29 operands: lhs = Counter(20), rhs = Counter(22) +- expression 30 operands: lhs = Expression(38, Add), rhs = Counter(23) +- expression 31 operands: lhs = Expression(39, Sub), rhs = Counter(21) +- expression 32 operands: lhs = Counter(20), rhs = Counter(22) +- expression 33 operands: lhs = Expression(38, Add), rhs = Counter(24) +- expression 34 operands: lhs = Expression(39, Sub), rhs = Counter(21) +- expression 35 operands: lhs = Counter(20), rhs = Counter(22) +- expression 36 operands: lhs = Expression(37, Sub), rhs = Counter(25) +- expression 37 operands: lhs = Expression(38, Add), rhs = Counter(24) +- expression 38 operands: lhs = Expression(39, Sub), rhs = Counter(21) +- expression 39 operands: lhs = Counter(20), rhs = Counter(22) +- expression 40 operands: lhs = Counter(29), rhs = Expression(56, Sub) +- expression 41 operands: lhs = Expression(57, Sub), rhs = Counter(30) +- expression 42 operands: lhs = Counter(26), rhs = Counter(27) - expression 43 operands: lhs = Counter(26), rhs = Counter(27) -- expression 44 operands: lhs = Expression(45, Sub), rhs = Zero -- expression 45 operands: lhs = Expression(46, Add), rhs = Counter(31) -- expression 46 operands: lhs = Counter(29), rhs = Expression(47, Sub) -- expression 47 operands: lhs = Expression(48, Sub), rhs = Counter(30) +- expression 44 operands: lhs = Counter(26), rhs = Counter(27) +- expression 45 operands: lhs = Expression(57, Sub), rhs = Zero +- expression 46 operands: lhs = Counter(26), rhs = Counter(27) +- expression 47 operands: lhs = Expression(57, Sub), rhs = Counter(30) - expression 48 operands: lhs = Counter(26), rhs = Counter(27) +- expression 49 operands: lhs = Expression(55, Add), rhs = Counter(31) +- expression 50 operands: lhs = Counter(29), rhs = Expression(56, Sub) +- expression 51 operands: lhs = Expression(57, Sub), rhs = Counter(30) +- expression 52 operands: lhs = Counter(26), rhs = Counter(27) +- expression 53 operands: lhs = Expression(54, Sub), rhs = Counter(32) +- expression 54 operands: lhs = Expression(55, Add), rhs = Counter(31) +- expression 55 operands: lhs = Counter(29), rhs = Expression(56, Sub) +- expression 56 operands: lhs = Expression(57, Sub), rhs = Counter(30) +- expression 57 operands: lhs = Counter(26), rhs = Counter(27) +- expression 58 operands: lhs = Counter(32), rhs = Counter(33) Number of file 0 mappings: 51 - Code(Counter(0)) at (prev + 8, 1) to (start + 3, 28) - Code(Counter(1)) at (prev + 4, 9) to (start + 1, 28) @@ -119,73 +129,78 @@ Number of file 0 mappings: 51 = (c1 - c2) - Code(Counter(3)) at (prev + 5, 5) to (start + 0, 31) - Code(Expression(1, Sub)) at (prev + 1, 5) to (start + 0, 31) - = (c3 - Zero) + = (c3 - c4) - Code(Counter(5)) at (prev + 1, 9) to (start + 1, 28) -- Code(Expression(4, Sub)) at (prev + 2, 5) to (start + 0, 31) +- Code(Expression(7, Sub)) at (prev + 2, 5) to (start + 0, 31) = (c5 - c6) -- Code(Expression(3, Sub)) at (prev + 1, 5) to (start + 0, 15) - = ((c5 - c6) - Zero) -- Code(Zero) at (prev + 0, 32) to (start + 0, 48) +- Code(Expression(6, Sub)) at (prev + 1, 5) to (start + 0, 15) + = ((c5 - c6) - c7) +- Code(Expression(5, Sub)) at (prev + 0, 32) to (start + 0, 48) + = (((c5 - c6) - c7) - c8) - Code(Counter(8)) at (prev + 1, 5) to (start + 3, 15) -- Code(Zero) at (prev + 3, 32) to (start + 0, 48) -- Code(Zero) at (prev + 0, 51) to (start + 0, 65) -- Code(Zero) at (prev + 0, 75) to (start + 0, 90) -- Code(Expression(7, Sub)) at (prev + 1, 5) to (start + 0, 15) - = (c8 - Zero) -- Code(Zero) at (prev + 5, 9) to (start + 3, 16) -- Code(Zero) at (prev + 5, 13) to (start + 0, 27) -- Code(Zero) at (prev + 2, 13) to (start + 0, 28) -- Code(Expression(6, Sub)) at (prev + 4, 9) to (start + 5, 6) - = ((c8 - Zero) - Zero) +- Code(Counter(9)) at (prev + 3, 32) to (start + 0, 48) +- Code(Counter(11)) at (prev + 0, 51) to (start + 0, 65) +- Code(Expression(8, Sub)) at (prev + 0, 75) to (start + 0, 90) + = (c9 - c11) +- Code(Expression(12, Sub)) at (prev + 1, 5) to (start + 0, 15) + = (c8 - c9) +- Code(Counter(10)) at (prev + 5, 9) to (start + 3, 16) +- Code(Counter(13)) at (prev + 5, 13) to (start + 0, 27) +- Code(Expression(10, Sub)) at (prev + 2, 13) to (start + 0, 28) + = (c10 - c13) +- Code(Expression(11, Sub)) at (prev + 4, 9) to (start + 5, 6) + = ((c8 - c9) - c10) - Code(Counter(12)) at (prev + 6, 5) to (start + 3, 6) -- Code(Expression(8, Sub)) at (prev + 4, 5) to (start + 3, 6) - = (c12 - Zero) +- Code(Expression(13, Sub)) at (prev + 4, 5) to (start + 3, 6) + = (c12 - c14) - Code(Counter(15)) at (prev + 4, 9) to (start + 4, 6) -- Code(Expression(11, Sub)) at (prev + 5, 8) to (start + 0, 15) - = (c15 - Zero) +- Code(Expression(16, Sub)) at (prev + 5, 8) to (start + 0, 15) + = (c15 - c16) - Code(Counter(17)) at (prev + 1, 9) to (start + 3, 10) -- Code(Expression(10, Sub)) at (prev + 5, 9) to (start + 3, 10) - = ((c15 - Zero) - c17) -- Code(Expression(15, Add)) at (prev + 5, 8) to (start + 0, 15) - = ((c17 - Zero) + c18) +- Code(Expression(15, Sub)) at (prev + 5, 9) to (start + 3, 10) + = ((c15 - c16) - c17) +- Code(Expression(24, Add)) at (prev + 5, 8) to (start + 0, 15) + = ((c17 - c19) + c18) - Code(Counter(20)) at (prev + 1, 9) to (start + 0, 19) -- Code(Zero) at (prev + 3, 13) to (start + 0, 29) -- Code(Expression(14, Sub)) at (prev + 3, 9) to (start + 0, 19) - = (((c17 - Zero) + c18) - c20) -- Code(Zero) at (prev + 3, 13) to (start + 0, 29) -- Code(Expression(29, Add)) at (prev + 3, 5) to (start + 0, 15) - = ((c20 - Zero) + c21) -- Code(Expression(29, Add)) at (prev + 1, 12) to (start + 0, 19) - = ((c20 - Zero) + c21) +- Code(Counter(22)) at (prev + 3, 13) to (start + 0, 29) +- Code(Expression(23, Sub)) at (prev + 3, 9) to (start + 0, 19) + = (((c17 - c19) + c18) - c20) +- Code(Expression(22, Sub)) at (prev + 3, 13) to (start + 0, 29) + = ((((c17 - c19) + c18) - c20) - c21) +- Code(Expression(38, Add)) at (prev + 3, 5) to (start + 0, 15) + = ((c20 - c22) + c21) +- Code(Expression(38, Add)) at (prev + 1, 12) to (start + 0, 19) + = ((c20 - c22) + c21) - Code(Counter(23)) at (prev + 1, 13) to (start + 0, 19) -- Code(Expression(21, Sub)) at (prev + 2, 13) to (start + 0, 19) - = (((c20 - Zero) + c21) - c23) -- Code(Expression(28, Sub)) at (prev + 4, 5) to (start + 2, 19) - = (((c20 - Zero) + c21) - c24) +- Code(Expression(30, Sub)) at (prev + 2, 13) to (start + 0, 19) + = (((c20 - c22) + c21) - c23) +- Code(Expression(37, Sub)) at (prev + 4, 5) to (start + 2, 19) + = (((c20 - c22) + c21) - c24) - Code(Counter(25)) at (prev + 3, 13) to (start + 0, 19) -- Code(Expression(27, Sub)) at (prev + 2, 13) to (start + 0, 19) - = ((((c20 - Zero) + c21) - c24) - c25) -- Code(Expression(46, Add)) at (prev + 3, 5) to (start + 0, 15) +- Code(Expression(36, Sub)) at (prev + 2, 13) to (start + 0, 19) + = ((((c20 - c22) + c21) - c24) - c25) +- Code(Expression(55, Add)) at (prev + 3, 5) to (start + 0, 15) = (c29 + ((c26 - c27) - c30)) - Code(Counter(26)) at (prev + 1, 12) to (start + 0, 19) - Code(Counter(27)) at (prev + 1, 13) to (start + 3, 14) - Code(Counter(29)) at (prev + 4, 13) to (start + 0, 19) -- Code(Expression(48, Sub)) at (prev + 2, 13) to (start + 0, 23) +- Code(Expression(57, Sub)) at (prev + 2, 13) to (start + 0, 23) = (c26 - c27) -- Code(Expression(48, Sub)) at (prev + 1, 20) to (start + 0, 27) +- Code(Expression(57, Sub)) at (prev + 1, 20) to (start + 0, 27) = (c26 - c27) - Code(Zero) at (prev + 1, 21) to (start + 0, 27) -- Code(Expression(36, Sub)) at (prev + 2, 21) to (start + 0, 27) +- Code(Expression(45, Sub)) at (prev + 2, 21) to (start + 0, 27) = ((c26 - c27) - Zero) -- Code(Expression(47, Sub)) at (prev + 4, 13) to (start + 0, 19) +- Code(Expression(56, Sub)) at (prev + 4, 13) to (start + 0, 19) = ((c26 - c27) - c30) - Code(Counter(31)) at (prev + 3, 9) to (start + 0, 25) -- Code(Expression(45, Sub)) at (prev + 2, 5) to (start + 0, 15) +- Code(Expression(54, Sub)) at (prev + 2, 5) to (start + 0, 15) = ((c29 + ((c26 - c27) - c30)) - c31) -- Code(Expression(44, Sub)) at (prev + 3, 9) to (start + 0, 34) - = (((c29 + ((c26 - c27) - c30)) - c31) - Zero) -- Code(Zero) at (prev + 2, 5) to (start + 0, 15) -- Code(Zero) at (prev + 3, 9) to (start + 0, 44) -- Code(Zero) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c31 +- Code(Expression(53, Sub)) at (prev + 3, 9) to (start + 0, 34) + = (((c29 + ((c26 - c27) - c30)) - c31) - c32) +- Code(Counter(32)) at (prev + 2, 5) to (start + 0, 15) +- Code(Expression(58, Sub)) at (prev + 3, 9) to (start + 0, 44) + = (c32 - c33) +- Code(Counter(33)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c33 diff --git a/tests/coverage/let_else_loop.cov-map b/tests/coverage/let_else_loop.cov-map index 04451596eae..7789114c239 100644 --- a/tests/coverage/let_else_loop.cov-map +++ b/tests/coverage/let_else_loop.cov-map @@ -21,13 +21,13 @@ Number of file 0 mappings: 3 Highest counter ID seen: (none) Function name: let_else_loop::loopy -Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 01, 01, 14, 00, 01, 1c, 00, 23, 05, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 01, 01, 14, 09, 01, 1c, 00, 23, 05, 01, 01, 00, 02] Number of files: 1 - file 0 => global file 1 Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 9, 1) to (start + 1, 20) -- Code(Zero) at (prev + 1, 28) to (start + 0, 35) +- Code(Counter(2)) at (prev + 1, 28) to (start + 0, 35) - Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c1 +Highest counter ID seen: c2 diff --git a/tests/coverage/no-core.cov-map b/tests/coverage/no-core.cov-map new file mode 100644 index 00000000000..3a1ca4745c7 --- /dev/null +++ b/tests/coverage/no-core.cov-map @@ -0,0 +1,9 @@ +Function name: no_core::main +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 01, 00, 0d] +Number of files: 1 +- file 0 => global file 1 +Number of expressions: 0 +Number of file 0 mappings: 1 +- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 13) +Highest counter ID seen: c0 + diff --git a/tests/coverage/no-core.coverage b/tests/coverage/no-core.coverage new file mode 100644 index 00000000000..8b890609568 --- /dev/null +++ b/tests/coverage/no-core.coverage @@ -0,0 +1,13 @@ + LL| |#![feature(no_core)] + LL| |#![no_core] + LL| |//@ edition: 2021 + LL| | + LL| |// Test that coverage instrumentation works for `#![no_core]` crates. + LL| | + LL| |// For this test, we pull in std anyway, to avoid having to set up our own + LL| |// no-core or no-std environment. What's important is that the compiler allows + LL| |// coverage for a crate with the `#![no_core]` annotation. + LL| |extern crate std; + LL| | + LL| 1|fn main() {} + diff --git a/tests/coverage/no-core.rs b/tests/coverage/no-core.rs new file mode 100644 index 00000000000..206222902fc --- /dev/null +++ b/tests/coverage/no-core.rs @@ -0,0 +1,12 @@ +#![feature(no_core)] +#![no_core] +//@ edition: 2021 + +// Test that coverage instrumentation works for `#![no_core]` crates. + +// For this test, we pull in std anyway, to avoid having to set up our own +// no-core or no-std environment. What's important is that the compiler allows +// coverage for a crate with the `#![no_core]` annotation. +extern crate std; + +fn main() {} diff --git a/tests/crashes/109681.rs b/tests/crashes/109681.rs deleted file mode 100644 index 73ff1007094..00000000000 --- a/tests/crashes/109681.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #109681 - -#![crate_type="lib"] -#![feature(linkage)] - -#[linkage = "common"] -pub static TEST3: bool = true; - -fn main() {} diff --git a/tests/crashes/119701.rs b/tests/crashes/119701.rs deleted file mode 100644 index bdb326ea76b..00000000000 --- a/tests/crashes/119701.rs +++ /dev/null @@ -1,21 +0,0 @@ -//@ known-bug: #119701 -#![feature(const_trait_impl, generic_const_exprs)] - -fn main() { - let _ = process::<()>([()]); -} - -fn process<T: const Trait>() -> [(); T::make(2)] { - input -} - -#[const_trait] -trait Trait { - fn make(input: u8) -> usize; -} - -impl const Trait for () { - fn make(input: usize) -> usize { - input / 2 - } -} diff --git a/tests/crashes/121127.rs b/tests/crashes/121127.rs deleted file mode 100644 index e50dc7763fc..00000000000 --- a/tests/crashes/121127.rs +++ /dev/null @@ -1,23 +0,0 @@ -//@ known-bug: #121127 -//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes -C debuginfo=2 -// Note that as of PR#123949 this only crashes with debuginfo enabled - -#![feature(specialization)] - -pub trait Foo { - fn abc() -> u32; -} - -pub trait Marker {} - -impl<T> Foo for T { - default fn abc(f: fn(&T), t: &T) -> u32 { - 16 - } -} - -impl<T: Marker> Foo for T { - fn def() -> u32 { - Self::abc() - } -} diff --git a/tests/crashes/121411.rs b/tests/crashes/121411.rs deleted file mode 100644 index 2456910e6fa..00000000000 --- a/tests/crashes/121411.rs +++ /dev/null @@ -1,13 +0,0 @@ -//@ known-bug: #121411 -#![feature(const_trait_impl)] - -#[const_trait] -trait Foo { - fn into_iter(&self) {} -} - -impl const Foo for () { - fn into_iter(a: u32, b: u32) {} -} - -const _: () = Foo::into_iter(&()); diff --git a/tests/crashes/121429.rs b/tests/crashes/121429.rs index 09bd343e0ba..e407754db5c 100644 --- a/tests/crashes/121429.rs +++ b/tests/crashes/121429.rs @@ -1,14 +1,11 @@ //@ known-bug: #121429 -#![feature(generic_const_exprs)] - -pub trait True {} -impl<const N: usize = { const { 3 } }> PartialEq<FixedI8<FRAC_RHS>> for FixedI8<FRAC_LHS> where - If<{}>: True -{ -} #![feature(generic_const_exprs)] +struct FixedI8<const X: usize>; +const FRAC_LHS: usize = 0; +const FRAC_RHS: usize = 1; + pub trait True {} impl<const N: usize = { const { 3 } }> PartialEq<FixedI8<FRAC_RHS>> for FixedI8<FRAC_LHS> where diff --git a/tests/crashes/124020.rs b/tests/crashes/124020.rs index f461f32f59d..1b875497465 100644 --- a/tests/crashes/124020.rs +++ b/tests/crashes/124020.rs @@ -1,7 +1,7 @@ //@ known-bug: #124020 //@ compile-flags: -Zpolymorphize=on --edition=2018 --crate-type=lib -#![feature(async_closure, noop_waker, async_fn_traits)] +#![feature(async_closure, noop_waker, async_trait_bounds)] use std::future::Future; use std::pin::pin; @@ -19,7 +19,7 @@ pub fn block_on<T>(fut: impl Future<Output = T>) -> T { } } -async fn call_once(f: impl async FnOnce(DropMe)) { +async fn call_once(f: impl AsyncFnOnce(DropMe)) { f(DropMe("world")).await; } diff --git a/tests/crashes/124350.rs b/tests/crashes/124350.rs deleted file mode 100644 index d6038f280cf..00000000000 --- a/tests/crashes/124350.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ known-bug: #124350 - -struct Node<const D: usize> {} - -impl Node<D> -where - SmallVec<{ D * 2 }>:, -{ - fn new() -> Self { - let mut node = Node::new(); - (&a, 0)(); - - node - } -} - -struct SmallVec<T1, T2> {} diff --git a/tests/crashes/124751.rs b/tests/crashes/124751.rs index f15e39965d3..1372b97233d 100644 --- a/tests/crashes/124751.rs +++ b/tests/crashes/124751.rs @@ -1,5 +1,5 @@ //@ known-bug: rust-lang/rust#124751 -//@ compile-flags: -Zunstable-options --edition=2024 +//@ edition: 2024 #![feature(gen_blocks)] diff --git a/tests/crashes/125476.rs b/tests/crashes/125476.rs deleted file mode 100644 index ad739639b72..00000000000 --- a/tests/crashes/125476.rs +++ /dev/null @@ -1,4 +0,0 @@ -//@ known-bug: rust-lang/rust#125476 -//@ only-x86_64 -pub struct Data([u8; usize::MAX >> 2]); -const _: &'static [Data] = &[]; diff --git a/tests/crashes/125758.rs b/tests/crashes/125758.rs deleted file mode 100644 index 86c3b80abab..00000000000 --- a/tests/crashes/125758.rs +++ /dev/null @@ -1,26 +0,0 @@ -//@ known-bug: rust-lang/rust#125758 -#![feature(impl_trait_in_assoc_type)] - -trait Trait: Sized { - type Assoc2; -} - -impl Trait for Bar { - type Assoc2 = impl std::fmt::Debug; -} - -struct Foo { - field: <Bar as Trait>::Assoc2, -} - -enum Bar { - C = 42, - D = 99, -} - -static BAR: u8 = 42; - -static FOO2: (&Foo, &<Bar as Trait>::Assoc2) = - unsafe { (std::mem::transmute(&BAR), std::mem::transmute(&BAR)) }; - -fn main() {} diff --git a/tests/crashes/126267.rs b/tests/crashes/126267.rs deleted file mode 100644 index 728578179ed..00000000000 --- a/tests/crashes/126267.rs +++ /dev/null @@ -1,30 +0,0 @@ -//@ known-bug: rust-lang/rust#126267 - -#![feature(transmutability)] -#![crate_type = "lib"] - -pub enum ApiError {} -pub struct TokioError { - b: bool, -} -pub enum Error { - Api { source: ApiError }, - Ethereum, - Tokio { source: TokioError }, -} - -mod assert { - use std::mem::TransmuteFrom; - - pub fn is_transmutable<Src, Dst>() - where - Dst: TransmuteFrom<Src>, // safety is NOT assumed - { - } -} - -fn test() { - struct Src; - type Dst = Error; - assert::is_transmutable::<Src, Dst>(); -} diff --git a/tests/crashes/126359.rs b/tests/crashes/126359.rs deleted file mode 100644 index 4b28c466b55..00000000000 --- a/tests/crashes/126359.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: rust-lang/rust#126359 - -struct OppOrder<const N: u8 = 3, T = u32> { - arr: [T; N], -} - -fn main() { - let _ = OppOrder::<3, u32> { arr: [0, 0, 0] }; -} diff --git a/tests/crashes/126646.rs b/tests/crashes/126646.rs deleted file mode 100644 index 24e3530320a..00000000000 --- a/tests/crashes/126646.rs +++ /dev/null @@ -1,18 +0,0 @@ -//@ known-bug: rust-lang/rust#126646 -mod foo { - pub trait Callable { - type Output; - fn call() -> Self::Output; - } - - impl<'a, V: ?Sized> Callable for &'a () { - type Output = (); - } -} -use foo::*; - -fn test<'a>() -> impl Sized { - <&'a () as Callable>::call() -} - -fn main() {} diff --git a/tests/crashes/127351.rs b/tests/crashes/127351.rs deleted file mode 100644 index e3f41594885..00000000000 --- a/tests/crashes/127351.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ known-bug: #127351 -#![feature(lazy_type_alias)] -#![allow(incomplete_features)] - -struct Outer0<'a, T>(ExplicitTypeOutlives<'a, T>); -type ExplicitTypeOutlives<'a, T: 'a> = (&'a (), T); - -pub struct Warns { - _significant_drop: ExplicitTypeOutlives, - field: String, -} - -pub fn test(w: Warns) { - _ = || drop(w.field); -} - -fn main() {} diff --git a/tests/crashes/127353.rs b/tests/crashes/127353.rs deleted file mode 100644 index 9bcb90b5c57..00000000000 --- a/tests/crashes/127353.rs +++ /dev/null @@ -1,18 +0,0 @@ -//@ known-bug: #127353 -#![feature(type_alias_impl_trait)] -trait Trait<T> {} -type Alias<'a, U> = impl Trait<U>; - -fn f<'a>() -> Alias<'a, ()> {} - -pub enum UninhabitedVariants { - Tuple(Alias), -} - -struct A; - -fn cannot_empty_match_on_enum_with_empty_variants_struct_to_anything(x: UninhabitedVariants) -> A { - match x {} -} - -fn main() {} diff --git a/tests/crashes/127742.rs b/tests/crashes/127742.rs deleted file mode 100644 index 24add454135..00000000000 --- a/tests/crashes/127742.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ known-bug: #127742 -struct Vtable(dyn Cap); // missing lifetime - -trait Cap<'a> {} - -union Transmute { - t: u64, // ICEs with u64, u128, or usize. Correctly errors with u32. - u: &'static Vtable, -} - -const G: &'static Vtable = unsafe { Transmute { t: 1 }.u }; diff --git a/tests/crashes/129075.rs b/tests/crashes/129075.rs deleted file mode 100644 index 4a0e920914c..00000000000 --- a/tests/crashes/129075.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ known-bug: rust-lang/rust#129075 -//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes - -struct Foo<T>([T; 2]); - -impl<T: Default + Copy> Default for Foo<T> { - fn default(&mut self) -> Self { - Foo([Default::default(); 2]) - } -} - -fn field_array() { - let a: i32; - let b; - Foo([a, b]) = Default::default(); -} diff --git a/tests/crashes/129127.rs b/tests/crashes/129127.rs deleted file mode 100644 index 8ec848dbd05..00000000000 --- a/tests/crashes/129127.rs +++ /dev/null @@ -1,21 +0,0 @@ -//@ known-bug: rust-lang/rust#129127 -//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir -Zcross-crate-inline-threshold=always - - - - -pub struct Rows<'a>(); - -impl<'a> Iterator for Rows<'a> { - type Item = (); - - fn next() -> Option<Self::Item> { - let mut rows = Rows(); - rows.map(|row| row).next() - } -} - -fn main() { - let mut rows = Rows(); - rows.next(); -} diff --git a/tests/crashes/129214.rs b/tests/crashes/129214.rs deleted file mode 100644 index e14b9f379d6..00000000000 --- a/tests/crashes/129214.rs +++ /dev/null @@ -1,30 +0,0 @@ -//@ known-bug: rust-lang/rust#129214 -//@ compile-flags: -Zvalidate-mir -Copt-level=3 --crate-type=lib - -trait to_str {} - -trait map<T> { - fn map<U, F>(&self, f: F) -> Vec<U> - where - F: FnMut(&Box<usize>) -> U; -} -impl<T> map<T> for Vec<T> { - fn map<U, F>(&self, mut f: F) -> Vec<U> - where - F: FnMut(&T) -> U, - { - let mut r = Vec::new(); - for i in self { - r.push(f(i)); - } - r - } -} - -fn foo<U, T: map<U>>(x: T) -> Vec<String> { - x.map(|_e| "hi".to_string()) -} - -pub fn main() { - assert_eq!(foo(vec![1]), ["hi".to_string()]); -} diff --git a/tests/crashes/129444.rs b/tests/crashes/129444.rs deleted file mode 100644 index b1b547b5191..00000000000 --- a/tests/crashes/129444.rs +++ /dev/null @@ -1,15 +0,0 @@ -//@ known-bug: rust-lang/rust#129444 - -//@ compile-flags: -Znext-solver=coherence - -trait Trait { - type Assoc; -} - -struct W<T: Trait>(*mut T); -impl<T: ?Trait> Trait for W<W<W<T>>> {} - -trait NoOverlap {} -impl<T: Trait<W<T>>> NoOverlap for T {} - -impl<T: Trait<Assoc = u32>> NoOverlap for W<T> {} diff --git a/tests/crashes/130521.rs b/tests/crashes/130521.rs index 7c078ab5790..ebcfacf9623 100644 --- a/tests/crashes/130521.rs +++ b/tests/crashes/130521.rs @@ -1,12 +1,12 @@ //@ known-bug: #130521 #![feature(dyn_compatible_for_dispatch)] -struct Vtable(dyn Cap); +struct Vtable(dyn Cap<'static>); trait Cap<'a> {} union Transmute { - t: u64, + t: u128, u: &'static Vtable, } diff --git a/tests/crashes/131101.rs b/tests/crashes/131101.rs deleted file mode 100644 index 3ec441101b7..00000000000 --- a/tests/crashes/131101.rs +++ /dev/null @@ -1,12 +0,0 @@ -//@ known-bug: #131101 -trait Foo<const N: u8> { - fn do_x(&self) -> [u8; N]; -} - -struct Bar; - -impl Foo<const 3> for Bar { - fn do_x(&self) -> [u8; 3] { - [0u8; 3] - } -} diff --git a/tests/crashes/131294-2.rs b/tests/crashes/131294-2.rs deleted file mode 100644 index 130a8b10fb7..00000000000 --- a/tests/crashes/131294-2.rs +++ /dev/null @@ -1,25 +0,0 @@ -//@ known-bug: #131294 -//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir -Zcross-crate-inline-threshold=always - -// https://github.com/rust-lang/rust/issues/131294#issuecomment-2395088049 second comment -struct Rows; - -impl Iterator for Rows { - type Item = String; - - fn next() -> Option<String> { - let args = format_args!("Hello world"); - - { - match args.as_str() { - Some(t) => t.to_owned(), - None => String::new(), - } - } - .into() - } -} - -fn main() { - Rows.next(); -} diff --git a/tests/crashes/131294.rs b/tests/crashes/131294.rs deleted file mode 100644 index ec6c9567467..00000000000 --- a/tests/crashes/131294.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ known-bug: #131294 -//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir -Zcross-crate-inline-threshold=always - -struct Rows; - -impl Iterator for Rows { - type Item = String; - - fn next() -> Option<Self::Item> { - std::fmt::format(format_args!("Hello world")).into() - } -} - -fn main() { - Rows.next(); -} diff --git a/tests/crashes/131538.rs b/tests/crashes/131538.rs deleted file mode 100644 index f971d8b7791..00000000000 --- a/tests/crashes/131538.rs +++ /dev/null @@ -1,13 +0,0 @@ -//@ known-bug: #131538 -#![feature(generic_associated_types_extended)] -#![feature(trivial_bounds)] - -trait HealthCheck { - async fn check<const N: usize>(); -} - -fn do_health_check_par() -where - HealthCheck: HealthCheck, -{ -} diff --git a/tests/crashes/131668.rs b/tests/crashes/131668.rs deleted file mode 100644 index 90aa4494425..00000000000 --- a/tests/crashes/131668.rs +++ /dev/null @@ -1,12 +0,0 @@ -//@ known-bug: #131668 - -#![feature(generic_associated_types_extended)] -trait B { - type Y<const N: i16>; -} - -struct Erase<T: B>(T); - -fn make_static() { - Erase::<dyn for<'c> B<&'c ()>>(()); -} diff --git a/tests/crashes/132320.rs b/tests/crashes/132320.rs deleted file mode 100644 index 79181c3a2c5..00000000000 --- a/tests/crashes/132320.rs +++ /dev/null @@ -1,15 +0,0 @@ -//@ known-bug: #132320 -//@ compile-flags: -Znext-solver=globally - -trait Foo { - type Item; - fn foo(&mut self); -} - -impl Foo for () { - type Item = Option<()>; - - fn foo(&mut self) { - let _ = Self::Item::None; - } -} diff --git a/tests/crashes/34127.rs b/tests/crashes/34127.rs index 88a2cf30ec5..ea36b48ecba 100644 --- a/tests/crashes/34127.rs +++ b/tests/crashes/34127.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -g -Copt-level=0 +//@ compile-flags: -g -Copt-level=0 -Z verify-llvm-ir //@ known-bug: #34127 //@ only-x86_64 diff --git a/tests/incremental/auxiliary/incremental_proc_macro_aux.rs b/tests/incremental/auxiliary/incremental_proc_macro_aux.rs index 505a9ee27a4..d0730eb00ee 100644 --- a/tests/incremental/auxiliary/incremental_proc_macro_aux.rs +++ b/tests/incremental/auxiliary/incremental_proc_macro_aux.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/incremental/auxiliary/issue-49482-macro-def.rs b/tests/incremental/auxiliary/issue-49482-macro-def.rs index 9218d6b62cb..6cd565c3a11 100644 --- a/tests/incremental/auxiliary/issue-49482-macro-def.rs +++ b/tests/incremental/auxiliary/issue-49482-macro-def.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type="proc-macro"] #![allow(non_snake_case)] extern crate proc_macro; diff --git a/tests/incremental/auxiliary/issue-49482-reexport.rs b/tests/incremental/auxiliary/issue-49482-reexport.rs index 39f19e3f15f..686766de54f 100644 --- a/tests/incremental/auxiliary/issue-49482-reexport.rs +++ b/tests/incremental/auxiliary/issue-49482-reexport.rs @@ -1,3 +1,4 @@ +//@ proc-macro: issue-49482-macro-def.rs #[macro_use] extern crate issue_49482_macro_def; diff --git a/tests/incremental/auxiliary/issue-54059.rs b/tests/incremental/auxiliary/issue-54059.rs index 5f45403735c..6bbc94149e8 100644 --- a/tests/incremental/auxiliary/issue-54059.rs +++ b/tests/incremental/auxiliary/issue-54059.rs @@ -1,9 +1,5 @@ -//@ force-host -//@ no-prefer-dynamic - // check that having extern "C" functions in a proc macro doesn't crash. -#![crate_type="proc-macro"] #![allow(non_snake_case)] extern crate proc_macro; diff --git a/tests/incremental/incremental_proc_macro.rs b/tests/incremental/incremental_proc_macro.rs index 97faf8e698a..3cf89cae652 100644 --- a/tests/incremental/incremental_proc_macro.rs +++ b/tests/incremental/incremental_proc_macro.rs @@ -1,4 +1,4 @@ -//@ aux-build:incremental_proc_macro_aux.rs +//@ proc-macro: incremental_proc_macro_aux.rs //@ revisions: cfail1 cfail2 //@ build-pass (FIXME(62277): could be check-pass?) diff --git a/tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs b/tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs index 3b4933811d3..877d74d731d 100644 --- a/tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs +++ b/tests/incremental/issue-110457-same-span-closures/auxiliary/egui_inspect_derive.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; diff --git a/tests/incremental/issue-110457-same-span-closures/main.rs b/tests/incremental/issue-110457-same-span-closures/main.rs index c36b7e3ca80..6a5e4b315ce 100644 --- a/tests/incremental/issue-110457-same-span-closures/main.rs +++ b/tests/incremental/issue-110457-same-span-closures/main.rs @@ -1,4 +1,4 @@ -//@ aux-build: egui_inspect_derive.rs +//@ proc-macro: egui_inspect_derive.rs //@ revisions: cpass1 cpass2 extern crate egui_inspect_derive; diff --git a/tests/incremental/issue-49482.rs b/tests/incremental/issue-49482.rs index 2dddde6c171..849f1c66600 100644 --- a/tests/incremental/issue-49482.rs +++ b/tests/incremental/issue-49482.rs @@ -1,4 +1,3 @@ -//@ aux-build:issue-49482-macro-def.rs //@ aux-build:issue-49482-reexport.rs //@ revisions: rpass1 diff --git a/tests/incremental/issue-54059.rs b/tests/incremental/issue-54059.rs index bfce4d487db..b6668b4be28 100644 --- a/tests/incremental/issue-54059.rs +++ b/tests/incremental/issue-54059.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-54059.rs +//@ proc-macro: issue-54059.rs //@ ignore-windows - dealing with weird symbols issues on dylibs isn't worth it //@ revisions: rpass1 diff --git a/tests/incremental/issue-85197-invalid-span/auxiliary/invalid-span-helper-lib.rs b/tests/incremental/issue-85197-invalid-span/auxiliary/invalid-span-helper-lib.rs index f84c4fe9895..704193cffd0 100644 --- a/tests/incremental/issue-85197-invalid-span/auxiliary/invalid-span-helper-lib.rs +++ b/tests/incremental/issue-85197-invalid-span/auxiliary/invalid-span-helper-lib.rs @@ -1,3 +1,4 @@ +//@ proc-macro: respan.rs //@ revisions: rpass1 rpass2 extern crate respan; diff --git a/tests/incremental/issue-85197-invalid-span/auxiliary/respan.rs b/tests/incremental/issue-85197-invalid-span/auxiliary/respan.rs index c56d9052e32..5bedca8a265 100644 --- a/tests/incremental/issue-85197-invalid-span/auxiliary/respan.rs +++ b/tests/incremental/issue-85197-invalid-span/auxiliary/respan.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/incremental/issue-85197-invalid-span/invalid_span_main.rs b/tests/incremental/issue-85197-invalid-span/invalid_span_main.rs index eaad44780c7..6db5107cbe4 100644 --- a/tests/incremental/issue-85197-invalid-span/invalid_span_main.rs +++ b/tests/incremental/issue-85197-invalid-span/invalid_span_main.rs @@ -1,5 +1,4 @@ //@ revisions: rpass1 rpass2 -//@ aux-build:respan.rs //@ aux-build:invalid-span-helper-lib.rs // This issue has several different parts. The high level idea is: diff --git a/tests/mir-opt/building/custom/debuginfo.constant.built.after.mir b/tests/mir-opt/building/custom/debuginfo.constant.built.after.mir new file mode 100644 index 00000000000..00702b5b99c --- /dev/null +++ b/tests/mir-opt/building/custom/debuginfo.constant.built.after.mir @@ -0,0 +1,10 @@ +// MIR for `constant` after built + +fn constant() -> () { + debug scalar => const 5_usize; + let mut _0: (); + + bb0: { + return; + } +} diff --git a/tests/mir-opt/building/custom/debuginfo.numbered.built.after.mir b/tests/mir-opt/building/custom/debuginfo.numbered.built.after.mir index d8639253718..fba611818ef 100644 --- a/tests/mir-opt/building/custom/debuginfo.numbered.built.after.mir +++ b/tests/mir-opt/building/custom/debuginfo.numbered.built.after.mir @@ -2,7 +2,7 @@ fn numbered(_1: (u32, i32)) -> () { debug first => (_1.0: u32); - debug second => (_1.0: u32); + debug second => (_1.1: i32); let mut _0: (); bb0: { diff --git a/tests/mir-opt/building/custom/debuginfo.rs b/tests/mir-opt/building/custom/debuginfo.rs index 5ab83fd4214..c4ea2162e0b 100644 --- a/tests/mir-opt/building/custom/debuginfo.rs +++ b/tests/mir-opt/building/custom/debuginfo.rs @@ -1,4 +1,3 @@ -// skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; @@ -7,6 +6,8 @@ use core::intrinsics::mir::*; // EMIT_MIR debuginfo.pointee.built.after.mir #[custom_mir(dialect = "built")] fn pointee(opt: &mut Option<i32>) { + // CHECK-LABEL: fn pointee( + // CHECK: debug foo => (((*_1) as variant#1).0: i32); mir! { debug foo => Field::<i32>(Variant(*opt, 1), 0); { @@ -18,9 +19,12 @@ fn pointee(opt: &mut Option<i32>) { // EMIT_MIR debuginfo.numbered.built.after.mir #[custom_mir(dialect = "analysis", phase = "post-cleanup")] fn numbered(i: (u32, i32)) { + // CHECK-LABEL: fn numbered( + // CHECK: debug first => (_1.0: u32); + // CHECK: debug second => (_1.1: i32); mir! { debug first => i.0; - debug second => i.0; + debug second => i.1; { Return() } @@ -34,6 +38,8 @@ struct S { // EMIT_MIR debuginfo.structured.built.after.mir #[custom_mir(dialect = "analysis", phase = "post-cleanup")] fn structured(i: S) { + // CHECK-LABEL: fn structured( + // CHECK: debug x => (_1.0: f32); mir! { debug x => i.x; { @@ -45,6 +51,8 @@ fn structured(i: S) { // EMIT_MIR debuginfo.variant.built.after.mir #[custom_mir(dialect = "built")] fn variant(opt: Option<i32>) { + // CHECK-LABEL: fn variant( + // CHECK: debug inner => ((_1 as variant#1).0: i32); mir! { debug inner => Field::<i32>(Variant(opt, 1), 0); { @@ -56,6 +64,9 @@ fn variant(opt: Option<i32>) { // EMIT_MIR debuginfo.variant_deref.built.after.mir #[custom_mir(dialect = "built")] fn variant_deref(opt: Option<&i32>) { + // CHECK-LABEL: fn variant_deref( + // CHECK: debug pointer => ((_1 as variant#1).0: &i32); + // CHECK: debug deref => (*((_1 as variant#1).0: &i32)); mir! { debug pointer => Field::<&i32>(Variant(opt, 1), 0); debug deref => *Field::<&i32>(Variant(opt, 1), 0); @@ -65,10 +76,24 @@ fn variant_deref(opt: Option<&i32>) { } } +// EMIT_MIR debuginfo.constant.built.after.mir +#[custom_mir(dialect = "built")] +fn constant() { + // CHECK-LABEL: fn constant( + // CHECK: debug scalar => const 5_usize; + mir!( + debug scalar => 5_usize; + { + Return() + } + ) +} + fn main() { numbered((5, 6)); structured(S { x: 5. }); variant(Some(5)); variant_deref(Some(&5)); pointee(&mut Some(5)); + constant(); } diff --git a/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff b/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff index 8df262b351f..23928337bf7 100644 --- a/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff +++ b/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff @@ -14,23 +14,19 @@ bb0: { StorageLive(_1); -- StorageLive(_2); + StorageLive(_2); - StorageLive(_3); + nop; -+ nop; _3 = const {ALLOC0: &u8}; -- _2 = copy (*_3); -+ _2 = const 2_u8; + _2 = copy (*_3); StorageLive(_4); StorageLive(_5); _5 = const {ALLOC0: &u8}; - _4 = copy (*_5); -- _1 = Add(move _2, move _4); -+ _4 = const 2_u8; -+ _1 = const 4_u8; ++ _4 = copy (*_3); + _1 = Add(move _2, move _4); StorageDead(_4); -- StorageDead(_2); -+ nop; + StorageDead(_2); StorageDead(_5); - StorageDead(_3); + nop; diff --git a/tests/mir-opt/const_prop/read_immutable_static.rs b/tests/mir-opt/const_prop/read_immutable_static.rs index 05fec2f3303..98ba76fb765 100644 --- a/tests/mir-opt/const_prop/read_immutable_static.rs +++ b/tests/mir-opt/const_prop/read_immutable_static.rs @@ -6,6 +6,7 @@ static FOO: u8 = 2; fn main() { // CHECK-LABEL: fn main( // CHECK: debug x => [[x:_.*]]; - // CHECK: [[x]] = const 4_u8; + // Disabled due to <https://github.com/rust-lang/rust/issues/130853> + // COM: CHECK: [[x]] = const 4_u8; let x = FOO + FOO; } diff --git a/tests/mir-opt/const_prop/ref_deref.main.GVN.diff b/tests/mir-opt/const_prop/ref_deref.main.GVN.diff index b9e269266b0..4477b4b005b 100644 --- a/tests/mir-opt/const_prop/ref_deref.main.GVN.diff +++ b/tests/mir-opt/const_prop/ref_deref.main.GVN.diff @@ -16,8 +16,7 @@ StorageLive(_2); _4 = const main::promoted[0]; _2 = &(*_4); -- _1 = copy (*_2); -+ _1 = const 4_i32; + _1 = copy (*_2); StorageDead(_2); _0 = const (); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff b/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff index dcc13c9251c..bbfd70bea16 100644 --- a/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff +++ b/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff @@ -16,8 +16,7 @@ StorageLive(_2); _4 = const main::promoted[0]; _2 = &((*_4).1: i32); -- _1 = copy (*_2); -+ _1 = const 5_i32; + _1 = copy (*_2); StorageDead(_2); _0 = const (); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/ref_deref_project.rs b/tests/mir-opt/const_prop/ref_deref_project.rs index 5a48a887f93..31108e1a57f 100644 --- a/tests/mir-opt/const_prop/ref_deref_project.rs +++ b/tests/mir-opt/const_prop/ref_deref_project.rs @@ -5,6 +5,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug a => [[a:_.*]]; - // CHECK: [[a]] = const 5_i32; + // Disabled due to <https://github.com/rust-lang/rust/issues/130853> + // COM: CHECK: [[a]] = const 5_i32; let a = *(&(4, 5).1); } diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff index 41ce94eda75..8a8ea5b7e20 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff @@ -30,17 +30,16 @@ StorageDead(_3); StorageLive(_6); _6 = const 1_usize; -- _7 = Len((*_2)); + _7 = Len((*_2)); - _8 = Lt(copy _6, copy _7); - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; -+ _7 = const 3_usize; -+ _8 = const true; -+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; ++ _8 = Lt(const 1_usize, copy _7); ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { - _1 = copy (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff index 8cced96cd43..f0c844884f6 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff @@ -30,17 +30,16 @@ StorageDead(_3); StorageLive(_6); _6 = const 1_usize; -- _7 = Len((*_2)); + _7 = Len((*_2)); - _8 = Lt(copy _6, copy _7); - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; -+ _7 = const 3_usize; -+ _8 = const true; -+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; ++ _8 = Lt(const 1_usize, copy _7); ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { - _1 = copy (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff index 41ce94eda75..8a8ea5b7e20 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff @@ -30,17 +30,16 @@ StorageDead(_3); StorageLive(_6); _6 = const 1_usize; -- _7 = Len((*_2)); + _7 = Len((*_2)); - _8 = Lt(copy _6, copy _7); - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; -+ _7 = const 3_usize; -+ _8 = const true; -+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; ++ _8 = Lt(const 1_usize, copy _7); ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { - _1 = copy (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff index 8cced96cd43..f0c844884f6 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff @@ -30,17 +30,16 @@ StorageDead(_3); StorageLive(_6); _6 = const 1_usize; -- _7 = Len((*_2)); + _7 = Len((*_2)); - _8 = Lt(copy _6, copy _7); - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; -+ _7 = const 3_usize; -+ _8 = const true; -+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; ++ _8 = Lt(const 1_usize, copy _7); ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { - _1 = copy (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs index ebd3c9e792d..498e09fbb65 100644 --- a/tests/mir-opt/const_prop/slice_len.rs +++ b/tests/mir-opt/const_prop/slice_len.rs @@ -8,7 +8,8 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug a => [[a:_.*]]; // CHECK: [[slice:_.*]] = copy {{.*}} as &[u32] (PointerCoercion(Unsize, AsCast)); - // CHECK: assert(const true, - // CHECK: [[a]] = const 2_u32; + // Disabled due to <https://github.com/rust-lang/rust/issues/130853> + // COM: CHECK: assert(const true, + // COM: CHECK: [[a]] = const 2_u32; let a = (&[1u32, 2, 3] as &[u32])[1]; } diff --git a/tests/mir-opt/dataflow.main.maybe_init.borrowck.dot b/tests/mir-opt/dataflow.main.maybe_init.borrowck.dot new file mode 100644 index 00000000000..7c7d8921fb3 --- /dev/null +++ b/tests/mir-opt/dataflow.main.maybe_init.borrowck.dot @@ -0,0 +1,6 @@ +digraph graph_for_def_id_0_3 { + graph[fontname="Courier, monospace"]; + node[fontname="Courier, monospace"]; + edge[fontname="Courier, monospace"]; + bb_0[label=<<table border="1" cellborder="1" cellspacing="0" cellpadding="3" sides="rb"><tr><td colspan="3" sides="tl">bb0</td></tr><tr><td colspan="2" bgcolor="#a0a0a0" sides="tl">MIR</td><td bgcolor="#a0a0a0" sides="tl">STATE</td></tr><tr><td valign="bottom" sides="tl" align="right"></td><td valign="bottom" sides="tl" align="left">(on start)</td><td colspan="1" valign="bottom" sides="tl" align="left">{}</td></tr><tr><td valign="top" sides="tl" bgcolor="#f0f0f0" align="right">0</td><td valign="top" sides="tl" bgcolor="#f0f0f0" align="left">_0 = const ()</td><td valign="top" sides="tl" bgcolor="#f0f0f0" align="left"><font color="darkgreen">+_0</font></td></tr><tr><td valign="top" sides="tl" align="right">T</td><td valign="top" sides="tl" align="left">return</td><td valign="top" sides="tl" align="left"></td></tr><tr><td valign="bottom" sides="tl" bgcolor="#f0f0f0" align="right"></td><td valign="bottom" sides="tl" bgcolor="#f0f0f0" align="left">(on end)</td><td colspan="1" valign="bottom" sides="tl" bgcolor="#f0f0f0" align="left">{_0}</td></tr></table>>][shape="none"]; +} diff --git a/tests/mir-opt/dataflow.rs b/tests/mir-opt/dataflow.rs new file mode 100644 index 00000000000..3a28f5d47b9 --- /dev/null +++ b/tests/mir-opt/dataflow.rs @@ -0,0 +1,6 @@ +// skip-filecheck +// Test graphviz dataflow output +//@ compile-flags: -Z dump-mir=main -Z dump-mir-dataflow + +// EMIT_MIR dataflow.main.maybe_init.borrowck.dot +fn main() {} diff --git a/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff b/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff index b0702696e18..acbea13642c 100644 --- a/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff @@ -18,8 +18,7 @@ } bb2: { -- _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind unreachable]; -+ _0 = opaque::<T>(copy _1) -> [return: bb3, unwind unreachable]; + _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff b/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff index fe05d4deeed..ba080bfdb07 100644 --- a/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff @@ -18,8 +18,7 @@ } bb2: { -- _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind continue]; -+ _0 = opaque::<T>(copy _1) -> [return: bb3, unwind continue]; + _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind continue]; } bb3: { diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff index a763614dc64..ecd7bdc433c 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff @@ -107,23 +107,18 @@ StorageLive(_18); _18 = &(*_1); StorageLive(_19); -- StorageLive(_20); -+ nop; + StorageLive(_20); _20 = copy (*_18); -- _19 = opaque::<u32>(move _20) -> [return: bb7, unwind unreachable]; -+ _19 = opaque::<u32>(copy _20) -> [return: bb7, unwind unreachable]; + _19 = opaque::<u32>(move _20) -> [return: bb7, unwind unreachable]; } bb7: { -- StorageDead(_20); -+ nop; + StorageDead(_20); StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = copy (*_18); -- _21 = opaque::<u32>(move _22) -> [return: bb8, unwind unreachable]; -+ _22 = copy _20; -+ _21 = opaque::<u32>(copy _20) -> [return: bb8, unwind unreachable]; + _22 = copy (*_18); + _21 = opaque::<u32>(move _22) -> [return: bb8, unwind unreachable]; } bb8: { @@ -157,23 +152,18 @@ StorageDead(_28); StorageDead(_27); StorageLive(_29); -- StorageLive(_30); -+ nop; + StorageLive(_30); _30 = copy ((*_3).0: u32); -- _29 = opaque::<u32>(move _30) -> [return: bb12, unwind unreachable]; -+ _29 = opaque::<u32>(copy _30) -> [return: bb12, unwind unreachable]; + _29 = opaque::<u32>(move _30) -> [return: bb12, unwind unreachable]; } bb12: { -- StorageDead(_30); -+ nop; + StorageDead(_30); StorageDead(_29); StorageLive(_31); StorageLive(_32); -- _32 = copy ((*_3).0: u32); -- _31 = opaque::<u32>(move _32) -> [return: bb13, unwind unreachable]; -+ _32 = copy _30; -+ _31 = opaque::<u32>(copy _30) -> [return: bb13, unwind unreachable]; + _32 = copy ((*_3).0: u32); + _31 = opaque::<u32>(move _32) -> [return: bb13, unwind unreachable]; } bb13: { diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff index ca6fda48364..bbca6bc3c75 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff @@ -107,23 +107,18 @@ StorageLive(_18); _18 = &(*_1); StorageLive(_19); -- StorageLive(_20); -+ nop; + StorageLive(_20); _20 = copy (*_18); -- _19 = opaque::<u32>(move _20) -> [return: bb7, unwind continue]; -+ _19 = opaque::<u32>(copy _20) -> [return: bb7, unwind continue]; + _19 = opaque::<u32>(move _20) -> [return: bb7, unwind continue]; } bb7: { -- StorageDead(_20); -+ nop; + StorageDead(_20); StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = copy (*_18); -- _21 = opaque::<u32>(move _22) -> [return: bb8, unwind continue]; -+ _22 = copy _20; -+ _21 = opaque::<u32>(copy _20) -> [return: bb8, unwind continue]; + _22 = copy (*_18); + _21 = opaque::<u32>(move _22) -> [return: bb8, unwind continue]; } bb8: { @@ -157,23 +152,18 @@ StorageDead(_28); StorageDead(_27); StorageLive(_29); -- StorageLive(_30); -+ nop; + StorageLive(_30); _30 = copy ((*_3).0: u32); -- _29 = opaque::<u32>(move _30) -> [return: bb12, unwind continue]; -+ _29 = opaque::<u32>(copy _30) -> [return: bb12, unwind continue]; + _29 = opaque::<u32>(move _30) -> [return: bb12, unwind continue]; } bb12: { -- StorageDead(_30); -+ nop; + StorageDead(_30); StorageDead(_29); StorageLive(_31); StorageLive(_32); -- _32 = copy ((*_3).0: u32); -- _31 = opaque::<u32>(move _32) -> [return: bb13, unwind continue]; -+ _32 = copy _30; -+ _31 = opaque::<u32>(copy _30) -> [return: bb13, unwind continue]; + _32 = copy ((*_3).0: u32); + _31 = opaque::<u32>(move _32) -> [return: bb13, unwind continue]; } bb13: { 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 130b011630c..7f99b83d937 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:614:19: 614:21}; + let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; + let mut _13: {closure@$DIR/gvn.rs:615:19: 615: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:614:19: 614:21}; + let _7: {closure@$DIR/gvn.rs:615:19: 615:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -62,16 +62,16 @@ StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; +- _7 = {closure@$DIR/gvn.rs:615:19: 615:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + nop; StorageLive(_9); - _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615: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:614:19: 614:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615: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 372a08d5473..06dd0502f30 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:614:19: 614:21}; + let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; + let mut _13: {closure@$DIR/gvn.rs:615:19: 615: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:614:19: 614:21}; + let _7: {closure@$DIR/gvn.rs:615:19: 615:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -62,16 +62,16 @@ StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; +- _7 = {closure@$DIR/gvn.rs:615:19: 615:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + nop; StorageLive(_9); - _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615: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:614:19: 614:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast)); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615: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 faa6faa7017..97513248e23 100644 --- a/tests/mir-opt/gvn.rs +++ b/tests/mir-opt/gvn.rs @@ -99,17 +99,18 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) { opaque((x * y) - y); opaque((x * y) - y); - // We can substitute through an immutable reference too. + // We cannot substitute through an immutable reference. + // (Disabled due to <https://github.com/rust-lang/rust/issues/130853>) // CHECK: [[ref:_.*]] = &_3; // CHECK: [[deref:_.*]] = copy (*[[ref]]); - // CHECK: [[addref:_.*]] = Add(copy [[deref]], copy _1); - // CHECK: opaque::<u64>(copy [[addref]]) - // CHECK: opaque::<u64>(copy [[addref]]) + // COM: CHECK: [[addref:_.*]] = Add(copy [[deref]], copy _1); + // COM: CHECK: opaque::<u64>(copy [[addref]]) + // COM: CHECK: opaque::<u64>(copy [[addref]]) let a = &z; opaque(*a + x); opaque(*a + x); - // But not through a mutable reference or a pointer. + // And certainly not through a mutable reference or a pointer. // CHECK: [[mut:_.*]] = &mut _3; // CHECK: [[addmut:_.*]] = Add( // CHECK: opaque::<u64>(move [[addmut]]) @@ -137,13 +138,13 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) { opaque(*d + x); } - // We can substitute again, but not with the earlier computations. + // We still cannot substitute again, and never with the earlier computations. // Important: `e` is not `a`! // CHECK: [[ref2:_.*]] = &_3; // CHECK: [[deref2:_.*]] = copy (*[[ref2]]); - // CHECK: [[addref2:_.*]] = Add(copy [[deref2]], copy _1); - // CHECK: opaque::<u64>(copy [[addref2]]) - // CHECK: opaque::<u64>(copy [[addref2]]) + // COM: CHECK: [[addref2:_.*]] = Add(copy [[deref2]], copy _1); + // COM: CHECK: opaque::<u64>(copy [[addref2]]) + // COM: CHECK: opaque::<u64>(copy [[addref2]]) let e = &z; opaque(*e + x); opaque(*e + x); @@ -495,15 +496,15 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) { unsafe { opaque(*z) }; unsafe { opaque(*z) }; - // We can reuse dereferences of `&Freeze`. + // Do not reuse dereferences of `&Freeze`. // CHECK: [[ref:_.*]] = &(*_1); // CHECK: [[st7:_.*]] = copy (*[[ref]]); - // CHECK: opaque::<u32>(copy [[st7]]) - // CHECK: opaque::<u32>(copy [[st7]]) + // COM: CHECK: opaque::<u32>(copy [[st7]]) + // COM: CHECK: opaque::<u32>(copy [[st7]]) let z = &*t; opaque(*z); opaque(*z); - // But not in reborrows. + // Not in reborrows either. // CHECK: [[reborrow:_.*]] = &(*[[ref]]); // CHECK: opaque::<&u32>(move [[reborrow]]) opaque(&*z); @@ -516,10 +517,10 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) { opaque(*u); opaque(*u); - // `*s` is not Copy, but `(*s).0` is, so we can reuse. + // `*s` is not Copy, but `(*s).0` is, but we still cannot reuse. // CHECK: [[st10:_.*]] = copy ((*_3).0: u32); - // CHECK: opaque::<u32>(copy [[st10]]) - // CHECK: opaque::<u32>(copy [[st10]]) + // COM: CHECK: opaque::<u32>(copy [[st10]]) + // COM: CHECK: opaque::<u32>(copy [[st10]]) opaque(s.0); opaque(s.0); } @@ -736,7 +737,7 @@ fn borrowed<T: Copy + Freeze>(x: T) { // CHECK: bb1: { // CHECK-NEXT: _0 = opaque::<T>(copy _1) // CHECK: bb2: { - // CHECK-NEXT: _0 = opaque::<T>(copy _1) + // COM: CHECK-NEXT: _0 = opaque::<T>(copy _1) mir! { { let a = x; diff --git a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff index e8e99b44e72..43efcbdfb1e 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff @@ -111,9 +111,8 @@ StorageLive(_7); StorageLive(_8); - StorageLive(_9); -- StorageLive(_10); -+ nop; + nop; + StorageLive(_10); StorageLive(_11); _11 = &(*_1); _10 = core::str::<impl str>::as_ptr(move _11) -> [return: bb3, unwind unreachable]; @@ -123,9 +122,8 @@ StorageDead(_11); _9 = &_10; - StorageLive(_12); -- StorageLive(_13); -+ nop; + nop; + StorageLive(_13); StorageLive(_14); - _14 = &(*_4); + _14 = &(*_1); @@ -150,12 +148,11 @@ StorageLive(_17); StorageLive(_18); - _18 = copy (*_15); -+ _18 = copy _10; ++ _18 = copy (*_9); StorageLive(_19); - _19 = copy (*_16); -- _17 = Eq(move _18, move _19); -+ _19 = copy _13; -+ _17 = Eq(copy _10, copy _13); ++ _19 = copy (*_12); + _17 = Eq(move _18, move _19); switchInt(move _17) -> [0: bb6, otherwise: bb5]; } @@ -166,10 +163,8 @@ StorageDead(_17); StorageDead(_16); StorageDead(_15); -- StorageDead(_13); -- StorageDead(_10); -+ nop; -+ nop; + StorageDead(_13); + StorageDead(_10); StorageDead(_8); StorageDead(_7); - StorageLive(_29); @@ -218,9 +213,8 @@ StorageLive(_33); StorageLive(_34); - StorageLive(_35); -- StorageLive(_36); -+ nop; + nop; + StorageLive(_36); StorageLive(_37); _37 = &(*_1); _36 = core::str::<impl str>::as_ptr(move _37) -> [return: bb8, unwind unreachable]; @@ -230,9 +224,8 @@ StorageDead(_37); _35 = &_36; - StorageLive(_38); -- StorageLive(_39); -+ nop; + nop; + StorageLive(_39); StorageLive(_40); _40 = &(*_29); _39 = core::slice::<impl [u8]>::as_ptr(move _40) -> [return: bb9, unwind unreachable]; @@ -256,12 +249,11 @@ StorageLive(_43); StorageLive(_44); - _44 = copy (*_41); -+ _44 = copy _36; ++ _44 = copy (*_35); StorageLive(_45); - _45 = copy (*_42); -- _43 = Eq(move _44, move _45); -+ _45 = copy _39; -+ _43 = Eq(copy _36, copy _39); ++ _45 = copy (*_38); + _43 = Eq(move _44, move _45); switchInt(move _43) -> [0: bb11, otherwise: bb10]; } @@ -272,10 +264,8 @@ StorageDead(_43); StorageDead(_42); StorageDead(_41); -- StorageDead(_39); -- StorageDead(_36); -+ nop; -+ nop; + StorageDead(_39); + StorageDead(_36); StorageDead(_34); StorageDead(_33); _0 = const (); diff --git a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff index 4296d4d4a59..8572f538c0f 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff @@ -111,9 +111,8 @@ StorageLive(_7); StorageLive(_8); - StorageLive(_9); -- StorageLive(_10); -+ nop; + nop; + StorageLive(_10); StorageLive(_11); _11 = &(*_1); _10 = core::str::<impl str>::as_ptr(move _11) -> [return: bb3, unwind continue]; @@ -123,9 +122,8 @@ StorageDead(_11); _9 = &_10; - StorageLive(_12); -- StorageLive(_13); -+ nop; + nop; + StorageLive(_13); StorageLive(_14); - _14 = &(*_4); + _14 = &(*_1); @@ -150,12 +148,11 @@ StorageLive(_17); StorageLive(_18); - _18 = copy (*_15); -+ _18 = copy _10; ++ _18 = copy (*_9); StorageLive(_19); - _19 = copy (*_16); -- _17 = Eq(move _18, move _19); -+ _19 = copy _13; -+ _17 = Eq(copy _10, copy _13); ++ _19 = copy (*_12); + _17 = Eq(move _18, move _19); switchInt(move _17) -> [0: bb6, otherwise: bb5]; } @@ -166,10 +163,8 @@ StorageDead(_17); StorageDead(_16); StorageDead(_15); -- StorageDead(_13); -- StorageDead(_10); -+ nop; -+ nop; + StorageDead(_13); + StorageDead(_10); StorageDead(_8); StorageDead(_7); - StorageLive(_29); @@ -218,9 +213,8 @@ StorageLive(_33); StorageLive(_34); - StorageLive(_35); -- StorageLive(_36); -+ nop; + nop; + StorageLive(_36); StorageLive(_37); _37 = &(*_1); _36 = core::str::<impl str>::as_ptr(move _37) -> [return: bb8, unwind continue]; @@ -230,9 +224,8 @@ StorageDead(_37); _35 = &_36; - StorageLive(_38); -- StorageLive(_39); -+ nop; + nop; + StorageLive(_39); StorageLive(_40); _40 = &(*_29); _39 = core::slice::<impl [u8]>::as_ptr(move _40) -> [return: bb9, unwind continue]; @@ -256,12 +249,11 @@ StorageLive(_43); StorageLive(_44); - _44 = copy (*_41); -+ _44 = copy _36; ++ _44 = copy (*_35); StorageLive(_45); - _45 = copy (*_42); -- _43 = Eq(move _44, move _45); -+ _45 = copy _39; -+ _43 = Eq(copy _36, copy _39); ++ _45 = copy (*_38); + _43 = Eq(move _44, move _45); switchInt(move _43) -> [0: bb11, otherwise: bb10]; } @@ -272,10 +264,8 @@ StorageDead(_43); StorageDead(_42); StorageDead(_41); -- StorageDead(_39); -- StorageDead(_36); -+ nop; -+ nop; + StorageDead(_39); + StorageDead(_36); StorageDead(_34); StorageDead(_33); _0 = const (); diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff index 7a479bc55da..e872e011542 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff @@ -758,39 +758,32 @@ StorageLive(_126); _126 = &_3; StorageLive(_127); -- StorageLive(_128); -- StorageLive(_129); -+ nop; -+ nop; + StorageLive(_128); + StorageLive(_129); _129 = copy (*_126); StorageLive(_130); _130 = copy _1; - _128 = Add(move _129, move _130); -+ _128 = Add(copy _129, copy _1); ++ _128 = Add(move _129, copy _1); StorageDead(_130); -- StorageDead(_129); -- _127 = opaque::<u64>(move _128) -> [return: bb35, unwind unreachable]; -+ nop; -+ _127 = opaque::<u64>(copy _128) -> [return: bb35, unwind unreachable]; + StorageDead(_129); + _127 = opaque::<u64>(move _128) -> [return: bb35, unwind unreachable]; } bb35: { -- StorageDead(_128); -+ nop; + StorageDead(_128); StorageDead(_127); StorageLive(_131); StorageLive(_132); StorageLive(_133); -- _133 = copy (*_126); -+ _133 = copy _129; + _133 = copy (*_126); StorageLive(_134); _134 = copy _1; - _132 = Add(move _133, move _134); -+ _132 = copy _128; ++ _132 = Add(move _133, copy _1); StorageDead(_134); StorageDead(_133); -- _131 = opaque::<u64>(move _132) -> [return: bb36, unwind unreachable]; -+ _131 = opaque::<u64>(copy _128) -> [return: bb36, unwind unreachable]; + _131 = opaque::<u64>(move _132) -> [return: bb36, unwind unreachable]; } bb36: { @@ -906,39 +899,32 @@ StorageLive(_163); _163 = &_3; StorageLive(_164); -- StorageLive(_165); -- StorageLive(_166); -+ nop; -+ nop; + StorageLive(_165); + StorageLive(_166); _166 = copy (*_163); StorageLive(_167); _167 = copy _1; - _165 = Add(move _166, move _167); -+ _165 = Add(copy _166, copy _1); ++ _165 = Add(move _166, copy _1); StorageDead(_167); -- StorageDead(_166); -- _164 = opaque::<u64>(move _165) -> [return: bb43, unwind unreachable]; -+ nop; -+ _164 = opaque::<u64>(copy _165) -> [return: bb43, unwind unreachable]; + StorageDead(_166); + _164 = opaque::<u64>(move _165) -> [return: bb43, unwind unreachable]; } bb43: { -- StorageDead(_165); -+ nop; + StorageDead(_165); StorageDead(_164); StorageLive(_168); StorageLive(_169); StorageLive(_170); -- _170 = copy (*_163); -+ _170 = copy _166; + _170 = copy (*_163); StorageLive(_171); _171 = copy _1; - _169 = Add(move _170, move _171); -+ _169 = copy _165; ++ _169 = Add(move _170, copy _1); StorageDead(_171); StorageDead(_170); -- _168 = opaque::<u64>(move _169) -> [return: bb44, unwind unreachable]; -+ _168 = opaque::<u64>(copy _165) -> [return: bb44, unwind unreachable]; + _168 = opaque::<u64>(move _169) -> [return: bb44, unwind unreachable]; } bb44: { diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff index 3ca5238663c..3996dab27a3 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff @@ -758,39 +758,32 @@ StorageLive(_126); _126 = &_3; StorageLive(_127); -- StorageLive(_128); -- StorageLive(_129); -+ nop; -+ nop; + StorageLive(_128); + StorageLive(_129); _129 = copy (*_126); StorageLive(_130); _130 = copy _1; - _128 = Add(move _129, move _130); -+ _128 = Add(copy _129, copy _1); ++ _128 = Add(move _129, copy _1); StorageDead(_130); -- StorageDead(_129); -- _127 = opaque::<u64>(move _128) -> [return: bb35, unwind continue]; -+ nop; -+ _127 = opaque::<u64>(copy _128) -> [return: bb35, unwind continue]; + StorageDead(_129); + _127 = opaque::<u64>(move _128) -> [return: bb35, unwind continue]; } bb35: { -- StorageDead(_128); -+ nop; + StorageDead(_128); StorageDead(_127); StorageLive(_131); StorageLive(_132); StorageLive(_133); -- _133 = copy (*_126); -+ _133 = copy _129; + _133 = copy (*_126); StorageLive(_134); _134 = copy _1; - _132 = Add(move _133, move _134); -+ _132 = copy _128; ++ _132 = Add(move _133, copy _1); StorageDead(_134); StorageDead(_133); -- _131 = opaque::<u64>(move _132) -> [return: bb36, unwind continue]; -+ _131 = opaque::<u64>(copy _128) -> [return: bb36, unwind continue]; + _131 = opaque::<u64>(move _132) -> [return: bb36, unwind continue]; } bb36: { @@ -906,39 +899,32 @@ StorageLive(_163); _163 = &_3; StorageLive(_164); -- StorageLive(_165); -- StorageLive(_166); -+ nop; -+ nop; + StorageLive(_165); + StorageLive(_166); _166 = copy (*_163); StorageLive(_167); _167 = copy _1; - _165 = Add(move _166, move _167); -+ _165 = Add(copy _166, copy _1); ++ _165 = Add(move _166, copy _1); StorageDead(_167); -- StorageDead(_166); -- _164 = opaque::<u64>(move _165) -> [return: bb43, unwind continue]; -+ nop; -+ _164 = opaque::<u64>(copy _165) -> [return: bb43, unwind continue]; + StorageDead(_166); + _164 = opaque::<u64>(move _165) -> [return: bb43, unwind continue]; } bb43: { -- StorageDead(_165); -+ nop; + StorageDead(_165); StorageDead(_164); StorageLive(_168); StorageLive(_169); StorageLive(_170); -- _170 = copy (*_163); -+ _170 = copy _166; + _170 = copy (*_163); StorageLive(_171); _171 = copy _1; - _169 = Add(move _170, move _171); -+ _169 = copy _165; ++ _169 = Add(move _170, copy _1); StorageDead(_171); StorageDead(_170); -- _168 = opaque::<u64>(move _169) -> [return: bb44, unwind continue]; -+ _168 = opaque::<u64>(copy _165) -> [return: bb44, unwind continue]; + _168 = opaque::<u64>(move _169) -> [return: bb44, unwind continue]; } bb44: { diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff index 37b7b0d2c9d..881b629803a 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff @@ -17,16 +17,15 @@ StorageLive(_3); _5 = const f::promoted[0]; _3 = &(*_5); -- _2 = copy ((*_3).1: E); -+ _2 = copy ((*_5).1: E); - StorageLive(_1); -- _1 = copy ((_2 as A).1: u32); -+ _1 = const 0_u32; + _2 = copy ((*_3).1: E); +- StorageLive(_1); ++ nop; + _1 = copy ((_2 as A).1: u32); StorageDead(_3); StorageDead(_2); -- _0 = copy _1; -+ _0 = const 0_u32; - StorageDead(_1); + _0 = copy _1; +- StorageDead(_1); ++ nop; return; } } diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff index 37b7b0d2c9d..881b629803a 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff @@ -17,16 +17,15 @@ StorageLive(_3); _5 = const f::promoted[0]; _3 = &(*_5); -- _2 = copy ((*_3).1: E); -+ _2 = copy ((*_5).1: E); - StorageLive(_1); -- _1 = copy ((_2 as A).1: u32); -+ _1 = const 0_u32; + _2 = copy ((*_3).1: E); +- StorageLive(_1); ++ nop; + _1 = copy ((_2 as A).1: u32); StorageDead(_3); StorageDead(_2); -- _0 = copy _1; -+ _0 = const 0_u32; - StorageDead(_1); + _0 = copy _1; +- StorageDead(_1); ++ nop; return; } } diff --git a/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-abort.diff b/tests/mir-opt/inline/issue_78442.bar.PostAnalysisNormalize.panic-abort.diff index b532b133a83..95c52925401 100644 --- a/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-abort.diff +++ b/tests/mir-opt/inline/issue_78442.bar.PostAnalysisNormalize.panic-abort.diff @@ -1,5 +1,5 @@ -- // MIR for `bar` before RevealAll -+ // MIR for `bar` after RevealAll +- // MIR for `bar` before PostAnalysisNormalize ++ // MIR for `bar` after PostAnalysisNormalize fn bar(_1: P) -> () { debug _baz => _1; diff --git a/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-unwind.diff b/tests/mir-opt/inline/issue_78442.bar.PostAnalysisNormalize.panic-unwind.diff index bcebcf297c2..1b710a78cb1 100644 --- a/tests/mir-opt/inline/issue_78442.bar.RevealAll.panic-unwind.diff +++ b/tests/mir-opt/inline/issue_78442.bar.PostAnalysisNormalize.panic-unwind.diff @@ -1,5 +1,5 @@ -- // MIR for `bar` before RevealAll -+ // MIR for `bar` after RevealAll +- // MIR for `bar` before PostAnalysisNormalize ++ // MIR for `bar` after PostAnalysisNormalize fn bar(_1: P) -> () { debug _baz => _1; diff --git a/tests/mir-opt/inline/issue_78442.rs b/tests/mir-opt/inline/issue_78442.rs index 6dc875f9a40..4eb5c142034 100644 --- a/tests/mir-opt/inline/issue_78442.rs +++ b/tests/mir-opt/inline/issue_78442.rs @@ -2,7 +2,7 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] -// EMIT_MIR issue_78442.bar.RevealAll.diff +// EMIT_MIR issue_78442.bar.PostAnalysisNormalize.diff // EMIT_MIR issue_78442.bar.Inline.diff pub fn bar<P>( // Error won't happen if "bar" is not generic diff --git a/tests/mir-opt/pre-codegen/deref_nested_borrows.rs b/tests/mir-opt/pre-codegen/deref_nested_borrows.rs new file mode 100644 index 00000000000..4f70ec36bc9 --- /dev/null +++ b/tests/mir-opt/pre-codegen/deref_nested_borrows.rs @@ -0,0 +1,25 @@ +//! Regression test for <https://github.com/rust-lang/rust/issues/130853> +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY + +fn src(x: &&u8) -> bool { + // CHECK-LABEL: fn src( + // CHECK-NOT: _0 = const true; + // CHECK: _0 = Eq({{.*}}, {{.*}}); + // CHECK-NOT: _0 = const true; + let y = **x; + unsafe { unknown() }; + **x == y +} + +#[inline(never)] +unsafe fn unknown() { + // CHECK-LABEL: fn unknown( +} + +fn main() { + // CHECK-LABEL: fn main( + src(&&0); +} + +// EMIT_MIR deref_nested_borrows.src.GVN.diff +// EMIT_MIR deref_nested_borrows.src.PreCodegen.after.mir diff --git a/tests/mir-opt/pre-codegen/deref_nested_borrows.src.GVN.panic-abort.diff b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.GVN.panic-abort.diff new file mode 100644 index 00000000000..993857f225a --- /dev/null +++ b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.GVN.panic-abort.diff @@ -0,0 +1,42 @@ +- // MIR for `src` before GVN ++ // MIR for `src` after GVN + + fn src(_1: &&u8) -> bool { + debug x => _1; + let mut _0: bool; + let _2: u8; + let _3: (); + let mut _4: u8; + let mut _5: u8; + let mut _6: &u8; + let mut _7: &u8; + scope 1 { + debug y => _2; + } + + bb0: { +- StorageLive(_2); +- _6 = deref_copy (*_1); ++ nop; ++ _6 = copy (*_1); + _2 = copy (*_6); + _3 = unknown() -> [return: bb1, unwind unreachable]; + } + + bb1: { + StorageLive(_4); +- _7 = deref_copy (*_1); ++ _7 = copy (*_1); + _4 = copy (*_7); + StorageLive(_5); + _5 = copy _2; +- _0 = Eq(move _4, move _5); ++ _0 = Eq(move _4, copy _2); + StorageDead(_5); + StorageDead(_4); +- StorageDead(_2); ++ nop; + return; + } + } + diff --git a/tests/mir-opt/pre-codegen/deref_nested_borrows.src.GVN.panic-unwind.diff b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.GVN.panic-unwind.diff new file mode 100644 index 00000000000..d81bfa9310b --- /dev/null +++ b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.GVN.panic-unwind.diff @@ -0,0 +1,42 @@ +- // MIR for `src` before GVN ++ // MIR for `src` after GVN + + fn src(_1: &&u8) -> bool { + debug x => _1; + let mut _0: bool; + let _2: u8; + let _3: (); + let mut _4: u8; + let mut _5: u8; + let mut _6: &u8; + let mut _7: &u8; + scope 1 { + debug y => _2; + } + + bb0: { +- StorageLive(_2); +- _6 = deref_copy (*_1); ++ nop; ++ _6 = copy (*_1); + _2 = copy (*_6); + _3 = unknown() -> [return: bb1, unwind continue]; + } + + bb1: { + StorageLive(_4); +- _7 = deref_copy (*_1); ++ _7 = copy (*_1); + _4 = copy (*_7); + StorageLive(_5); + _5 = copy _2; +- _0 = Eq(move _4, move _5); ++ _0 = Eq(move _4, copy _2); + StorageDead(_5); + StorageDead(_4); +- StorageDead(_2); ++ nop; + return; + } + } + diff --git a/tests/mir-opt/pre-codegen/deref_nested_borrows.src.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.PreCodegen.after.panic-abort.mir new file mode 100644 index 00000000000..23b1c3f3f43 --- /dev/null +++ b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.PreCodegen.after.panic-abort.mir @@ -0,0 +1,29 @@ +// MIR for `src` after PreCodegen + +fn src(_1: &&u8) -> bool { + debug x => _1; + let mut _0: bool; + let mut _2: &u8; + let _3: u8; + let _4: (); + let mut _5: &u8; + let mut _6: u8; + scope 1 { + debug y => _3; + } + + bb0: { + _2 = copy (*_1); + _3 = copy (*_2); + _4 = unknown() -> [return: bb1, unwind unreachable]; + } + + bb1: { + StorageLive(_6); + _5 = copy (*_1); + _6 = copy (*_5); + _0 = Eq(move _6, copy _3); + StorageDead(_6); + return; + } +} diff --git a/tests/mir-opt/pre-codegen/deref_nested_borrows.src.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.PreCodegen.after.panic-unwind.mir new file mode 100644 index 00000000000..4c01e9464bf --- /dev/null +++ b/tests/mir-opt/pre-codegen/deref_nested_borrows.src.PreCodegen.after.panic-unwind.mir @@ -0,0 +1,29 @@ +// MIR for `src` after PreCodegen + +fn src(_1: &&u8) -> bool { + debug x => _1; + let mut _0: bool; + let mut _2: &u8; + let _3: u8; + let _4: (); + let mut _5: &u8; + let mut _6: u8; + scope 1 { + debug y => _3; + } + + bb0: { + _2 = copy (*_1); + _3 = copy (*_2); + _4 = unknown() -> [return: bb1, unwind continue]; + } + + bb1: { + StorageLive(_6); + _5 = copy (*_1); + _6 = copy (*_5); + _0 = Eq(move _6, copy _3); + StorageDead(_6); + return; + } +} diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir index cbdd194afd3..5a269717f82 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir @@ -4,65 +4,70 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 let mut _0: bool; let mut _3: &(usize, usize, usize, usize); let _4: &usize; - let _5: &usize; + let mut _5: &(usize, usize, usize, usize); let _6: &usize; - let _7: &usize; - let mut _8: &&usize; - let _9: &usize; - let mut _10: &&usize; - let mut _13: bool; - let mut _14: &&usize; - let _15: &usize; - let mut _16: &&usize; - let mut _19: bool; - let mut _20: &&usize; - let _21: &usize; - let mut _22: &&usize; - let mut _23: bool; - let mut _24: &&usize; - let _25: &usize; - let mut _26: &&usize; + let mut _7: &(usize, usize, usize, usize); + let _8: &usize; + let mut _9: &(usize, usize, usize, usize); + let _10: &usize; + let mut _11: &&usize; + let _12: &usize; + let mut _13: &&usize; + let mut _16: bool; + let mut _17: &&usize; + let _18: &usize; + let mut _19: &&usize; + let mut _22: bool; + let mut _23: &&usize; + let _24: &usize; + let mut _25: &&usize; + let mut _28: bool; + let mut _29: &&usize; + let _30: &usize; + let mut _31: &&usize; scope 1 { debug a => _4; - debug b => _5; - debug c => _6; - debug d => _7; + debug b => _6; + debug c => _8; + debug d => _10; scope 2 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _8; - debug other => _10; + debug self => _11; + debug other => _13; scope 3 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) { debug self => _4; - debug other => _6; - let mut _11: usize; - let mut _12: usize; + debug other => _8; + let mut _14: usize; + let mut _15: usize; } } scope 4 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _14; - debug other => _16; + debug self => _17; + debug other => _19; scope 5 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) { - debug self => _7; - debug other => _5; - let mut _17: usize; - let mut _18: usize; + debug self => _10; + debug other => _6; + let mut _20: usize; + let mut _21: usize; } } scope 6 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _20; - debug other => _22; + debug self => _23; + debug other => _25; scope 7 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) { - debug self => _6; + debug self => _8; debug other => _4; + let mut _26: usize; + let mut _27: usize; } } scope 8 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _24; - debug other => _26; + debug self => _29; + debug other => _31; scope 9 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) { - debug self => _5; - debug other => _7; - let mut _27: usize; - let mut _28: usize; + debug self => _6; + debug other => _10; + let mut _32: usize; + let mut _33: usize; } } } @@ -70,116 +75,129 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 bb0: { _3 = copy (*_2); _4 = &((*_3).0: usize); - _5 = &((*_3).1: usize); - _6 = &((*_3).2: usize); - _7 = &((*_3).3: usize); + _5 = copy (*_2); + _6 = &((*_5).1: usize); + _7 = copy (*_2); + _8 = &((*_7).2: usize); + _9 = copy (*_2); + _10 = &((*_9).3: usize); + StorageLive(_16); + StorageLive(_11); + _11 = &_4; StorageLive(_13); - StorageLive(_8); - _8 = &_4; - StorageLive(_10); - StorageLive(_9); - _9 = copy _6; - _10 = &_9; - _11 = copy ((*_3).0: usize); - _12 = copy ((*_3).2: usize); - _13 = Le(copy _11, copy _12); - switchInt(move _13) -> [0: bb1, otherwise: bb2]; + StorageLive(_12); + _12 = copy _8; + _13 = &_12; + StorageLive(_14); + _14 = copy ((*_3).0: usize); + StorageLive(_15); + _15 = copy ((*_7).2: usize); + _16 = Le(move _14, move _15); + StorageDead(_15); + StorageDead(_14); + switchInt(move _16) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageDead(_9); - StorageDead(_10); - StorageDead(_8); + StorageDead(_12); + StorageDead(_13); + StorageDead(_11); goto -> bb4; } bb2: { - StorageDead(_9); - StorageDead(_10); - StorageDead(_8); - StorageLive(_19); - StorageLive(_14); - _14 = &_7; - StorageLive(_16); - StorageLive(_15); - _15 = copy _5; - _16 = &_15; + StorageDead(_12); + StorageDead(_13); + StorageDead(_11); + StorageLive(_22); StorageLive(_17); - _17 = copy ((*_3).3: usize); + _17 = &_10; + StorageLive(_19); StorageLive(_18); - _18 = copy ((*_3).1: usize); - _19 = Le(move _17, move _18); - StorageDead(_18); - StorageDead(_17); - switchInt(move _19) -> [0: bb3, otherwise: bb8]; + _18 = copy _6; + _19 = &_18; + StorageLive(_20); + _20 = copy ((*_9).3: usize); + StorageLive(_21); + _21 = copy ((*_5).1: usize); + _22 = Le(move _20, move _21); + StorageDead(_21); + StorageDead(_20); + switchInt(move _22) -> [0: bb3, otherwise: bb8]; } bb3: { - StorageDead(_15); - StorageDead(_16); - StorageDead(_14); + StorageDead(_18); + StorageDead(_19); + StorageDead(_17); goto -> bb4; } bb4: { + StorageLive(_28); StorageLive(_23); - StorageLive(_20); - _20 = &_6; - StorageLive(_22); - StorageLive(_21); - _21 = copy _4; - _22 = &_21; - _23 = Le(copy _12, copy _11); - switchInt(move _23) -> [0: bb5, otherwise: bb6]; + _23 = &_8; + StorageLive(_25); + StorageLive(_24); + _24 = copy _4; + _25 = &_24; + StorageLive(_26); + _26 = copy ((*_7).2: usize); + StorageLive(_27); + _27 = copy ((*_3).0: usize); + _28 = Le(move _26, move _27); + StorageDead(_27); + StorageDead(_26); + switchInt(move _28) -> [0: bb5, otherwise: bb6]; } bb5: { - StorageDead(_21); - StorageDead(_22); - StorageDead(_20); + StorageDead(_24); + StorageDead(_25); + StorageDead(_23); _0 = const false; goto -> bb7; } bb6: { - StorageDead(_21); - StorageDead(_22); - StorageDead(_20); - StorageLive(_24); - _24 = &_5; - StorageLive(_26); - StorageLive(_25); - _25 = copy _7; - _26 = &_25; - StorageLive(_27); - _27 = copy ((*_3).1: usize); - StorageLive(_28); - _28 = copy ((*_3).3: usize); - _0 = Le(move _27, move _28); - StorageDead(_28); - StorageDead(_27); - StorageDead(_25); - StorageDead(_26); StorageDead(_24); + StorageDead(_25); + StorageDead(_23); + StorageLive(_29); + _29 = &_6; + StorageLive(_31); + StorageLive(_30); + _30 = copy _10; + _31 = &_30; + StorageLive(_32); + _32 = copy ((*_5).1: usize); + StorageLive(_33); + _33 = copy ((*_9).3: usize); + _0 = Le(move _32, move _33); + StorageDead(_33); + StorageDead(_32); + StorageDead(_30); + StorageDead(_31); + StorageDead(_29); goto -> bb7; } bb7: { - StorageDead(_23); + StorageDead(_28); goto -> bb9; } bb8: { - StorageDead(_15); - StorageDead(_16); - StorageDead(_14); + StorageDead(_18); + StorageDead(_19); + StorageDead(_17); _0 = const true; goto -> bb9; } bb9: { - StorageDead(_19); - StorageDead(_13); + StorageDead(_22); + StorageDead(_16); return; } } diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir index bc7a31d5219..f93f7264dec 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir @@ -4,40 +4,46 @@ fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, let mut _0: bool; let mut _3: &(usize, usize, usize, usize); let _4: usize; - let _5: usize; + let mut _5: &(usize, usize, usize, usize); let _6: usize; - let _7: usize; - let mut _8: bool; - let mut _9: bool; - let mut _10: bool; + let mut _7: &(usize, usize, usize, usize); + let _8: usize; + let mut _9: &(usize, usize, usize, usize); + let _10: usize; + let mut _11: bool; + let mut _12: bool; + let mut _13: bool; scope 1 { debug a => _4; - debug b => _5; - debug c => _6; - debug d => _7; + debug b => _6; + debug c => _8; + debug d => _10; } bb0: { _3 = copy (*_2); _4 = copy ((*_3).0: usize); - _5 = copy ((*_3).1: usize); - _6 = copy ((*_3).2: usize); - _7 = copy ((*_3).3: usize); - StorageLive(_8); - _8 = Le(copy _4, copy _6); - switchInt(move _8) -> [0: bb2, otherwise: bb1]; + _5 = copy (*_2); + _6 = copy ((*_5).1: usize); + _7 = copy (*_2); + _8 = copy ((*_7).2: usize); + _9 = copy (*_2); + _10 = copy ((*_9).3: usize); + StorageLive(_11); + _11 = Le(copy _4, copy _8); + switchInt(move _11) -> [0: bb2, otherwise: bb1]; } bb1: { - StorageLive(_9); - _9 = Le(copy _7, copy _5); - switchInt(move _9) -> [0: bb2, otherwise: bb6]; + StorageLive(_12); + _12 = Le(copy _10, copy _6); + switchInt(move _12) -> [0: bb2, otherwise: bb6]; } bb2: { - StorageLive(_10); - _10 = Le(copy _6, copy _4); - switchInt(move _10) -> [0: bb3, otherwise: bb4]; + StorageLive(_13); + _13 = Le(copy _8, copy _4); + switchInt(move _13) -> [0: bb3, otherwise: bb4]; } bb3: { @@ -46,12 +52,12 @@ fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, } bb4: { - _0 = Le(copy _5, copy _7); + _0 = Le(copy _6, copy _10); goto -> bb5; } bb5: { - StorageDead(_10); + StorageDead(_13); goto -> bb7; } @@ -61,8 +67,8 @@ fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, } bb7: { - StorageDead(_9); - StorageDead(_8); + StorageDead(_12); + StorageDead(_11); return; } } diff --git a/tests/pretty/attr-derive.rs b/tests/pretty/attr-derive.rs index 79b6ea51446..afb86b29315 100644 --- a/tests/pretty/attr-derive.rs +++ b/tests/pretty/attr-derive.rs @@ -1,4 +1,4 @@ -//@ aux-build:derive-foo.rs +//@ proc-macro: derive-foo.rs //@ pp-exact // Testing that both the inner item and next outer item are // preserved, and that the first outer item parsed in main is not diff --git a/tests/pretty/auxiliary/derive-foo.rs b/tests/pretty/auxiliary/derive-foo.rs index dc682beafad..16027508281 100644 --- a/tests/pretty/auxiliary/derive-foo.rs +++ b/tests/pretty/auxiliary/derive-foo.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/run-make/apple-deployment-target/rmake.rs b/tests/run-make/apple-deployment-target/rmake.rs index fed6d310770..0ae95cb1f4b 100644 --- a/tests/run-make/apple-deployment-target/rmake.rs +++ b/tests/run-make/apple-deployment-target/rmake.rs @@ -24,21 +24,31 @@ fn minos(file: &str, version: &str) { fn main() { // These versions should generally be higher than the default versions - let (env_var, example_version, higher_example_version) = match apple_os() { - "macos" => ("MACOSX_DEPLOYMENT_TARGET", "12.0", "13.0"), + let (example_version, higher_example_version) = match apple_os() { + "macos" => ("12.0", "13.0"), // armv7s-apple-ios and i386-apple-ios only supports iOS 10.0 - "ios" if target() == "armv7s-apple-ios" || target() == "i386-apple-ios" => { - ("IPHONEOS_DEPLOYMENT_TARGET", "10.0", "10.0") - } - "ios" => ("IPHONEOS_DEPLOYMENT_TARGET", "15.0", "16.0"), - "watchos" => ("WATCHOS_DEPLOYMENT_TARGET", "7.0", "9.0"), - "tvos" => ("TVOS_DEPLOYMENT_TARGET", "14.0", "15.0"), - "visionos" => ("XROS_DEPLOYMENT_TARGET", "1.1", "1.2"), + "ios" if target() == "armv7s-apple-ios" || target() == "i386-apple-ios" => ("10.0", "10.0"), + "ios" => ("15.0", "16.0"), + "watchos" => ("7.0", "9.0"), + "tvos" => ("14.0", "15.0"), + "visionos" => ("1.1", "1.2"), _ => unreachable!(), }; - let default_version = - rustc().target(target()).env_remove(env_var).print("deployment-target").run().stdout_utf8(); - let default_version = default_version.strip_prefix("deployment_target=").unwrap().trim(); + + // Remove env vars to get `rustc`'s default + let output = rustc() + .target(target()) + .env_remove("MACOSX_DEPLOYMENT_TARGET") + .env_remove("IPHONEOS_DEPLOYMENT_TARGET") + .env_remove("WATCHOS_DEPLOYMENT_TARGET") + .env_remove("TVOS_DEPLOYMENT_TARGET") + .env_remove("XROS_DEPLOYMENT_TARGET") + .print("deployment-target") + .run() + .stdout_utf8(); + let (env_var, default_version) = output.split_once('=').unwrap(); + let env_var = env_var.trim(); + let default_version = default_version.trim(); // Test that version makes it to the object file. run_in_tmpdir(|| { diff --git a/tests/run-make/apple-sdk-version/rmake.rs b/tests/run-make/apple-sdk-version/rmake.rs index 6463ec00403..43e80577204 100644 --- a/tests/run-make/apple-sdk-version/rmake.rs +++ b/tests/run-make/apple-sdk-version/rmake.rs @@ -26,8 +26,7 @@ fn main() { // Fetch rustc's inferred deployment target. let current_deployment_target = rustc().target(target()).print("deployment-target").run().stdout_utf8(); - let current_deployment_target = - current_deployment_target.strip_prefix("deployment_target=").unwrap().trim(); + let current_deployment_target = current_deployment_target.split('=').last().unwrap().trim(); // Fetch current SDK version via. xcrun. // diff --git a/tests/run-make/avr-rjmp-offset/rmake.rs b/tests/run-make/avr-rjmp-offset/rmake.rs index 89cbca309be..de64b724eed 100644 --- a/tests/run-make/avr-rjmp-offset/rmake.rs +++ b/tests/run-make/avr-rjmp-offset/rmake.rs @@ -10,6 +10,11 @@ //! wrong output is only produced with direct assembly generation, but not when //! "emit-asm" is used, as described in the issue description of #129301: //! https://github.com/rust-lang/rust/issues/129301#issue-2475070770 + +// FIXME(#133480): this has been randomly failing on `x86_64-mingw` due to linker hangs or +// crashes... so I'm going to disable this test for windows for now. +//@ ignore-windows-gnu + use run_make_support::{llvm_objdump, rustc}; fn main() { diff --git a/tests/run-make/crate-loading-crate-depends-on-itself/foo-current.rs b/tests/run-make/crate-loading-crate-depends-on-itself/foo-current.rs new file mode 100644 index 00000000000..71b27cd85bf --- /dev/null +++ b/tests/run-make/crate-loading-crate-depends-on-itself/foo-current.rs @@ -0,0 +1,14 @@ +#![crate_type = "lib"] +#![crate_name = "foo"] + +extern crate foo; + +pub struct Struct; +pub trait Trait {} +impl Trait for Struct {} + +fn check_trait<T: Trait>() {} + +fn ice() { + check_trait::<foo::Struct>(); +} diff --git a/tests/run-make/crate-loading-crate-depends-on-itself/foo-prev.rs b/tests/run-make/crate-loading-crate-depends-on-itself/foo-prev.rs new file mode 100644 index 00000000000..19d3f3c972b --- /dev/null +++ b/tests/run-make/crate-loading-crate-depends-on-itself/foo-prev.rs @@ -0,0 +1,6 @@ +#![crate_type = "lib"] +#![crate_name = "foo"] + +pub struct Struct; +pub trait Trait {} +impl Trait for Struct {} 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 new file mode 100644 index 00000000000..36379429530 --- /dev/null +++ b/tests/run-make/crate-loading-crate-depends-on-itself/foo.stderr @@ -0,0 +1,34 @@ +error[E0277]: the trait bound `foo::Struct: Trait` is not satisfied + --> foo-current.rs:13:19 + | +13 | check_trait::<foo::Struct>(); + | ^^^^^^^^^^^ the trait `Trait` is not implemented for `foo::Struct` + | +note: there are multiple different versions of crate `foo` in the dependency graph + --> foo-current.rs:7:1 + | +4 | extern crate foo; + | ----------------- one version of crate `foo` is used here, as a direct dependency of the current crate +5 | +6 | pub struct Struct; + | ----------------- this type implements the required trait +7 | pub trait Trait {} + | ^^^^^^^^^^^^^^^ this is the required trait + | + ::: foo-prev.rs:X:Y + | +4 | pub struct Struct; + | ----------------- this type doesn't implement the required 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 +note: required by a bound in `check_trait` + --> foo-current.rs:10:19 + | +10 | fn check_trait<T: Trait>() {} + | ^^^^^ required by this bound in `check_trait` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. \ No newline at end of file diff --git a/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs b/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs new file mode 100644 index 00000000000..57e0cab92f1 --- /dev/null +++ b/tests/run-make/crate-loading-crate-depends-on-itself/rmake.rs @@ -0,0 +1,31 @@ +//@ only-linux +//@ ignore-wasm32 +//@ ignore-wasm64 +// ignore-tidy-linelength + +// Verify that if the current crate depends on a different version of the same crate, *and* types +// and traits of the different versions are mixed, we produce diagnostic output and not an ICE. +// #133563 + +use run_make_support::{diff, rust_lib_name, rustc}; + +fn main() { + rustc().input("foo-prev.rs").run(); + + let out = rustc() + .extra_filename("current") + .metadata("current") + .input("foo-current.rs") + .extern_("foo", rust_lib_name("foo")) + .run_fail() + .stderr_utf8(); + + // We don't remap the path of the `foo-prev` crate, so we remap it here. + let mut lines: Vec<_> = out.lines().collect(); + for line in &mut lines { + if line.starts_with(" ::: ") { + *line = " ::: foo-prev.rs:X:Y"; + } + } + diff().expected_file("foo.stderr").actual_text("(rustc)", &lines.join("\n")).run(); +} diff --git a/tests/run-make/crate-loading/multiple-dep-versions.stderr b/tests/run-make/crate-loading/multiple-dep-versions.stderr new file mode 100644 index 00000000000..5888aad8f37 --- /dev/null +++ b/tests/run-make/crate-loading/multiple-dep-versions.stderr @@ -0,0 +1,127 @@ +error[E0277]: the trait bound `dep_2_reexport::Type: Trait` is not satisfied + --> replaced + | +LL | do_something(Type); + | ------------ ^^^^ the trait `Trait` is not implemented for `dep_2_reexport::Type` + | | + | required by a bound introduced by this call + | +note: there are multiple different versions of crate `dependency` in the dependency graph + --> replaced + | +LL | pub struct Type(pub i32); + | --------------- this type implements the required trait +LL | pub trait Trait { + | ^^^^^^^^^^^^^^^ this is the required trait + | + ::: replaced + | +LL | extern crate dep_2_reexport; + | ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo` +LL | extern crate dependency; + | ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate + | + ::: replaced + | +LL | pub struct Type; + | --------------- this type doesn't implement the required trait +LL | 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 +note: required by a bound in `do_something` + --> replaced + | +LL | pub fn do_something<X: Trait>(_: X) {} + | ^^^^^ required by this bound in `do_something` + +error[E0599]: no method named `foo` found for struct `dep_2_reexport::Type` in the current scope + --> replaced + | +LL | Type.foo(); + | ^^^ method not found in `Type` + | +note: there are multiple different versions of crate `dependency` in the dependency graph + --> replaced + | +LL | pub trait Trait { + | ^^^^^^^^^^^^^^^ this is the trait that is needed +LL | fn foo(&self); + | -------------- the method is available for `dep_2_reexport::Type` here + | + ::: replaced + | +LL | use dependency::{Trait, do_something}; + | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency` + | + ::: replaced + | +LL | pub trait Trait { + | --------------- this is the trait that was imported + +error[E0599]: no function or associated item named `bar` found for struct `dep_2_reexport::Type` in the current scope + --> replaced + | +LL | Type::bar(); + | ^^^ function or associated item not found in `Type` + | +note: there are multiple different versions of crate `dependency` in the dependency graph + --> replaced + | +LL | pub trait Trait { + | ^^^^^^^^^^^^^^^ this is the trait that is needed +LL | fn foo(&self); +LL | fn bar(); + | --------- the associated function is available for `dep_2_reexport::Type` here + | + ::: replaced + | +LL | use dependency::{Trait, do_something}; + | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency` + | + ::: replaced + | +LL | pub trait Trait { + | --------------- this is the trait that was imported + +error[E0277]: the trait bound `OtherType: Trait` is not satisfied + --> replaced + | +LL | do_something(OtherType); + | ------------ ^^^^^^^^^ the trait `Trait` is not implemented for `OtherType` + | | + | required by a bound introduced by this call + | +note: there are multiple different versions of crate `dependency` in the dependency graph + --> replaced + | +LL | pub trait Trait { + | ^^^^^^^^^^^^^^^ this is the required trait + | + ::: replaced + | +LL | extern crate dep_2_reexport; + | ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo` +LL | extern crate dependency; + | ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate + | + ::: replaced + | +LL | pub struct OtherType; + | -------------------- this type doesn't implement the required trait + | + ::: replaced + | +LL | pub trait Trait { + | --------------- this is the found trait + = help: you can use `cargo tree` to explore your dependency tree +note: required by a bound in `do_something` + --> replaced + | +LL | pub fn do_something<X: Trait>(_: X) {} + | ^^^^^ required by this bound in `do_something` + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0277, E0599. +For more information about an error, try `rustc --explain E0277`. \ No newline at end of file diff --git a/tests/run-make/crate-loading/rmake.rs b/tests/run-make/crate-loading/rmake.rs index 2d5913c4bcb..6ad456e3e3e 100644 --- a/tests/run-make/crate-loading/rmake.rs +++ b/tests/run-make/crate-loading/rmake.rs @@ -3,7 +3,7 @@ //@ ignore-wasm64 // ignore-tidy-linelength -use run_make_support::{rust_lib_name, rustc}; +use run_make_support::{diff, rust_lib_name, rustc}; fn main() { rustc().input("multiple-dep-versions-1.rs").run(); @@ -13,77 +13,26 @@ fn main() { .extern_("dependency", rust_lib_name("dependency2")) .run(); - rustc() + let out = rustc() .input("multiple-dep-versions.rs") .extern_("dependency", rust_lib_name("dependency")) .extern_("dep_2_reexport", rust_lib_name("foo")) + .ui_testing() .run_fail() - .assert_stderr_contains(r#"error[E0277]: the trait bound `dep_2_reexport::Type: Trait` is not satisfied because the trait comes from a different crate version - --> multiple-dep-versions.rs:7:18 - | -7 | do_something(Type); - | ^^^^ the trait `Trait` is not implemented for `dep_2_reexport::Type` - | -note: there are multiple different versions of crate `dependency` in the dependency graph"#) - .assert_stderr_contains(r#" -3 | pub struct Type(pub i32); - | --------------- this type implements the required trait -4 | pub trait Trait { - | ^^^^^^^^^^^^^^^ this is the required trait -"#) - .assert_stderr_contains(r#" -1 | extern crate dep_2_reexport; - | ---------------------------- one version of crate `dependency` is used here, as a dependency of crate `foo` -2 | extern crate dependency; - | ------------------------ one version of crate `dependency` is used here, as a direct dependency of the current crate"#) - .assert_stderr_contains(r#" -3 | pub struct Type; - | --------------- this type doesn't implement the required trait -4 | 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"#) - .assert_stderr_contains(r#"error[E0599]: no method named `foo` found for struct `dep_2_reexport::Type` in the current scope - --> multiple-dep-versions.rs:8:10 - | -8 | Type.foo(); - | ^^^ method not found in `Type` - | -note: there are multiple different versions of crate `dependency` in the dependency graph"#) - .assert_stderr_contains(r#" -4 | pub trait Trait { - | ^^^^^^^^^^^^^^^ this is the trait that is needed -5 | fn foo(&self); - | -------------- the method is available for `dep_2_reexport::Type` here - | - ::: multiple-dep-versions.rs:4:18 - | -4 | use dependency::{Trait, do_something}; - | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#) - .assert_stderr_contains(r#" -4 | pub trait Trait { - | --------------- this is the trait that was imported"#) - .assert_stderr_contains(r#" -error[E0599]: no function or associated item named `bar` found for struct `dep_2_reexport::Type` in the current scope - --> multiple-dep-versions.rs:9:11 - | -9 | Type::bar(); - | ^^^ function or associated item not found in `Type` - | -note: there are multiple different versions of crate `dependency` in the dependency graph"#) - .assert_stderr_contains(r#" -4 | pub trait Trait { - | ^^^^^^^^^^^^^^^ this is the trait that is needed -5 | fn foo(&self); -6 | fn bar(); - | --------- the associated function is available for `dep_2_reexport::Type` here - | - ::: multiple-dep-versions.rs:4:18 - | -4 | use dependency::{Trait, do_something}; - | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#) - .assert_stderr_contains( - r#" -6 | pub struct OtherType; - | -------------------- this type doesn't implement the required trait"#); + .stderr_utf8(); + + // We don't remap all the paths, so we remap it here. + let mut lines: Vec<_> = out.lines().collect(); + for line in &mut lines { + if line.starts_with(" --> ") { + *line = " --> replaced"; + } + if line.starts_with(" ::: ") { + *line = " ::: replaced"; + } + } + diff() + .expected_file("multiple-dep-versions.stderr") + .actual_text("(rustc)", &lines.join("\n")) + .run(); } diff --git a/tests/run-make/diagnostics-traits-from-duplicate-crates/minibevy.rs b/tests/run-make/diagnostics-traits-from-duplicate-crates/minibevy.rs new file mode 100644 index 00000000000..1bc8473e08e --- /dev/null +++ b/tests/run-make/diagnostics-traits-from-duplicate-crates/minibevy.rs @@ -0,0 +1,2 @@ +pub trait Resource {} +pub struct Ray2d; diff --git a/tests/run-make/diagnostics-traits-from-duplicate-crates/minirapier.rs b/tests/run-make/diagnostics-traits-from-duplicate-crates/minirapier.rs new file mode 100644 index 00000000000..2b84332aa51 --- /dev/null +++ b/tests/run-make/diagnostics-traits-from-duplicate-crates/minirapier.rs @@ -0,0 +1 @@ +pub type Ray = minibevy::Ray2d; diff --git a/tests/run-make/diagnostics-traits-from-duplicate-crates/repro.rs b/tests/run-make/diagnostics-traits-from-duplicate-crates/repro.rs new file mode 100644 index 00000000000..90a6dfc2e15 --- /dev/null +++ b/tests/run-make/diagnostics-traits-from-duplicate-crates/repro.rs @@ -0,0 +1,14 @@ +extern crate minibevy; +extern crate minirapier; + +use minibevy::Resource; +use minirapier::Ray; + +fn insert_resource<R: Resource>(_resource: R) {} + +struct Res; +impl Resource for Res {} + +fn main() { + insert_resource(Res.into()); +} diff --git a/tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs b/tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs new file mode 100644 index 00000000000..32c4cf33896 --- /dev/null +++ b/tests/run-make/diagnostics-traits-from-duplicate-crates/rmake.rs @@ -0,0 +1,45 @@ +// Non-regression test for issue #132920 where multiple versions of the same crate are present in +// the dependency graph, and an unexpected error in a dependent crate caused an ICE in the +// unsatisfied bounds diagnostics for traits present in multiple crate versions. +// +// Setup: +// - two versions of the same crate: minibevy_a and minibevy_b +// - minirapier: depends on minibevy_a +// - repro: depends on minirapier and minibevy_b + +use run_make_support::rustc; + +fn main() { + // Prepare dependencies, mimicking a check build with cargo. + rustc() + .input("minibevy.rs") + .crate_name("minibevy") + .crate_type("lib") + .emit("metadata") + .metadata("a") + .extra_filename("-a") + .run(); + rustc() + .input("minibevy.rs") + .crate_name("minibevy") + .crate_type("lib") + .emit("metadata") + .metadata("b") + .extra_filename("-b") + .run(); + rustc() + .input("minirapier.rs") + .crate_name("minirapier") + .crate_type("lib") + .emit("metadata") + .extern_("minibevy", "libminibevy-a.rmeta") + .run(); + + // Building the main crate used to ICE here when printing the `type annotations needed` error. + rustc() + .input("repro.rs") + .extern_("minibevy", "libminibevy-b.rmeta") + .extern_("minirapier", "libminirapier.rmeta") + .run_fail() + .assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug"); +} diff --git a/tests/run-make/libstd-no-protected/rmake.rs b/tests/run-make/libstd-no-protected/rmake.rs new file mode 100644 index 00000000000..3bba59a8f4d --- /dev/null +++ b/tests/run-make/libstd-no-protected/rmake.rs @@ -0,0 +1,63 @@ +// If libstd was compiled to use protected symbols, then linking would fail if GNU ld < 2.40 were +// used. This might not be noticed, since usually we use LLD for linking, so we could end up +// distributing a version of libstd that would cause link errors for such users. + +//@ only-x86_64-unknown-linux-gnu + +use run_make_support::object::Endianness; +use run_make_support::object::read::archive::ArchiveFile; +use run_make_support::object::read::elf::{FileHeader as _, SectionHeader as _}; +use run_make_support::rfs::{read, read_dir}; +use run_make_support::{has_prefix, has_suffix, object, path, rustc, shallow_find_files, target}; + +type FileHeader = run_make_support::object::elf::FileHeader64<Endianness>; +type SymbolTable<'data> = run_make_support::object::read::elf::SymbolTable<'data, FileHeader>; + +fn main() { + // Find libstd-...rlib + let sysroot = rustc().print("sysroot").run().stdout_utf8(); + let sysroot = sysroot.trim(); + let target_sysroot = path(sysroot).join("lib/rustlib").join(target()).join("lib"); + let mut libs = shallow_find_files(&target_sysroot, |path| { + has_prefix(path, "libstd-") && has_suffix(path, ".rlib") + }); + assert_eq!(libs.len(), 1); + let libstd_path = libs.pop().unwrap(); + let archive_data = read(libstd_path); + + // Parse all the object files within the libstd archive, checking defined symbols. + let mut num_protected = 0; + let mut num_symbols = 0; + + let archive = ArchiveFile::parse(&*archive_data).unwrap(); + for member in archive.members() { + let member = member.unwrap(); + if member.name() == b"lib.rmeta" { + continue; + } + let data = member.data(&*archive_data).unwrap(); + + let header = FileHeader::parse(data).unwrap(); + let endian = header.endian().unwrap(); + let sections = header.sections(endian, data).unwrap(); + + for (section_index, section) in sections.enumerate() { + if section.sh_type(endian) == object::elf::SHT_SYMTAB { + let symbols = + SymbolTable::parse(endian, data, §ions, section_index, section).unwrap(); + for symbol in symbols.symbols() { + if symbol.st_visibility() == object::elf::STV_PROTECTED { + num_protected += 1; + } + num_symbols += 1; + } + } + } + } + + // If there were no symbols at all, then something is wrong with the test. + assert_ne!(num_symbols, 0); + + // The purpose of this test - check that no symbols have protected visibility. + assert_eq!(num_protected, 0); +} diff --git a/tests/run-make/libtest-thread-limit/rmake.rs b/tests/run-make/libtest-thread-limit/rmake.rs index 5decd802b34..fe14d2c046c 100644 --- a/tests/run-make/libtest-thread-limit/rmake.rs +++ b/tests/run-make/libtest-thread-limit/rmake.rs @@ -38,7 +38,7 @@ fn main() { // If the process ID is 0, this is the child process responsible for running the test // program. if pid == 0 { - let test = CString::new("test").unwrap(); + let test = c"test"; // The argv array should be terminated with a NULL pointer. let argv = [test.as_ptr(), std::ptr::null()]; // rlim_cur is soft limit, rlim_max is hard limit. diff --git a/tests/run-make/naked-symbol-visibility/a_rust_dylib.rs b/tests/run-make/naked-symbol-visibility/a_rust_dylib.rs index 8dd19e613bf..f98a2036544 100644 --- a/tests/run-make/naked-symbol-visibility/a_rust_dylib.rs +++ b/tests/run-make/naked-symbol-visibility/a_rust_dylib.rs @@ -1,4 +1,4 @@ -#![feature(naked_functions, asm_const, linkage)] +#![feature(naked_functions, linkage)] #![crate_type = "dylib"] use std::arch::naked_asm; @@ -38,7 +38,7 @@ pub extern "C" fn public_vanilla() -> u32 { #[naked] #[no_mangle] -pub extern "C" fn public_naked() -> u32 { +pub extern "C" fn public_naked_nongeneric() -> u32 { unsafe { naked_asm!("mov rax, 42", "ret") } } diff --git a/tests/run-make/naked-symbol-visibility/rmake.rs b/tests/run-make/naked-symbol-visibility/rmake.rs index d026196f43b..c69a9ef9eeb 100644 --- a/tests/run-make/naked-symbol-visibility/rmake.rs +++ b/tests/run-make/naked-symbol-visibility/rmake.rs @@ -17,10 +17,12 @@ fn main() { not_exported(&rdylib, "private_naked"); global_function(&rdylib, "public_vanilla"); - global_function(&rdylib, "public_naked"); + global_function(&rdylib, "public_naked_nongeneric"); not_exported(&rdylib, "public_vanilla_generic"); - not_exported(&rdylib, "public_naked_generic"); + // #[naked] functions are implicitly #[inline(never)], so they get shared regardless of + // -Zshare-generics. + global_function(&rdylib, "public_naked_generic"); global_function(&rdylib, "vanilla_external_linkage"); global_function(&rdylib, "naked_external_linkage"); diff --git a/tests/run-make/rustc-help/help-v.stdout b/tests/run-make/rustc-help/help-v.stdout index dbd67b57df2..8f6fde69c29 100644 --- a/tests/run-make/rustc-help/help-v.stdout +++ b/tests/run-make/rustc-help/help-v.stdout @@ -25,7 +25,7 @@ Options: --edition 2015|2018|2021|2024 Specify which edition of the compiler to use when compiling code. The default is 2015 and the latest - stable edition is 2021. + stable edition is 2024. --emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir] Comma separated list of types of output for the compiler to emit diff --git a/tests/run-make/rustc-help/help.stdout b/tests/run-make/rustc-help/help.stdout index a7d07162799..131efa93282 100644 --- a/tests/run-make/rustc-help/help.stdout +++ b/tests/run-make/rustc-help/help.stdout @@ -25,7 +25,7 @@ Options: --edition 2015|2018|2021|2024 Specify which edition of the compiler to use when compiling code. The default is 2015 and the latest - stable edition is 2021. + stable edition is 2024. --emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir] Comma separated list of types of output for the compiler to emit diff --git a/tests/run-make/thumb-none-qemu/rmake.rs b/tests/run-make/thumb-none-qemu/rmake.rs index a505bb013f9..9d4b426f4a1 100644 --- a/tests/run-make/thumb-none-qemu/rmake.rs +++ b/tests/run-make/thumb-none-qemu/rmake.rs @@ -27,7 +27,6 @@ fn main() { std::env::set_current_dir(CRATE).unwrap(); let target_dir = path("target"); - let manifest_path = path("Cargo.toml"); // Debug cargo() diff --git a/tests/run-make/unstable-feature-usage-metrics/lib.rs b/tests/run-make/unstable-feature-usage-metrics/lib.rs new file mode 100644 index 00000000000..2202d722c49 --- /dev/null +++ b/tests/run-make/unstable-feature-usage-metrics/lib.rs @@ -0,0 +1,9 @@ +#![feature(ascii_char)] // random lib feature +#![feature(box_patterns)] // random lang feature + +// picked arbitrary unstable features, just need a random lib and lang feature, ideally ones that +// won't be stabilized any time soon so we don't have to update this test + +fn main() { + println!("foobar"); +} diff --git a/tests/run-make/unstable-feature-usage-metrics/rmake.rs b/tests/run-make/unstable-feature-usage-metrics/rmake.rs new file mode 100644 index 00000000000..1397548a6fc --- /dev/null +++ b/tests/run-make/unstable-feature-usage-metrics/rmake.rs @@ -0,0 +1,87 @@ +//! This test checks if unstable feature usage metric dump files `unstable-feature-usage*.json` work +//! as expected. +//! +//! - Basic sanity checks on a default ICE dump. +//! +//! See <https://github.com/rust-lang/rust/issues/129485>. +//! +//! # Test history +//! +//! - forked from dump-ice-to-disk test, which has flakeyness issues on i686-mingw, I'm assuming +//! those will be present in this test as well on the same platform + +//@ ignore-windows +//FIXME(#128911): still flakey on i686-mingw. + +use std::path::{Path, PathBuf}; + +use run_make_support::rfs::create_dir_all; +use run_make_support::{ + cwd, filename_contains, has_extension, rfs, run_in_tmpdir, rustc, serde_json, + shallow_find_files, +}; + +fn find_feature_usage_metrics<P: AsRef<Path>>(dir: P) -> Vec<PathBuf> { + shallow_find_files(dir, |path| { + if filename_contains(path, "unstable_feature_usage") && has_extension(path, "json") { + true + } else { + dbg!(path); + false + } + }) +} + +fn main() { + test_metrics_dump(); + test_metrics_errors(); +} + +#[track_caller] +fn test_metrics_dump() { + run_in_tmpdir(|| { + let metrics_dir = cwd().join("metrics"); + create_dir_all(&metrics_dir); + rustc() + .input("lib.rs") + .env("RUST_BACKTRACE", "short") + .arg(format!("-Zmetrics-dir={}", metrics_dir.display())) + .run(); + let mut metrics = find_feature_usage_metrics(&metrics_dir); + let json_path = + metrics.pop().expect("there should be one metrics file in the output directory"); + + // After the `pop` above, there should be no files left. + assert!( + metrics.is_empty(), + "there should be no more than one metrics file in the output directory" + ); + + let message = rfs::read_to_string(json_path); + let parsed: serde_json::Value = + serde_json::from_str(&message).expect("metrics should be dumped as json"); + let expected = serde_json::json!( + { + "lib_features":[{"symbol":"ascii_char"}], + "lang_features":[{"symbol":"box_patterns","since":null}] + } + ); + + assert_eq!(expected, parsed); + }); +} + +#[track_caller] +fn test_metrics_errors() { + run_in_tmpdir(|| { + rustc() + .input("lib.rs") + .env("RUST_BACKTRACE", "short") + .arg("-Zmetrics-dir=invaliddirectorythatdefinitelydoesntexist") + .run_fail() + .assert_stderr_contains( + "error: cannot dump feature usage metrics: No such file or directory", + ) + .assert_stdout_not_contains("internal compiler error"); + }); +} diff --git a/tests/rustdoc-gui/deref-block.goml b/tests/rustdoc-gui/deref-block.goml index 24f612f8a6f..97930b61ef4 100644 --- a/tests/rustdoc-gui/deref-block.goml +++ b/tests/rustdoc-gui/deref-block.goml @@ -20,8 +20,12 @@ assert-css: (".big-toggle summary::before", { "left": "-11px", "top": "9px", }) -// It should have the same X position as the other toggles. -compare-elements-position: (".big-toggle summary::before", ".method-toggle summary::before", ["x"]) +// It should have a slightly different X position as the other toggles. +store-position: (".big-toggle summary::before", {"x": big_toggle}) +store-position: (".method-toggle summary::before", {"x": small_toggle}) +assert: |big_toggle| < |small_toggle| +// Margin is 0.5em so around 8 px. +assert: |small_toggle| - |big_toggle| < 10 // But still shouldn't have the same Y position. compare-elements-position-false: ( ".big-toggle summary::before", diff --git a/tests/rustdoc-gui/docblock-table-overflow.goml b/tests/rustdoc-gui/docblock-table-overflow.goml index 1ca919d1eab..abfa820ef27 100644 --- a/tests/rustdoc-gui/docblock-table-overflow.goml +++ b/tests/rustdoc-gui/docblock-table-overflow.goml @@ -16,6 +16,6 @@ compare-elements-property: ( "#implementations-list > details .docblock > p", ["scrollWidth"], ) -assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "816"}) +assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "835"}) // However, since there is overflow in the <table>, its scroll width is bigger. assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1572"}) diff --git a/tests/rustdoc-gui/item-info-alignment.goml b/tests/rustdoc-gui/item-info-alignment.goml index cd0624056b9..075722bb539 100644 --- a/tests/rustdoc-gui/item-info-alignment.goml +++ b/tests/rustdoc-gui/item-info-alignment.goml @@ -4,7 +4,9 @@ go-to: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html" // First, we try it in "desktop" mode. set-window-size: (1200, 870) +wait-for-size: ("body", {"width": 1200}) compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"]) // Next, we try it in "mobile" mode (max-width: 700px). set-window-size: (650, 650) +wait-for-size: ("body", {"width": 650}) compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"]) diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml index 1636e149692..b5b0052fe61 100644 --- a/tests/rustdoc-gui/item-info.goml +++ b/tests/rustdoc-gui/item-info.goml @@ -19,7 +19,7 @@ store-position: ( "//*[@class='stab portability']//code[normalize-space()='Win32_System_Diagnostics']", {"x": second_line_x, "y": second_line_y}, ) -assert: |first_line_x| != |second_line_x| && |first_line_x| == 516 && |second_line_x| == 272 +assert: |first_line_x| != |second_line_x| && |first_line_x| == 521 && |second_line_x| == 277 assert: |first_line_y| != |second_line_y| && |first_line_y| == 718 && |second_line_y| == 741 // Now we ensure that they're not rendered on the same line. diff --git a/tests/rustdoc-gui/methods-left-margin.goml b/tests/rustdoc-gui/methods-left-margin.goml index 1003cec33f9..31b53faf756 100644 --- a/tests/rustdoc-gui/methods-left-margin.goml +++ b/tests/rustdoc-gui/methods-left-margin.goml @@ -1,7 +1,6 @@ // This test is to ensure that methods are correctly aligned on the left side. go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" - // First we ensure that we have methods with and without documentation. assert: ".impl-items > details.method-toggle > summary > section.method" assert: ".impl-items > section.method" diff --git a/tests/rustdoc-gui/notable-trait.goml b/tests/rustdoc-gui/notable-trait.goml index e02974e6082..4624fb80b37 100644 --- a/tests/rustdoc-gui/notable-trait.goml +++ b/tests/rustdoc-gui/notable-trait.goml @@ -62,9 +62,9 @@ define-function: ( // We start with a wide screen. set-window-size: (1100, 600) call-function: ("check-notable-tooltip-position-complete", { - "x": 677, - "i_x": 955, - "popover_x": 463, + "x": 682, + "i_x": 960, + "popover_x": 468, }) // Now only the `i` should be on the next line. @@ -78,16 +78,16 @@ compare-elements-position-false: ( // Now both the `i` and the struct name should be on the next line. set-window-size: (980, 600) call-function: ("check-notable-tooltip-position", { - "x": 245, - "i_x": 523, + "x": 250, + "i_x": 528, }) // Checking on mobile now. set-window-size: (650, 600) wait-for-size: ("body", {"width": 650}) call-function: ("check-notable-tooltip-position-complete", { - "x": 25, - "i_x": 303, + "x": 26, + "i_x": 305, "popover_x": 0, }) diff --git a/tests/rustdoc-gui/toggle-docs-mobile.goml b/tests/rustdoc-gui/toggle-docs-mobile.goml index b69aa6e30ca..be12e4c19b3 100644 --- a/tests/rustdoc-gui/toggle-docs-mobile.goml +++ b/tests/rustdoc-gui/toggle-docs-mobile.goml @@ -18,7 +18,7 @@ assert-position: ("#implementations-list > details > summary::before", {"x": 4}) // Assert the position of the toggle on a method. assert-position: ( "#trait-implementations-list .impl-items .method-toggle > summary::before", - {"x": 4}, + {"x": 6}, ) // Now we do the same but with a little bigger width diff --git a/tests/rustdoc-json/impls/trait-for-dyn-trait.rs b/tests/rustdoc-json/impls/trait-for-dyn-trait.rs new file mode 100644 index 00000000000..0fbb4df0028 --- /dev/null +++ b/tests/rustdoc-json/impls/trait-for-dyn-trait.rs @@ -0,0 +1,15 @@ +//@ set t1 = '$.index[*][?(@.name=="T1")].id' +pub trait T1 {} + +//@ set t2 = '$.index[*][?(@.name=="T2")].id' +pub trait T2 {} + +/// Fun impl +impl T1 for dyn T2 {} + +//@ set impl = '$.index[*][?(@.docs=="Fun impl")].id' +//@ is '$.index[*][?(@.name=="T1")].inner.trait.implementations[*]' $impl +//@ is '$.index[*][?(@.name=="T2")].inner.trait.implementations' [] + +//@ is '$.index[*][?(@.docs=="Fun impl")].inner.impl.trait.id' $t1 +//@ is '$.index[*][?(@.docs=="Fun impl")].inner.impl.for.dyn_trait.traits[*].trait.id' $t2 diff --git a/tests/rustdoc-json/statics/extern.rs b/tests/rustdoc-json/statics/extern.rs new file mode 100644 index 00000000000..d38fdf1cd1c --- /dev/null +++ b/tests/rustdoc-json/statics/extern.rs @@ -0,0 +1,39 @@ +// ignore-tidy-linelength +//@ edition: 2021 + +extern "C" { + //@ is '$.index[*][?(@.name=="A")].inner.static.is_unsafe' true + //@ is '$.index[*][?(@.name=="A")].inner.static.is_mutable' false + pub static A: i32; + //@ is '$.index[*][?(@.name=="B")].inner.static.is_unsafe' true + //@ is '$.index[*][?(@.name=="B")].inner.static.is_mutable' true + pub static mut B: i32; + + // items in unadorned `extern` blocks cannot have safety qualifiers +} + +unsafe extern "C" { + //@ is '$.index[*][?(@.name=="C")].inner.static.is_unsafe' true + //@ is '$.index[*][?(@.name=="C")].inner.static.is_mutable' false + pub static C: i32; + //@ is '$.index[*][?(@.name=="D")].inner.static.is_unsafe' true + //@ is '$.index[*][?(@.name=="D")].inner.static.is_mutable' true + pub static mut D: i32; + + //@ is '$.index[*][?(@.name=="E")].inner.static.is_unsafe' false + //@ is '$.index[*][?(@.name=="E")].inner.static.is_mutable' false + pub safe static E: i32; + //@ is '$.index[*][?(@.name=="F")].inner.static.is_unsafe' false + //@ is '$.index[*][?(@.name=="F")].inner.static.is_mutable' true + pub safe static mut F: i32; + + //@ is '$.index[*][?(@.name=="G")].inner.static.is_unsafe' true + //@ is '$.index[*][?(@.name=="G")].inner.static.is_mutable' false + pub unsafe static G: i32; + //@ is '$.index[*][?(@.name=="H")].inner.static.is_unsafe' true + //@ is '$.index[*][?(@.name=="H")].inner.static.is_mutable' true + pub unsafe static mut H: i32; +} + +//@ ismany '$.index[*][?(@.inner.static)].inner.static.expr' '""' '""' '""' '""' '""' '""' '""' '""' +//@ ismany '$.index[*][?(@.inner.static)].inner.static.type.primitive' '"i32"' '"i32"' '"i32"' '"i32"' '"i32"' '"i32"' '"i32"' '"i32"' diff --git a/tests/rustdoc-json/statics/statics.rs b/tests/rustdoc-json/statics/statics.rs new file mode 100644 index 00000000000..a8af23cc87d --- /dev/null +++ b/tests/rustdoc-json/statics/statics.rs @@ -0,0 +1,12 @@ +//@ is '$.index[*][?(@.name=="A")].inner.static.type.primitive' '"i32"' +//@ is '$.index[*][?(@.name=="A")].inner.static.is_mutable' false +//@ is '$.index[*][?(@.name=="A")].inner.static.expr' '"5"' +//@ is '$.index[*][?(@.name=="A")].inner.static.is_unsafe' false +pub static A: i32 = 5; + +//@ is '$.index[*][?(@.name=="B")].inner.static.type.primitive' '"u32"' +//@ is '$.index[*][?(@.name=="B")].inner.static.is_mutable' true +// Expr value isn't gaurenteed, it'd be fine to change it. +//@ is '$.index[*][?(@.name=="B")].inner.static.expr' '"_"' +//@ is '$.index[*][?(@.name=="B")].inner.static.is_unsafe' false +pub static mut B: u32 = 2 + 3; diff --git a/tests/rustdoc-ui/2024-doctests-checks.rs b/tests/rustdoc-ui/2024-doctests-checks.rs index 464cf5b200d..f3e4e10f571 100644 --- a/tests/rustdoc-ui/2024-doctests-checks.rs +++ b/tests/rustdoc-ui/2024-doctests-checks.rs @@ -1,5 +1,6 @@ //@ check-pass -//@ compile-flags: --test --test-args=--test-threads=1 -Zunstable-options --edition 2024 +//@ edition: 2024 +//@ compile-flags: --test --test-args=--test-threads=1 //@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL" diff --git a/tests/rustdoc-ui/2024-doctests-checks.stdout b/tests/rustdoc-ui/2024-doctests-checks.stdout index d1064084a85..534fe466fe7 100644 --- a/tests/rustdoc-ui/2024-doctests-checks.stdout +++ b/tests/rustdoc-ui/2024-doctests-checks.stdout @@ -1,12 +1,12 @@ running 1 test -test $DIR/2024-doctests-checks.rs - Foo (line 7) ... ok +test $DIR/2024-doctests-checks.rs - Foo (line 8) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME running 1 test -test $DIR/2024-doctests-checks.rs - Foo (line 14) ... ok +test $DIR/2024-doctests-checks.rs - Foo (line 15) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/rustdoc-ui/2024-doctests-crate-attribute.rs b/tests/rustdoc-ui/2024-doctests-crate-attribute.rs index 4984fdfe194..a353fc7cc44 100644 --- a/tests/rustdoc-ui/2024-doctests-crate-attribute.rs +++ b/tests/rustdoc-ui/2024-doctests-crate-attribute.rs @@ -1,5 +1,6 @@ //@ check-pass -//@ compile-flags: --test --test-args=--test-threads=1 -Zunstable-options --edition 2024 +//@ edition: 2024 +//@ compile-flags: --test --test-args=--test-threads=1 //@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL" diff --git a/tests/rustdoc-ui/2024-doctests-crate-attribute.stdout b/tests/rustdoc-ui/2024-doctests-crate-attribute.stdout index 29702ce8929..c084ac4522e 100644 --- a/tests/rustdoc-ui/2024-doctests-crate-attribute.stdout +++ b/tests/rustdoc-ui/2024-doctests-crate-attribute.stdout @@ -1,12 +1,12 @@ running 1 test -test $DIR/2024-doctests-crate-attribute.rs - Foo (line 19) ... ok +test $DIR/2024-doctests-crate-attribute.rs - Foo (line 20) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME running 1 test -test $DIR/2024-doctests-crate-attribute.rs - Foo (line 10) ... ok +test $DIR/2024-doctests-crate-attribute.rs - Foo (line 11) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/rustdoc-ui/coverage/doc-examples-json.stdout b/tests/rustdoc-ui/coverage/doc-examples-json.stdout index 92f58556975..070fed0783e 100644 --- a/tests/rustdoc-ui/coverage/doc-examples-json.stdout +++ b/tests/rustdoc-ui/coverage/doc-examples-json.stdout @@ -1 +1 @@ -{"$DIR/doc-examples-json.rs":{"total":3,"with_docs":2,"total_examples":2,"with_examples":1}} +{"$DIR/doc-examples-json.rs":{"total":3,"with_docs":2,"total_examples":1,"with_examples":1}} diff --git a/tests/rustdoc-ui/coverage/doc-examples.stdout b/tests/rustdoc-ui/coverage/doc-examples.stdout index 8188740f873..793adeb3518 100644 --- a/tests/rustdoc-ui/coverage/doc-examples.stdout +++ b/tests/rustdoc-ui/coverage/doc-examples.stdout @@ -1,7 +1,7 @@ +-------------------------------------+------------+------------+------------+------------+ | File | Documented | Percentage | Examples | Percentage | +-------------------------------------+------------+------------+------------+------------+ -| ...tdoc-ui/coverage/doc-examples.rs | 4 | 100.0% | 1 | 25.0% | +| ...tdoc-ui/coverage/doc-examples.rs | 4 | 100.0% | 1 | 33.3% | +-------------------------------------+------------+------------+------------+------------+ -| Total | 4 | 100.0% | 1 | 25.0% | +| Total | 4 | 100.0% | 1 | 33.3% | +-------------------------------------+------------+------------+------------+------------+ diff --git a/tests/rustdoc-ui/coverage/json.stdout b/tests/rustdoc-ui/coverage/json.stdout index c2be73ce3ed..25fd896baf1 100644 --- a/tests/rustdoc-ui/coverage/json.stdout +++ b/tests/rustdoc-ui/coverage/json.stdout @@ -1 +1 @@ -{"$DIR/json.rs":{"total":17,"with_docs":12,"total_examples":15,"with_examples":6}} +{"$DIR/json.rs":{"total":17,"with_docs":12,"total_examples":13,"with_examples":6}} diff --git a/tests/rustdoc-ui/doctest/auxiliary/extern_macros_2024.rs b/tests/rustdoc-ui/doctest/auxiliary/extern_macros_2024.rs index 354427000bf..388b8f310ae 100644 --- a/tests/rustdoc-ui/doctest/auxiliary/extern_macros_2024.rs +++ b/tests/rustdoc-ui/doctest/auxiliary/extern_macros_2024.rs @@ -1,5 +1,4 @@ //@ edition:2024 -//@ compile-flags:-Z unstable-options #![crate_name="extern_macros"] #[macro_export] macro_rules! attrs_on_struct { diff --git a/tests/rustdoc-ui/doctest/dead-code-2024.rs b/tests/rustdoc-ui/doctest/dead-code-2024.rs index 4c77112e61a..41459c5e651 100644 --- a/tests/rustdoc-ui/doctest/dead-code-2024.rs +++ b/tests/rustdoc-ui/doctest/dead-code-2024.rs @@ -1,6 +1,7 @@ // This test ensures that the 2024 edition merged doctest will not use `#[allow(unused)]`. -//@ compile-flags:--test -Zunstable-options --edition 2024 +//@ edition: 2024 +//@ compile-flags:--test //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ failure-status: 101 diff --git a/tests/rustdoc-ui/doctest/dead-code-2024.stdout b/tests/rustdoc-ui/doctest/dead-code-2024.stdout index 69dd4e2ede1..a943a177e10 100644 --- a/tests/rustdoc-ui/doctest/dead-code-2024.stdout +++ b/tests/rustdoc-ui/doctest/dead-code-2024.stdout @@ -1,18 +1,18 @@ running 1 test -test $DIR/dead-code-2024.rs - f (line 12) - compile ... FAILED +test $DIR/dead-code-2024.rs - f (line 13) - compile ... FAILED failures: ----- $DIR/dead-code-2024.rs - f (line 12) stdout ---- +---- $DIR/dead-code-2024.rs - f (line 13) stdout ---- error: trait `T` is never used - --> $DIR/dead-code-2024.rs:13:7 + --> $DIR/dead-code-2024.rs:14:7 | LL | trait T { fn f(); } | ^ | note: the lint level is defined here - --> $DIR/dead-code-2024.rs:11:9 + --> $DIR/dead-code-2024.rs:12:9 | LL | #![deny(warnings)] | ^^^^^^^^ @@ -23,7 +23,7 @@ error: aborting due to 1 previous error Couldn't compile the test. failures: - $DIR/dead-code-2024.rs - f (line 12) + $DIR/dead-code-2024.rs - f (line 13) test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/rustdoc-ui/doctest/doctest-output-include-fail.rs b/tests/rustdoc-ui/doctest/doctest-output-include-fail.rs index bae61992eb2..58612b682a0 100644 --- a/tests/rustdoc-ui/doctest/doctest-output-include-fail.rs +++ b/tests/rustdoc-ui/doctest/doctest-output-include-fail.rs @@ -1,5 +1,5 @@ //@ edition:2024 -//@ compile-flags:--test --test-args=--test-threads=1 -Z unstable-options +//@ compile-flags:--test --test-args=--test-threads=1 //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ failure-status: 101 diff --git a/tests/rustdoc-ui/doctest/doctest-output.rs b/tests/rustdoc-ui/doctest/doctest-output.rs index 0e5ccf0b090..946bc550b12 100644 --- a/tests/rustdoc-ui/doctest/doctest-output.rs +++ b/tests/rustdoc-ui/doctest/doctest-output.rs @@ -4,7 +4,7 @@ //@[edition2015]compile-flags:--test --test-args=--test-threads=1 //@[edition2024]edition:2015 //@[edition2024]aux-build:extern_macros.rs -//@[edition2024]compile-flags:--test --test-args=--test-threads=1 -Z unstable-options +//@[edition2024]compile-flags:--test --test-args=--test-threads=1 //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ check-pass diff --git a/tests/rustdoc-ui/doctest/failed-doctest-should-panic.rs b/tests/rustdoc-ui/doctest/failed-doctest-should-panic.rs index 4018e37105f..d057218688c 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-should-panic.rs +++ b/tests/rustdoc-ui/doctest/failed-doctest-should-panic.rs @@ -1,7 +1,8 @@ // FIXME: if/when the output of the test harness can be tested on its own, this test should be // adapted to use that, and that normalize line can go away -//@ compile-flags:--test -Z unstable-options --edition 2024 +//@ edition: 2024 +//@ compile-flags:--test //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ failure-status: 101 diff --git a/tests/rustdoc-ui/doctest/failed-doctest-should-panic.stdout b/tests/rustdoc-ui/doctest/failed-doctest-should-panic.stdout index cb3456e087e..90c0463d832 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-should-panic.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-should-panic.stdout @@ -1,14 +1,14 @@ running 1 test -test $DIR/failed-doctest-should-panic.rs - Foo (line 9) - should panic ... FAILED +test $DIR/failed-doctest-should-panic.rs - Foo (line 10) - should panic ... FAILED failures: ----- $DIR/failed-doctest-should-panic.rs - Foo (line 9) stdout ---- +---- $DIR/failed-doctest-should-panic.rs - Foo (line 10) stdout ---- note: test did not panic as expected failures: - $DIR/failed-doctest-should-panic.rs - Foo (line 9) + $DIR/failed-doctest-should-panic.rs - Foo (line 10) test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs b/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs index 4c21d542951..754791361e8 100644 --- a/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs +++ b/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs @@ -1,4 +1,5 @@ -//@ compile-flags:--test --test-args=--test-threads=1 -Zunstable-options --edition 2024 +//@ edition: 2024 +//@ compile-flags:--test --test-args=--test-threads=1 //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ check-pass diff --git a/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout b/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout index f2cb1e7e72f..a32da0aeb96 100644 --- a/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout +++ b/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout @@ -1,7 +1,7 @@ running 2 tests -test $DIR/merged-ignore-no_run.rs - ignored (line 6) ... ignored -test $DIR/merged-ignore-no_run.rs - no_run (line 11) - compile ... ok +test $DIR/merged-ignore-no_run.rs - ignored (line 7) ... ignored +test $DIR/merged-ignore-no_run.rs - no_run (line 12) - compile ... ok test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/rustdoc-ui/doctest/relative-path-include-bytes-132203.rs b/tests/rustdoc-ui/doctest/relative-path-include-bytes-132203.rs index b393d126306..5a1d4d0a60d 100644 --- a/tests/rustdoc-ui/doctest/relative-path-include-bytes-132203.rs +++ b/tests/rustdoc-ui/doctest/relative-path-include-bytes-132203.rs @@ -6,7 +6,7 @@ //@[edition2015]compile-flags:--test --test-args=--test-threads=1 //@[edition2024]edition:2024 //@[edition2024]check-pass -//@[edition2024]compile-flags:--test --test-args=--test-threads=1 -Z unstable-options +//@[edition2024]compile-flags:--test --test-args=--test-threads=1 //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" diff --git a/tests/rustdoc-ui/doctest/standalone-warning-2024.rs b/tests/rustdoc-ui/doctest/standalone-warning-2024.rs index aac43031546..35d1c738bb1 100644 --- a/tests/rustdoc-ui/doctest/standalone-warning-2024.rs +++ b/tests/rustdoc-ui/doctest/standalone-warning-2024.rs @@ -1,6 +1,7 @@ // This test checks that it will output warnings for usage of `standalone` or `standalone_crate`. -//@ compile-flags:--test -Zunstable-options --edition 2024 +//@ edition: 2024 +//@ compile-flags:--test //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL" diff --git a/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr b/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr index d69d03d8657..bfc1e919404 100644 --- a/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr +++ b/tests/rustdoc-ui/doctest/standalone-warning-2024.stderr @@ -1,34 +1,34 @@ error: unknown attribute `standalone` - --> $DIR/standalone-warning-2024.rs:10:1 + --> $DIR/standalone-warning-2024.rs:11:1 | -10 | / //! ```standalone -11 | | //! bla -12 | | //! ``` -13 | | //! -14 | | //! ```standalone-crate -15 | | //! bla -16 | | //! ``` +11 | / //! ```standalone +12 | | //! bla +13 | | //! ``` +14 | | //! +15 | | //! ```standalone-crate +16 | | //! bla +17 | | //! ``` | |_______^ | = help: use `standalone_crate` to compile this code block separately = help: this code block may be skipped during testing, because unknown attributes are treated as markers for code samples written in other programming languages, unless it is also explicitly marked as `rust` note: the lint level is defined here - --> $DIR/standalone-warning-2024.rs:8:9 + --> $DIR/standalone-warning-2024.rs:9:9 | -8 | #![deny(warnings)] +9 | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]` error: unknown attribute `standalone-crate` - --> $DIR/standalone-warning-2024.rs:10:1 + --> $DIR/standalone-warning-2024.rs:11:1 | -10 | / //! ```standalone -11 | | //! bla -12 | | //! ``` -13 | | //! -14 | | //! ```standalone-crate -15 | | //! bla -16 | | //! ``` +11 | / //! ```standalone +12 | | //! bla +13 | | //! ``` +14 | | //! +15 | | //! ```standalone-crate +16 | | //! bla +17 | | //! ``` | |_______^ | = help: use `standalone_crate` to compile this code block separately diff --git a/tests/rustdoc-ui/doctest/wrong-ast-2024.rs b/tests/rustdoc-ui/doctest/wrong-ast-2024.rs index 7b4fa8fd2c9..a1455c01bc6 100644 --- a/tests/rustdoc-ui/doctest/wrong-ast-2024.rs +++ b/tests/rustdoc-ui/doctest/wrong-ast-2024.rs @@ -1,4 +1,5 @@ -//@ compile-flags:--test --test-args=--test-threads=1 -Zunstable-options --edition 2024 +//@ edition: 2024 +//@ compile-flags:--test --test-args=--test-threads=1 //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL" diff --git a/tests/rustdoc-ui/doctest/wrong-ast-2024.stdout b/tests/rustdoc-ui/doctest/wrong-ast-2024.stdout index 22c8ce468fd..62e1fb10b9f 100644 --- a/tests/rustdoc-ui/doctest/wrong-ast-2024.stdout +++ b/tests/rustdoc-ui/doctest/wrong-ast-2024.stdout @@ -1,17 +1,17 @@ running 1 test -test $DIR/wrong-ast-2024.rs - three (line 17) - should panic ... ok +test $DIR/wrong-ast-2024.rs - three (line 18) - should panic ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME running 2 tests -test $DIR/wrong-ast-2024.rs - one (line 7) ... FAILED -test $DIR/wrong-ast-2024.rs - two (line 12) ... FAILED +test $DIR/wrong-ast-2024.rs - one (line 8) ... FAILED +test $DIR/wrong-ast-2024.rs - two (line 13) ... FAILED failures: ----- $DIR/wrong-ast-2024.rs - one (line 7) stdout ---- +---- $DIR/wrong-ast-2024.rs - one (line 8) stdout ---- error[E0758]: unterminated block comment --> $DIR/wrong-ast-2024.rs:$LINE:$COL | @@ -22,7 +22,7 @@ error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0758`. Couldn't compile the test. ----- $DIR/wrong-ast-2024.rs - two (line 12) stdout ---- +---- $DIR/wrong-ast-2024.rs - two (line 13) stdout ---- error: unexpected closing delimiter: `}` --> $DIR/wrong-ast-2024.rs:$LINE:$COL | @@ -34,8 +34,8 @@ error: aborting due to 1 previous error Couldn't compile the test. failures: - $DIR/wrong-ast-2024.rs - one (line 7) - $DIR/wrong-ast-2024.rs - two (line 12) + $DIR/wrong-ast-2024.rs - one (line 8) + $DIR/wrong-ast-2024.rs - two (line 13) test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/rustdoc-ui/intra-doc/auxiliary/in-proc-item-comment.rs b/tests/rustdoc-ui/intra-doc/auxiliary/in-proc-item-comment.rs new file mode 100644 index 00000000000..5d3d3c196e1 --- /dev/null +++ b/tests/rustdoc-ui/intra-doc/auxiliary/in-proc-item-comment.rs @@ -0,0 +1,20 @@ +//@ force-host +//@ no-prefer-dynamic +#![crate_type = "proc-macro"] + +extern crate proc_macro; +use proc_macro::TokenStream; + +mod view {} + +/// [`view`] +#[proc_macro] +pub fn f(_: TokenStream) -> TokenStream { + todo!() +} + +/// [`f()`] +#[proc_macro] +pub fn g(_: TokenStream) -> TokenStream { + todo!() +} diff --git a/tests/rustdoc-ui/intra-doc/pub-proc-item.rs b/tests/rustdoc-ui/intra-doc/pub-proc-item.rs new file mode 100644 index 00000000000..413efb40b0d --- /dev/null +++ b/tests/rustdoc-ui/intra-doc/pub-proc-item.rs @@ -0,0 +1,8 @@ +//@ aux-build:in-proc-item-comment.rs +//@ check-pass + +// issue#132743 + +extern crate in_proc_item_comment; + +pub use in_proc_item_comment::{f, g}; diff --git a/tests/rustdoc-ui/lints/check.rs b/tests/rustdoc-ui/lints/check.rs index 391ba517077..058c5d6c468 100644 --- a/tests/rustdoc-ui/lints/check.rs +++ b/tests/rustdoc-ui/lints/check.rs @@ -4,7 +4,6 @@ #![feature(rustdoc_missing_doc_code_examples)] //~^ WARN -//~^^ WARN #![warn(missing_docs)] #![warn(rustdoc::missing_doc_code_examples)] diff --git a/tests/rustdoc-ui/lints/check.stderr b/tests/rustdoc-ui/lints/check.stderr index acdb8128443..f1f36e8830d 100644 --- a/tests/rustdoc-ui/lints/check.stderr +++ b/tests/rustdoc-ui/lints/check.stderr @@ -4,19 +4,20 @@ warning: missing documentation for the crate LL | / #![feature(rustdoc_missing_doc_code_examples)] LL | | LL | | +LL | | #![warn(missing_docs)] ... | LL | | LL | | pub fn foo() {} | |_______________^ | note: the lint level is defined here - --> $DIR/check.rs:9:9 + --> $DIR/check.rs:8:9 | LL | #![warn(missing_docs)] | ^^^^^^^^^^^^ warning: missing documentation for a function - --> $DIR/check.rs:13:1 + --> $DIR/check.rs:12:1 | LL | pub fn foo() {} | ^^^^^^^^^^^^ @@ -26,34 +27,23 @@ warning: no documentation found for this crate's top-level module = help: The following guide may be of use: https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html note: the lint level is defined here - --> $DIR/check.rs:11:9 + --> $DIR/check.rs:10:9 | LL | #![warn(rustdoc::all)] | ^^^^^^^^^^^^ = note: `#[warn(rustdoc::missing_crate_level_docs)]` implied by `#[warn(rustdoc::all)]` warning: missing code example in this documentation - --> $DIR/check.rs:5:1 + --> $DIR/check.rs:12:1 | -LL | / #![feature(rustdoc_missing_doc_code_examples)] -LL | | -LL | | -... | -LL | | -LL | | pub fn foo() {} - | |_______________^ +LL | pub fn foo() {} + | ^^^^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/check.rs:10:9 + --> $DIR/check.rs:9:9 | LL | #![warn(rustdoc::missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -warning: missing code example in this documentation - --> $DIR/check.rs:13:1 - | -LL | pub fn foo() {} - | ^^^^^^^^^^^^^^^ - -warning: 5 warnings emitted +warning: 4 warnings emitted diff --git a/tests/rustdoc-ui/lints/doc-without-codeblock.rs b/tests/rustdoc-ui/lints/doc-without-codeblock.rs index 86d7c83d335..ccb241d4037 100644 --- a/tests/rustdoc-ui/lints/doc-without-codeblock.rs +++ b/tests/rustdoc-ui/lints/doc-without-codeblock.rs @@ -1,4 +1,4 @@ -#![feature(rustdoc_missing_doc_code_examples)] //~ ERROR missing code example in this documentation +#![feature(rustdoc_missing_doc_code_examples)] #![deny(rustdoc::missing_doc_code_examples)] /// Some docs. @@ -6,7 +6,6 @@ pub struct Foo; /// And then, the princess died. -//~^ ERROR missing code example in this documentation pub mod foo { /// Or maybe not because she saved herself! //~^ ERROR missing code example in this documentation diff --git a/tests/rustdoc-ui/lints/doc-without-codeblock.stderr b/tests/rustdoc-ui/lints/doc-without-codeblock.stderr index ebf2a2d54f7..d230f160693 100644 --- a/tests/rustdoc-ui/lints/doc-without-codeblock.stderr +++ b/tests/rustdoc-ui/lints/doc-without-codeblock.stderr @@ -1,14 +1,8 @@ error: missing code example in this documentation - --> $DIR/doc-without-codeblock.rs:1:1 + --> $DIR/doc-without-codeblock.rs:10:5 | -LL | / #![feature(rustdoc_missing_doc_code_examples)] -LL | | #![deny(rustdoc::missing_doc_code_examples)] -LL | | -LL | | /// Some docs. -... | -LL | | } -LL | | } - | |_^ +LL | /// Or maybe not because she saved herself! + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/doc-without-codeblock.rs:2:9 @@ -17,22 +11,10 @@ LL | #![deny(rustdoc::missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing code example in this documentation - --> $DIR/doc-without-codeblock.rs:8:1 - | -LL | /// And then, the princess died. - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: missing code example in this documentation - --> $DIR/doc-without-codeblock.rs:11:5 - | -LL | /// Or maybe not because she saved herself! - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: missing code example in this documentation --> $DIR/doc-without-codeblock.rs:4:1 | LL | /// Some docs. | ^^^^^^^^^^^^^^ -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors diff --git a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs index 40f35728d79..8e5c31d50ed 100644 --- a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs +++ b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.rs @@ -17,7 +17,7 @@ pub fn test() { } #[allow(missing_docs)] -pub mod module1 { //~ ERROR +pub mod module1 { } #[allow(rustdoc::missing_doc_code_examples)] diff --git a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr index f9331250154..22533b9816a 100644 --- a/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr +++ b/tests/rustdoc-ui/lints/lint-missing-doc-code-example.stderr @@ -1,8 +1,8 @@ error: missing code example in this documentation - --> $DIR/lint-missing-doc-code-example.rs:20:1 + --> $DIR/lint-missing-doc-code-example.rs:38:3 | -LL | pub mod module1 { - | ^^^^^^^^^^^^^^^ +LL | /// doc + | ^^^^^^^ | note: the lint level is defined here --> $DIR/lint-missing-doc-code-example.rs:3:9 @@ -11,12 +11,6 @@ LL | #![deny(rustdoc::missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing code example in this documentation - --> $DIR/lint-missing-doc-code-example.rs:38:3 - | -LL | /// doc - | ^^^^^^^ - -error: missing code example in this documentation --> $DIR/lint-missing-doc-code-example.rs:50:1 | LL | /// Doc @@ -34,5 +28,5 @@ error: missing code example in this documentation LL | /// Doc | ^^^^^^^ -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors diff --git a/tests/rustdoc-ui/show-coverage-json.stdout b/tests/rustdoc-ui/show-coverage-json.stdout index ed5b5a60212..e6e882b2c57 100644 --- a/tests/rustdoc-ui/show-coverage-json.stdout +++ b/tests/rustdoc-ui/show-coverage-json.stdout @@ -1 +1 @@ -{"$DIR/show-coverage-json.rs":{"total":2,"with_docs":1,"total_examples":2,"with_examples":1}} +{"$DIR/show-coverage-json.rs":{"total":2,"with_docs":1,"total_examples":1,"with_examples":1}} diff --git a/tests/rustdoc-ui/show-coverage.stdout b/tests/rustdoc-ui/show-coverage.stdout index b3b7679771f..b9e0316545e 100644 --- a/tests/rustdoc-ui/show-coverage.stdout +++ b/tests/rustdoc-ui/show-coverage.stdout @@ -1,7 +1,7 @@ +-------------------------------------+------------+------------+------------+------------+ | File | Documented | Percentage | Examples | Percentage | +-------------------------------------+------------+------------+------------+------------+ -| ...ests/rustdoc-ui/show-coverage.rs | 1 | 50.0% | 1 | 50.0% | +| ...ests/rustdoc-ui/show-coverage.rs | 1 | 50.0% | 1 | 100.0% | +-------------------------------------+------------+------------+------------+------------+ -| Total | 1 | 50.0% | 1 | 50.0% | +| Total | 1 | 50.0% | 1 | 100.0% | +-------------------------------------+------------+------------+------------+------------+ diff --git a/tests/rustdoc-ui/unable-fulfill-trait.rs b/tests/rustdoc-ui/unable-fulfill-trait.rs index 4edc7ab76c1..49dce32072b 100644 --- a/tests/rustdoc-ui/unable-fulfill-trait.rs +++ b/tests/rustdoc-ui/unable-fulfill-trait.rs @@ -3,7 +3,6 @@ pub struct Foo<'a, 'b, T> { field1: dyn Bar<'a, 'b>, //~^ ERROR - //~| ERROR } pub trait Bar<'x, 's, U> diff --git a/tests/rustdoc-ui/unable-fulfill-trait.stderr b/tests/rustdoc-ui/unable-fulfill-trait.stderr index 12e53546cda..2786a005cd1 100644 --- a/tests/rustdoc-ui/unable-fulfill-trait.stderr +++ b/tests/rustdoc-ui/unable-fulfill-trait.stderr @@ -5,7 +5,7 @@ LL | field1: dyn Bar<'a, 'b>, | ^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `U` - --> $DIR/unable-fulfill-trait.rs:9:11 + --> $DIR/unable-fulfill-trait.rs:8:11 | LL | pub trait Bar<'x, 's, U> | ^^^ - @@ -14,13 +14,6 @@ help: add missing generic argument LL | field1: dyn Bar<'a, 'b, U>, | +++ -error[E0227]: ambiguous lifetime bound, explicit lifetime bound required - --> $DIR/unable-fulfill-trait.rs:4:13 - | -LL | field1: dyn Bar<'a, 'b>, - | ^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0107, E0227. -For more information about an error, try `rustc --explain E0107`. +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/rustdoc-ui/unescaped_backticks.rs b/tests/rustdoc-ui/unescaped_backticks.rs index e813fba4717..8d6239296bf 100644 --- a/tests/rustdoc-ui/unescaped_backticks.rs +++ b/tests/rustdoc-ui/unescaped_backticks.rs @@ -218,7 +218,7 @@ pub mod rustc { pub fn with_options() {} /// Subtracts `set from `row`. `set` can be either `BitSet` or - /// `HybridBitSet`. Has no effect if `row` does not exist. + /// `ChunkedBitSet`. Has no effect if `row` does not exist. //~^ ERROR unescaped backtick /// /// Returns true if the row was changed. diff --git a/tests/rustdoc-ui/unescaped_backticks.stderr b/tests/rustdoc-ui/unescaped_backticks.stderr index 67b87f353a1..1e2b3528d4a 100644 --- a/tests/rustdoc-ui/unescaped_backticks.stderr +++ b/tests/rustdoc-ui/unescaped_backticks.stderr @@ -124,10 +124,10 @@ LL | /// also avoids the need to import `OpenOptions\`. | + error: unescaped backtick - --> $DIR/unescaped_backticks.rs:221:46 + --> $DIR/unescaped_backticks.rs:221:47 | -LL | /// `HybridBitSet`. Has no effect if `row` does not exist. - | ^ +LL | /// `ChunkedBitSet`. Has no effect if `row` does not exist. + | ^ | help: a previous inline code might be longer than expected | @@ -135,8 +135,8 @@ LL | /// Subtracts `set` from `row`. `set` can be either `BitSet` or | + help: if you meant to use a literal backtick, escape it | -LL | /// `HybridBitSet`. Has no effect if `row\` does not exist. - | + +LL | /// `ChunkedBitSet`. Has no effect if `row\` does not exist. + | + error: unescaped backtick --> $DIR/unescaped_backticks.rs:247:12 diff --git a/tests/rustdoc/jump-to-def-prelude-types.rs b/tests/rustdoc/jump-to-def-prelude-types.rs new file mode 100644 index 00000000000..43617b1bc9d --- /dev/null +++ b/tests/rustdoc/jump-to-def-prelude-types.rs @@ -0,0 +1,23 @@ +// This test checks that prelude types like `Result` and `Option` still get a link generated. + +//@ compile-flags: -Zunstable-options --generate-link-to-definition + +#![crate_name = "foo"] + +//@ has 'src/foo/jump-to-def-prelude-types.rs.html' +// FIXME: would be nice to be able to check both the class and the href at the same time so +// we could check the text as well... +//@ has - '//a[@class="prelude-ty"]/@href' '{{channel}}/core/result/enum.Result.html' +//@ has - '//a[@class="prelude-ty"]/@href' '{{channel}}/core/option/enum.Option.html' +pub fn foo() -> Result<Option<()>, ()> { Err(()) } + +// This part is to ensure that they are not linking to the actual prelude ty. +pub mod bar { + struct Result; + struct Option; + + //@ has - '//a[@href="#16"]' 'Result' + pub fn bar() -> Result { Result } + //@ has - '//a[@href="#17"]' 'Option' + pub fn bar2() -> Option { Option } +} diff --git a/tests/ui-fulldeps/obtain-borrowck.rs b/tests/ui-fulldeps/obtain-borrowck.rs index e6c703addd9..af98f93297b 100644 --- a/tests/ui-fulldeps/obtain-borrowck.rs +++ b/tests/ui-fulldeps/obtain-borrowck.rs @@ -25,19 +25,20 @@ extern crate rustc_interface; extern crate rustc_middle; extern crate rustc_session; +use std::cell::RefCell; +use std::collections::HashMap; +use std::thread_local; + use rustc_borrowck::consumers::{self, BodyWithBorrowckFacts, ConsumerOptions}; use rustc_driver::Compilation; use rustc_hir::def::DefKind; use rustc_hir::def_id::LocalDefId; +use rustc_interface::Config; use rustc_interface::interface::Compiler; -use rustc_interface::{Config, Queries}; use rustc_middle::query::queries::mir_borrowck::ProvidedValue; use rustc_middle::ty::TyCtxt; use rustc_middle::util::Providers; use rustc_session::Session; -use std::cell::RefCell; -use std::collections::HashMap; -use std::thread_local; fn main() { let exit_code = rustc_driver::catch_with_exit_code(move || { @@ -63,55 +64,49 @@ impl rustc_driver::Callbacks for CompilerCalls { // In this callback we trigger borrow checking of all functions and obtain // the result. - fn after_analysis<'tcx>( - &mut self, - compiler: &Compiler, - queries: &'tcx Queries<'tcx>, - ) -> Compilation { - compiler.sess.dcx().abort_if_errors(); - queries.global_ctxt().unwrap().enter(|tcx| { - // Collect definition ids of MIR bodies. - let hir = tcx.hir(); - let mut bodies = Vec::new(); - - let crate_items = tcx.hir_crate_items(()); - for id in crate_items.free_items() { - if matches!(tcx.def_kind(id.owner_id), DefKind::Fn) { - bodies.push(id.owner_id); - } + fn after_analysis<'tcx>(&mut self, _compiler: &Compiler, tcx: TyCtxt<'tcx>) -> Compilation { + tcx.sess.dcx().abort_if_errors(); + // Collect definition ids of MIR bodies. + let hir = tcx.hir(); + let mut bodies = Vec::new(); + + let crate_items = tcx.hir_crate_items(()); + for id in crate_items.free_items() { + if matches!(tcx.def_kind(id.owner_id), DefKind::Fn) { + bodies.push(id.owner_id); } - - for id in crate_items.trait_items() { - if matches!(tcx.def_kind(id.owner_id), DefKind::AssocFn) { - let trait_item = hir.trait_item(id); - if let rustc_hir::TraitItemKind::Fn(_, trait_fn) = &trait_item.kind { - if let rustc_hir::TraitFn::Provided(_) = trait_fn { - bodies.push(trait_item.owner_id); - } + } + + for id in crate_items.trait_items() { + if matches!(tcx.def_kind(id.owner_id), DefKind::AssocFn) { + let trait_item = hir.trait_item(id); + if let rustc_hir::TraitItemKind::Fn(_, trait_fn) = &trait_item.kind { + if let rustc_hir::TraitFn::Provided(_) = trait_fn { + bodies.push(trait_item.owner_id); } } } + } - for id in crate_items.impl_items() { - if matches!(tcx.def_kind(id.owner_id), DefKind::AssocFn) { - bodies.push(id.owner_id); - } - } - - // Trigger borrow checking of all bodies. - for def_id in bodies { - let _ = tcx.optimized_mir(def_id); - } - - // See what bodies were borrow checked. - let mut bodies = get_bodies(tcx); - bodies.sort_by(|(def_id1, _), (def_id2, _)| def_id1.cmp(def_id2)); - println!("Bodies retrieved for:"); - for (def_id, body) in bodies { - println!("{}", def_id); - assert!(body.input_facts.unwrap().cfg_edge.len() > 0); + for id in crate_items.impl_items() { + if matches!(tcx.def_kind(id.owner_id), DefKind::AssocFn) { + bodies.push(id.owner_id); } - }); + } + + // Trigger borrow checking of all bodies. + for def_id in bodies { + let _ = tcx.optimized_mir(def_id); + } + + // See what bodies were borrow checked. + let mut bodies = get_bodies(tcx); + bodies.sort_by(|(def_id1, _), (def_id2, _)| def_id1.cmp(def_id2)); + println!("Bodies retrieved for:"); + for (def_id, body) in bodies { + println!("{}", def_id); + assert!(body.input_facts.unwrap().cfg_edge.len() > 0); + } Compilation::Continue } diff --git a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs new file mode 100644 index 00000000000..fd6644d73c1 --- /dev/null +++ b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs @@ -0,0 +1,242 @@ +//@ run-pass +//@ ignore-cross-compile + +// This test covers the AST pretty-printer's automatic insertion of parentheses +// into unparenthesized syntax trees according to precedence and various grammar +// restrictions and edge cases. +// +// For example if the following syntax tree represents the expression a*(b+c), +// in which the parenthesis is necessary for precedence: +// +// Binary('*', Path("a"), Paren(Binary('+', Path("b"), Path("c")))) +// +// then the pretty-printer needs to be able to print the following +// unparenthesized syntax tree with an automatically inserted parenthesization. +// +// Binary('*', Path("a"), Binary('+', Path("b"), Path("c"))) +// +// Handling this correctly is relevant in real-world code when pretty-printing +// macro-generated syntax trees, in which expressions can get interpolated into +// one another without any parenthesization being visible in the syntax tree. +// +// macro_rules! repro { +// ($rhs:expr) => { +// a * $rhs +// }; +// } +// +// let _ = repro!(b + c); + +#![feature(rustc_private)] + +extern crate rustc_ast; +extern crate rustc_ast_pretty; +extern crate rustc_driver; +extern crate rustc_errors; +extern crate rustc_parse; +extern crate rustc_session; +extern crate rustc_span; +extern crate smallvec; + +use std::mem; +use std::process::ExitCode; + +use rustc_ast::ast::{DUMMY_NODE_ID, Expr, ExprKind, Stmt}; +use rustc_ast::mut_visit::{self, DummyAstNode as _, MutVisitor}; +use rustc_ast::node_id::NodeId; +use rustc_ast::ptr::P; +use rustc_ast_pretty::pprust; +use rustc_errors::Diag; +use rustc_parse::parser::Recovery; +use rustc_session::parse::ParseSess; +use rustc_span::{DUMMY_SP, FileName, Span}; +use smallvec::SmallVec; + +// Every parenthesis in the following expressions is re-inserted by the +// pretty-printer. +// +// FIXME: Some of them shouldn't be. +static EXPRS: &[&str] = &[ + // Straightforward binary operator precedence. + "2 * 2 + 2", + "2 + 2 * 2", + "(2 + 2) * 2", + "2 * (2 + 2)", + "2 + 2 + 2", + // Return has lower precedence than a binary operator. + "(return 2) + 2", + "2 + (return 2)", // FIXME: no parenthesis needed. + "(return) + 2", // FIXME: no parenthesis needed. + // These mean different things. + "return - 2", + "(return) - 2", + // These mean different things. + "if let _ = true && false {}", + "if let _ = (true && false) {}", + // Conditions end at the first curly brace, so struct expressions need to be + // parenthesized. Except in a match guard, where conditions end at arrow. + "if let _ = (Struct {}) {}", + "match 2 { _ if let _ = Struct {} => {} }", + // Match arms terminate eagerly, so parenthesization is needed around some + // expressions. + "match 2 { _ => 1 - 1 }", + "match 2 { _ => ({ 1 }) - 1 }", + // Grammar restriction: break value starting with a labeled loop is not + // allowed, except if the break is also labeled. + "break 'outer 'inner: loop {} + 2", + "break ('inner: loop {} + 2)", + // Grammar restriction: the value in let-else is not allowed to end in a + // curly brace. + "{ let _ = 1 + 1 else {}; }", + "{ let _ = (loop {}) else {}; }", + "{ let _ = mac!() else {}; }", + "{ let _ = (mac! {}) else {}; }", + // Parentheses are necessary to prevent an eager statement boundary. + "{ 2 - 1 }", + "{ (match 2 {}) - 1 }", + "{ (match 2 {})() - 1 }", + "{ (match 2 {})[0] - 1 }", + "{ (loop {}) - 1 }", + // Angle bracket is eagerly parsed as a path's generic argument list. + "(2 as T) < U", + "(2 as T<U>) < V", // FIXME: no parentheses needed. + /* + // FIXME: pretty-printer produces invalid syntax. `2 + 2 as T < U` + "(2 + 2 as T) < U", + */ + /* + // FIXME: pretty-printer produces invalid syntax. `if (let _ = () && Struct {}.x) {}` + "if let _ = () && (Struct {}).x {}", + */ + /* + // FIXME: pretty-printer produces invalid syntax. `(1 < 2 == false) as usize` + "((1 < 2) == false) as usize", + */ + /* + // FIXME: pretty-printer produces invalid syntax. `for _ in 1..{ 2 } {}` + "for _ in (1..{ 2 }) {}", + */ + /* + // FIXME: pretty-printer loses the attribute. `{ let Struct { field } = s; }` + "{ let Struct { #[attr] field } = s; }", + */ + /* + // FIXME: pretty-printer turns this into a range. `0..to_string()` + "(0.).to_string()", + "0. .. 1.", + */ + /* + // FIXME: pretty-printer loses the dyn*. `i as Trait` + "i as dyn* Trait", + */ +]; + +// Flatten the content of parenthesis nodes into their parent node. For example +// this syntax tree representing the expression a*(b+c): +// +// Binary('*', Path("a"), Paren(Binary('+', Path("b"), Path("c")))) +// +// would unparenthesize to: +// +// Binary('*', Path("a"), Binary('+', Path("b"), Path("c"))) +struct Unparenthesize; + +impl MutVisitor for Unparenthesize { + fn visit_expr(&mut self, e: &mut P<Expr>) { + while let ExprKind::Paren(paren) = &mut e.kind { + **e = mem::replace(&mut *paren, Expr::dummy()); + } + mut_visit::walk_expr(self, e); + } +} + +// Erase Span information that could distinguish between identical expressions +// parsed from different source strings. +struct Normalize; + +impl MutVisitor for Normalize { + const VISIT_TOKENS: bool = true; + + fn visit_id(&mut self, id: &mut NodeId) { + *id = DUMMY_NODE_ID; + } + + fn visit_span(&mut self, span: &mut Span) { + *span = DUMMY_SP; + } + + fn visit_expr(&mut self, expr: &mut P<Expr>) { + if let ExprKind::Binary(binop, _left, _right) = &mut expr.kind { + self.visit_span(&mut binop.span); + } + mut_visit::walk_expr(self, expr); + } + + fn flat_map_stmt(&mut self, mut stmt: Stmt) -> SmallVec<[Stmt; 1]> { + self.visit_span(&mut stmt.span); + mut_visit::walk_flat_map_stmt(self, stmt) + } +} + +fn parse_expr(psess: &ParseSess, source_code: &str) -> Option<P<Expr>> { + let parser = rustc_parse::unwrap_or_emit_fatal(rustc_parse::new_parser_from_source_str( + psess, + FileName::anon_source_code(source_code), + source_code.to_owned(), + )); + + let mut expr = parser.recovery(Recovery::Forbidden).parse_expr().map_err(Diag::cancel).ok()?; + Normalize.visit_expr(&mut expr); + Some(expr) +} + +fn main() -> ExitCode { + let mut status = ExitCode::SUCCESS; + let mut fail = |description: &str, before: &str, after: &str| { + status = ExitCode::FAILURE; + eprint!( + "{description}\n BEFORE: {before}\n AFTER: {after}\n\n", + before = before.replace('\n', "\n "), + after = after.replace('\n', "\n "), + ); + }; + + rustc_span::create_default_session_globals_then(|| { + let psess = &ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE]); + + for &source_code in EXPRS { + let expr = parse_expr(psess, source_code).unwrap(); + + // Check for FALSE POSITIVE: pretty-printer inserting parentheses where not needed. + // Pseudocode: + // assert(expr == parse(print(expr))) + let printed = &pprust::expr_to_string(&expr); + let Some(expr2) = parse_expr(psess, printed) else { + fail("Pretty-printer produced invalid syntax", source_code, printed); + continue; + }; + if format!("{expr:#?}") != format!("{expr2:#?}") { + fail("Pretty-printer inserted unnecessary parenthesis", source_code, printed); + continue; + } + + // Check for FALSE NEGATIVE: pretty-printer failing to place necessary parentheses. + // Pseudocode: + // assert(unparenthesize(expr) == unparenthesize(parse(print(unparenthesize(expr))))) + let mut expr = expr; + Unparenthesize.visit_expr(&mut expr); + let printed = &pprust::expr_to_string(&expr); + let Some(mut expr2) = parse_expr(psess, printed) else { + fail("Pretty-printer with no parens produced invalid syntax", source_code, printed); + continue; + }; + Unparenthesize.visit_expr(&mut expr2); + if format!("{expr:#?}") != format!("{expr2:#?}") { + fail("Pretty-printer lost necessary parentheses", source_code, printed); + continue; + } + } + }); + + status +} diff --git a/tests/ui-fulldeps/stable-mir/check_abi.rs b/tests/ui-fulldeps/stable-mir/check_abi.rs index 5b7da7bb129..8caf3032afc 100644 --- a/tests/ui-fulldeps/stable-mir/check_abi.rs +++ b/tests/ui-fulldeps/stable-mir/check_abi.rs @@ -11,6 +11,7 @@ #![feature(ascii_char, ascii_char_variants)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_allocation.rs b/tests/ui-fulldeps/stable-mir/check_allocation.rs index 1e2f640f39f..072c8ba6a44 100644 --- a/tests/ui-fulldeps/stable-mir/check_allocation.rs +++ b/tests/ui-fulldeps/stable-mir/check_allocation.rs @@ -13,6 +13,7 @@ #![feature(ascii_char, ascii_char_variants)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_attribute.rs b/tests/ui-fulldeps/stable-mir/check_attribute.rs index 131fd99ebaa..22481e275a9 100644 --- a/tests/ui-fulldeps/stable-mir/check_attribute.rs +++ b/tests/ui-fulldeps/stable-mir/check_attribute.rs @@ -9,6 +9,7 @@ #![feature(rustc_private)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_binop.rs b/tests/ui-fulldeps/stable-mir/check_binop.rs index 3b52d88de3c..8c44e285108 100644 --- a/tests/ui-fulldeps/stable-mir/check_binop.rs +++ b/tests/ui-fulldeps/stable-mir/check_binop.rs @@ -9,6 +9,7 @@ #![feature(rustc_private)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_crate_defs.rs b/tests/ui-fulldeps/stable-mir/check_crate_defs.rs index e039ca07dd4..ed093903381 100644 --- a/tests/ui-fulldeps/stable-mir/check_crate_defs.rs +++ b/tests/ui-fulldeps/stable-mir/check_crate_defs.rs @@ -10,6 +10,7 @@ #![feature(assert_matches)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_def_ty.rs b/tests/ui-fulldeps/stable-mir/check_def_ty.rs index ec3cf1753e2..482dbd22d5f 100644 --- a/tests/ui-fulldeps/stable-mir/check_def_ty.rs +++ b/tests/ui-fulldeps/stable-mir/check_def_ty.rs @@ -11,6 +11,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_defs.rs b/tests/ui-fulldeps/stable-mir/check_defs.rs index 3402b345818..bf1f1a2ceab 100644 --- a/tests/ui-fulldeps/stable-mir/check_defs.rs +++ b/tests/ui-fulldeps/stable-mir/check_defs.rs @@ -10,6 +10,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_instance.rs b/tests/ui-fulldeps/stable-mir/check_instance.rs index 7d63e202fa6..464350b1045 100644 --- a/tests/ui-fulldeps/stable-mir/check_instance.rs +++ b/tests/ui-fulldeps/stable-mir/check_instance.rs @@ -10,6 +10,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_intrinsics.rs b/tests/ui-fulldeps/stable-mir/check_intrinsics.rs index 3534228f73e..6edebaf756c 100644 --- a/tests/ui-fulldeps/stable-mir/check_intrinsics.rs +++ b/tests/ui-fulldeps/stable-mir/check_intrinsics.rs @@ -13,6 +13,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; extern crate rustc_hir; #[macro_use] extern crate rustc_smir; diff --git a/tests/ui-fulldeps/stable-mir/check_item_kind.rs b/tests/ui-fulldeps/stable-mir/check_item_kind.rs index 91baa074c10..23b54e6c60b 100644 --- a/tests/ui-fulldeps/stable-mir/check_item_kind.rs +++ b/tests/ui-fulldeps/stable-mir/check_item_kind.rs @@ -10,6 +10,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_normalization.rs b/tests/ui-fulldeps/stable-mir/check_normalization.rs index 72e410f8080..928173b154b 100644 --- a/tests/ui-fulldeps/stable-mir/check_normalization.rs +++ b/tests/ui-fulldeps/stable-mir/check_normalization.rs @@ -9,6 +9,7 @@ #![feature(rustc_private)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_trait_queries.rs b/tests/ui-fulldeps/stable-mir/check_trait_queries.rs index 8721f243587..304a7ce9255 100644 --- a/tests/ui-fulldeps/stable-mir/check_trait_queries.rs +++ b/tests/ui-fulldeps/stable-mir/check_trait_queries.rs @@ -10,6 +10,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_transform.rs b/tests/ui-fulldeps/stable-mir/check_transform.rs index 40217b9aa95..bcf79c456b0 100644 --- a/tests/ui-fulldeps/stable-mir/check_transform.rs +++ b/tests/ui-fulldeps/stable-mir/check_transform.rs @@ -11,6 +11,7 @@ #![feature(ascii_char, ascii_char_variants)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/check_ty_fold.rs b/tests/ui-fulldeps/stable-mir/check_ty_fold.rs index 0715e0cfc52..e21508c9b46 100644 --- a/tests/ui-fulldeps/stable-mir/check_ty_fold.rs +++ b/tests/ui-fulldeps/stable-mir/check_ty_fold.rs @@ -11,6 +11,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/compilation-result.rs b/tests/ui-fulldeps/stable-mir/compilation-result.rs index 286bbd7c594..d921de73f43 100644 --- a/tests/ui-fulldeps/stable-mir/compilation-result.rs +++ b/tests/ui-fulldeps/stable-mir/compilation-result.rs @@ -10,6 +10,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/stable-mir/crate-info.rs index 6b458c5d923..53be8eb10c1 100644 --- a/tests/ui-fulldeps/stable-mir/crate-info.rs +++ b/tests/ui-fulldeps/stable-mir/crate-info.rs @@ -11,6 +11,7 @@ #![feature(assert_matches)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/projections.rs b/tests/ui-fulldeps/stable-mir/projections.rs index a8bf4c1d399..fdb7eeed1b0 100644 --- a/tests/ui-fulldeps/stable-mir/projections.rs +++ b/tests/ui-fulldeps/stable-mir/projections.rs @@ -11,6 +11,7 @@ #![feature(assert_matches)] extern crate rustc_hir; +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui-fulldeps/stable-mir/smir_visitor.rs b/tests/ui-fulldeps/stable-mir/smir_visitor.rs index f1bc03781b9..666000d3b07 100644 --- a/tests/ui-fulldeps/stable-mir/smir_visitor.rs +++ b/tests/ui-fulldeps/stable-mir/smir_visitor.rs @@ -10,6 +10,7 @@ #![feature(rustc_private)] #![feature(assert_matches)] +extern crate rustc_middle; #[macro_use] extern crate rustc_smir; extern crate rustc_driver; diff --git a/tests/ui/README.md b/tests/ui/README.md index c14d0ee78c8..aa36481ae06 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -6,9 +6,9 @@ This folder contains `rustc`'s ## Test Directives (Headers) Typically, a UI test will have some test directives / headers which are -special comments that tell compiletest how to build and intepret a test. +special comments that tell compiletest how to build and interpret a test. -As part of an on-going effort to rewrite compiletest +As part of an ongoing effort to rewrite compiletest (see <https://github.com/rust-lang/compiler-team/issues/536>), a major change proposal to change legacy compiletest-style headers `// <directive>` to [`ui_test`](https://github.com/oli-obk/ui_test)-style headers @@ -30,6 +30,6 @@ but in `ui_test` style, the header would be written as compiletest is changed to accept only `//@` directives for UI tests (currently), and will reject and report an error if it encounters any -comments `// <content>` that may be parsed as an legacy compiletest-style +comments `// <content>` that may be parsed as a legacy compiletest-style test header. To fix this, you should migrate to the `ui_test`-style header `//@ <content>`. diff --git a/tests/ui/abi/anon-extern-mod.rs b/tests/ui/abi/anon-extern-mod.rs index bb3739bc4af..134542b9cff 100644 --- a/tests/ui/abi/anon-extern-mod.rs +++ b/tests/ui/abi/anon-extern-mod.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #[link(name = "rust_test_helpers", kind = "static")] extern "C" { diff --git a/tests/ui/abi/c-stack-as-value.rs b/tests/ui/abi/c-stack-as-value.rs index 401bc132b6e..10933bdb278 100644 --- a/tests/ui/abi/c-stack-as-value.rs +++ b/tests/ui/abi/c-stack-as-value.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 mod rustrt { #[link(name = "rust_test_helpers", kind = "static")] diff --git a/tests/ui/abi/cross-crate/anon-extern-mod-cross-crate-2.rs b/tests/ui/abi/cross-crate/anon-extern-mod-cross-crate-2.rs index 95bf4df68df..b2d06444c13 100644 --- a/tests/ui/abi/cross-crate/anon-extern-mod-cross-crate-2.rs +++ b/tests/ui/abi/cross-crate/anon-extern-mod-cross-crate-2.rs @@ -1,6 +1,5 @@ //@ run-pass //@ aux-build:anon-extern-mod-cross-crate-1.rs -//@ pretty-expanded FIXME #23616 extern crate anonexternmod; diff --git a/tests/ui/abi/cross-crate/duplicated-external-mods.rs b/tests/ui/abi/cross-crate/duplicated-external-mods.rs index 2a3875d2773..19a9b07d65c 100644 --- a/tests/ui/abi/cross-crate/duplicated-external-mods.rs +++ b/tests/ui/abi/cross-crate/duplicated-external-mods.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:anon-extern-mod-cross-crate-1.rs //@ aux-build:anon-extern-mod-cross-crate-1.rs -//@ pretty-expanded FIXME #23616 extern crate anonexternmod; diff --git a/tests/ui/abi/extern/extern-pass-empty.rs b/tests/ui/abi/extern/extern-pass-empty.rs index f168f5faa17..1ad52b128ad 100644 --- a/tests/ui/abi/extern/extern-pass-empty.rs +++ b/tests/ui/abi/extern/extern-pass-empty.rs @@ -3,7 +3,6 @@ // Test a foreign function that accepts empty struct. -//@ pretty-expanded FIXME #23616 //@ ignore-msvc //@ ignore-emscripten emcc asserts on an empty struct as an argument diff --git a/tests/ui/abi/foreign/invoke-external-foreign.rs b/tests/ui/abi/foreign/invoke-external-foreign.rs index 78cc84804bf..a22b12af672 100644 --- a/tests/ui/abi/foreign/invoke-external-foreign.rs +++ b/tests/ui/abi/foreign/invoke-external-foreign.rs @@ -5,7 +5,6 @@ // successfully (and safely) invoke external, cdecl // functions from outside the crate. -//@ pretty-expanded FIXME #23616 extern crate foreign_lib; diff --git a/tests/ui/alias-uninit-value.rs b/tests/ui/alias-uninit-value.rs index 3223bac1820..0084a98e627 100644 --- a/tests/ui/alias-uninit-value.rs +++ b/tests/ui/alias-uninit-value.rs @@ -7,7 +7,6 @@ // Regression test for issue #374 -//@ pretty-expanded FIXME #23616 enum sty { ty_nil, } diff --git a/tests/ui/annotate-snippet/auxiliary/multispan.rs b/tests/ui/annotate-snippet/auxiliary/multispan.rs index b5f1ed9b56a..1eb379d3877 100644 --- a/tests/ui/annotate-snippet/auxiliary/multispan.rs +++ b/tests/ui/annotate-snippet/auxiliary/multispan.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)] extern crate proc_macro; diff --git a/tests/ui/annotate-snippet/multispan.rs b/tests/ui/annotate-snippet/multispan.rs index c9ec4043e37..b7cf22eebcb 100644 --- a/tests/ui/annotate-snippet/multispan.rs +++ b/tests/ui/annotate-snippet/multispan.rs @@ -1,4 +1,4 @@ -//@ aux-build:multispan.rs +//@ proc-macro: multispan.rs //@ error-pattern:hello to you, too! //@ compile-flags: --error-format human-annotate-rs -Z unstable-options diff --git a/tests/ui/array-slice-vec/cast-in-array-size.rs b/tests/ui/array-slice-vec/cast-in-array-size.rs index cb5072564b2..5276288f819 100644 --- a/tests/ui/array-slice-vec/cast-in-array-size.rs +++ b/tests/ui/array-slice-vec/cast-in-array-size.rs @@ -2,7 +2,6 @@ // issues #10618 and #16382 -//@ pretty-expanded FIXME #23616 const SIZE: isize = 25; diff --git a/tests/ui/array-slice-vec/empty-mutable-vec.rs b/tests/ui/array-slice-vec/empty-mutable-vec.rs index 663071bf613..1785b1aa39e 100644 --- a/tests/ui/array-slice-vec/empty-mutable-vec.rs +++ b/tests/ui/array-slice-vec/empty-mutable-vec.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(unused_mut)] diff --git a/tests/ui/array-slice-vec/issue-15730.rs b/tests/ui/array-slice-vec/issue-15730.rs index fe9d908a1ff..2a69417819d 100644 --- a/tests/ui/array-slice-vec/issue-15730.rs +++ b/tests/ui/array-slice-vec/issue-15730.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_mut)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 fn main() { let mut array = [1, 2, 3]; diff --git a/tests/ui/array-slice-vec/issue-18425.rs b/tests/ui/array-slice-vec/issue-18425.rs index 22345718ad8..e74a20de726 100644 --- a/tests/ui/array-slice-vec/issue-18425.rs +++ b/tests/ui/array-slice-vec/issue-18425.rs @@ -2,7 +2,6 @@ // Check that codegen doesn't ICE when codegenning an array repeat // expression with a count of 1 and a non-Copy element type. -//@ pretty-expanded FIXME #23616 fn main() { let _ = [Box::new(1_usize); 1]; diff --git a/tests/ui/array-slice-vec/match_arr_unknown_len.stderr b/tests/ui/array-slice-vec/match_arr_unknown_len.stderr index 3ed0d6bdf3a..f617ff33938 100644 --- a/tests/ui/array-slice-vec/match_arr_unknown_len.stderr +++ b/tests/ui/array-slice-vec/match_arr_unknown_len.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/match_arr_unknown_len.rs:3:9 | LL | [1, 2] => true, - | ^^^^^^ expected `2`, found `N` - | - = note: expected array `[u32; 2]` - found array `[u32; N]` + | ^^^^^^ expected an array with a size of 2, found one with a size of N error: aborting due to 1 previous error diff --git a/tests/ui/array-slice-vec/mut-vstore-expr.rs b/tests/ui/array-slice-vec/mut-vstore-expr.rs index 809c001b079..9553aed9a00 100644 --- a/tests/ui/array-slice-vec/mut-vstore-expr.rs +++ b/tests/ui/array-slice-vec/mut-vstore-expr.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let _x: &mut [isize] = &mut [ 1, 2, 3 ]; diff --git a/tests/ui/array-slice-vec/vec-macro-with-brackets.rs b/tests/ui/array-slice-vec/vec-macro-with-brackets.rs index 65ca182b615..b62e294f9d1 100644 --- a/tests/ui/array-slice-vec/vec-macro-with-brackets.rs +++ b/tests/ui/array-slice-vec/vec-macro-with-brackets.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 macro_rules! vec [ ($($e:expr),*) => ({ diff --git a/tests/ui/array-slice-vec/vec-repeat-with-cast.rs b/tests/ui/array-slice-vec/vec-repeat-with-cast.rs index 4af38d9cf32..1f1fd4cd0d2 100644 --- a/tests/ui/array-slice-vec/vec-repeat-with-cast.rs +++ b/tests/ui/array-slice-vec/vec-repeat-with-cast.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let _a = [0; 1 as usize]; } diff --git a/tests/ui/array-slice-vec/vector-no-ann-2.rs b/tests/ui/array-slice-vec/vector-no-ann-2.rs index b130c6bc2ff..63828551af1 100644 --- a/tests/ui/array-slice-vec/vector-no-ann-2.rs +++ b/tests/ui/array-slice-vec/vector-no-ann-2.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let _quux: Box<Vec<usize>> = Box::new(Vec::new()); diff --git a/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr new file mode 100644 index 00000000000..0e544119650 --- /dev/null +++ b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr @@ -0,0 +1,38 @@ +error: invalid register `$r0`: constant zero cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:22:18 + | +LL | asm!("", out("$r0") _); + | ^^^^^^^^^^^^ + +error: invalid register `$tp`: reserved for TLS + --> $DIR/bad-reg.rs:24:18 + | +LL | asm!("", out("$tp") _); + | ^^^^^^^^^^^^ + +error: invalid register `$sp`: the stack pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:26:18 + | +LL | asm!("", out("$sp") _); + | ^^^^^^^^^^^^ + +error: invalid register `$r21`: reserved by the ABI + --> $DIR/bad-reg.rs:28:18 + | +LL | asm!("", out("$r21") _); + | ^^^^^^^^^^^^^ + +error: invalid register `$fp`: the frame pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:30:18 + | +LL | asm!("", out("$fp") _); + | ^^^^^^^^^^^^ + +error: invalid register `$r31`: $r31 is used internally by LLVM and cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:32:18 + | +LL | asm!("", out("$r31") _); + | ^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr new file mode 100644 index 00000000000..6d0410dc6a1 --- /dev/null +++ b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr @@ -0,0 +1,62 @@ +error: invalid register `$r0`: constant zero cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:22:18 + | +LL | asm!("", out("$r0") _); + | ^^^^^^^^^^^^ + +error: invalid register `$tp`: reserved for TLS + --> $DIR/bad-reg.rs:24:18 + | +LL | asm!("", out("$tp") _); + | ^^^^^^^^^^^^ + +error: invalid register `$sp`: the stack pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:26:18 + | +LL | asm!("", out("$sp") _); + | ^^^^^^^^^^^^ + +error: invalid register `$r21`: reserved by the ABI + --> $DIR/bad-reg.rs:28:18 + | +LL | asm!("", out("$r21") _); + | ^^^^^^^^^^^^^ + +error: invalid register `$fp`: the frame pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:30:18 + | +LL | asm!("", out("$fp") _); + | ^^^^^^^^^^^^ + +error: invalid register `$r31`: $r31 is used internally by LLVM and cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:32:18 + | +LL | asm!("", out("$r31") _); + | ^^^^^^^^^^^^^ + +error: register class `freg` requires at least one of the following target features: d, f + --> $DIR/bad-reg.rs:36:26 + | +LL | asm!("/* {} */", in(freg) f); + | ^^^^^^^^^^ + +error: register class `freg` requires at least one of the following target features: d, f + --> $DIR/bad-reg.rs:38:26 + | +LL | asm!("/* {} */", out(freg) _); + | ^^^^^^^^^^^ + +error: register class `freg` requires at least one of the following target features: d, f + --> $DIR/bad-reg.rs:40:26 + | +LL | asm!("/* {} */", in(freg) d); + | ^^^^^^^^^^ + +error: register class `freg` requires at least one of the following target features: d, f + --> $DIR/bad-reg.rs:42:26 + | +LL | asm!("/* {} */", out(freg) d); + | ^^^^^^^^^^^ + +error: aborting due to 10 previous errors + diff --git a/tests/ui/asm/loongarch/bad-reg.rs b/tests/ui/asm/loongarch/bad-reg.rs new file mode 100644 index 00000000000..c5288cc78b7 --- /dev/null +++ b/tests/ui/asm/loongarch/bad-reg.rs @@ -0,0 +1,45 @@ +//@ add-core-stubs +//@ needs-asm-support +//@ revisions: loongarch64_lp64d loongarch64_lp64s +//@[loongarch64_lp64d] compile-flags: --target loongarch64-unknown-linux-gnu +//@[loongarch64_lp64d] needs-llvm-components: loongarch +//@[loongarch64_lp64s] compile-flags: --target loongarch64-unknown-none-softfloat +//@[loongarch64_lp64s] needs-llvm-components: loongarch + +#![crate_type = "lib"] +#![feature(no_core, rustc_attrs)] +#![no_core] + +extern crate minicore; +use minicore::*; + +fn f() { + let mut x = 0; + let mut f = 0.0_f32; + let mut d = 0.0_f64; + unsafe { + // Unsupported registers + asm!("", out("$r0") _); + //~^ ERROR constant zero cannot be used as an operand for inline asm + asm!("", out("$tp") _); + //~^ ERROR invalid register `$tp`: reserved for TLS + asm!("", out("$sp") _); + //~^ ERROR invalid register `$sp`: the stack pointer cannot be used as an operand for inline asm + asm!("", out("$r21") _); + //~^ ERROR invalid register `$r21`: reserved by the ABI + asm!("", out("$fp") _); + //~^ ERROR invalid register `$fp`: the frame pointer cannot be used as an operand for inline asm + asm!("", out("$r31") _); + //~^ ERROR invalid register `$r31`: $r31 is used internally by LLVM and cannot be used as an operand for inline asm + + asm!("", out("$f0") _); // ok + asm!("/* {} */", in(freg) f); + //[loongarch64_lp64s]~^ ERROR register class `freg` requires at least one of the following target features: d, f + asm!("/* {} */", out(freg) _); + //[loongarch64_lp64s]~^ ERROR register class `freg` requires at least one of the following target features: d, f + asm!("/* {} */", in(freg) d); + //[loongarch64_lp64s]~^ ERROR register class `freg` requires at least one of the following target features: d, f + asm!("/* {} */", out(freg) d); + //[loongarch64_lp64s]~^ ERROR register class `freg` requires at least one of the following target features: d, f + } +} diff --git a/tests/ui/asm/powerpc/bad-reg.aix64.stderr b/tests/ui/asm/powerpc/bad-reg.aix64.stderr index 34105ceac04..036641951cc 100644 --- a/tests/ui/asm/powerpc/bad-reg.aix64.stderr +++ b/tests/ui/asm/powerpc/bad-reg.aix64.stderr @@ -1,125 +1,101 @@ error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:32:18 + --> $DIR/bad-reg.rs:45:18 | LL | asm!("", out("sp") _); | ^^^^^^^^^^^ error: invalid register `r2`: r2 is a system reserved register and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:34:18 + --> $DIR/bad-reg.rs:47:18 | LL | asm!("", out("r2") _); | ^^^^^^^^^^^ error: invalid register `r29`: r29 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:38:18 + --> $DIR/bad-reg.rs:51:18 | LL | asm!("", out("r29") _); | ^^^^^^^^^^^^ error: invalid register `r30`: r30 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:40:18 + --> $DIR/bad-reg.rs:53:18 | LL | asm!("", out("r30") _); | ^^^^^^^^^^^^ error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:42:18 + --> $DIR/bad-reg.rs:55:18 | LL | asm!("", out("fp") _); | ^^^^^^^^^^^ error: invalid register `lr`: the link register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:44:18 + --> $DIR/bad-reg.rs:57:18 | LL | asm!("", out("lr") _); | ^^^^^^^^^^^ error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:46:18 + --> $DIR/bad-reg.rs:59:18 | LL | asm!("", out("ctr") _); | ^^^^^^^^^^^^ error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:48:18 + --> $DIR/bad-reg.rs:61:18 | LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:66:18 + --> $DIR/bad-reg.rs:109:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:69:18 + --> $DIR/bad-reg.rs:112:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:72:26 + --> $DIR/bad-reg.rs:115:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:75:26 + --> $DIR/bad-reg.rs:118:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:79:18 + --> $DIR/bad-reg.rs:122:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:82:18 + --> $DIR/bad-reg.rs:125:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:85:26 + --> $DIR/bad-reg.rs:128:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:88:26 + --> $DIR/bad-reg.rs:131:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:93:18 - | -LL | asm!("", in("v0") x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:96:18 - | -LL | asm!("", out("v0") x); - | ^^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:99:26 - | -LL | asm!("/* {} */", in(vreg) x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:102:26 - | -LL | asm!("/* {} */", out(vreg) _); - | ^^^^^^^^^^^ - error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:106:31 + --> $DIR/bad-reg.rs:135:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -127,7 +103,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:108:31 + --> $DIR/bad-reg.rs:137:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -135,7 +111,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:110:31 + --> $DIR/bad-reg.rs:139:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -143,7 +119,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:112:31 + --> $DIR/bad-reg.rs:141:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -151,7 +127,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:114:31 + --> $DIR/bad-reg.rs:143:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -159,7 +135,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:116:31 + --> $DIR/bad-reg.rs:145:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -167,7 +143,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:118:31 + --> $DIR/bad-reg.rs:147:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -175,7 +151,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:120:31 + --> $DIR/bad-reg.rs:149:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -183,13 +159,37 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: cannot use register `r13`: r13 is a reserved register on this target - --> $DIR/bad-reg.rs:36:18 + --> $DIR/bad-reg.rs:49:18 | LL | asm!("", out("r13") _); | ^^^^^^^^^^^^ error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:66:27 + --> $DIR/bad-reg.rs:76:27 + | +LL | asm!("", in("v0") x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:79:28 + | +LL | asm!("", out("v0") x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:87:35 + | +LL | asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:109:27 | LL | asm!("", in("cr") x); | ^ @@ -197,7 +197,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:69:28 + --> $DIR/bad-reg.rs:112:28 | LL | asm!("", out("cr") x); | ^ @@ -205,7 +205,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:72:33 + --> $DIR/bad-reg.rs:115:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -213,7 +213,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:79:28 + --> $DIR/bad-reg.rs:122:28 | LL | asm!("", in("xer") x); | ^ @@ -221,7 +221,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:82:29 + --> $DIR/bad-reg.rs:125:29 | LL | asm!("", out("xer") x); | ^ @@ -229,36 +229,12 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:85:34 + --> $DIR/bad-reg.rs:128:34 | LL | asm!("/* {} */", in(xer) x); | ^ | = note: register class `xer` supports these types: -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:93:27 - | -LL | asm!("", in("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:96:28 - | -LL | asm!("", out("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:99:35 - | -LL | asm!("/* {} */", in(vreg) x); - | ^ - | - = note: register class `vreg` supports these types: - -error: aborting due to 38 previous errors +error: aborting due to 34 previous errors diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc.stderr index 34105ceac04..13fc5a048d8 100644 --- a/tests/ui/asm/powerpc/bad-reg.powerpc.stderr +++ b/tests/ui/asm/powerpc/bad-reg.powerpc.stderr @@ -1,125 +1,101 @@ error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:32:18 + --> $DIR/bad-reg.rs:45:18 | LL | asm!("", out("sp") _); | ^^^^^^^^^^^ error: invalid register `r2`: r2 is a system reserved register and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:34:18 + --> $DIR/bad-reg.rs:47:18 | LL | asm!("", out("r2") _); | ^^^^^^^^^^^ error: invalid register `r29`: r29 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:38:18 + --> $DIR/bad-reg.rs:51:18 | LL | asm!("", out("r29") _); | ^^^^^^^^^^^^ error: invalid register `r30`: r30 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:40:18 + --> $DIR/bad-reg.rs:53:18 | LL | asm!("", out("r30") _); | ^^^^^^^^^^^^ error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:42:18 + --> $DIR/bad-reg.rs:55:18 | LL | asm!("", out("fp") _); | ^^^^^^^^^^^ error: invalid register `lr`: the link register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:44:18 + --> $DIR/bad-reg.rs:57:18 | LL | asm!("", out("lr") _); | ^^^^^^^^^^^ error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:46:18 + --> $DIR/bad-reg.rs:59:18 | LL | asm!("", out("ctr") _); | ^^^^^^^^^^^^ error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:48:18 + --> $DIR/bad-reg.rs:61:18 | LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:66:18 + --> $DIR/bad-reg.rs:109:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:69:18 + --> $DIR/bad-reg.rs:112:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:72:26 + --> $DIR/bad-reg.rs:115:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:75:26 + --> $DIR/bad-reg.rs:118:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:79:18 + --> $DIR/bad-reg.rs:122:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:82:18 + --> $DIR/bad-reg.rs:125:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:85:26 + --> $DIR/bad-reg.rs:128:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:88:26 + --> $DIR/bad-reg.rs:131:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:93:18 - | -LL | asm!("", in("v0") x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:96:18 - | -LL | asm!("", out("v0") x); - | ^^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:99:26 - | -LL | asm!("/* {} */", in(vreg) x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:102:26 - | -LL | asm!("/* {} */", out(vreg) _); - | ^^^^^^^^^^^ - error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:106:31 + --> $DIR/bad-reg.rs:135:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -127,7 +103,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:108:31 + --> $DIR/bad-reg.rs:137:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -135,7 +111,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:110:31 + --> $DIR/bad-reg.rs:139:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -143,7 +119,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:112:31 + --> $DIR/bad-reg.rs:141:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -151,7 +127,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:114:31 + --> $DIR/bad-reg.rs:143:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -159,7 +135,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:116:31 + --> $DIR/bad-reg.rs:145:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -167,7 +143,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:118:31 + --> $DIR/bad-reg.rs:147:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -175,7 +151,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:120:31 + --> $DIR/bad-reg.rs:149:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -183,13 +159,73 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: cannot use register `r13`: r13 is a reserved register on this target - --> $DIR/bad-reg.rs:36:18 + --> $DIR/bad-reg.rs:49:18 | LL | asm!("", out("r13") _); | ^^^^^^^^^^^^ +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:66:18 + | +LL | asm!("", in("v0") v32x4); // requires altivec + | ^^^^^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:68:18 + | +LL | asm!("", out("v0") v32x4); // requires altivec + | ^^^^^^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:70:18 + | +LL | asm!("", in("v0") v64x2); // requires vsx + | ^^^^^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:73:18 + | +LL | asm!("", out("v0") v64x2); // requires vsx + | ^^^^^^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:76:18 + | +LL | asm!("", in("v0") x); // FIXME: should be ok if vsx is available + | ^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:79:18 + | +LL | asm!("", out("v0") x); // FIXME: should be ok if vsx is available + | ^^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:82:26 + | +LL | asm!("/* {} */", in(vreg) v32x4); // requires altivec + | ^^^^^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:84:26 + | +LL | asm!("/* {} */", in(vreg) v64x2); // requires vsx + | ^^^^^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:87:26 + | +LL | asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available + | ^^^^^^^^^^ + +error: register class `vreg` requires at least one of the following target features: altivec, vsx + --> $DIR/bad-reg.rs:90:26 + | +LL | asm!("/* {} */", out(vreg) _); // requires altivec + | ^^^^^^^^^^^ + error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:66:27 + --> $DIR/bad-reg.rs:109:27 | LL | asm!("", in("cr") x); | ^ @@ -197,7 +233,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:69:28 + --> $DIR/bad-reg.rs:112:28 | LL | asm!("", out("cr") x); | ^ @@ -205,7 +241,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:72:33 + --> $DIR/bad-reg.rs:115:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -213,7 +249,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:79:28 + --> $DIR/bad-reg.rs:122:28 | LL | asm!("", in("xer") x); | ^ @@ -221,7 +257,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:82:29 + --> $DIR/bad-reg.rs:125:29 | LL | asm!("", out("xer") x); | ^ @@ -229,36 +265,12 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:85:34 + --> $DIR/bad-reg.rs:128:34 | LL | asm!("/* {} */", in(xer) x); | ^ | = note: register class `xer` supports these types: -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:93:27 - | -LL | asm!("", in("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:96:28 - | -LL | asm!("", out("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:99:35 - | -LL | asm!("/* {} */", in(vreg) x); - | ^ - | - = note: register class `vreg` supports these types: - -error: aborting due to 38 previous errors +error: aborting due to 41 previous errors diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr index 34105ceac04..6a9d552bfe2 100644 --- a/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr +++ b/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr @@ -1,125 +1,101 @@ error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:32:18 + --> $DIR/bad-reg.rs:45:18 | LL | asm!("", out("sp") _); | ^^^^^^^^^^^ error: invalid register `r2`: r2 is a system reserved register and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:34:18 + --> $DIR/bad-reg.rs:47:18 | LL | asm!("", out("r2") _); | ^^^^^^^^^^^ error: invalid register `r29`: r29 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:38:18 + --> $DIR/bad-reg.rs:51:18 | LL | asm!("", out("r29") _); | ^^^^^^^^^^^^ error: invalid register `r30`: r30 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:40:18 + --> $DIR/bad-reg.rs:53:18 | LL | asm!("", out("r30") _); | ^^^^^^^^^^^^ error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:42:18 + --> $DIR/bad-reg.rs:55:18 | LL | asm!("", out("fp") _); | ^^^^^^^^^^^ error: invalid register `lr`: the link register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:44:18 + --> $DIR/bad-reg.rs:57:18 | LL | asm!("", out("lr") _); | ^^^^^^^^^^^ error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:46:18 + --> $DIR/bad-reg.rs:59:18 | LL | asm!("", out("ctr") _); | ^^^^^^^^^^^^ error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:48:18 + --> $DIR/bad-reg.rs:61:18 | LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:66:18 + --> $DIR/bad-reg.rs:109:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:69:18 + --> $DIR/bad-reg.rs:112:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:72:26 + --> $DIR/bad-reg.rs:115:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:75:26 + --> $DIR/bad-reg.rs:118:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:79:18 + --> $DIR/bad-reg.rs:122:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:82:18 + --> $DIR/bad-reg.rs:125:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:85:26 + --> $DIR/bad-reg.rs:128:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:88:26 + --> $DIR/bad-reg.rs:131:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:93:18 - | -LL | asm!("", in("v0") x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:96:18 - | -LL | asm!("", out("v0") x); - | ^^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:99:26 - | -LL | asm!("/* {} */", in(vreg) x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:102:26 - | -LL | asm!("/* {} */", out(vreg) _); - | ^^^^^^^^^^^ - error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:106:31 + --> $DIR/bad-reg.rs:135:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -127,7 +103,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:108:31 + --> $DIR/bad-reg.rs:137:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -135,7 +111,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:110:31 + --> $DIR/bad-reg.rs:139:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -143,7 +119,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:112:31 + --> $DIR/bad-reg.rs:141:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -151,7 +127,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:114:31 + --> $DIR/bad-reg.rs:143:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -159,7 +135,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:116:31 + --> $DIR/bad-reg.rs:145:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -167,7 +143,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:118:31 + --> $DIR/bad-reg.rs:147:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -175,7 +151,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:120:31 + --> $DIR/bad-reg.rs:149:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -183,13 +159,61 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: cannot use register `r13`: r13 is a reserved register on this target - --> $DIR/bad-reg.rs:36:18 + --> $DIR/bad-reg.rs:49:18 | LL | asm!("", out("r13") _); | ^^^^^^^^^^^^ +error: `vsx` target feature is not enabled + --> $DIR/bad-reg.rs:70:27 + | +LL | asm!("", in("v0") v64x2); // requires vsx + | ^^^^^ + | + = note: this is required to use type `i64x2` with register class `vreg` + +error: `vsx` target feature is not enabled + --> $DIR/bad-reg.rs:73:28 + | +LL | asm!("", out("v0") v64x2); // requires vsx + | ^^^^^ + | + = note: this is required to use type `i64x2` with register class `vreg` + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:76:27 + | +LL | asm!("", in("v0") x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:79:28 + | +LL | asm!("", out("v0") x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: `vsx` target feature is not enabled + --> $DIR/bad-reg.rs:84:35 + | +LL | asm!("/* {} */", in(vreg) v64x2); // requires vsx + | ^^^^^ + | + = note: this is required to use type `i64x2` with register class `vreg` + error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:66:27 + --> $DIR/bad-reg.rs:87:35 + | +LL | asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:109:27 | LL | asm!("", in("cr") x); | ^ @@ -197,7 +221,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:69:28 + --> $DIR/bad-reg.rs:112:28 | LL | asm!("", out("cr") x); | ^ @@ -205,7 +229,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:72:33 + --> $DIR/bad-reg.rs:115:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -213,7 +237,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:79:28 + --> $DIR/bad-reg.rs:122:28 | LL | asm!("", in("xer") x); | ^ @@ -221,7 +245,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:82:29 + --> $DIR/bad-reg.rs:125:29 | LL | asm!("", out("xer") x); | ^ @@ -229,36 +253,12 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:85:34 + --> $DIR/bad-reg.rs:128:34 | LL | asm!("/* {} */", in(xer) x); | ^ | = note: register class `xer` supports these types: -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:93:27 - | -LL | asm!("", in("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:96:28 - | -LL | asm!("", out("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:99:35 - | -LL | asm!("/* {} */", in(vreg) x); - | ^ - | - = note: register class `vreg` supports these types: - -error: aborting due to 38 previous errors +error: aborting due to 37 previous errors diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr index 34105ceac04..036641951cc 100644 --- a/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr +++ b/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr @@ -1,125 +1,101 @@ error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:32:18 + --> $DIR/bad-reg.rs:45:18 | LL | asm!("", out("sp") _); | ^^^^^^^^^^^ error: invalid register `r2`: r2 is a system reserved register and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:34:18 + --> $DIR/bad-reg.rs:47:18 | LL | asm!("", out("r2") _); | ^^^^^^^^^^^ error: invalid register `r29`: r29 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:38:18 + --> $DIR/bad-reg.rs:51:18 | LL | asm!("", out("r29") _); | ^^^^^^^^^^^^ error: invalid register `r30`: r30 is used internally by LLVM and cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:40:18 + --> $DIR/bad-reg.rs:53:18 | LL | asm!("", out("r30") _); | ^^^^^^^^^^^^ error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:42:18 + --> $DIR/bad-reg.rs:55:18 | LL | asm!("", out("fp") _); | ^^^^^^^^^^^ error: invalid register `lr`: the link register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:44:18 + --> $DIR/bad-reg.rs:57:18 | LL | asm!("", out("lr") _); | ^^^^^^^^^^^ error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:46:18 + --> $DIR/bad-reg.rs:59:18 | LL | asm!("", out("ctr") _); | ^^^^^^^^^^^^ error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:48:18 + --> $DIR/bad-reg.rs:61:18 | LL | asm!("", out("vrsave") _); | ^^^^^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:66:18 + --> $DIR/bad-reg.rs:109:18 | LL | asm!("", in("cr") x); | ^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:69:18 + --> $DIR/bad-reg.rs:112:18 | LL | asm!("", out("cr") x); | ^^^^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:72:26 + --> $DIR/bad-reg.rs:115:26 | LL | asm!("/* {} */", in(cr) x); | ^^^^^^^^ error: register class `cr` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:75:26 + --> $DIR/bad-reg.rs:118:26 | LL | asm!("/* {} */", out(cr) _); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:79:18 + --> $DIR/bad-reg.rs:122:18 | LL | asm!("", in("xer") x); | ^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:82:18 + --> $DIR/bad-reg.rs:125:18 | LL | asm!("", out("xer") x); | ^^^^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:85:26 + --> $DIR/bad-reg.rs:128:26 | LL | asm!("/* {} */", in(xer) x); | ^^^^^^^^^ error: register class `xer` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:88:26 + --> $DIR/bad-reg.rs:131:26 | LL | asm!("/* {} */", out(xer) _); | ^^^^^^^^^^ -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:93:18 - | -LL | asm!("", in("v0") x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:96:18 - | -LL | asm!("", out("v0") x); - | ^^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:99:26 - | -LL | asm!("/* {} */", in(vreg) x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:102:26 - | -LL | asm!("/* {} */", out(vreg) _); - | ^^^^^^^^^^^ - error: register `cr0` conflicts with register `cr` - --> $DIR/bad-reg.rs:106:31 + --> $DIR/bad-reg.rs:135:31 | LL | asm!("", out("cr") _, out("cr0") _); | ----------- ^^^^^^^^^^^^ register `cr0` @@ -127,7 +103,7 @@ LL | asm!("", out("cr") _, out("cr0") _); | register `cr` error: register `cr1` conflicts with register `cr` - --> $DIR/bad-reg.rs:108:31 + --> $DIR/bad-reg.rs:137:31 | LL | asm!("", out("cr") _, out("cr1") _); | ----------- ^^^^^^^^^^^^ register `cr1` @@ -135,7 +111,7 @@ LL | asm!("", out("cr") _, out("cr1") _); | register `cr` error: register `cr2` conflicts with register `cr` - --> $DIR/bad-reg.rs:110:31 + --> $DIR/bad-reg.rs:139:31 | LL | asm!("", out("cr") _, out("cr2") _); | ----------- ^^^^^^^^^^^^ register `cr2` @@ -143,7 +119,7 @@ LL | asm!("", out("cr") _, out("cr2") _); | register `cr` error: register `cr3` conflicts with register `cr` - --> $DIR/bad-reg.rs:112:31 + --> $DIR/bad-reg.rs:141:31 | LL | asm!("", out("cr") _, out("cr3") _); | ----------- ^^^^^^^^^^^^ register `cr3` @@ -151,7 +127,7 @@ LL | asm!("", out("cr") _, out("cr3") _); | register `cr` error: register `cr4` conflicts with register `cr` - --> $DIR/bad-reg.rs:114:31 + --> $DIR/bad-reg.rs:143:31 | LL | asm!("", out("cr") _, out("cr4") _); | ----------- ^^^^^^^^^^^^ register `cr4` @@ -159,7 +135,7 @@ LL | asm!("", out("cr") _, out("cr4") _); | register `cr` error: register `cr5` conflicts with register `cr` - --> $DIR/bad-reg.rs:116:31 + --> $DIR/bad-reg.rs:145:31 | LL | asm!("", out("cr") _, out("cr5") _); | ----------- ^^^^^^^^^^^^ register `cr5` @@ -167,7 +143,7 @@ LL | asm!("", out("cr") _, out("cr5") _); | register `cr` error: register `cr6` conflicts with register `cr` - --> $DIR/bad-reg.rs:118:31 + --> $DIR/bad-reg.rs:147:31 | LL | asm!("", out("cr") _, out("cr6") _); | ----------- ^^^^^^^^^^^^ register `cr6` @@ -175,7 +151,7 @@ LL | asm!("", out("cr") _, out("cr6") _); | register `cr` error: register `cr7` conflicts with register `cr` - --> $DIR/bad-reg.rs:120:31 + --> $DIR/bad-reg.rs:149:31 | LL | asm!("", out("cr") _, out("cr7") _); | ----------- ^^^^^^^^^^^^ register `cr7` @@ -183,13 +159,37 @@ LL | asm!("", out("cr") _, out("cr7") _); | register `cr` error: cannot use register `r13`: r13 is a reserved register on this target - --> $DIR/bad-reg.rs:36:18 + --> $DIR/bad-reg.rs:49:18 | LL | asm!("", out("r13") _); | ^^^^^^^^^^^^ error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:66:27 + --> $DIR/bad-reg.rs:76:27 + | +LL | asm!("", in("v0") x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:79:28 + | +LL | asm!("", out("v0") x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:87:35 + | +LL | asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available + | ^ + | + = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:109:27 | LL | asm!("", in("cr") x); | ^ @@ -197,7 +197,7 @@ LL | asm!("", in("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:69:28 + --> $DIR/bad-reg.rs:112:28 | LL | asm!("", out("cr") x); | ^ @@ -205,7 +205,7 @@ LL | asm!("", out("cr") x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:72:33 + --> $DIR/bad-reg.rs:115:33 | LL | asm!("/* {} */", in(cr) x); | ^ @@ -213,7 +213,7 @@ LL | asm!("/* {} */", in(cr) x); = note: register class `cr` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:79:28 + --> $DIR/bad-reg.rs:122:28 | LL | asm!("", in("xer") x); | ^ @@ -221,7 +221,7 @@ LL | asm!("", in("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:82:29 + --> $DIR/bad-reg.rs:125:29 | LL | asm!("", out("xer") x); | ^ @@ -229,36 +229,12 @@ LL | asm!("", out("xer") x); = note: register class `xer` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:85:34 + --> $DIR/bad-reg.rs:128:34 | LL | asm!("/* {} */", in(xer) x); | ^ | = note: register class `xer` supports these types: -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:93:27 - | -LL | asm!("", in("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:96:28 - | -LL | asm!("", out("v0") x); - | ^ - | - = note: register class `vreg` supports these types: - -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:99:35 - | -LL | asm!("/* {} */", in(vreg) x); - | ^ - | - = note: register class `vreg` supports these types: - -error: aborting due to 38 previous errors +error: aborting due to 34 previous errors diff --git a/tests/ui/asm/powerpc/bad-reg.rs b/tests/ui/asm/powerpc/bad-reg.rs index 5023ad51838..f34c45663a0 100644 --- a/tests/ui/asm/powerpc/bad-reg.rs +++ b/tests/ui/asm/powerpc/bad-reg.rs @@ -8,17 +8,28 @@ //@[aix64] compile-flags: --target powerpc64-ibm-aix //@[aix64] needs-llvm-components: powerpc //@ needs-asm-support +// ignore-tidy-linelength #![crate_type = "rlib"] -#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)] +#![feature(no_core, rustc_attrs, lang_items, repr_simd, asm_experimental_arch)] #![no_core] +#![allow(non_camel_case_types)] #[lang = "sized"] trait Sized {} #[lang = "copy"] trait Copy {} +#[repr(simd)] +pub struct i32x4([i32; 4]); +#[repr(simd)] +pub struct i64x2([i64; 2]); + +impl<T: Copy, const N: usize> Copy for [T; N] {} impl Copy for i32 {} +impl Copy for i64 {} +impl Copy for i32x4 {} +impl Copy for i64x2 {} #[rustc_builtin_macro] macro_rules! asm { @@ -27,6 +38,8 @@ macro_rules! asm { fn f() { let mut x = 0; + let mut v32x4 = i32x4([0; 4]); + let mut v64x2 = i64x2([0; 2]); unsafe { // Unsupported registers asm!("", out("sp") _); @@ -47,6 +60,36 @@ fn f() { //~^ ERROR invalid register `ctr`: the counter register cannot be used as an operand for inline asm asm!("", out("vrsave") _); //~^ ERROR invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm + + // vreg + asm!("", out("v0") _); // always ok + asm!("", in("v0") v32x4); // requires altivec + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + asm!("", out("v0") v32x4); // requires altivec + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + asm!("", in("v0") v64x2); // requires vsx + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + //[powerpc64]~^^ ERROR `vsx` target feature is not enabled + asm!("", out("v0") v64x2); // requires vsx + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + //[powerpc64]~^^ ERROR `vsx` target feature is not enabled + asm!("", in("v0") x); // FIXME: should be ok if vsx is available + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + //[powerpc64,powerpc64le,aix64]~^^ ERROR type `i32` cannot be used with this register class + asm!("", out("v0") x); // FIXME: should be ok if vsx is available + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + //[powerpc64,powerpc64le,aix64]~^^ ERROR type `i32` cannot be used with this register class + asm!("/* {} */", in(vreg) v32x4); // requires altivec + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + asm!("/* {} */", in(vreg) v64x2); // requires vsx + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + //[powerpc64]~^^ ERROR `vsx` target feature is not enabled + asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + //[powerpc64,powerpc64le,aix64]~^^ ERROR type `i32` cannot be used with this register class + asm!("/* {} */", out(vreg) _); // requires altivec + //[powerpc]~^ ERROR register class `vreg` requires at least one of the following target features: altivec, vsx + // v20-v31 are reserved on AIX with vec-default ABI (this ABI is not currently used in Rust's builtin AIX targets). asm!("", out("v20") _); asm!("", out("v21") _); asm!("", out("v22") _); @@ -87,20 +130,6 @@ fn f() { //~| ERROR type `i32` cannot be used with this register class asm!("/* {} */", out(xer) _); //~^ ERROR can only be used as a clobber - // vreg - asm!("", out("v0") _); // ok - // FIXME: will be supported in the subsequent patch: https://github.com/rust-lang/rust/pull/131551 - asm!("", in("v0") x); - //~^ ERROR can only be used as a clobber - //~| ERROR type `i32` cannot be used with this register class - asm!("", out("v0") x); - //~^ ERROR can only be used as a clobber - //~| ERROR type `i32` cannot be used with this register class - asm!("/* {} */", in(vreg) x); - //~^ ERROR can only be used as a clobber - //~| ERROR type `i32` cannot be used with this register class - asm!("/* {} */", out(vreg) _); - //~^ ERROR can only be used as a clobber // Overlapping-only registers asm!("", out("cr") _, out("cr0") _); diff --git a/tests/ui/asm/s390x/bad-reg.rs b/tests/ui/asm/s390x/bad-reg.rs index 6de43fdfe5e..144215b1a3d 100644 --- a/tests/ui/asm/s390x/bad-reg.rs +++ b/tests/ui/asm/s390x/bad-reg.rs @@ -1,19 +1,31 @@ //@ add-core-stubs //@ needs-asm-support -//@ revisions: s390x +//@ revisions: s390x s390x_vector s390x_vector_stable //@[s390x] compile-flags: --target s390x-unknown-linux-gnu //@[s390x] needs-llvm-components: systemz +//@[s390x_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector +//@[s390x_vector] needs-llvm-components: systemz +//@[s390x_vector_stable] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector +//@[s390x_vector_stable] needs-llvm-components: systemz #![crate_type = "rlib"] -#![feature(no_core, rustc_attrs)] -#![feature(asm_experimental_arch)] +#![feature(no_core, rustc_attrs, repr_simd)] +#![cfg_attr(not(s390x_vector_stable), feature(asm_experimental_reg))] #![no_core] +#![allow(non_camel_case_types)] extern crate minicore; use minicore::*; +#[repr(simd)] +pub struct i64x2([i64; 2]); + +impl Copy for i64x2 {} + fn f() { let mut x = 0; + let mut b = 0u8; + let mut v = i64x2([0; 2]); unsafe { // Unsupported registers asm!("", out("r11") _); @@ -57,6 +69,51 @@ fn f() { asm!("", out("a1") _); //~^ ERROR invalid register `a1`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm + // vreg + asm!("", out("v0") _); // always ok + asm!("", in("v0") v); // requires vector & asm_experimental_reg + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector_stable]~^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `i64x2` cannot be used with this register class in stable [E0658] + asm!("", out("v0") v); // requires vector & asm_experimental_reg + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector_stable]~^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `i64x2` cannot be used with this register class in stable [E0658] + asm!("", in("v0") x); // requires vector & asm_experimental_reg + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector_stable]~^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `i32` cannot be used with this register class in stable [E0658] + asm!("", out("v0") x); // requires vector & asm_experimental_reg + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector_stable]~^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `i32` cannot be used with this register class in stable [E0658] + asm!("", in("v0") b); + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector]~^^ ERROR type `u8` cannot be used with this register class + //[s390x_vector_stable]~^^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `u8` cannot be used with this register class + asm!("", out("v0") b); + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector]~^^ ERROR type `u8` cannot be used with this register class + //[s390x_vector_stable]~^^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `u8` cannot be used with this register class + asm!("/* {} */", in(vreg) v); // requires vector & asm_experimental_reg + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector_stable]~^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `i64x2` cannot be used with this register class in stable [E0658] + asm!("/* {} */", in(vreg) x); // requires vector & asm_experimental_reg + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector_stable]~^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `i32` cannot be used with this register class in stable [E0658] + asm!("/* {} */", in(vreg) b); + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector]~^^ ERROR type `u8` cannot be used with this register class + //[s390x_vector_stable]~^^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + //[s390x_vector_stable]~| ERROR type `u8` cannot be used with this register class + asm!("/* {} */", out(vreg) _); // requires vector & asm_experimental_reg + //[s390x]~^ ERROR register class `vreg` requires the `vector` target feature + //[s390x_vector_stable]~^^ ERROR register class `vreg` can only be used as a clobber in stable [E0658] + // Clobber-only registers // areg asm!("", out("a2") _); // ok @@ -72,21 +129,6 @@ fn f() { asm!("/* {} */", out(areg) _); //~^ ERROR can only be used as a clobber - // vreg - asm!("", out("v0") _); // ok - // FIXME: will be supported in https://github.com/rust-lang/rust/pull/131664 - asm!("", in("v0") x); - //~^ ERROR can only be used as a clobber - //~| ERROR type `i32` cannot be used with this register class - asm!("", out("v0") x); - //~^ ERROR can only be used as a clobber - //~| ERROR type `i32` cannot be used with this register class - asm!("/* {} */", in(vreg) x); - //~^ ERROR can only be used as a clobber - //~| ERROR type `i32` cannot be used with this register class - asm!("/* {} */", out(vreg) _); - //~^ ERROR can only be used as a clobber - // Overlapping registers // vreg/freg asm!("", out("v0") _, out("f0") _); diff --git a/tests/ui/asm/s390x/bad-reg.s390x.stderr b/tests/ui/asm/s390x/bad-reg.s390x.stderr index 460d7c15de1..238419b376b 100644 --- a/tests/ui/asm/s390x/bad-reg.s390x.stderr +++ b/tests/ui/asm/s390x/bad-reg.s390x.stderr @@ -1,173 +1,149 @@ error: invalid register `r11`: The frame pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:19:18 + --> $DIR/bad-reg.rs:31:18 | LL | asm!("", out("r11") _); | ^^^^^^^^^^^^ error: invalid register `r15`: The stack pointer cannot be used as an operand for inline asm - --> $DIR/bad-reg.rs:21:18 + --> $DIR/bad-reg.rs:33:18 | LL | asm!("", out("r15") _); | ^^^^^^^^^^^^ error: invalid register `c0`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:23:18 + --> $DIR/bad-reg.rs:35:18 | LL | asm!("", out("c0") _); | ^^^^^^^^^^^ error: invalid register `c1`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:25:18 + --> $DIR/bad-reg.rs:37:18 | LL | asm!("", out("c1") _); | ^^^^^^^^^^^ error: invalid register `c2`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:27:18 + --> $DIR/bad-reg.rs:39:18 | LL | asm!("", out("c2") _); | ^^^^^^^^^^^ error: invalid register `c3`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:29:18 + --> $DIR/bad-reg.rs:41:18 | LL | asm!("", out("c3") _); | ^^^^^^^^^^^ error: invalid register `c4`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:31:18 + --> $DIR/bad-reg.rs:43:18 | LL | asm!("", out("c4") _); | ^^^^^^^^^^^ error: invalid register `c5`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:33:18 + --> $DIR/bad-reg.rs:45:18 | LL | asm!("", out("c5") _); | ^^^^^^^^^^^ error: invalid register `c6`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:35:18 + --> $DIR/bad-reg.rs:47:18 | LL | asm!("", out("c6") _); | ^^^^^^^^^^^ error: invalid register `c7`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:37:18 + --> $DIR/bad-reg.rs:49:18 | LL | asm!("", out("c7") _); | ^^^^^^^^^^^ error: invalid register `c8`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:39:18 + --> $DIR/bad-reg.rs:51:18 | LL | asm!("", out("c8") _); | ^^^^^^^^^^^ error: invalid register `c9`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:41:18 + --> $DIR/bad-reg.rs:53:18 | LL | asm!("", out("c9") _); | ^^^^^^^^^^^ error: invalid register `c10`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:43:18 + --> $DIR/bad-reg.rs:55:18 | LL | asm!("", out("c10") _); | ^^^^^^^^^^^^ error: invalid register `c11`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:45:18 + --> $DIR/bad-reg.rs:57:18 | LL | asm!("", out("c11") _); | ^^^^^^^^^^^^ error: invalid register `c12`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:47:18 + --> $DIR/bad-reg.rs:59:18 | LL | asm!("", out("c12") _); | ^^^^^^^^^^^^ error: invalid register `c13`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:49:18 + --> $DIR/bad-reg.rs:61:18 | LL | asm!("", out("c13") _); | ^^^^^^^^^^^^ error: invalid register `c14`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:51:18 + --> $DIR/bad-reg.rs:63:18 | LL | asm!("", out("c14") _); | ^^^^^^^^^^^^ error: invalid register `c15`: control registers are reserved by the kernel and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:53:18 + --> $DIR/bad-reg.rs:65:18 | LL | asm!("", out("c15") _); | ^^^^^^^^^^^^ error: invalid register `a0`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:55:18 + --> $DIR/bad-reg.rs:67:18 | LL | asm!("", out("a0") _); | ^^^^^^^^^^^ error: invalid register `a1`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm - --> $DIR/bad-reg.rs:57:18 + --> $DIR/bad-reg.rs:69:18 | LL | asm!("", out("a1") _); | ^^^^^^^^^^^ error: register class `areg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:63:18 + --> $DIR/bad-reg.rs:120:18 | LL | asm!("", in("a2") x); | ^^^^^^^^^^ error: register class `areg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:66:18 + --> $DIR/bad-reg.rs:123:18 | LL | asm!("", out("a2") x); | ^^^^^^^^^^^ error: register class `areg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:69:26 + --> $DIR/bad-reg.rs:126:26 | LL | asm!("/* {} */", in(areg) x); | ^^^^^^^^^^ error: register class `areg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:72:26 + --> $DIR/bad-reg.rs:129:26 | LL | asm!("/* {} */", out(areg) _); | ^^^^^^^^^^^ -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:78:18 - | -LL | asm!("", in("v0") x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:81:18 - | -LL | asm!("", out("v0") x); - | ^^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:84:26 - | -LL | asm!("/* {} */", in(vreg) x); - | ^^^^^^^^^^ - -error: register class `vreg` can only be used as a clobber, not as an input or output - --> $DIR/bad-reg.rs:87:26 - | -LL | asm!("/* {} */", out(vreg) _); - | ^^^^^^^^^^^ - error: register `f0` conflicts with register `v0` - --> $DIR/bad-reg.rs:92:31 + --> $DIR/bad-reg.rs:134:31 | LL | asm!("", out("v0") _, out("f0") _); | ----------- ^^^^^^^^^^^ register `f0` @@ -175,7 +151,7 @@ LL | asm!("", out("v0") _, out("f0") _); | register `v0` error: register `f1` conflicts with register `v1` - --> $DIR/bad-reg.rs:94:31 + --> $DIR/bad-reg.rs:136:31 | LL | asm!("", out("v1") _, out("f1") _); | ----------- ^^^^^^^^^^^ register `f1` @@ -183,7 +159,7 @@ LL | asm!("", out("v1") _, out("f1") _); | register `v1` error: register `f2` conflicts with register `v2` - --> $DIR/bad-reg.rs:96:31 + --> $DIR/bad-reg.rs:138:31 | LL | asm!("", out("v2") _, out("f2") _); | ----------- ^^^^^^^^^^^ register `f2` @@ -191,7 +167,7 @@ LL | asm!("", out("v2") _, out("f2") _); | register `v2` error: register `f3` conflicts with register `v3` - --> $DIR/bad-reg.rs:98:31 + --> $DIR/bad-reg.rs:140:31 | LL | asm!("", out("v3") _, out("f3") _); | ----------- ^^^^^^^^^^^ register `f3` @@ -199,7 +175,7 @@ LL | asm!("", out("v3") _, out("f3") _); | register `v3` error: register `f4` conflicts with register `v4` - --> $DIR/bad-reg.rs:100:31 + --> $DIR/bad-reg.rs:142:31 | LL | asm!("", out("v4") _, out("f4") _); | ----------- ^^^^^^^^^^^ register `f4` @@ -207,7 +183,7 @@ LL | asm!("", out("v4") _, out("f4") _); | register `v4` error: register `f5` conflicts with register `v5` - --> $DIR/bad-reg.rs:102:31 + --> $DIR/bad-reg.rs:144:31 | LL | asm!("", out("v5") _, out("f5") _); | ----------- ^^^^^^^^^^^ register `f5` @@ -215,7 +191,7 @@ LL | asm!("", out("v5") _, out("f5") _); | register `v5` error: register `f6` conflicts with register `v6` - --> $DIR/bad-reg.rs:104:31 + --> $DIR/bad-reg.rs:146:31 | LL | asm!("", out("v6") _, out("f6") _); | ----------- ^^^^^^^^^^^ register `f6` @@ -223,7 +199,7 @@ LL | asm!("", out("v6") _, out("f6") _); | register `v6` error: register `f7` conflicts with register `v7` - --> $DIR/bad-reg.rs:106:31 + --> $DIR/bad-reg.rs:148:31 | LL | asm!("", out("v7") _, out("f7") _); | ----------- ^^^^^^^^^^^ register `f7` @@ -231,7 +207,7 @@ LL | asm!("", out("v7") _, out("f7") _); | register `v7` error: register `f8` conflicts with register `v8` - --> $DIR/bad-reg.rs:108:31 + --> $DIR/bad-reg.rs:150:31 | LL | asm!("", out("v8") _, out("f8") _); | ----------- ^^^^^^^^^^^ register `f8` @@ -239,7 +215,7 @@ LL | asm!("", out("v8") _, out("f8") _); | register `v8` error: register `f9` conflicts with register `v9` - --> $DIR/bad-reg.rs:110:31 + --> $DIR/bad-reg.rs:152:31 | LL | asm!("", out("v9") _, out("f9") _); | ----------- ^^^^^^^^^^^ register `f9` @@ -247,7 +223,7 @@ LL | asm!("", out("v9") _, out("f9") _); | register `v9` error: register `f10` conflicts with register `v10` - --> $DIR/bad-reg.rs:112:32 + --> $DIR/bad-reg.rs:154:32 | LL | asm!("", out("v10") _, out("f10") _); | ------------ ^^^^^^^^^^^^ register `f10` @@ -255,7 +231,7 @@ LL | asm!("", out("v10") _, out("f10") _); | register `v10` error: register `f11` conflicts with register `v11` - --> $DIR/bad-reg.rs:114:32 + --> $DIR/bad-reg.rs:156:32 | LL | asm!("", out("v11") _, out("f11") _); | ------------ ^^^^^^^^^^^^ register `f11` @@ -263,7 +239,7 @@ LL | asm!("", out("v11") _, out("f11") _); | register `v11` error: register `f12` conflicts with register `v12` - --> $DIR/bad-reg.rs:116:32 + --> $DIR/bad-reg.rs:158:32 | LL | asm!("", out("v12") _, out("f12") _); | ------------ ^^^^^^^^^^^^ register `f12` @@ -271,7 +247,7 @@ LL | asm!("", out("v12") _, out("f12") _); | register `v12` error: register `f13` conflicts with register `v13` - --> $DIR/bad-reg.rs:118:32 + --> $DIR/bad-reg.rs:160:32 | LL | asm!("", out("v13") _, out("f13") _); | ------------ ^^^^^^^^^^^^ register `f13` @@ -279,7 +255,7 @@ LL | asm!("", out("v13") _, out("f13") _); | register `v13` error: register `f14` conflicts with register `v14` - --> $DIR/bad-reg.rs:120:32 + --> $DIR/bad-reg.rs:162:32 | LL | asm!("", out("v14") _, out("f14") _); | ------------ ^^^^^^^^^^^^ register `f14` @@ -287,7 +263,7 @@ LL | asm!("", out("v14") _, out("f14") _); | register `v14` error: register `f15` conflicts with register `v15` - --> $DIR/bad-reg.rs:122:32 + --> $DIR/bad-reg.rs:164:32 | LL | asm!("", out("v15") _, out("f15") _); | ------------ ^^^^^^^^^^^^ register `f15` @@ -295,58 +271,94 @@ LL | asm!("", out("v15") _, out("f15") _); | register `v15` error: invalid register `f16`: unknown register - --> $DIR/bad-reg.rs:125:32 + --> $DIR/bad-reg.rs:167:32 | LL | asm!("", out("v16") _, out("f16") _); | ^^^^^^^^^^^^ -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:63:27 +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:74:18 | -LL | asm!("", in("a2") x); - | ^ +LL | asm!("", in("v0") v); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:78:18 | - = note: register class `areg` supports these types: +LL | asm!("", out("v0") v); // requires vector & asm_experimental_reg + | ^^^^^^^^^^^ -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:66:28 +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:82:18 | -LL | asm!("", out("a2") x); - | ^ +LL | asm!("", in("v0") x); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:86:18 | - = note: register class `areg` supports these types: +LL | asm!("", out("v0") x); // requires vector & asm_experimental_reg + | ^^^^^^^^^^^ -error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:69:35 +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:90:18 | -LL | asm!("/* {} */", in(areg) x); - | ^ +LL | asm!("", in("v0") b); + | ^^^^^^^^^^ + +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:95:18 | - = note: register class `areg` supports these types: +LL | asm!("", out("v0") b); + | ^^^^^^^^^^^ + +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:100:26 + | +LL | asm!("/* {} */", in(vreg) v); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:104:26 + | +LL | asm!("/* {} */", in(vreg) x); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:108:26 + | +LL | asm!("/* {} */", in(vreg) b); + | ^^^^^^^^^^ + +error: register class `vreg` requires the `vector` target feature + --> $DIR/bad-reg.rs:113:26 + | +LL | asm!("/* {} */", out(vreg) _); // requires vector & asm_experimental_reg + | ^^^^^^^^^^^ error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:78:27 + --> $DIR/bad-reg.rs:120:27 | -LL | asm!("", in("v0") x); +LL | asm!("", in("a2") x); | ^ | - = note: register class `vreg` supports these types: + = note: register class `areg` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:81:28 + --> $DIR/bad-reg.rs:123:28 | -LL | asm!("", out("v0") x); +LL | asm!("", out("a2") x); | ^ | - = note: register class `vreg` supports these types: + = note: register class `areg` supports these types: error: type `i32` cannot be used with this register class - --> $DIR/bad-reg.rs:84:35 + --> $DIR/bad-reg.rs:126:35 | -LL | asm!("/* {} */", in(vreg) x); +LL | asm!("/* {} */", in(areg) x); | ^ | - = note: register class `vreg` supports these types: + = note: register class `areg` supports these types: -error: aborting due to 51 previous errors +error: aborting due to 54 previous errors diff --git a/tests/ui/asm/s390x/bad-reg.s390x_vector.stderr b/tests/ui/asm/s390x/bad-reg.s390x_vector.stderr new file mode 100644 index 00000000000..897f872ae72 --- /dev/null +++ b/tests/ui/asm/s390x/bad-reg.s390x_vector.stderr @@ -0,0 +1,328 @@ +error: invalid register `r11`: The frame pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:31:18 + | +LL | asm!("", out("r11") _); + | ^^^^^^^^^^^^ + +error: invalid register `r15`: The stack pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:33:18 + | +LL | asm!("", out("r15") _); + | ^^^^^^^^^^^^ + +error: invalid register `c0`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:35:18 + | +LL | asm!("", out("c0") _); + | ^^^^^^^^^^^ + +error: invalid register `c1`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:37:18 + | +LL | asm!("", out("c1") _); + | ^^^^^^^^^^^ + +error: invalid register `c2`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:39:18 + | +LL | asm!("", out("c2") _); + | ^^^^^^^^^^^ + +error: invalid register `c3`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:41:18 + | +LL | asm!("", out("c3") _); + | ^^^^^^^^^^^ + +error: invalid register `c4`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:43:18 + | +LL | asm!("", out("c4") _); + | ^^^^^^^^^^^ + +error: invalid register `c5`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:45:18 + | +LL | asm!("", out("c5") _); + | ^^^^^^^^^^^ + +error: invalid register `c6`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:47:18 + | +LL | asm!("", out("c6") _); + | ^^^^^^^^^^^ + +error: invalid register `c7`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:49:18 + | +LL | asm!("", out("c7") _); + | ^^^^^^^^^^^ + +error: invalid register `c8`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:51:18 + | +LL | asm!("", out("c8") _); + | ^^^^^^^^^^^ + +error: invalid register `c9`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:53:18 + | +LL | asm!("", out("c9") _); + | ^^^^^^^^^^^ + +error: invalid register `c10`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:55:18 + | +LL | asm!("", out("c10") _); + | ^^^^^^^^^^^^ + +error: invalid register `c11`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:57:18 + | +LL | asm!("", out("c11") _); + | ^^^^^^^^^^^^ + +error: invalid register `c12`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:59:18 + | +LL | asm!("", out("c12") _); + | ^^^^^^^^^^^^ + +error: invalid register `c13`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:61:18 + | +LL | asm!("", out("c13") _); + | ^^^^^^^^^^^^ + +error: invalid register `c14`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:63:18 + | +LL | asm!("", out("c14") _); + | ^^^^^^^^^^^^ + +error: invalid register `c15`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:65:18 + | +LL | asm!("", out("c15") _); + | ^^^^^^^^^^^^ + +error: invalid register `a0`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:67:18 + | +LL | asm!("", out("a0") _); + | ^^^^^^^^^^^ + +error: invalid register `a1`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:69:18 + | +LL | asm!("", out("a1") _); + | ^^^^^^^^^^^ + +error: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:120:18 + | +LL | asm!("", in("a2") x); + | ^^^^^^^^^^ + +error: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:123:18 + | +LL | asm!("", out("a2") x); + | ^^^^^^^^^^^ + +error: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:126:26 + | +LL | asm!("/* {} */", in(areg) x); + | ^^^^^^^^^^ + +error: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:129:26 + | +LL | asm!("/* {} */", out(areg) _); + | ^^^^^^^^^^^ + +error: register `f0` conflicts with register `v0` + --> $DIR/bad-reg.rs:134:31 + | +LL | asm!("", out("v0") _, out("f0") _); + | ----------- ^^^^^^^^^^^ register `f0` + | | + | register `v0` + +error: register `f1` conflicts with register `v1` + --> $DIR/bad-reg.rs:136:31 + | +LL | asm!("", out("v1") _, out("f1") _); + | ----------- ^^^^^^^^^^^ register `f1` + | | + | register `v1` + +error: register `f2` conflicts with register `v2` + --> $DIR/bad-reg.rs:138:31 + | +LL | asm!("", out("v2") _, out("f2") _); + | ----------- ^^^^^^^^^^^ register `f2` + | | + | register `v2` + +error: register `f3` conflicts with register `v3` + --> $DIR/bad-reg.rs:140:31 + | +LL | asm!("", out("v3") _, out("f3") _); + | ----------- ^^^^^^^^^^^ register `f3` + | | + | register `v3` + +error: register `f4` conflicts with register `v4` + --> $DIR/bad-reg.rs:142:31 + | +LL | asm!("", out("v4") _, out("f4") _); + | ----------- ^^^^^^^^^^^ register `f4` + | | + | register `v4` + +error: register `f5` conflicts with register `v5` + --> $DIR/bad-reg.rs:144:31 + | +LL | asm!("", out("v5") _, out("f5") _); + | ----------- ^^^^^^^^^^^ register `f5` + | | + | register `v5` + +error: register `f6` conflicts with register `v6` + --> $DIR/bad-reg.rs:146:31 + | +LL | asm!("", out("v6") _, out("f6") _); + | ----------- ^^^^^^^^^^^ register `f6` + | | + | register `v6` + +error: register `f7` conflicts with register `v7` + --> $DIR/bad-reg.rs:148:31 + | +LL | asm!("", out("v7") _, out("f7") _); + | ----------- ^^^^^^^^^^^ register `f7` + | | + | register `v7` + +error: register `f8` conflicts with register `v8` + --> $DIR/bad-reg.rs:150:31 + | +LL | asm!("", out("v8") _, out("f8") _); + | ----------- ^^^^^^^^^^^ register `f8` + | | + | register `v8` + +error: register `f9` conflicts with register `v9` + --> $DIR/bad-reg.rs:152:31 + | +LL | asm!("", out("v9") _, out("f9") _); + | ----------- ^^^^^^^^^^^ register `f9` + | | + | register `v9` + +error: register `f10` conflicts with register `v10` + --> $DIR/bad-reg.rs:154:32 + | +LL | asm!("", out("v10") _, out("f10") _); + | ------------ ^^^^^^^^^^^^ register `f10` + | | + | register `v10` + +error: register `f11` conflicts with register `v11` + --> $DIR/bad-reg.rs:156:32 + | +LL | asm!("", out("v11") _, out("f11") _); + | ------------ ^^^^^^^^^^^^ register `f11` + | | + | register `v11` + +error: register `f12` conflicts with register `v12` + --> $DIR/bad-reg.rs:158:32 + | +LL | asm!("", out("v12") _, out("f12") _); + | ------------ ^^^^^^^^^^^^ register `f12` + | | + | register `v12` + +error: register `f13` conflicts with register `v13` + --> $DIR/bad-reg.rs:160:32 + | +LL | asm!("", out("v13") _, out("f13") _); + | ------------ ^^^^^^^^^^^^ register `f13` + | | + | register `v13` + +error: register `f14` conflicts with register `v14` + --> $DIR/bad-reg.rs:162:32 + | +LL | asm!("", out("v14") _, out("f14") _); + | ------------ ^^^^^^^^^^^^ register `f14` + | | + | register `v14` + +error: register `f15` conflicts with register `v15` + --> $DIR/bad-reg.rs:164:32 + | +LL | asm!("", out("v15") _, out("f15") _); + | ------------ ^^^^^^^^^^^^ register `f15` + | | + | register `v15` + +error: invalid register `f16`: unknown register + --> $DIR/bad-reg.rs:167:32 + | +LL | asm!("", out("v16") _, out("f16") _); + | ^^^^^^^^^^^^ + +error: type `u8` cannot be used with this register class + --> $DIR/bad-reg.rs:90:27 + | +LL | asm!("", in("v0") b); + | ^ + | + = note: register class `vreg` supports these types: i32, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2 + +error: type `u8` cannot be used with this register class + --> $DIR/bad-reg.rs:95:28 + | +LL | asm!("", out("v0") b); + | ^ + | + = note: register class `vreg` supports these types: i32, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2 + +error: type `u8` cannot be used with this register class + --> $DIR/bad-reg.rs:108:35 + | +LL | asm!("/* {} */", in(vreg) b); + | ^ + | + = note: register class `vreg` supports these types: i32, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2 + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:120:27 + | +LL | asm!("", in("a2") x); + | ^ + | + = note: register class `areg` supports these types: + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:123:28 + | +LL | asm!("", out("a2") x); + | ^ + | + = note: register class `areg` supports these types: + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:126:35 + | +LL | asm!("/* {} */", in(areg) x); + | ^ + | + = note: register class `areg` supports these types: + +error: aborting due to 47 previous errors + diff --git a/tests/ui/asm/s390x/bad-reg.s390x_vector_stable.stderr b/tests/ui/asm/s390x/bad-reg.s390x_vector_stable.stderr new file mode 100644 index 00000000000..e2b3eeef4e9 --- /dev/null +++ b/tests/ui/asm/s390x/bad-reg.s390x_vector_stable.stderr @@ -0,0 +1,489 @@ +error: invalid register `r11`: The frame pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:31:18 + | +LL | asm!("", out("r11") _); + | ^^^^^^^^^^^^ + +error: invalid register `r15`: The stack pointer cannot be used as an operand for inline asm + --> $DIR/bad-reg.rs:33:18 + | +LL | asm!("", out("r15") _); + | ^^^^^^^^^^^^ + +error: invalid register `c0`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:35:18 + | +LL | asm!("", out("c0") _); + | ^^^^^^^^^^^ + +error: invalid register `c1`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:37:18 + | +LL | asm!("", out("c1") _); + | ^^^^^^^^^^^ + +error: invalid register `c2`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:39:18 + | +LL | asm!("", out("c2") _); + | ^^^^^^^^^^^ + +error: invalid register `c3`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:41:18 + | +LL | asm!("", out("c3") _); + | ^^^^^^^^^^^ + +error: invalid register `c4`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:43:18 + | +LL | asm!("", out("c4") _); + | ^^^^^^^^^^^ + +error: invalid register `c5`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:45:18 + | +LL | asm!("", out("c5") _); + | ^^^^^^^^^^^ + +error: invalid register `c6`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:47:18 + | +LL | asm!("", out("c6") _); + | ^^^^^^^^^^^ + +error: invalid register `c7`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:49:18 + | +LL | asm!("", out("c7") _); + | ^^^^^^^^^^^ + +error: invalid register `c8`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:51:18 + | +LL | asm!("", out("c8") _); + | ^^^^^^^^^^^ + +error: invalid register `c9`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:53:18 + | +LL | asm!("", out("c9") _); + | ^^^^^^^^^^^ + +error: invalid register `c10`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:55:18 + | +LL | asm!("", out("c10") _); + | ^^^^^^^^^^^^ + +error: invalid register `c11`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:57:18 + | +LL | asm!("", out("c11") _); + | ^^^^^^^^^^^^ + +error: invalid register `c12`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:59:18 + | +LL | asm!("", out("c12") _); + | ^^^^^^^^^^^^ + +error: invalid register `c13`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:61:18 + | +LL | asm!("", out("c13") _); + | ^^^^^^^^^^^^ + +error: invalid register `c14`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:63:18 + | +LL | asm!("", out("c14") _); + | ^^^^^^^^^^^^ + +error: invalid register `c15`: control registers are reserved by the kernel and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:65:18 + | +LL | asm!("", out("c15") _); + | ^^^^^^^^^^^^ + +error: invalid register `a0`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:67:18 + | +LL | asm!("", out("a0") _); + | ^^^^^^^^^^^ + +error: invalid register `a1`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm + --> $DIR/bad-reg.rs:69:18 + | +LL | asm!("", out("a1") _); + | ^^^^^^^^^^^ + +error[E0658]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:74:18 + | +LL | asm!("", in("v0") v); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:78:18 + | +LL | asm!("", out("v0") v); // requires vector & asm_experimental_reg + | ^^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:82:18 + | +LL | asm!("", in("v0") x); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:86:18 + | +LL | asm!("", out("v0") x); // requires vector & asm_experimental_reg + | ^^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:90:18 + | +LL | asm!("", in("v0") b); + | ^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:95:18 + | +LL | asm!("", out("v0") b); + | ^^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:100:26 + | +LL | asm!("/* {} */", in(vreg) v); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:104:26 + | +LL | asm!("/* {} */", in(vreg) x); // requires vector & asm_experimental_reg + | ^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:108:26 + | +LL | asm!("/* {} */", in(vreg) b); + | ^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: register class `vreg` can only be used as a clobber in stable + --> $DIR/bad-reg.rs:113:26 + | +LL | asm!("/* {} */", out(vreg) _); // requires vector & asm_experimental_reg + | ^^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:120:18 + | +LL | asm!("", in("a2") x); + | ^^^^^^^^^^ + +error: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:123:18 + | +LL | asm!("", out("a2") x); + | ^^^^^^^^^^^ + +error: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:126:26 + | +LL | asm!("/* {} */", in(areg) x); + | ^^^^^^^^^^ + +error: register class `areg` can only be used as a clobber, not as an input or output + --> $DIR/bad-reg.rs:129:26 + | +LL | asm!("/* {} */", out(areg) _); + | ^^^^^^^^^^^ + +error: register `f0` conflicts with register `v0` + --> $DIR/bad-reg.rs:134:31 + | +LL | asm!("", out("v0") _, out("f0") _); + | ----------- ^^^^^^^^^^^ register `f0` + | | + | register `v0` + +error: register `f1` conflicts with register `v1` + --> $DIR/bad-reg.rs:136:31 + | +LL | asm!("", out("v1") _, out("f1") _); + | ----------- ^^^^^^^^^^^ register `f1` + | | + | register `v1` + +error: register `f2` conflicts with register `v2` + --> $DIR/bad-reg.rs:138:31 + | +LL | asm!("", out("v2") _, out("f2") _); + | ----------- ^^^^^^^^^^^ register `f2` + | | + | register `v2` + +error: register `f3` conflicts with register `v3` + --> $DIR/bad-reg.rs:140:31 + | +LL | asm!("", out("v3") _, out("f3") _); + | ----------- ^^^^^^^^^^^ register `f3` + | | + | register `v3` + +error: register `f4` conflicts with register `v4` + --> $DIR/bad-reg.rs:142:31 + | +LL | asm!("", out("v4") _, out("f4") _); + | ----------- ^^^^^^^^^^^ register `f4` + | | + | register `v4` + +error: register `f5` conflicts with register `v5` + --> $DIR/bad-reg.rs:144:31 + | +LL | asm!("", out("v5") _, out("f5") _); + | ----------- ^^^^^^^^^^^ register `f5` + | | + | register `v5` + +error: register `f6` conflicts with register `v6` + --> $DIR/bad-reg.rs:146:31 + | +LL | asm!("", out("v6") _, out("f6") _); + | ----------- ^^^^^^^^^^^ register `f6` + | | + | register `v6` + +error: register `f7` conflicts with register `v7` + --> $DIR/bad-reg.rs:148:31 + | +LL | asm!("", out("v7") _, out("f7") _); + | ----------- ^^^^^^^^^^^ register `f7` + | | + | register `v7` + +error: register `f8` conflicts with register `v8` + --> $DIR/bad-reg.rs:150:31 + | +LL | asm!("", out("v8") _, out("f8") _); + | ----------- ^^^^^^^^^^^ register `f8` + | | + | register `v8` + +error: register `f9` conflicts with register `v9` + --> $DIR/bad-reg.rs:152:31 + | +LL | asm!("", out("v9") _, out("f9") _); + | ----------- ^^^^^^^^^^^ register `f9` + | | + | register `v9` + +error: register `f10` conflicts with register `v10` + --> $DIR/bad-reg.rs:154:32 + | +LL | asm!("", out("v10") _, out("f10") _); + | ------------ ^^^^^^^^^^^^ register `f10` + | | + | register `v10` + +error: register `f11` conflicts with register `v11` + --> $DIR/bad-reg.rs:156:32 + | +LL | asm!("", out("v11") _, out("f11") _); + | ------------ ^^^^^^^^^^^^ register `f11` + | | + | register `v11` + +error: register `f12` conflicts with register `v12` + --> $DIR/bad-reg.rs:158:32 + | +LL | asm!("", out("v12") _, out("f12") _); + | ------------ ^^^^^^^^^^^^ register `f12` + | | + | register `v12` + +error: register `f13` conflicts with register `v13` + --> $DIR/bad-reg.rs:160:32 + | +LL | asm!("", out("v13") _, out("f13") _); + | ------------ ^^^^^^^^^^^^ register `f13` + | | + | register `v13` + +error: register `f14` conflicts with register `v14` + --> $DIR/bad-reg.rs:162:32 + | +LL | asm!("", out("v14") _, out("f14") _); + | ------------ ^^^^^^^^^^^^ register `f14` + | | + | register `v14` + +error: register `f15` conflicts with register `v15` + --> $DIR/bad-reg.rs:164:32 + | +LL | asm!("", out("v15") _, out("f15") _); + | ------------ ^^^^^^^^^^^^ register `f15` + | | + | register `v15` + +error: invalid register `f16`: unknown register + --> $DIR/bad-reg.rs:167:32 + | +LL | asm!("", out("v16") _, out("f16") _); + | ^^^^^^^^^^^^ + +error[E0658]: type `i64x2` cannot be used with this register class in stable + --> $DIR/bad-reg.rs:74:27 + | +LL | asm!("", in("v0") v); // requires vector & asm_experimental_reg + | ^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: type `i64x2` cannot be used with this register class in stable + --> $DIR/bad-reg.rs:78:28 + | +LL | asm!("", out("v0") v); // requires vector & asm_experimental_reg + | ^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: type `i32` cannot be used with this register class in stable + --> $DIR/bad-reg.rs:82:27 + | +LL | asm!("", in("v0") x); // requires vector & asm_experimental_reg + | ^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: type `i32` cannot be used with this register class in stable + --> $DIR/bad-reg.rs:86:28 + | +LL | asm!("", out("v0") x); // requires vector & asm_experimental_reg + | ^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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: type `u8` cannot be used with this register class + --> $DIR/bad-reg.rs:90:27 + | +LL | asm!("", in("v0") b); + | ^ + | + = note: register class `vreg` supports these types: + +error: type `u8` cannot be used with this register class + --> $DIR/bad-reg.rs:95:28 + | +LL | asm!("", out("v0") b); + | ^ + | + = note: register class `vreg` supports these types: + +error[E0658]: type `i64x2` cannot be used with this register class in stable + --> $DIR/bad-reg.rs:100:35 + | +LL | asm!("/* {} */", in(vreg) v); // requires vector & asm_experimental_reg + | ^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: type `i32` cannot be used with this register class in stable + --> $DIR/bad-reg.rs:104:35 + | +LL | asm!("/* {} */", in(vreg) x); // requires vector & asm_experimental_reg + | ^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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: type `u8` cannot be used with this register class + --> $DIR/bad-reg.rs:108:35 + | +LL | asm!("/* {} */", in(vreg) b); + | ^ + | + = note: register class `vreg` supports these types: + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:120:27 + | +LL | asm!("", in("a2") x); + | ^ + | + = note: register class `areg` supports these types: + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:123:28 + | +LL | asm!("", out("a2") x); + | ^ + | + = note: register class `areg` supports these types: + +error: type `i32` cannot be used with this register class + --> $DIR/bad-reg.rs:126:35 + | +LL | asm!("/* {} */", in(areg) x); + | ^ + | + = note: register class `areg` supports these types: + +error: aborting due to 63 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/asm/x86_64/goto-block-safe.rs b/tests/ui/asm/x86_64/goto-block-safe.rs new file mode 100644 index 00000000000..ee833a48a4b --- /dev/null +++ b/tests/ui/asm/x86_64/goto-block-safe.rs @@ -0,0 +1,23 @@ +//@ only-x86_64 +//@ needs-asm-support + +#![deny(unreachable_code)] +#![feature(asm_goto)] + +use std::arch::asm; + +fn goto_fallthough() { + unsafe { + asm!( + "/* {} */", + label { + core::hint::unreachable_unchecked(); + //~^ ERROR [E0133] + } + ) + } +} + +fn main() { + goto_fallthough(); +} diff --git a/tests/ui/asm/x86_64/goto-block-safe.stderr b/tests/ui/asm/x86_64/goto-block-safe.stderr new file mode 100644 index 00000000000..49818db7484 --- /dev/null +++ b/tests/ui/asm/x86_64/goto-block-safe.stderr @@ -0,0 +1,14 @@ +error[E0133]: call to unsafe function `unreachable_unchecked` is unsafe and requires unsafe function or block + --> $DIR/goto-block-safe.rs:14:17 + | +LL | unsafe { + | ------ items do not inherit unsafety from separate enclosing items +... +LL | core::hint::unreachable_unchecked(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/asm/x86_64/goto.rs b/tests/ui/asm/x86_64/goto.rs index 6c14bb57ac6..50e7441509a 100644 --- a/tests/ui/asm/x86_64/goto.rs +++ b/tests/ui/asm/x86_64/goto.rs @@ -3,7 +3,7 @@ //@ needs-asm-support #![deny(unreachable_code)] -#![feature(asm_goto)] +#![feature(asm_goto, asm_goto_with_outputs)] use std::arch::asm; @@ -31,10 +31,6 @@ fn goto_jump() { } } -// asm goto with outputs cause miscompilation in LLVM. UB can be triggered -// when outputs are used inside the label block when optimisation is enabled. -// See: https://github.com/llvm/llvm-project/issues/74483 -/* fn goto_out_fallthrough() { unsafe { let mut out: usize; @@ -68,7 +64,57 @@ fn goto_out_jump() { assert!(value); } } -*/ + +fn goto_out_jump_noreturn() { + unsafe { + let mut value = false; + let mut out: usize; + asm!( + "lea {}, [{} + 1]", + "jmp {}", + out(reg) out, + in(reg) 0x12345678usize, + label { + value = true; + assert_eq!(out, 0x12345679); + }, + options(noreturn) + ); + assert!(value); + } +} + +// asm goto with outputs cause miscompilation in LLVM when multiple outputs are present. +// The code sample below is adapted from https://github.com/llvm/llvm-project/issues/74483 +// and does not work with `-C opt-level=0` +#[expect(unused)] +fn goto_multi_out() { + #[inline(never)] + #[allow(unused)] + fn goto_multi_out(a: usize, b: usize) -> usize { + let mut x: usize; + let mut y: usize; + let mut z: usize; + unsafe { + core::arch::asm!( + "mov {x}, {a}", + "test {a}, {a}", + "jnz {label1}", + "/* {y} {z} {b} {label2} */", + x = out(reg) x, + y = out(reg) y, + z = out(reg) z, + a = in(reg) a, + b = in(reg) b, + label1 = label { return x }, + label2 = label { return 1 }, + ); + 0 + } + } + + assert_eq!(goto_multi_out(11, 22), 11); +} fn goto_noreturn() { unsafe { @@ -102,8 +148,10 @@ fn goto_noreturn_diverge() { fn main() { goto_fallthough(); goto_jump(); - // goto_out_fallthrough(); - // goto_out_jump(); + goto_out_fallthrough(); + goto_out_jump(); + goto_out_jump_noreturn(); + // goto_multi_out(); goto_noreturn(); goto_noreturn_diverge(); } diff --git a/tests/ui/asm/x86_64/goto.stderr b/tests/ui/asm/x86_64/goto.stderr index 27e227d71a5..8f89e2b1290 100644 --- a/tests/ui/asm/x86_64/goto.stderr +++ b/tests/ui/asm/x86_64/goto.stderr @@ -1,5 +1,5 @@ warning: unreachable statement - --> $DIR/goto.rs:97:9 + --> $DIR/goto.rs:143:9 | LL | / asm!( LL | | "jmp {}", @@ -13,7 +13,7 @@ LL | unreachable!(); | ^^^^^^^^^^^^^^ unreachable statement | note: the lint level is defined here - --> $DIR/goto.rs:87:8 + --> $DIR/goto.rs:133:8 | LL | #[warn(unreachable_code)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.rs b/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.rs index 8fe79b97d9b..977ef604b34 100644 --- a/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.rs +++ b/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.rs @@ -15,6 +15,7 @@ impl Foo for Def { pub fn test<A: Foo, B: Foo>() { let _array = [4; <A as Foo>::Y]; //~^ ERROR constant expression depends on a generic parameter + //~| ERROR constant expression depends on a generic parameter } fn main() { diff --git a/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.stderr b/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.stderr index cd830394285..8202342c65d 100644 --- a/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.stderr +++ b/tests/ui/associated-consts/associated-const-type-parameter-arrays-2.stderr @@ -6,5 +6,13 @@ LL | let _array = [4; <A as Foo>::Y]; | = note: this may fail depending on what value the parameter takes -error: aborting due to 1 previous error +error: constant expression depends on a generic parameter + --> $DIR/associated-const-type-parameter-arrays-2.rs:16:18 + | +LL | let _array = [4; <A as Foo>::Y]; + | ^^^^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to 2 previous errors diff --git a/tests/ui/associated-type-bounds/all-generics-lookup.rs b/tests/ui/associated-type-bounds/all-generics-lookup.rs new file mode 100644 index 00000000000..c5940c14f44 --- /dev/null +++ b/tests/ui/associated-type-bounds/all-generics-lookup.rs @@ -0,0 +1,31 @@ +//@ check-pass + +#![feature(return_type_notation)] + +trait Trait { + fn method(&self) -> impl Sized; +} + +impl Trait for () { + fn method(&self) -> impl Sized {} +} + +struct Struct<T>(T); + +// This test used to fail a debug assertion since we weren't resolving the item +// for `T::method(..)` correctly, leading to two bound vars being given the +// index 0. The solution is to look at both generics of `test` and its parent impl. + +impl<T> Struct<T> +where + T: Trait, +{ + fn test() + where + T::method(..): Send + {} +} + +fn main() { + Struct::<()>::test(); +} diff --git a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs index c0012564843..ee75cb96afd 100644 --- a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs +++ b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs @@ -5,7 +5,6 @@ trait Item { pub struct Flatten<I> { inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, //~^ ERROR E0191 - //~| ERROR E0223 } fn main() {} diff --git a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr index 39a2b98e2e2..c80b32dc3d8 100644 --- a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr +++ b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr @@ -4,18 +4,6 @@ error[E0191]: the value of the associated types `Item` and `IntoIter` in `IntoIt LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated types: `IntoIterator<Item: IntoIterator<Item: >, Item = Type, IntoIter = Type>` -error[E0223]: ambiguous associated type - --> $DIR/overlaping-bound-suggestion.rs:6:13 - | -LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: if there were a trait named `Example` with associated type `IntoIterator` implemented for `(dyn IntoIterator + 'static)`, you could use the fully-qualified path - | -LL | inner: <<(dyn IntoIterator + 'static) as Example>::IntoIterator as Item>::Core, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0191, E0223. -For more information about an error, try `rustc --explain E0191`. +For more information about this error, try `rustc --explain E0191`. diff --git a/tests/ui/associated-types/associated-types-binding-in-where-clause.rs b/tests/ui/associated-types/associated-types-binding-in-where-clause.rs index ed2cebb5f7e..b82656945a2 100644 --- a/tests/ui/associated-types/associated-types-binding-in-where-clause.rs +++ b/tests/ui/associated-types/associated-types-binding-in-where-clause.rs @@ -1,7 +1,6 @@ //@ run-pass // Test equality constraints on associated types in a where clause. -//@ pretty-expanded FIXME #23616 pub trait Foo { type A; diff --git a/tests/ui/associated-types/associated-types-conditional-dispatch.rs b/tests/ui/associated-types/associated-types-conditional-dispatch.rs index d30ea66e9b9..3ec835ccbc3 100644 --- a/tests/ui/associated-types/associated-types-conditional-dispatch.rs +++ b/tests/ui/associated-types/associated-types-conditional-dispatch.rs @@ -5,7 +5,6 @@ // `Target=[A]`, then the impl marked with `(*)` is seen to conflict // with all the others. -//@ pretty-expanded FIXME #23616 use std::marker::PhantomData; use std::ops::Deref; diff --git a/tests/ui/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs b/tests/ui/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs index e2c13716a69..9bf7570534c 100644 --- a/tests/ui/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs +++ b/tests/ui/associated-types/associated-types-duplicate-binding-in-env-hrtb.rs @@ -4,7 +4,6 @@ // (modulo bound lifetime names) appears in the environment // twice. Issue #21965. -//@ pretty-expanded FIXME #23616 fn foo<T>(t: T) -> i32 where T : for<'a> Fn(&'a u8) -> i32, diff --git a/tests/ui/associated-types/associated-types-duplicate-binding-in-env.rs b/tests/ui/associated-types/associated-types-duplicate-binding-in-env.rs index d1ff4b222b7..44c5634f4ef 100644 --- a/tests/ui/associated-types/associated-types-duplicate-binding-in-env.rs +++ b/tests/ui/associated-types/associated-types-duplicate-binding-in-env.rs @@ -3,7 +3,6 @@ // Check that we do not report ambiguities when the same predicate // appears in the environment twice. Issue #21965. -//@ pretty-expanded FIXME #23616 trait Foo { type B; diff --git a/tests/ui/associated-types/associated-types-eq-obj.rs b/tests/ui/associated-types/associated-types-eq-obj.rs index 1236d770b95..c1ca8bbd739 100644 --- a/tests/ui/associated-types/associated-types-eq-obj.rs +++ b/tests/ui/associated-types/associated-types-eq-obj.rs @@ -1,7 +1,6 @@ //@ run-pass // Test equality constraints on associated types inside of an object type -//@ pretty-expanded FIXME #23616 pub trait Foo { type A; diff --git a/tests/ui/associated-types/associated-types-issue-20371.rs b/tests/ui/associated-types/associated-types-issue-20371.rs index 32fe1ca1c00..d2e056a57b2 100644 --- a/tests/ui/associated-types/associated-types-issue-20371.rs +++ b/tests/ui/associated-types/associated-types-issue-20371.rs @@ -2,7 +2,6 @@ // Test that we are able to have an impl that defines an associated type // before the actual trait. -//@ pretty-expanded FIXME #23616 impl X for f64 { type Y = isize; } trait X { type Y; } diff --git a/tests/ui/associated-types/associated-types-nested-projections.rs b/tests/ui/associated-types/associated-types-nested-projections.rs index 90ff170a6a7..659016b4644 100644 --- a/tests/ui/associated-types/associated-types-nested-projections.rs +++ b/tests/ui/associated-types/associated-types-nested-projections.rs @@ -2,7 +2,6 @@ #![allow(unused_variables)] // Test that we can resolve nested projection types. Issue #20666. -//@ pretty-expanded FIXME #23616 use std::slice; diff --git a/tests/ui/associated-types/associated-types-nested-projections.stderr b/tests/ui/associated-types/associated-types-nested-projections.stderr index 97d5a758573..1b69fcfacf5 100644 --- a/tests/ui/associated-types/associated-types-nested-projections.stderr +++ b/tests/ui/associated-types/associated-types-nested-projections.stderr @@ -1,5 +1,5 @@ warning: method `into_iter` is never used - --> $DIR/associated-types-nested-projections.rs:16:8 + --> $DIR/associated-types-nested-projections.rs:15:8 | LL | trait IntoIterator { | ------------ method in this trait diff --git a/tests/ui/associated-types/associated-types-normalize-in-bounds-binding.rs b/tests/ui/associated-types/associated-types-normalize-in-bounds-binding.rs index bd9b91b002e..a6e426df1c9 100644 --- a/tests/ui/associated-types/associated-types-normalize-in-bounds-binding.rs +++ b/tests/ui/associated-types/associated-types-normalize-in-bounds-binding.rs @@ -3,7 +3,6 @@ // Test that we normalize associated types that appear in a bound that // contains a binding. Issue #21664. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/associated-types/associated-types-normalize-in-bounds-ufcs.rs b/tests/ui/associated-types/associated-types-normalize-in-bounds-ufcs.rs index 884b1a17a2c..f15de0d9a28 100644 --- a/tests/ui/associated-types/associated-types-normalize-in-bounds-ufcs.rs +++ b/tests/ui/associated-types/associated-types-normalize-in-bounds-ufcs.rs @@ -3,7 +3,6 @@ // Test that we normalize associated types that appear in bounds; if // we didn't, the call to `self.split2()` fails to type check. -//@ pretty-expanded FIXME #23616 use std::marker::PhantomData; diff --git a/tests/ui/associated-types/associated-types-normalize-in-bounds.rs b/tests/ui/associated-types/associated-types-normalize-in-bounds.rs index 8da60e1d9cb..7e94d3a011f 100644 --- a/tests/ui/associated-types/associated-types-normalize-in-bounds.rs +++ b/tests/ui/associated-types/associated-types-normalize-in-bounds.rs @@ -3,7 +3,6 @@ // Test that we normalize associated types that appear in bounds; if // we didn't, the call to `self.split2()` fails to type check. -//@ pretty-expanded FIXME #23616 use std::marker::PhantomData; diff --git a/tests/ui/associated-types/associated-types-projection-in-object-type.rs b/tests/ui/associated-types/associated-types-projection-in-object-type.rs index 4cf1c256f3d..d5d7a294dfd 100644 --- a/tests/ui/associated-types/associated-types-projection-in-object-type.rs +++ b/tests/ui/associated-types/associated-types-projection-in-object-type.rs @@ -6,7 +6,6 @@ // appear in associated type bindings in object types, which were not // being properly flagged. -//@ pretty-expanded FIXME #23616 use std::ops::{Shl, Shr}; use std::cell::RefCell; diff --git a/tests/ui/associated-types/associated-types-projection-in-where-clause.rs b/tests/ui/associated-types/associated-types-projection-in-where-clause.rs index ed8259396d1..6f4ee8bf177 100644 --- a/tests/ui/associated-types/associated-types-projection-in-where-clause.rs +++ b/tests/ui/associated-types/associated-types-projection-in-where-clause.rs @@ -3,7 +3,6 @@ #![allow(unused_variables)] // Test a where clause that uses a non-normalized projection type. -//@ pretty-expanded FIXME #23616 trait Int { diff --git a/tests/ui/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs b/tests/ui/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs index f0a34325196..c2550c930d3 100644 --- a/tests/ui/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs +++ b/tests/ui/associated-types/associated-types-qualified-path-with-trait-with-type-parameters.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Foo<T> { type Bar; diff --git a/tests/ui/associated-types/associated-types-ref-from-struct.rs b/tests/ui/associated-types/associated-types-ref-from-struct.rs index c16bb8651c3..bdff76e86a3 100644 --- a/tests/ui/associated-types/associated-types-ref-from-struct.rs +++ b/tests/ui/associated-types/associated-types-ref-from-struct.rs @@ -1,7 +1,6 @@ //@ run-pass // Test associated type references in structure fields. -//@ pretty-expanded FIXME #23616 trait Test { type V; diff --git a/tests/ui/associated-types/associated-types-region-erasure-issue-20582.rs b/tests/ui/associated-types/associated-types-region-erasure-issue-20582.rs index dec3a3c9245..7c556005f2d 100644 --- a/tests/ui/associated-types/associated-types-region-erasure-issue-20582.rs +++ b/tests/ui/associated-types/associated-types-region-erasure-issue-20582.rs @@ -3,7 +3,6 @@ // Regression test for #20582. This test caused an ICE related to // inconsistent region erasure in codegen. -//@ pretty-expanded FIXME #23616 struct Foo<'a> { buf: &'a[u8] diff --git a/tests/ui/associated-types/associated-types-resolve-lifetime.rs b/tests/ui/associated-types/associated-types-resolve-lifetime.rs index 6be2fa6f2ab..a75488cf843 100644 --- a/tests/ui/associated-types/associated-types-resolve-lifetime.rs +++ b/tests/ui/associated-types/associated-types-resolve-lifetime.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Get<T> { fn get(&self) -> T; diff --git a/tests/ui/associated-types/issue-19129-1.rs b/tests/ui/associated-types/issue-19129-1.rs index 65340b413e9..e4d8082c05a 100644 --- a/tests/ui/associated-types/issue-19129-1.rs +++ b/tests/ui/associated-types/issue-19129-1.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Trait<Input> { type Output; diff --git a/tests/ui/associated-types/issue-19129-2.rs b/tests/ui/associated-types/issue-19129-2.rs index 6562c54b0b7..15e73bfc532 100644 --- a/tests/ui/associated-types/issue-19129-2.rs +++ b/tests/ui/associated-types/issue-19129-2.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 trait Trait<Input> { type Output; diff --git a/tests/ui/associated-types/issue-20763-1.rs b/tests/ui/associated-types/issue-20763-1.rs index ea2e696767d..0abd2317fa9 100644 --- a/tests/ui/associated-types/issue-20763-1.rs +++ b/tests/ui/associated-types/issue-20763-1.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait T0 { type O; diff --git a/tests/ui/associated-types/issue-20763-2.rs b/tests/ui/associated-types/issue-20763-2.rs index 149bfcb8c99..9e7f3e15fe0 100644 --- a/tests/ui/associated-types/issue-20763-2.rs +++ b/tests/ui/associated-types/issue-20763-2.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait T0 { type O; diff --git a/tests/ui/associated-types/issue-21363.rs b/tests/ui/associated-types/issue-21363.rs index 0dcebafd95b..96d4c202349 100644 --- a/tests/ui/associated-types/issue-21363.rs +++ b/tests/ui/associated-types/issue-21363.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 #![no_implicit_prelude] diff --git a/tests/ui/associated-types/issue-21726.rs b/tests/ui/associated-types/issue-21726.rs index f014c644786..9611423b9f0 100644 --- a/tests/ui/associated-types/issue-21726.rs +++ b/tests/ui/associated-types/issue-21726.rs @@ -4,7 +4,6 @@ // subtyping of projection types that resulted in an unconstrained // region, yielding region inference failures. -//@ pretty-expanded FIXME #23616 fn main() { } diff --git a/tests/ui/associated-types/issue-22560.rs b/tests/ui/associated-types/issue-22560.rs index 44be8817b08..465aea515ee 100644 --- a/tests/ui/associated-types/issue-22560.rs +++ b/tests/ui/associated-types/issue-22560.rs @@ -7,9 +7,6 @@ trait Sub<Rhs=Self> { } type Test = dyn Add + Sub; -//~^ ERROR E0393 -//~| ERROR E0191 -//~| ERROR E0393 -//~| ERROR E0225 +//~^ ERROR E0225 fn main() { } diff --git a/tests/ui/associated-types/issue-22560.stderr b/tests/ui/associated-types/issue-22560.stderr index 834040490f9..d0b6adc520c 100644 --- a/tests/ui/associated-types/issue-22560.stderr +++ b/tests/ui/associated-types/issue-22560.stderr @@ -9,56 +9,6 @@ LL | type Test = dyn Add + Sub; = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add + Sub {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> -error[E0191]: the value of the associated types `Output` in `Add`, `Output` in `Sub` must be specified - --> $DIR/issue-22560.rs:9:17 - | -LL | type Output; - | ----------- `Output` defined here -... -LL | type Output; - | ----------- `Output` defined here -... -LL | type Test = dyn Add + Sub; - | ^^^ ^^^ associated type `Output` must be specified - | | - | associated type `Output` must be specified - | -help: specify the associated types - | -LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>; - | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ - -error[E0393]: the type parameter `Rhs` must be explicitly specified - --> $DIR/issue-22560.rs:9:17 - | -LL | trait Add<Rhs=Self> { - | ------------------- type parameter `Rhs` must be specified for this -... -LL | type Test = dyn Add + Sub; - | ^^^ - | - = note: because of the default `Self` reference, type parameters must be specified on object types -help: set the type parameter to the desired type - | -LL | type Test = dyn Add<Rhs> + Sub; - | +++++ - -error[E0393]: the type parameter `Rhs` must be explicitly specified - --> $DIR/issue-22560.rs:9:23 - | -LL | trait Sub<Rhs=Self> { - | ------------------- type parameter `Rhs` must be specified for this -... -LL | type Test = dyn Add + Sub; - | ^^^ - | - = note: because of the default `Self` reference, type parameters must be specified on object types -help: set the type parameter to the desired type - | -LL | type Test = dyn Add + Sub<Rhs>; - | +++++ - -error: aborting due to 4 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0191, E0225, E0393. -For more information about an error, try `rustc --explain E0191`. +For more information about this error, try `rustc --explain E0225`. diff --git a/tests/ui/associated-types/issue-22828.rs b/tests/ui/associated-types/issue-22828.rs index 2f65f1c2303..5624b9c693b 100644 --- a/tests/ui/associated-types/issue-22828.rs +++ b/tests/ui/associated-types/issue-22828.rs @@ -3,7 +3,6 @@ // Test transitive analysis for associated types. Collected types // should be normalized and new obligations generated. -//@ pretty-expanded FIXME #23616 trait Foo { type A; diff --git a/tests/ui/associated-types/missing-associated-types.rs b/tests/ui/associated-types/missing-associated-types.rs index 3c8410e39bd..4e532715f1e 100644 --- a/tests/ui/associated-types/missing-associated-types.rs +++ b/tests/ui/associated-types/missing-associated-types.rs @@ -11,16 +11,12 @@ trait Fine<Rhs>: Div<Rhs, Output = Rhs> {} type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>; //~^ ERROR only auto traits can be used as additional traits in a trait object -//~| ERROR the value of the associated types type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>; //~^ ERROR only auto traits can be used as additional traits in a trait object -//~| ERROR the value of the associated types type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>; //~^ ERROR only auto traits can be used as additional traits in a trait object -//~| ERROR the value of the associated types type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>; //~^ ERROR only auto traits can be used as additional traits in a trait object -//~| ERROR the value of the associated types type Bal<Rhs> = dyn X<Rhs>; //~^ ERROR the value of the associated types diff --git a/tests/ui/associated-types/missing-associated-types.stderr b/tests/ui/associated-types/missing-associated-types.stderr index 0636667ea1f..ce4b57e8af8 100644 --- a/tests/ui/associated-types/missing-associated-types.stderr +++ b/tests/ui/associated-types/missing-associated-types.stderr @@ -9,26 +9,8 @@ LL | type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>; = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs> {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> -error[E0191]: the value of the associated types `A` in `Y`, `Output` in `Add`, `Output` in `Mul`, `Output` in `Sub` must be specified - --> $DIR/missing-associated-types.rs:12:21 - | -LL | type A; - | ------ `A` defined here -... -LL | type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>; - | ^^^^^^^^ ^^^^^^^^ ^^^^^^ ^^^^^^ associated type `A` must be specified - | | | | - | | | associated type `Output` must be specified - | | associated type `Output` must be specified - | associated type `Output` must be specified - | -help: specify the associated types - | -LL | type Foo<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs, Output = Type> + Y<Rhs, A = Type>; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ - error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/missing-associated-types.rs:15:32 + --> $DIR/missing-associated-types.rs:14:32 | LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>; | -------- ^^^^^^^^ additional non-auto trait @@ -38,33 +20,8 @@ LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>; = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs> {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> -error[E0191]: the value of the associated types `A` and `B` in `Z`, `Output` and `Output` in `Div`, `Output` in `Add`, `Output` in `Mul`, `Output` in `Sub` must be specified - --> $DIR/missing-associated-types.rs:15:21 - | -LL | type A; - | ------ `A` defined here -LL | type B; - | ------ `B` defined here -... -LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>; - | ^^^^^^^^ ^^^^^^^^ ^^^^^^ ^^^^^^ associated types `A`, `B`, `Output` must be specified - | | | | - | | | associated types `Output` (from trait `Div`), `Output` (from trait `Mul`) must be specified - | | associated type `Output` must be specified - | associated type `Output` must be specified - | -help: consider introducing a new type parameter, adding `where` constraints using the fully-qualified path to the associated types - --> $DIR/missing-associated-types.rs:15:43 - | -LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>; - | ^^^^^^ -help: specify the associated types - | -LL | type Bar<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs> + Z<Rhs, A = Type, B = Type, Output = Type>; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/missing-associated-types.rs:18:32 + --> $DIR/missing-associated-types.rs:16:32 | LL | type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>; | -------- ^^^^^^^^ additional non-auto trait @@ -74,25 +31,8 @@ LL | type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>; = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add<Rhs> + Sub<Rhs> + Y<Rhs> {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> -error[E0191]: the value of the associated types `A` in `Y`, `Output` in `Add`, `Output` in `Sub` must be specified - --> $DIR/missing-associated-types.rs:18:21 - | -LL | type A; - | ------ `A` defined here -... -LL | type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>; - | ^^^^^^^^ ^^^^^^^^ ^^^^^^ associated type `A` must be specified - | | | - | | associated type `Output` must be specified - | associated type `Output` must be specified - | -help: specify the associated types - | -LL | type Baz<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Y<Rhs, A = Type>; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ - error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/missing-associated-types.rs:21:32 + --> $DIR/missing-associated-types.rs:18:32 | LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>; | -------- ^^^^^^^^ additional non-auto trait @@ -102,28 +42,15 @@ LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>; = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add<Rhs> + Sub<Rhs> + Fine<Rhs> {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> -error[E0191]: the value of the associated types `Output` in `Add`, `Output` in `Sub` must be specified - --> $DIR/missing-associated-types.rs:21:21 - | -LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>; - | ^^^^^^^^ ^^^^^^^^ associated type `Output` must be specified - | | - | associated type `Output` must be specified - | -help: specify the associated types - | -LL | type Bat<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Fine<Rhs>; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ - error[E0191]: the value of the associated types `Output` in `Div`, `Output` in `Mul` must be specified - --> $DIR/missing-associated-types.rs:24:21 + --> $DIR/missing-associated-types.rs:20:21 | LL | type Bal<Rhs> = dyn X<Rhs>; | ^^^^^^ associated types `Output` (from trait `Div`), `Output` (from trait `Mul`) must be specified | = help: consider introducing a new type parameter, adding `where` constraints using the fully-qualified path to the associated types -error: aborting due to 9 previous errors +error: aborting due to 5 previous errors Some errors have detailed explanations: E0191, E0225. For more information about an error, try `rustc --explain E0191`. diff --git a/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs b/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs index 5ed65425f34..8309cfbd58f 100644 --- a/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs +++ b/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs @@ -10,7 +10,7 @@ fn main() { block_on::block_on(async { let x = async || {}; - async fn needs_async_fn_mut(mut x: impl async FnMut()) { + async fn needs_async_fn_mut(mut x: impl AsyncFnMut()) { x().await; } needs_async_fn_mut(x).await; diff --git a/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs b/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs index be436465315..e7644e3dfe0 100644 --- a/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs +++ b/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs @@ -8,7 +8,7 @@ extern crate block_on; fn main() { block_on::block_on(async { - async fn needs_async_fn_once(x: impl async FnOnce()) { + async fn needs_async_fn_once(x: impl AsyncFnOnce()) { x().await; } diff --git a/tests/ui/async-await/async-closures/auxiliary/foreign.rs b/tests/ui/async-await/async-closures/auxiliary/foreign.rs index 2c935f5e1fa..33548a1b30d 100644 --- a/tests/ui/async-await/async-closures/auxiliary/foreign.rs +++ b/tests/ui/async-await/async-closures/auxiliary/foreign.rs @@ -2,6 +2,6 @@ #![feature(async_closure)] -pub fn closure() -> impl async Fn() { +pub fn closure() -> impl AsyncFn() { async || { /* Don't really need to do anything here. */ } } diff --git a/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs b/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs index 4382a689e75..a72ff8e5dce 100644 --- a/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs +++ b/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs @@ -11,7 +11,7 @@ extern crate block_on; async fn empty() {} -pub async fn call_once<F: async FnOnce()>(f: F) { +pub async fn call_once<F: AsyncFnOnce()>(f: F) { f().await; } diff --git a/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs b/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs index 8b2de578b24..5ec1c5ee50e 100644 --- a/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs +++ b/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs @@ -16,7 +16,7 @@ impl Trait for (i32,) { } } -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/brand.rs b/tests/ui/async-await/async-closures/brand.rs index 5168f3696d7..db1f5d271c6 100644 --- a/tests/ui/async-await/async-closures/brand.rs +++ b/tests/ui/async-await/async-closures/brand.rs @@ -13,7 +13,7 @@ struct S; struct B<'b>(PhantomData<&'b mut &'b mut ()>); impl S { - async fn q<F: async Fn(B<'_>)>(self, f: F) { + async fn q<F: AsyncFn(B<'_>)>(self, f: F) { f(B(PhantomData)).await; } } diff --git a/tests/ui/async-await/async-closures/captures.rs b/tests/ui/async-await/async-closures/captures.rs index 0a9d0529bf5..2bd4b685997 100644 --- a/tests/ui/async-await/async-closures/captures.rs +++ b/tests/ui/async-await/async-closures/captures.rs @@ -13,11 +13,11 @@ fn main() { block_on::block_on(async_main()); } -async fn call<T>(f: &impl async Fn() -> T) -> T { +async fn call<T>(f: &impl AsyncFn() -> T) -> T { f().await } -async fn call_once<T>(f: impl async FnOnce() -> T) -> T { +async fn call_once<T>(f: impl AsyncFnOnce() -> T) -> T { f().await } @@ -80,7 +80,7 @@ async fn async_main() { call_once(c).await; } - fn force_fnonce<T>(f: impl async FnOnce() -> T) -> impl async FnOnce() -> T { + fn force_fnonce<T>(f: impl AsyncFnOnce() -> T) -> impl AsyncFnOnce() -> T { f } diff --git a/tests/ui/async-await/async-closures/clone-closure.rs b/tests/ui/async-await/async-closures/clone-closure.rs index 807897e3e03..a9e1d6bccc7 100644 --- a/tests/ui/async-await/async-closures/clone-closure.rs +++ b/tests/ui/async-await/async-closures/clone-closure.rs @@ -7,7 +7,7 @@ extern crate block_on; -async fn for_each(f: impl async FnOnce(&str) + Clone) { +async fn for_each(f: impl AsyncFnOnce(&str) + Clone) { f.clone()("world").await; f.clone()("world2").await; } diff --git a/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs b/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs index 3b222d00bae..1acbf0311b3 100644 --- a/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs +++ b/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs @@ -6,7 +6,7 @@ #![feature(async_closure)] -fn constrain<T: async FnOnce()>(t: T) -> T { +fn constrain<T: AsyncFnOnce()>(t: T) -> T { t } @@ -14,7 +14,7 @@ fn call_once<T>(f: impl FnOnce() -> T) -> T { f() } -async fn async_call_once<T>(f: impl async FnOnce() -> T) -> T { +async fn async_call_once<T>(f: impl AsyncFnOnce() -> T) -> T { f().await } diff --git a/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs b/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs index 6f339f0c8ef..f71cc1ef537 100644 --- a/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs +++ b/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs @@ -7,7 +7,7 @@ extern crate block_on; -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/drop.rs b/tests/ui/async-await/async-closures/drop.rs index 2884a20f244..9c99550e3b7 100644 --- a/tests/ui/async-await/async-closures/drop.rs +++ b/tests/ui/async-await/async-closures/drop.rs @@ -16,7 +16,7 @@ impl Drop for DropMe { } } -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { println!("before call"); let fut = Box::pin(f()); println!("after call"); diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.rs b/tests/ui/async-await/async-closures/fn-exception-target-features.rs index de62fc8bf7e..eb554650b7c 100644 --- a/tests/ui/async-await/async-closures/fn-exception-target-features.rs +++ b/tests/ui/async-await/async-closures/fn-exception-target-features.rs @@ -10,7 +10,7 @@ use std::future::Future; #[target_feature(enable = "sse2")] fn target_feature() -> Pin<Box<dyn Future<Output = ()> + 'static>> { todo!() } -fn test(f: impl async Fn()) {} +fn test(f: impl AsyncFn()) {} fn main() { test(target_feature); //~ ERROR the trait bound diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.stderr b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr index 396167f4070..db5895108bb 100644 --- a/tests/ui/async-await/async-closures/fn-exception-target-features.stderr +++ b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}: AsyncFn<()>` is not satisfied +error[E0277]: the trait bound `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}: AsyncFn()` is not satisfied --> $DIR/fn-exception-target-features.rs:16:10 | LL | test(target_feature); - | ---- ^^^^^^^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}` + | ---- ^^^^^^^^^^^^^^ the trait `AsyncFn()` is not implemented for fn item `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}` | | | required by a bound introduced by this call | note: required by a bound in `test` --> $DIR/fn-exception-target-features.rs:13:17 | -LL | fn test(f: impl async Fn()) {} - | ^^^^^^^^^^ required by this bound in `test` +LL | fn test(f: impl AsyncFn()) {} + | ^^^^^^^^^ required by this bound in `test` error: aborting due to 1 previous error diff --git a/tests/ui/async-await/async-closures/fn-exception.rs b/tests/ui/async-await/async-closures/fn-exception.rs index 0e06ebf48a4..36cb955cd5c 100644 --- a/tests/ui/async-await/async-closures/fn-exception.rs +++ b/tests/ui/async-await/async-closures/fn-exception.rs @@ -13,7 +13,7 @@ unsafe extern "C" { pub safe fn abi() -> Pin<Box<dyn Future<Output = ()> + 'static>>; } -fn test(f: impl async Fn()) {} +fn test(f: impl AsyncFn()) {} fn main() { test(unsafety); //~ ERROR the trait bound diff --git a/tests/ui/async-await/async-closures/fn-exception.stderr b/tests/ui/async-await/async-closures/fn-exception.stderr index bacd079af0f..b3118664c15 100644 --- a/tests/ui/async-await/async-closures/fn-exception.stderr +++ b/tests/ui/async-await/async-closures/fn-exception.stderr @@ -1,30 +1,30 @@ -error[E0277]: the trait bound `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}: AsyncFn<()>` is not satisfied +error[E0277]: the trait bound `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}: AsyncFn()` is not satisfied --> $DIR/fn-exception.rs:19:10 | LL | test(unsafety); - | ---- ^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}` + | ---- ^^^^^^^^ the trait `AsyncFn()` is not implemented for fn item `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}` | | | required by a bound introduced by this call | note: required by a bound in `test` --> $DIR/fn-exception.rs:16:17 | -LL | fn test(f: impl async Fn()) {} - | ^^^^^^^^^^ required by this bound in `test` +LL | fn test(f: impl AsyncFn()) {} + | ^^^^^^^^^ required by this bound in `test` -error[E0277]: the trait bound `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}: AsyncFn<()>` is not satisfied +error[E0277]: the trait bound `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}: AsyncFn()` is not satisfied --> $DIR/fn-exception.rs:20:10 | LL | test(abi); - | ---- ^^^ the trait `AsyncFn<()>` is not implemented for fn item `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}` + | ---- ^^^ the trait `AsyncFn()` is not implemented for fn item `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}` | | | required by a bound introduced by this call | note: required by a bound in `test` --> $DIR/fn-exception.rs:16:17 | -LL | fn test(f: impl async Fn()) {} - | ^^^^^^^^^^ required by this bound in `test` +LL | fn test(f: impl AsyncFn()) {} + | ^^^^^^^^^ required by this bound in `test` error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs b/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs index 7ce210a33c3..c20e3664d8b 100644 --- a/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs +++ b/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs @@ -6,7 +6,7 @@ extern crate block_on; -fn force_fnonce<T: async FnOnce()>(t: T) -> T { t } +fn force_fnonce<T: AsyncFnOnce()>(t: T) -> T { t } fn main() { block_on::block_on(async { diff --git a/tests/ui/async-await/async-closures/foreign.rs b/tests/ui/async-await/async-closures/foreign.rs index ab6fe06a3f4..a244eef4102 100644 --- a/tests/ui/async-await/async-closures/foreign.rs +++ b/tests/ui/async-await/async-closures/foreign.rs @@ -12,7 +12,7 @@ extern crate foreign; struct NoCopy; -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/implements-fnmut.rs b/tests/ui/async-await/async-closures/implements-fnmut.rs index 8e780ce9889..f49d1423c40 100644 --- a/tests/ui/async-await/async-closures/implements-fnmut.rs +++ b/tests/ui/async-await/async-closures/implements-fnmut.rs @@ -1,7 +1,7 @@ //@ build-pass //@ edition: 2021 -// Demonstrates that an async closure may implement `FnMut` (not just `async FnMut`!) +// Demonstrates that an async closure may implement `FnMut` (not just `AsyncFnMut`!) // if it has no self-borrows. In this case, `&Ty` is not borrowed from the closure env, // since it's fine to reborrow it with its original lifetime. See the doc comment on // `should_reborrow_from_env_of_parent_coroutine_closure` for more detail for when we diff --git a/tests/ui/async-await/async-closures/inline-body.rs b/tests/ui/async-await/async-closures/inline-body.rs index a842d98d1de..1bd2da6e899 100644 --- a/tests/ui/async-await/async-closures/inline-body.rs +++ b/tests/ui/async-await/async-closures/inline-body.rs @@ -24,7 +24,7 @@ pub fn block_on<T>(fut: impl Future<Output = T>) -> T { } } -async fn call_once<T>(f: impl async FnOnce() -> T) -> T { +async fn call_once<T>(f: impl AsyncFnOnce() -> T) -> T { f().await } diff --git a/tests/ui/async-await/async-closures/mangle.rs b/tests/ui/async-await/async-closures/mangle.rs index a428905e40b..3032ca3c02b 100644 --- a/tests/ui/async-await/async-closures/mangle.rs +++ b/tests/ui/async-await/async-closures/mangle.rs @@ -13,11 +13,11 @@ use std::future::Future; use std::pin::pin; use std::task::*; -async fn call_mut(f: &mut impl async FnMut()) { +async fn call_mut(f: &mut impl AsyncFnMut()) { f().await; } -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/moro-example.rs b/tests/ui/async-await/async-closures/moro-example.rs index 5a8f42c7ca5..c331b8e5b5e 100644 --- a/tests/ui/async-await/async-closures/moro-example.rs +++ b/tests/ui/async-await/async-closures/moro-example.rs @@ -22,7 +22,7 @@ impl<'scope, 'env: 'scope> Scope<'scope, 'env> { fn scope_with_closure<'env, B>(_body: B) -> BoxFuture<'env, ()> where - for<'scope> B: async FnOnce(&'scope Scope<'scope, 'env>), + for<'scope> B: AsyncFnOnce(&'scope Scope<'scope, 'env>), { todo!() } diff --git a/tests/ui/async-await/async-closures/move-is-async-fn.rs b/tests/ui/async-await/async-closures/move-is-async-fn.rs index 79e2298f609..d0e2bc24b52 100644 --- a/tests/ui/async-await/async-closures/move-is-async-fn.rs +++ b/tests/ui/async-await/async-closures/move-is-async-fn.rs @@ -19,7 +19,7 @@ fn main() { is_static(&c); // Check that `<{async fn} as AsyncFnOnce>::CallOnceFuture` owns its captures. - fn call_once<F: async FnOnce()>(f: F) -> F::CallOnceFuture { f() } + fn call_once<F: AsyncFnOnce()>(f: F) -> F::CallOnceFuture { f() } is_static(&call_once(c)); }); } diff --git a/tests/ui/async-await/async-closures/mut-ref-reborrow.rs b/tests/ui/async-await/async-closures/mut-ref-reborrow.rs index 9f2cbd7ce1c..c37048398e9 100644 --- a/tests/ui/async-await/async-closures/mut-ref-reborrow.rs +++ b/tests/ui/async-await/async-closures/mut-ref-reborrow.rs @@ -9,7 +9,7 @@ extern crate block_on; -async fn call_once(f: impl async FnOnce()) { f().await; } +async fn call_once(f: impl AsyncFnOnce()) { f().await; } pub async fn async_closure(x: &mut i32) { let c = async move || { diff --git a/tests/ui/async-await/async-closures/no-borrow-from-env.rs b/tests/ui/async-await/async-closures/no-borrow-from-env.rs index 3f9d26b9713..36b10c06dca 100644 --- a/tests/ui/async-await/async-closures/no-borrow-from-env.rs +++ b/tests/ui/async-await/async-closures/no-borrow-from-env.rs @@ -5,7 +5,7 @@ fn outlives<'a>(_: impl Sized + 'a) {} -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs b/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs index cd9d98d0799..cfb50dd5574 100644 --- a/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs +++ b/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs @@ -6,7 +6,7 @@ extern crate block_on; -fn wrapper(f: impl Fn(String)) -> impl async Fn(String) { +fn wrapper(f: impl Fn(String)) -> impl AsyncFn(String) { async move |s| f(s) } diff --git a/tests/ui/async-await/async-closures/overlapping-projs.rs b/tests/ui/async-await/async-closures/overlapping-projs.rs index 6dd00b16103..f778534cfe2 100644 --- a/tests/ui/async-await/async-closures/overlapping-projs.rs +++ b/tests/ui/async-await/async-closures/overlapping-projs.rs @@ -7,7 +7,7 @@ extern crate block_on; -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/precise-captures.rs b/tests/ui/async-await/async-closures/precise-captures.rs index c4c67df544f..7dcbf2595f0 100644 --- a/tests/ui/async-await/async-closures/precise-captures.rs +++ b/tests/ui/async-await/async-closures/precise-captures.rs @@ -5,7 +5,7 @@ //@ revisions: call call_once force_once // call - Call the closure regularly. -// call_once - Call the closure w/ `async FnOnce`, so exercising the by_move shim. +// call_once - Call the closure w/ `AsyncFnOnce`, so exercising the by_move shim. // force_once - Force the closure mode to `FnOnce`, so exercising what was fixed // in <https://github.com/rust-lang/rust/pull/123350>. @@ -20,7 +20,7 @@ macro_rules! call { } #[cfg(call_once)] -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await } @@ -35,7 +35,7 @@ macro_rules! guidance { } #[cfg(force_once)] -fn infer_fnonce(c: impl async FnOnce()) -> impl async FnOnce() { c } +fn infer_fnonce(c: impl AsyncFnOnce()) -> impl AsyncFnOnce() { c } #[cfg(force_once)] macro_rules! guidance { diff --git a/tests/ui/async-await/async-closures/pretty-async-fn-opaque.rs b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.rs new file mode 100644 index 00000000000..2e7cf1b09fd --- /dev/null +++ b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.rs @@ -0,0 +1,14 @@ +//@ edition: 2021 + +#![feature(async_closure)] + +use std::ops::AsyncFnMut; + +fn produce() -> impl AsyncFnMut() -> &'static str { + async || "" +} + +fn main() { + let x: i32 = produce(); + //~^ ERROR mismatched types +} diff --git a/tests/ui/async-await/async-closures/pretty-async-fn-opaque.stderr b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.stderr new file mode 100644 index 00000000000..863e61eb35a --- /dev/null +++ b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.stderr @@ -0,0 +1,17 @@ +error[E0308]: mismatched types + --> $DIR/pretty-async-fn-opaque.rs:12:18 + | +LL | fn produce() -> impl AsyncFnMut() -> &'static str { + | --------------------------------- the found opaque type +... +LL | let x: i32 = produce(); + | --- ^^^^^^^^^ expected `i32`, found opaque type + | | + | expected due to this + | + = note: expected type `i32` + found opaque type `impl AsyncFnMut() -> &'static str` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/async-await/async-closures/refd.rs b/tests/ui/async-await/async-closures/refd.rs index 0b8d3d7aff5..8c16ecb1531 100644 --- a/tests/ui/async-await/async-closures/refd.rs +++ b/tests/ui/async-await/async-closures/refd.rs @@ -10,15 +10,15 @@ struct NoCopy; fn main() { block_on::block_on(async { - async fn call_once(x: impl async Fn()) { x().await } + async fn call_once(x: impl AsyncFn()) { x().await } - // check that `&{async-closure}` implements `async Fn`. + // check that `&{async-closure}` implements `AsyncFn`. call_once(&async || {}).await; - // check that `&{closure}` implements `async Fn`. + // check that `&{closure}` implements `AsyncFn`. call_once(&|| async {}).await; - // check that `&fndef` implements `async Fn`. + // check that `&fndef` implements `AsyncFn`. async fn foo() {} call_once(&foo).await; }); diff --git a/tests/ui/async-await/async-closures/signature-deduction.rs b/tests/ui/async-await/async-closures/signature-deduction.rs index 856f3963ee6..4e9a6747f1f 100644 --- a/tests/ui/async-await/async-closures/signature-deduction.rs +++ b/tests/ui/async-await/async-closures/signature-deduction.rs @@ -3,7 +3,7 @@ #![feature(async_closure)] -async fn foo(x: impl async Fn(&str) -> &str) {} +async fn foo(x: impl AsyncFn(&str) -> &str) {} fn main() { foo(async |x| x); diff --git a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs index be3f032b8ff..19f366cc903 100644 --- a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs +++ b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs @@ -8,7 +8,7 @@ fn outlives<'a>(_: impl Sized + 'a) {} -async fn call_once(f: impl async FnOnce()) { +async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/wrong-fn-kind.rs b/tests/ui/async-await/async-closures/wrong-fn-kind.rs index 3d6f856874f..a566b8aa663 100644 --- a/tests/ui/async-await/async-closures/wrong-fn-kind.rs +++ b/tests/ui/async-await/async-closures/wrong-fn-kind.rs @@ -2,7 +2,7 @@ #![feature(async_closure)] -fn needs_async_fn(_: impl async Fn()) {} +fn needs_async_fn(_: impl AsyncFn()) {} fn a() { let mut x = 1; @@ -15,7 +15,7 @@ fn a() { fn b() { let x = String::new(); needs_async_fn(move || async move { - //~^ ERROR expected a closure that implements the `async Fn` trait, but this closure only implements `async FnOnce` + //~^ ERROR expected a closure that implements the `AsyncFn` trait, but this closure only implements `AsyncFnOnce` println!("{x}"); }); } diff --git a/tests/ui/async-await/async-closures/wrong-fn-kind.stderr b/tests/ui/async-await/async-closures/wrong-fn-kind.stderr index 4b626c1bed6..d03b10ca2cc 100644 --- a/tests/ui/async-await/async-closures/wrong-fn-kind.stderr +++ b/tests/ui/async-await/async-closures/wrong-fn-kind.stderr @@ -1,29 +1,29 @@ -error[E0525]: expected a closure that implements the `async Fn` trait, but this closure only implements `async FnOnce` +error[E0525]: expected a closure that implements the `AsyncFn` trait, but this closure only implements `AsyncFnOnce` --> $DIR/wrong-fn-kind.rs:17:20 | LL | needs_async_fn(move || async move { | -------------- -^^^^^^ | | | - | _____|______________this closure implements `async FnOnce`, not `async Fn` + | _____|______________this closure implements `AsyncFnOnce`, not `AsyncFn` | | | | | required by a bound introduced by this call LL | | LL | | println!("{x}"); - | | - closure is `async FnOnce` because it moves the variable `x` out of its environment + | | - closure is `AsyncFnOnce` because it moves the variable `x` out of its environment LL | | }); - | |_____- the requirement to implement `async Fn` derives from here + | |_____- the requirement to implement `AsyncFn` derives from here | note: required by a bound in `needs_async_fn` --> $DIR/wrong-fn-kind.rs:5:27 | -LL | fn needs_async_fn(_: impl async Fn()) {} - | ^^^^^^^^^^ required by this bound in `needs_async_fn` +LL | fn needs_async_fn(_: impl AsyncFn()) {} + | ^^^^^^^^^ required by this bound in `needs_async_fn` error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure --> $DIR/wrong-fn-kind.rs:9:20 | -LL | fn needs_async_fn(_: impl async Fn()) {} - | --------------- change this to accept `FnMut` instead of `Fn` +LL | fn needs_async_fn(_: impl AsyncFn()) {} + | -------------- change this to accept `FnMut` instead of `Fn` ... LL | needs_async_fn(async || { | -------------- ^^^^^^^^ diff --git a/tests/ui/async-await/async-fn/dyn-pos.rs b/tests/ui/async-await/async-fn/dyn-pos.rs index 772c7d15cfd..129ea282936 100644 --- a/tests/ui/async-await/async-fn/dyn-pos.rs +++ b/tests/ui/async-await/async-fn/dyn-pos.rs @@ -2,10 +2,7 @@ #![feature(async_closure)] -fn foo(x: &dyn async Fn()) {} -//~^ ERROR the trait `AsyncFn` cannot be made into an object -//~| ERROR the trait `AsyncFnMut` cannot be made into an object -//~| ERROR the trait `AsyncFnMut` cannot be made into an object -//~| ERROR the trait `AsyncFnMut` cannot be made into an object +fn foo(x: &dyn AsyncFn()) {} +//~^ ERROR the trait `AsyncFnMut` cannot be made into an object fn main() {} diff --git a/tests/ui/async-await/async-fn/dyn-pos.stderr b/tests/ui/async-await/async-fn/dyn-pos.stderr index 78e915d49e7..aaa8eb2634d 100644 --- a/tests/ui/async-await/async-fn/dyn-pos.stderr +++ b/tests/ui/async-await/async-fn/dyn-pos.stderr @@ -1,8 +1,8 @@ error[E0038]: the trait `AsyncFnMut` cannot be made into an object --> $DIR/dyn-pos.rs:5:16 | -LL | fn foo(x: &dyn async Fn()) {} - | ^^^^^^^^^^ `AsyncFnMut` cannot be made into an object +LL | fn foo(x: &dyn AsyncFn()) {} + | ^^^^^^^^^ `AsyncFnMut` cannot be made into an object | note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL @@ -13,52 +13,6 @@ note: for a trait to be "dyn-compatible" it needs to allow building a vtable to &mut F std::boxed::Box<F, A> -error[E0038]: the trait `AsyncFnMut` cannot be made into an object - --> $DIR/dyn-pos.rs:5:16 - | -LL | fn foo(x: &dyn async Fn()) {} - | ^^^^^^^^^^ `AsyncFnMut` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL - | - = note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture` - = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFnMut` for this new enum and using it instead: - &F - &mut F - std::boxed::Box<F, A> - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0038]: the trait `AsyncFnMut` cannot be made into an object - --> $DIR/dyn-pos.rs:5:16 - | -LL | fn foo(x: &dyn async Fn()) {} - | ^^^^^^^^^^ `AsyncFnMut` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL - | - = note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture` - = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFnMut` for this new enum and using it instead: - &F - &mut F - std::boxed::Box<F, A> - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0038]: the trait `AsyncFn` cannot be made into an object - --> $DIR/dyn-pos.rs:5:12 - | -LL | fn foo(x: &dyn async Fn()) {} - | ^^^^^^^^^^^^^^ `AsyncFn` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL - | - = note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture` - = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFn` for this new enum and using it instead: - &F - std::boxed::Box<F, A> - -error: aborting due to 4 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/async-await/async-fn/edition-2015.rs b/tests/ui/async-await/async-fn/edition-2015.rs index e38179758f6..7fc62a8dd93 100644 --- a/tests/ui/async-await/async-fn/edition-2015.rs +++ b/tests/ui/async-await/async-fn/edition-2015.rs @@ -1,8 +1,8 @@ fn foo(x: impl async Fn()) -> impl async Fn() { x } //~^ ERROR `async` trait bounds are only allowed in Rust 2018 or later //~| ERROR `async` trait bounds are only allowed in Rust 2018 or later -//~| ERROR async closures are unstable -//~| ERROR async closures are unstable +//~| ERROR `async` trait bounds are unstable +//~| ERROR `async` trait bounds are unstable //~| ERROR use of unstable library feature `async_closure` //~| ERROR use of unstable library feature `async_closure` diff --git a/tests/ui/async-await/async-fn/edition-2015.stderr b/tests/ui/async-await/async-fn/edition-2015.stderr index 25101cb65df..96fb4c9e979 100644 --- a/tests/ui/async-await/async-fn/edition-2015.stderr +++ b/tests/ui/async-await/async-fn/edition-2015.stderr @@ -4,7 +4,7 @@ error: `async` trait bounds are only allowed in Rust 2018 or later LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: `async` trait bounds are only allowed in Rust 2018 or later @@ -13,30 +13,30 @@ error: `async` trait bounds are only allowed in Rust 2018 or later LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide -error[E0658]: async closures are unstable +error[E0658]: `async` trait bounds are unstable --> $DIR/edition-2015.rs:1:16 | LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` + = help: use the desugared name of the async trait, such as `AsyncFn` -error[E0658]: async closures are unstable +error[E0658]: `async` trait bounds are unstable --> $DIR/edition-2015.rs:1:36 | LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` + = help: use the desugared name of the async trait, such as `AsyncFn` error[E0658]: use of unstable library feature `async_closure` --> $DIR/edition-2015.rs:1:42 diff --git a/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs b/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs index f8da517213a..5d675921028 100644 --- a/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs +++ b/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs @@ -15,7 +15,7 @@ async fn f(arg: &i32) {} async fn func<F>(f: F) where - F: for<'a> async Fn(&'a i32), + F: for<'a> AsyncFn(&'a i32), { let x: i32 = 0; f(&x).await; diff --git a/tests/ui/async-await/async-fn/impl-trait.rs b/tests/ui/async-await/async-fn/impl-trait.rs index 686addcb1a9..11faf9ac983 100644 --- a/tests/ui/async-await/async-fn/impl-trait.rs +++ b/tests/ui/async-await/async-fn/impl-trait.rs @@ -3,13 +3,13 @@ #![feature(async_closure, type_alias_impl_trait)] -type Tait = impl async Fn(); +type Tait = impl AsyncFn(); fn tait() -> Tait { || async {} } -fn foo(x: impl async Fn()) -> impl async Fn() { x } +fn foo(x: impl AsyncFn()) -> impl AsyncFn() { x } -fn param<T: async Fn()>() {} +fn param<T: AsyncFn()>() {} fn main() {} diff --git a/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.rs b/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.rs index abc429772fd..ea67831b68e 100644 --- a/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.rs +++ b/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.rs @@ -13,9 +13,9 @@ macro_rules! demo { } demo! { impl async Trait } -//~^ ERROR async closures are unstable +//~^ ERROR `async` trait bounds are unstable demo! { dyn async Trait } -//~^ ERROR async closures are unstable +//~^ ERROR `async` trait bounds are unstable fn main() {} diff --git a/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.stderr b/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.stderr index 13b8e72b49d..a463944d113 100644 --- a/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.stderr +++ b/tests/ui/async-await/async-fn/mbe-async-trait-bound-theoretical-regression.stderr @@ -20,27 +20,27 @@ LL | demo! { dyn async Trait } | = note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0658]: async closures are unstable +error[E0658]: `async` trait bounds are unstable --> $DIR/mbe-async-trait-bound-theoretical-regression.rs:15:14 | LL | demo! { impl async Trait } | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` + = help: use the desugared name of the async trait, such as `AsyncFn` -error[E0658]: async closures are unstable +error[E0658]: `async` trait bounds are unstable --> $DIR/mbe-async-trait-bound-theoretical-regression.rs:18:13 | LL | demo! { dyn async Trait } | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` + = help: use the desugared name of the async trait, such as `AsyncFn` error: aborting due to 4 previous errors diff --git a/tests/ui/async-await/async-fn/not-a-trait.rs b/tests/ui/async-await/async-fn/not-a-trait.rs index 0d22cbd2c07..5cf23f2456a 100644 --- a/tests/ui/async-await/async-fn/not-a-trait.rs +++ b/tests/ui/async-await/async-fn/not-a-trait.rs @@ -1,6 +1,6 @@ //@ edition:2018 -#![feature(async_closure)] +#![feature(async_trait_bounds)] struct S; diff --git a/tests/ui/async-await/async-fn/project.rs b/tests/ui/async-await/async-fn/project.rs index 5cbdc378dda..b6068a916ae 100644 --- a/tests/ui/async-await/async-fn/project.rs +++ b/tests/ui/async-await/async-fn/project.rs @@ -6,7 +6,9 @@ #![feature(async_closure, unboxed_closures, async_fn_traits)] -fn project<F: async Fn<()>>(_: F) -> Option<F::Output> { None } +use std::ops::AsyncFn; + +fn project<F: AsyncFn<()>>(_: F) -> Option<F::Output> { None } fn main() { let x: Option<i32> = project(|| async { 1i32 }); diff --git a/tests/ui/async-await/async-fn/sugar.rs b/tests/ui/async-await/async-fn/sugar.rs index 29b6abc814a..0225b666ac5 100644 --- a/tests/ui/async-await/async-fn/sugar.rs +++ b/tests/ui/async-await/async-fn/sugar.rs @@ -1,7 +1,7 @@ //@ edition: 2021 //@ check-pass -#![feature(async_closure)] +#![feature(async_closure, async_trait_bounds)] async fn foo() {} diff --git a/tests/ui/async-await/async-fn/trait-bounds-in-macro.rs b/tests/ui/async-await/async-fn/trait-bounds-in-macro.rs index 329a1528e8b..654883966f4 100644 --- a/tests/ui/async-await/async-fn/trait-bounds-in-macro.rs +++ b/tests/ui/async-await/async-fn/trait-bounds-in-macro.rs @@ -6,7 +6,7 @@ macro_rules! x { x! { async fn foo() -> impl async Fn() { } - //~^ ERROR async closures are unstable + //~^ ERROR `async` trait bounds are unstable } fn main() {} diff --git a/tests/ui/async-await/async-fn/trait-bounds-in-macro.stderr b/tests/ui/async-await/async-fn/trait-bounds-in-macro.stderr index f68c09737db..259e13cd1fe 100644 --- a/tests/ui/async-await/async-fn/trait-bounds-in-macro.stderr +++ b/tests/ui/async-await/async-fn/trait-bounds-in-macro.stderr @@ -1,13 +1,13 @@ -error[E0658]: async closures are unstable +error[E0658]: `async` trait bounds are unstable --> $DIR/trait-bounds-in-macro.rs:8:28 | LL | async fn foo() -> impl async Fn() { } | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` + = help: use the desugared name of the async trait, such as `AsyncFn` error: aborting due to 1 previous error diff --git a/tests/ui/async-await/async-fn/wrong-trait.rs b/tests/ui/async-await/async-fn/wrong-trait.rs index e6fb0b46712..38d6bb1d01a 100644 --- a/tests/ui/async-await/async-fn/wrong-trait.rs +++ b/tests/ui/async-await/async-fn/wrong-trait.rs @@ -1,6 +1,6 @@ //@ edition:2018 -#![feature(async_closure)] +#![feature(async_trait_bounds)] trait Foo {} diff --git a/tests/ui/async-await/coroutine-desc.stderr b/tests/ui/async-await/coroutine-desc.stderr index e1d7898478e..5434ff3d958 100644 --- a/tests/ui/async-await/coroutine-desc.stderr +++ b/tests/ui/async-await/coroutine-desc.stderr @@ -19,7 +19,7 @@ LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | ^^^ - ----- ----- this parameter needs to match the `async` block type of `f1` | | | | | `f2` needs to match the `async` block type of this parameter - | `f1` and `f2` all reference this parameter F + | `f1` and `f2` both reference this parameter `F` error[E0308]: mismatched types --> $DIR/coroutine-desc.rs:12:16 @@ -39,7 +39,7 @@ LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | ^^^ - ----- ----- this parameter needs to match the future type of `f1` | | | | | `f2` needs to match the future type of this parameter - | `f1` and `f2` all reference this parameter F + | `f1` and `f2` both reference this parameter `F` error[E0308]: mismatched types --> $DIR/coroutine-desc.rs:14:26 @@ -62,7 +62,7 @@ LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | ^^^ - ----- ----- this parameter needs to match the `async` closure body type of `f1` | | | | | `f2` needs to match the `async` closure body type of this parameter - | `f1` and `f2` all reference this parameter F + | `f1` and `f2` both reference this parameter `F` error: aborting due to 3 previous errors diff --git a/tests/ui/async-await/edition-deny-async-fns-2015.stderr b/tests/ui/async-await/edition-deny-async-fns-2015.stderr index c40cdc5acec..f39ec033e70 100644 --- a/tests/ui/async-await/edition-deny-async-fns-2015.stderr +++ b/tests/ui/async-await/edition-deny-async-fns-2015.stderr @@ -4,7 +4,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn foo() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -13,7 +13,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | fn baz() { async fn foo() {} } | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -22,7 +22,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn async_baz() { | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -31,7 +31,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn bar() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -40,7 +40,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn foo() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -49,7 +49,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn foo() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -58,7 +58,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn bar() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -67,7 +67,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn foo() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 @@ -76,7 +76,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn bar() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: aborting due to 9 previous errors diff --git a/tests/ui/async-await/for-await-passthrough.rs b/tests/ui/async-await/for-await-passthrough.rs index b4fba6b2f76..1918e2f61aa 100644 --- a/tests/ui/async-await/for-await-passthrough.rs +++ b/tests/ui/async-await/for-await-passthrough.rs @@ -1,6 +1,5 @@ //@ run-pass //@ edition: 2024 -//@ compile-flags: -Zunstable-options #![feature(async_iterator, async_iter_from_iter, async_for_loop, noop_waker, gen_blocks)] diff --git a/tests/ui/async-await/issues/auxiliary/issue-60674.rs b/tests/ui/async-await/issues/auxiliary/issue-60674.rs index da11142a3a4..a22f90e9516 100644 --- a/tests/ui/async-await/issues/auxiliary/issue-60674.rs +++ b/tests/ui/async-await/issues/auxiliary/issue-60674.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/async-await/issues/issue-60674.rs b/tests/ui/async-await/issues/issue-60674.rs index 9def3552e67..d04fa23840e 100644 --- a/tests/ui/async-await/issues/issue-60674.rs +++ b/tests/ui/async-await/issues/issue-60674.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-60674.rs +//@ proc-macro: issue-60674.rs //@ build-pass (FIXME(62277): could be check-pass?) //@ edition:2018 diff --git a/tests/ui/async-await/pin-ergonomics/coerce-non-pointer-pin.rs b/tests/ui/async-await/pin-ergonomics/coerce-non-pointer-pin.rs new file mode 100644 index 00000000000..a95665f126d --- /dev/null +++ b/tests/ui/async-await/pin-ergonomics/coerce-non-pointer-pin.rs @@ -0,0 +1,10 @@ +//@ check-pass + +#![feature(pin_ergonomics)] +//~^ WARN the feature `pin_ergonomics` is incomplete + +use std::pin::Pin; + +fn main() { + let _: Pin<Box<()>> = Box::pin(()); +} diff --git a/tests/ui/async-await/pin-ergonomics/coerce-non-pointer-pin.stderr b/tests/ui/async-await/pin-ergonomics/coerce-non-pointer-pin.stderr new file mode 100644 index 00000000000..2deb5b09884 --- /dev/null +++ b/tests/ui/async-await/pin-ergonomics/coerce-non-pointer-pin.stderr @@ -0,0 +1,11 @@ +warning: the feature `pin_ergonomics` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/coerce-non-pointer-pin.rs:3:12 + | +LL | #![feature(pin_ergonomics)] + | ^^^^^^^^^^^^^^ + | + = note: see issue #130494 <https://github.com/rust-lang/rust/issues/130494> for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/async-await/pin-reborrow-arg.rs b/tests/ui/async-await/pin-ergonomics/reborrow-arg.rs index 2008bd1f52d..2008bd1f52d 100644 --- a/tests/ui/async-await/pin-reborrow-arg.rs +++ b/tests/ui/async-await/pin-ergonomics/reborrow-arg.rs diff --git a/tests/ui/async-await/pin-reborrow-const-as-mut.rs b/tests/ui/async-await/pin-ergonomics/reborrow-const-as-mut.rs index 27c70a7b4df..27c70a7b4df 100644 --- a/tests/ui/async-await/pin-reborrow-const-as-mut.rs +++ b/tests/ui/async-await/pin-ergonomics/reborrow-const-as-mut.rs diff --git a/tests/ui/async-await/pin-reborrow-const-as-mut.stderr b/tests/ui/async-await/pin-ergonomics/reborrow-const-as-mut.stderr index 2c2d9ec2717..36bbf1c493a 100644 --- a/tests/ui/async-await/pin-reborrow-const-as-mut.stderr +++ b/tests/ui/async-await/pin-ergonomics/reborrow-const-as-mut.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/pin-reborrow-const-as-mut.rs:14:9 + --> $DIR/reborrow-const-as-mut.rs:14:9 | LL | foo(x); | --- ^ types differ in mutability @@ -9,7 +9,7 @@ LL | foo(x); = note: expected struct `Pin<&mut Foo>` found struct `Pin<&Foo>` note: function defined here - --> $DIR/pin-reborrow-const-as-mut.rs:10:4 + --> $DIR/reborrow-const-as-mut.rs:10:4 | LL | fn foo(_: Pin<&mut Foo>) { | ^^^ ---------------- diff --git a/tests/ui/async-await/pin-reborrow-once.rs b/tests/ui/async-await/pin-ergonomics/reborrow-once.rs index 241efadef7d..241efadef7d 100644 --- a/tests/ui/async-await/pin-reborrow-once.rs +++ b/tests/ui/async-await/pin-ergonomics/reborrow-once.rs diff --git a/tests/ui/async-await/pin-reborrow-once.stderr b/tests/ui/async-await/pin-ergonomics/reborrow-once.stderr index b8fde8ffee8..a1ea2b4a57a 100644 --- a/tests/ui/async-await/pin-reborrow-once.stderr +++ b/tests/ui/async-await/pin-ergonomics/reborrow-once.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `*x.__pointer` as mutable more than once at a time - --> $DIR/pin-reborrow-once.rs:12:14 + --> $DIR/reborrow-once.rs:12:14 | LL | twice(x, x); | ----- - ^ second mutable borrow occurs here diff --git a/tests/ui/async-await/pin-reborrow-self.rs b/tests/ui/async-await/pin-ergonomics/reborrow-self.rs index ee617617da0..ee617617da0 100644 --- a/tests/ui/async-await/pin-reborrow-self.rs +++ b/tests/ui/async-await/pin-ergonomics/reborrow-self.rs diff --git a/tests/ui/async-await/pin-reborrow-shorter.rs b/tests/ui/async-await/pin-ergonomics/reborrow-shorter.rs index 06c266e0035..06c266e0035 100644 --- a/tests/ui/async-await/pin-reborrow-shorter.rs +++ b/tests/ui/async-await/pin-ergonomics/reborrow-shorter.rs diff --git a/tests/ui/async-await/pin-sugar-ambiguity.rs b/tests/ui/async-await/pin-ergonomics/sugar-ambiguity.rs index d183000931e..d183000931e 100644 --- a/tests/ui/async-await/pin-sugar-ambiguity.rs +++ b/tests/ui/async-await/pin-ergonomics/sugar-ambiguity.rs diff --git a/tests/ui/async-await/pin-sugar-no-const.rs b/tests/ui/async-await/pin-ergonomics/sugar-no-const.rs index dd6456b6034..dd6456b6034 100644 --- a/tests/ui/async-await/pin-sugar-no-const.rs +++ b/tests/ui/async-await/pin-ergonomics/sugar-no-const.rs diff --git a/tests/ui/async-await/pin-sugar-no-const.stderr b/tests/ui/async-await/pin-ergonomics/sugar-no-const.stderr index 5f01156c1f0..822cfffcb8c 100644 --- a/tests/ui/async-await/pin-sugar-no-const.stderr +++ b/tests/ui/async-await/pin-ergonomics/sugar-no-const.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `(`, `::`, `;`, `<`, or `=`, found `i32` - --> $DIR/pin-sugar-no-const.rs:7:18 + --> $DIR/sugar-no-const.rs:7:18 | LL | let _x: &pin i32 = todo!(); | - ^^^ expected one of `!`, `(`, `::`, `;`, `<`, or `=` diff --git a/tests/ui/async-await/pin-sugar.rs b/tests/ui/async-await/pin-ergonomics/sugar.rs index 8dbdec418b1..8dbdec418b1 100644 --- a/tests/ui/async-await/pin-sugar.rs +++ b/tests/ui/async-await/pin-ergonomics/sugar.rs diff --git a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs index e1fae0f0e93..bcb5cb94b77 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs +++ b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs @@ -12,7 +12,7 @@ fn await_on_struct_missing() { //~^ ERROR no field `await` on type //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP set `edition = "2021"` in `Cargo.toml` + //~| HELP set `edition = "2024"` in `Cargo.toml` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -26,7 +26,7 @@ fn await_on_struct_similar() { //~| NOTE unknown field //~| HELP a field with a similar name exists //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP set `edition = "2021"` in `Cargo.toml` + //~| HELP set `edition = "2024"` in `Cargo.toml` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -35,7 +35,7 @@ fn await_on_63533(x: Pin<&mut dyn Future<Output = ()>>) { //~^ ERROR no field `await` on type //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP set `edition = "2021"` in `Cargo.toml` + //~| HELP set `edition = "2024"` in `Cargo.toml` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -44,6 +44,6 @@ fn await_on_apit(x: impl Future<Output = ()>) { //~^ ERROR no field `await` on type //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP set `edition = "2021"` in `Cargo.toml` + //~| HELP set `edition = "2024"` in `Cargo.toml` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } diff --git a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr index dd863ca541c..c8bbb3a243c 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr +++ b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr @@ -5,7 +5,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: set `edition = "2021"` in `Cargo.toml` + = help: set `edition = "2024"` in `Cargo.toml` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `await_on_struct_similar::S` @@ -15,7 +15,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: set `edition = "2021"` in `Cargo.toml` + = help: set `edition = "2024"` in `Cargo.toml` = note: for more on editions, read https://doc.rust-lang.org/edition-guide help: a field with a similar name exists | @@ -29,7 +29,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: set `edition = "2021"` in `Cargo.toml` + = help: set `edition = "2024"` in `Cargo.toml` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `impl Future<Output = ()>` @@ -39,7 +39,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: set `edition = "2021"` in `Cargo.toml` + = help: set `edition = "2024"` in `Cargo.toml` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: aborting due to 4 previous errors diff --git a/tests/ui/async-await/suggest-switching-edition-on-await.rs b/tests/ui/async-await/suggest-switching-edition-on-await.rs index 10e245796ee..0907a87e02c 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await.rs +++ b/tests/ui/async-await/suggest-switching-edition-on-await.rs @@ -10,7 +10,7 @@ fn await_on_struct_missing() { //~^ ERROR no field `await` on type //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -24,7 +24,7 @@ fn await_on_struct_similar() { //~| NOTE unknown field //~| HELP a field with a similar name exists //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -33,7 +33,7 @@ fn await_on_63533(x: Pin<&mut dyn Future<Output = ()>>) { //~^ ERROR no field `await` on type //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -42,6 +42,6 @@ fn await_on_apit(x: impl Future<Output = ()>) { //~^ ERROR no field `await` on type //~| NOTE unknown field //~| NOTE to `.await` a `Future`, switch to Rust 2018 - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } diff --git a/tests/ui/async-await/suggest-switching-edition-on-await.stderr b/tests/ui/async-await/suggest-switching-edition-on-await.stderr index 0ed256b059f..ef5a5f81269 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await.stderr +++ b/tests/ui/async-await/suggest-switching-edition-on-await.stderr @@ -5,7 +5,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `await_on_struct_similar::S` @@ -15,7 +15,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide help: a field with a similar name exists | @@ -29,7 +29,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0609]: no field `await` on type `impl Future<Output = ()>` @@ -39,7 +39,7 @@ LL | x.await; | ^^^^^ unknown field | = note: to `.await` a `Future`, switch to Rust 2018 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: aborting due to 4 previous errors diff --git a/tests/ui/attr-start.rs b/tests/ui/attr-start.rs index 27cf35601fd..232f50955b2 100644 --- a/tests/ui/attr-start.rs +++ b/tests/ui/attr-start.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![feature(start)] diff --git a/tests/ui/attributes/attr-before-view-item.rs b/tests/ui/attributes/attr-before-view-item.rs index e0e086ea476..19874052e33 100644 --- a/tests/ui/attributes/attr-before-view-item.rs +++ b/tests/ui/attributes/attr-before-view-item.rs @@ -1,5 +1,4 @@ //@ build-pass (FIXME(62277): could be check-pass?) -//@ pretty-expanded FIXME #23616 #![feature(rustc_attrs)] #![feature(test)] diff --git a/tests/ui/attributes/attr-before-view-item2.rs b/tests/ui/attributes/attr-before-view-item2.rs index 8d74d73fe2e..e58063a13ab 100644 --- a/tests/ui/attributes/attr-before-view-item2.rs +++ b/tests/ui/attributes/attr-before-view-item2.rs @@ -1,5 +1,4 @@ //@ build-pass (FIXME(62277): could be check-pass?) -//@ pretty-expanded FIXME #23616 #![feature(rustc_attrs)] #![feature(test)] diff --git a/tests/ui/attributes/attr-mix-new.rs b/tests/ui/attributes/attr-mix-new.rs index bb2bab8f267..bd249a0c198 100644 --- a/tests/ui/attributes/attr-mix-new.rs +++ b/tests/ui/attributes/attr-mix-new.rs @@ -1,5 +1,4 @@ //@ build-pass (FIXME(62277): could be check-pass?) -//@ pretty-expanded FIXME #23616 #![feature(rustc_attrs)] diff --git a/tests/ui/attributes/auxiliary/key-value-expansion.rs b/tests/ui/attributes/auxiliary/key-value-expansion.rs index 9db82cec635..5ecc62ed3fa 100644 --- a/tests/ui/attributes/auxiliary/key-value-expansion.rs +++ b/tests/ui/attributes/auxiliary/key-value-expansion.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/attributes/dump_def_parents.rs b/tests/ui/attributes/dump_def_parents.rs index de0c88bb6c3..04a725f6c14 100644 --- a/tests/ui/attributes/dump_def_parents.rs +++ b/tests/ui/attributes/dump_def_parents.rs @@ -3,16 +3,17 @@ fn bar() { fn foo() { + #[rustc_dump_def_parents] fn baz() { - #[rustc_dump_def_parents] + //~^ ERROR: rustc_dump_def_parents: DefId || { - //~^ ERROR: rustc_dump_def_parents: DefId qux::< { //~^ ERROR: rustc_dump_def_parents: DefId fn inhibits_dump() { qux::< { + //~^ ERROR: rustc_dump_def_parents: DefId "hi"; 1 }, diff --git a/tests/ui/attributes/dump_def_parents.stderr b/tests/ui/attributes/dump_def_parents.stderr index b2cc32d09b0..a928e8e33a4 100644 --- a/tests/ui/attributes/dump_def_parents.stderr +++ b/tests/ui/attributes/dump_def_parents.stderr @@ -1,11 +1,50 @@ error: rustc_dump_def_parents: DefId(..) - --> $DIR/dump_def_parents.rs:8:13 + --> $DIR/dump_def_parents.rs:7:9 + | +LL | fn baz() { + | ^^^^^^^^ + | +note: DefId(..) + --> $DIR/dump_def_parents.rs:5:5 + | +LL | fn foo() { + | ^^^^^^^^ +note: DefId(..) + --> $DIR/dump_def_parents.rs:4:1 + | +LL | fn bar() { + | ^^^^^^^^ +note: DefId(..) + --> $DIR/dump_def_parents.rs:2:1 + | +LL | / #![feature(rustc_attrs)] +LL | | +LL | | fn bar() { +LL | | fn foo() { +... | +LL | | +LL | | fn main() {} + | |____________^ + +error: rustc_dump_def_parents: DefId(..) + --> $DIR/dump_def_parents.rs:11:21 + | +LL | / { +LL | | +LL | | fn inhibits_dump() { +LL | | qux::< +... | +LL | | 1 +LL | | }, + | |_____________________^ + | +note: DefId(..) + --> $DIR/dump_def_parents.rs:9:13 | LL | || { | ^^ - | note: DefId(..) - --> $DIR/dump_def_parents.rs:6:9 + --> $DIR/dump_def_parents.rs:7:9 | LL | fn baz() { | ^^^^^^^^ @@ -32,6 +71,21 @@ LL | | fn main() {} | |____________^ error: rustc_dump_def_parents: DefId(..) + --> $DIR/dump_def_parents.rs:15:33 + | +LL | / ... { +LL | | ... +LL | | ... "hi"; +LL | | ... 1 +LL | | ... }, + | |_______________________^ + | +note: DefId(..) + --> $DIR/dump_def_parents.rs:13:25 + | +LL | fn inhibits_dump() { + | ^^^^^^^^^^^^^^^^^^ +note: DefId(..) --> $DIR/dump_def_parents.rs:11:21 | LL | / { @@ -42,14 +96,13 @@ LL | | qux::< LL | | 1 LL | | }, | |_____________________^ - | note: DefId(..) - --> $DIR/dump_def_parents.rs:8:13 + --> $DIR/dump_def_parents.rs:9:13 | LL | || { | ^^ note: DefId(..) - --> $DIR/dump_def_parents.rs:6:9 + --> $DIR/dump_def_parents.rs:7:9 | LL | fn baz() { | ^^^^^^^^ @@ -76,7 +129,7 @@ LL | | fn main() {} | |____________^ error: rustc_dump_def_parents: DefId(..) - --> $DIR/dump_def_parents.rs:22:31 + --> $DIR/dump_def_parents.rs:23:31 | LL | qux::<{ 1 + 1 }>(); | ^^^^^^^^^ @@ -93,12 +146,12 @@ LL | | 1 LL | | }, | |_____________________^ note: DefId(..) - --> $DIR/dump_def_parents.rs:8:13 + --> $DIR/dump_def_parents.rs:9:13 | LL | || { | ^^ note: DefId(..) - --> $DIR/dump_def_parents.rs:6:9 + --> $DIR/dump_def_parents.rs:7:9 | LL | fn baz() { | ^^^^^^^^ @@ -124,5 +177,5 @@ LL | | LL | | fn main() {} | |____________^ -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors diff --git a/tests/ui/attributes/key-value-expansion.rs b/tests/ui/attributes/key-value-expansion.rs index dd408ebb77e..e5700a75935 100644 --- a/tests/ui/attributes/key-value-expansion.rs +++ b/tests/ui/attributes/key-value-expansion.rs @@ -1,7 +1,7 @@ // Regression tests for issue #55414, expansion happens in the value of a key-value attribute, // and the expanded expression is more complex than simply a macro call. -//@ aux-build:key-value-expansion.rs +//@ proc-macro: key-value-expansion.rs #![feature(rustc_attrs)] diff --git a/tests/ui/attributes/main-removed-2/auxiliary/tokyo.rs b/tests/ui/attributes/main-removed-2/auxiliary/tokyo.rs index 25879d17027..038183a80b8 100644 --- a/tests/ui/attributes/main-removed-2/auxiliary/tokyo.rs +++ b/tests/ui/attributes/main-removed-2/auxiliary/tokyo.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/attributes/main-removed-2/main.rs b/tests/ui/attributes/main-removed-2/main.rs index e4a3de79ec9..53696d68ced 100644 --- a/tests/ui/attributes/main-removed-2/main.rs +++ b/tests/ui/attributes/main-removed-2/main.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:tokyo.rs +//@ proc-macro: tokyo.rs //@ compile-flags:--extern tokyo //@ edition:2021 diff --git a/tests/ui/attributes/method-attributes.rs b/tests/ui/attributes/method-attributes.rs index 4a7f042c20a..ded72d2457b 100644 --- a/tests/ui/attributes/method-attributes.rs +++ b/tests/ui/attributes/method-attributes.rs @@ -1,6 +1,5 @@ //@ build-pass (FIXME(62277): could be check-pass?) //@ pp-exact - Make sure we print all the attributes -//@ pretty-expanded FIXME #23616 #![feature(rustc_attrs)] diff --git a/tests/ui/attributes/no-sanitize.rs b/tests/ui/attributes/no-sanitize.rs index 82b7a22d570..8c79866d5aa 100644 --- a/tests/ui/attributes/no-sanitize.rs +++ b/tests/ui/attributes/no-sanitize.rs @@ -4,31 +4,37 @@ #![allow(dead_code)] fn invalid() { - #[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition + #[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function { 1 }; } -#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition +#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function type InvalidTy = (); -#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition +#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function mod invalid_module {} fn main() { - let _ = #[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition + let _ = #[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function (|| 1); } -#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition +#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function struct F; -#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition +#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function impl F { #[no_sanitize(memory)] fn valid(&self) {} } +#[no_sanitize(address, memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function +static INVALID : i32 = 0; + #[no_sanitize(memory)] fn valid() {} + +#[no_sanitize(address)] +static VALID : i32 = 0; diff --git a/tests/ui/attributes/no-sanitize.stderr b/tests/ui/attributes/no-sanitize.stderr index f742ba0beed..9b0b76e3f4e 100644 --- a/tests/ui/attributes/no-sanitize.stderr +++ b/tests/ui/attributes/no-sanitize.stderr @@ -1,55 +1,63 @@ -error: attribute should be applied to a function definition - --> $DIR/no-sanitize.rs:7:5 +error: `#[no_sanitize(memory)]` should be applied to a function + --> $DIR/no-sanitize.rs:7:19 | LL | #[no_sanitize(memory)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ LL | / { LL | | 1 LL | | }; - | |_____- not a function definition + | |_____- not a function -error: attribute should be applied to a function definition - --> $DIR/no-sanitize.rs:13:1 +error: `#[no_sanitize(memory)]` should be applied to a function + --> $DIR/no-sanitize.rs:13:15 | LL | #[no_sanitize(memory)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ LL | type InvalidTy = (); - | -------------------- not a function definition + | -------------------- not a function -error: attribute should be applied to a function definition - --> $DIR/no-sanitize.rs:16:1 +error: `#[no_sanitize(memory)]` should be applied to a function + --> $DIR/no-sanitize.rs:16:15 | LL | #[no_sanitize(memory)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ LL | mod invalid_module {} - | --------------------- not a function definition + | --------------------- not a function -error: attribute should be applied to a function definition - --> $DIR/no-sanitize.rs:20:13 +error: `#[no_sanitize(memory)]` should be applied to a function + --> $DIR/no-sanitize.rs:20:27 | LL | let _ = #[no_sanitize(memory)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ LL | (|| 1); - | ------ not a function definition + | ------ not a function -error: attribute should be applied to a function definition - --> $DIR/no-sanitize.rs:24:1 +error: `#[no_sanitize(memory)]` should be applied to a function + --> $DIR/no-sanitize.rs:24:15 | LL | #[no_sanitize(memory)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ LL | struct F; - | --------- not a function definition + | --------- not a function -error: attribute should be applied to a function definition - --> $DIR/no-sanitize.rs:27:1 +error: `#[no_sanitize(memory)]` should be applied to a function + --> $DIR/no-sanitize.rs:27:15 | LL | #[no_sanitize(memory)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ LL | / impl F { LL | | #[no_sanitize(memory)] LL | | fn valid(&self) {} LL | | } - | |_- not a function definition + | |_- not a function -error: aborting due to 6 previous errors +error: `#[no_sanitize(memory)]` should be applied to a function + --> $DIR/no-sanitize.rs:33:24 + | +LL | #[no_sanitize(address, memory)] + | ^^^^^^ +LL | static INVALID : i32 = 0; + | ------------------------- not a function + +error: aborting due to 7 previous errors diff --git a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs index 273b127bf9c..19046c08ca8 100644 --- a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options #[unsafe(cfg(any()))] //~ ERROR: is not an unsafe attribute fn a() {} diff --git a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr index 445d239d867..b549a638d5e 100644 --- a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr @@ -1,5 +1,5 @@ error: `cfg` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:4:3 + --> $DIR/extraneous-unsafe-attributes.rs:3:3 | LL | #[unsafe(cfg(any()))] | ^^^^^^ this is not an unsafe attribute @@ -7,7 +7,7 @@ LL | #[unsafe(cfg(any()))] = note: extraneous unsafe is not allowed in attributes error: `cfg_attr` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:7:3 + --> $DIR/extraneous-unsafe-attributes.rs:6:3 | LL | #[unsafe(cfg_attr(any(), allow(dead_code)))] | ^^^^^^ this is not an unsafe attribute @@ -15,7 +15,7 @@ LL | #[unsafe(cfg_attr(any(), allow(dead_code)))] = note: extraneous unsafe is not allowed in attributes error: `test` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:10:3 + --> $DIR/extraneous-unsafe-attributes.rs:9:3 | LL | #[unsafe(test)] | ^^^^^^ this is not an unsafe attribute @@ -23,7 +23,7 @@ LL | #[unsafe(test)] = note: extraneous unsafe is not allowed in attributes error: expected identifier, found keyword `unsafe` - --> $DIR/extraneous-unsafe-attributes.rs:31:19 + --> $DIR/extraneous-unsafe-attributes.rs:30:19 | LL | let _a = cfg!(unsafe(foo)); | ^^^^^^ expected identifier, found keyword @@ -34,13 +34,13 @@ LL | let _a = cfg!(r#unsafe(foo)); | ++ error[E0537]: invalid predicate `r#unsafe` - --> $DIR/extraneous-unsafe-attributes.rs:31:19 + --> $DIR/extraneous-unsafe-attributes.rs:30:19 | LL | let _a = cfg!(unsafe(foo)); | ^^^^^^^^^^^ error: `ignore` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:13:3 + --> $DIR/extraneous-unsafe-attributes.rs:12:3 | LL | #[unsafe(ignore = "test")] | ^^^^^^ this is not an unsafe attribute @@ -48,7 +48,7 @@ LL | #[unsafe(ignore = "test")] = note: extraneous unsafe is not allowed in attributes error: `should_panic` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:16:3 + --> $DIR/extraneous-unsafe-attributes.rs:15:3 | LL | #[unsafe(should_panic(expected = "test"))] | ^^^^^^ this is not an unsafe attribute @@ -56,7 +56,7 @@ LL | #[unsafe(should_panic(expected = "test"))] = note: extraneous unsafe is not allowed in attributes error: `macro_use` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:19:3 + --> $DIR/extraneous-unsafe-attributes.rs:18:3 | LL | #[unsafe(macro_use)] | ^^^^^^ this is not an unsafe attribute @@ -64,7 +64,7 @@ LL | #[unsafe(macro_use)] = note: extraneous unsafe is not allowed in attributes error: `macro_export` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:21:7 + --> $DIR/extraneous-unsafe-attributes.rs:20:7 | LL | #[unsafe(macro_export)] | ^^^^^^ this is not an unsafe attribute @@ -72,7 +72,7 @@ LL | #[unsafe(macro_export)] = note: extraneous unsafe is not allowed in attributes error: `used` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:27:3 + --> $DIR/extraneous-unsafe-attributes.rs:26:3 | LL | #[unsafe(used)] | ^^^^^^ this is not an unsafe attribute diff --git a/tests/ui/attributes/variant-attributes.rs b/tests/ui/attributes/variant-attributes.rs index 57423ad61b2..a08856aa278 100644 --- a/tests/ui/attributes/variant-attributes.rs +++ b/tests/ui/attributes/variant-attributes.rs @@ -1,6 +1,5 @@ //@ build-pass (FIXME(62277): could be check-pass?) //@ pp-exact - Make sure we actually print the attributes -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] #![feature(rustc_attrs)] diff --git a/tests/ui/autodiff/auxiliary/my_macro.rs b/tests/ui/autodiff/auxiliary/my_macro.rs index 417199611cc..217631a33c9 100644 --- a/tests/ui/autodiff/auxiliary/my_macro.rs +++ b/tests/ui/autodiff/auxiliary/my_macro.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/autodiff/visibility.rs b/tests/ui/autodiff/visibility.rs index 6a4851de2dc..dfaec03aef0 100644 --- a/tests/ui/autodiff/visibility.rs +++ b/tests/ui/autodiff/visibility.rs @@ -1,7 +1,7 @@ //@ ignore-enzyme //@ revisions: std_autodiff no_std_autodiff //@[no_std_autodiff] check-pass -//@ aux-build: my_macro.rs +//@ proc-macro: my_macro.rs #![crate_type = "lib"] #![feature(autodiff)] diff --git a/tests/ui/autoref-autoderef/autoderef-and-borrow-method-receiver.rs b/tests/ui/autoref-autoderef/autoderef-and-borrow-method-receiver.rs index b44e2a8cd37..d75a2ab8bdb 100644 --- a/tests/ui/autoref-autoderef/autoderef-and-borrow-method-receiver.rs +++ b/tests/ui/autoref-autoderef/autoderef-and-borrow-method-receiver.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Foo { x: isize, diff --git a/tests/ui/auxiliary/unsafe-fields-crate-dep.rs b/tests/ui/auxiliary/unsafe-fields-crate-dep.rs new file mode 100644 index 00000000000..95b928402a9 --- /dev/null +++ b/tests/ui/auxiliary/unsafe-fields-crate-dep.rs @@ -0,0 +1,7 @@ +#![allow(incomplete_features)] +#![feature(unsafe_fields)] + +pub struct WithUnsafeField { + pub unsafe unsafe_field: u32, + pub safe_field: u32, +} diff --git a/tests/ui/bench/issue-32062.rs b/tests/ui/bench/issue-32062.rs index 84de427a200..a7d1f8073d4 100644 --- a/tests/ui/bench/issue-32062.rs +++ b/tests/ui/bench/issue-32062.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { let _ = test(Some(0).into_iter()); diff --git a/tests/ui/binding/inconsistent-lifetime-mismatch.rs b/tests/ui/binding/inconsistent-lifetime-mismatch.rs index b45c72cd9bd..539f8f58a1d 100644 --- a/tests/ui/binding/inconsistent-lifetime-mismatch.rs +++ b/tests/ui/binding/inconsistent-lifetime-mismatch.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn foo(_: &[&str]) {} diff --git a/tests/ui/binding/match-naked-record-expr.rs b/tests/ui/binding/match-naked-record-expr.rs index c6557cc10d6..57697a73ca4 100644 --- a/tests/ui/binding/match-naked-record-expr.rs +++ b/tests/ui/binding/match-naked-record-expr.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct X { x: isize } diff --git a/tests/ui/binding/match-naked-record.rs b/tests/ui/binding/match-naked-record.rs index 24d7aec00e7..ce9489a00f2 100644 --- a/tests/ui/binding/match-naked-record.rs +++ b/tests/ui/binding/match-naked-record.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct X { x: isize } diff --git a/tests/ui/binding/match-path.rs b/tests/ui/binding/match-path.rs index 9bcef9914d1..1305ac7668e 100644 --- a/tests/ui/binding/match-path.rs +++ b/tests/ui/binding/match-path.rs @@ -3,7 +3,6 @@ #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 mod m1 { pub enum foo { foo1, foo2, } diff --git a/tests/ui/binding/match-pattern-simple.rs b/tests/ui/binding/match-pattern-simple.rs index 2e43b702fae..da22acd7f37 100644 --- a/tests/ui/binding/match-pattern-simple.rs +++ b/tests/ui/binding/match-pattern-simple.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn altsimple(f: isize) { match f { _x => () } } diff --git a/tests/ui/binding/match-phi.rs b/tests/ui/binding/match-phi.rs index cfef03adaa4..128d4d618a0 100644 --- a/tests/ui/binding/match-phi.rs +++ b/tests/ui/binding/match-phi.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_assignments)] -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] #![allow(unused_variables)] diff --git a/tests/ui/binding/match-range-static.rs b/tests/ui/binding/match-range-static.rs index 478dfb3cf41..cf4d030b66f 100644 --- a/tests/ui/binding/match-range-static.rs +++ b/tests/ui/binding/match-range-static.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_upper_case_globals)] const s: isize = 1; diff --git a/tests/ui/binding/match-value-binding-in-guard-3291.rs b/tests/ui/binding/match-value-binding-in-guard-3291.rs index a1f939cadca..ca8c34628b7 100644 --- a/tests/ui/binding/match-value-binding-in-guard-3291.rs +++ b/tests/ui/binding/match-value-binding-in-guard-3291.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn foo(x: Option<Box<isize>>, b: bool) -> isize { match x { diff --git a/tests/ui/binding/nil-pattern.rs b/tests/ui/binding/nil-pattern.rs index 757d701c15a..68dbfe3b453 100644 --- a/tests/ui/binding/nil-pattern.rs +++ b/tests/ui/binding/nil-pattern.rs @@ -1,4 +1,3 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let x = (); match x { () => { } } } diff --git a/tests/ui/binding/simple-generic-match.rs b/tests/ui/binding/simple-generic-match.rs index 910bab03e1f..001b469d35e 100644 --- a/tests/ui/binding/simple-generic-match.rs +++ b/tests/ui/binding/simple-generic-match.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum clam<T> { a(#[allow(dead_code)] T), } diff --git a/tests/ui/borrowck/borrowck-assign-to-subfield.rs b/tests/ui/borrowck/borrowck-assign-to-subfield.rs index 807941d9c85..27d9046e7b7 100644 --- a/tests/ui/borrowck/borrowck-assign-to-subfield.rs +++ b/tests/ui/borrowck/borrowck-assign-to-subfield.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { struct A { diff --git a/tests/ui/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs b/tests/ui/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs index a815253d714..ef5baae4500 100644 --- a/tests/ui/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs +++ b/tests/ui/borrowck/borrowck-borrow-of-mut-base-ptr-safe.rs @@ -7,7 +7,6 @@ // // Example from compiler/rustc_borrowck/borrowck/README.md -//@ pretty-expanded FIXME #23616 fn foo<'a>(mut t0: &'a mut isize, mut t1: &'a mut isize) { diff --git a/tests/ui/borrowck/borrowck-field-sensitivity-rpass.rs b/tests/ui/borrowck/borrowck-field-sensitivity-rpass.rs index d78d8a9d966..d200ef6d6f8 100644 --- a/tests/ui/borrowck/borrowck-field-sensitivity-rpass.rs +++ b/tests/ui/borrowck/borrowck-field-sensitivity-rpass.rs @@ -2,7 +2,6 @@ #![allow(unused_mut)] #![allow(unused_variables)] #![allow(dropping_copy_types)] -//@ pretty-expanded FIXME #23616 struct A { a: isize, b: Box<isize> } struct B { a: Box<isize>, b: Box<isize> } diff --git a/tests/ui/borrowck/borrowck-lend-args.rs b/tests/ui/borrowck/borrowck-lend-args.rs index 08a7aea1627..9d45730f196 100644 --- a/tests/ui/borrowck/borrowck-lend-args.rs +++ b/tests/ui/borrowck/borrowck-lend-args.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn borrow(_v: &isize) {} diff --git a/tests/ui/borrowck/borrowck-static-item-in-fn.rs b/tests/ui/borrowck/borrowck-static-item-in-fn.rs index 9cdd4c89132..3c2e7b92c9e 100644 --- a/tests/ui/borrowck/borrowck-static-item-in-fn.rs +++ b/tests/ui/borrowck/borrowck-static-item-in-fn.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // Regression test for issue #7740 -//@ pretty-expanded FIXME #23616 pub fn main() { static A: &'static char = &'A'; diff --git a/tests/ui/borrowck/borrowck-trait-lifetime.rs b/tests/ui/borrowck/borrowck-trait-lifetime.rs index e43201fb10b..26d4cfb8887 100644 --- a/tests/ui/borrowck/borrowck-trait-lifetime.rs +++ b/tests/ui/borrowck/borrowck-trait-lifetime.rs @@ -3,7 +3,6 @@ // This test verifies that casting from the same lifetime on a value // to the same lifetime on a trait succeeds. See issue #10766. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/borrowck/borrowck-uniq-via-ref.rs b/tests/ui/borrowck/borrowck-uniq-via-ref.rs index d3190d66bd3..67f908a0c07 100644 --- a/tests/ui/borrowck/borrowck-uniq-via-ref.rs +++ b/tests/ui/borrowck/borrowck-uniq-via-ref.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Rec { f: Box<isize>, diff --git a/tests/ui/borrowck/borrowck-use-mut-borrow-rpass.rs b/tests/ui/borrowck/borrowck-use-mut-borrow-rpass.rs index 9649f484471..5bbac021504 100644 --- a/tests/ui/borrowck/borrowck-use-mut-borrow-rpass.rs +++ b/tests/ui/borrowck/borrowck-use-mut-borrow-rpass.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dropping_copy_types)] diff --git a/tests/ui/box/new-box-syntax.rs b/tests/ui/box/new-box-syntax.rs index f2899ff3dde..a0d8cb75584 100644 --- a/tests/ui/box/new-box-syntax.rs +++ b/tests/ui/box/new-box-syntax.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ diff --git a/tests/ui/box/new.rs b/tests/ui/box/new.rs index 682a998ae19..2e7525e208f 100644 --- a/tests/ui/box/new.rs +++ b/tests/ui/box/new.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { let _a = Box::new(1); diff --git a/tests/ui/box/unit/unique-containing-tag.rs b/tests/ui/box/unit/unique-containing-tag.rs index cd88cfab425..a9752a64f4d 100644 --- a/tests/ui/box/unit/unique-containing-tag.rs +++ b/tests/ui/box/unit/unique-containing-tag.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 pub fn main() { enum t { t1(isize), t2(isize), } diff --git a/tests/ui/box/unit/unique-create.rs b/tests/ui/box/unit/unique-create.rs index bf3826156b1..b3b72971e53 100644 --- a/tests/ui/box/unit/unique-create.rs +++ b/tests/ui/box/unit/unique-create.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub fn main() { let _: Box<_> = Box::new(100); diff --git a/tests/ui/box/unit/unique-drop-complex.rs b/tests/ui/box/unit/unique-drop-complex.rs index f23635e59cd..6e5fb524f41 100644 --- a/tests/ui/box/unit/unique-drop-complex.rs +++ b/tests/ui/box/unit/unique-drop-complex.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let _x: Box<_> = Box::new(vec![0,0,0,0,0]); diff --git a/tests/ui/box/unit/unique-generic-assign.rs b/tests/ui/box/unit/unique-generic-assign.rs index ef9c34c41a3..2c5cb0c1112 100644 --- a/tests/ui/box/unit/unique-generic-assign.rs +++ b/tests/ui/box/unit/unique-generic-assign.rs @@ -3,7 +3,6 @@ // Issue #976 -//@ pretty-expanded FIXME #23616 fn f<T>(x: Box<T>) { let _x2 = x; diff --git a/tests/ui/box/unit/unique-init.rs b/tests/ui/box/unit/unique-init.rs index ad2390c2ca0..0950c794c48 100644 --- a/tests/ui/box/unit/unique-init.rs +++ b/tests/ui/box/unit/unique-init.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let _i: Box<_> = Box::new(100); diff --git a/tests/ui/box/unit/unique-match-discrim.rs b/tests/ui/box/unit/unique-match-discrim.rs index 97b502004f5..c1b7b15c7c4 100644 --- a/tests/ui/box/unit/unique-match-discrim.rs +++ b/tests/ui/box/unit/unique-match-discrim.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // Issue #961 -//@ pretty-expanded FIXME #23616 fn altsimple() { match Box::new(true) { diff --git a/tests/ui/box/unit/unique-object-move.rs b/tests/ui/box/unit/unique-object-move.rs index f30fc5c8e64..6ed2b1dc401 100644 --- a/tests/ui/box/unit/unique-object-move.rs +++ b/tests/ui/box/unit/unique-object-move.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // Issue #5192 -//@ pretty-expanded FIXME #23616 pub trait EventLoop { fn foo(&self) {} } diff --git a/tests/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs b/tests/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs index 8a2fa468577..ea5d3bdcfdb 100644 --- a/tests/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs +++ b/tests/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs @@ -5,7 +5,6 @@ // super-builtin-kind of a trait, if the type parameter is never used, // the type can implement the trait anyway. -//@ pretty-expanded FIXME #23616 use std::marker; diff --git a/tests/ui/builtin-superkinds/builtin-superkinds-simple2.rs b/tests/ui/builtin-superkinds/builtin-superkinds-simple2.rs index 1354b4ac188..510ef4c158e 100644 --- a/tests/ui/builtin-superkinds/builtin-superkinds-simple2.rs +++ b/tests/ui/builtin-superkinds/builtin-superkinds-simple2.rs @@ -1,7 +1,6 @@ //@ check-pass // Simple test case of implementing a trait with super-builtin-kinds. -//@ pretty-expanded FIXME #23616 trait Foo : Send { } diff --git a/tests/ui/builtin-superkinds/builtin-superkinds-typaram.rs b/tests/ui/builtin-superkinds/builtin-superkinds-typaram.rs index 15b867dd5e0..de2afc4a171 100644 --- a/tests/ui/builtin-superkinds/builtin-superkinds-typaram.rs +++ b/tests/ui/builtin-superkinds/builtin-superkinds-typaram.rs @@ -2,7 +2,6 @@ // Tests correct implementation of traits with super-builtin-kinds // using a bounded type parameter. -//@ pretty-expanded FIXME #23616 trait Foo : Send { } diff --git a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs deleted file mode 100644 index d47a8e085fd..00000000000 --- a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs +++ /dev/null @@ -1,19 +0,0 @@ -//@ only-x86_64 - -fn efiapi(f: extern "efiapi" fn(usize, ...)) { - //~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl` - //~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable - f(22, 44); -} -fn sysv(f: extern "sysv64" fn(usize, ...)) { - //~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl` - //~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable - f(22, 44); -} -fn win(f: extern "win64" fn(usize, ...)) { - //~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl` - //~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable - f(22, 44); -} - -fn main() {} diff --git a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr deleted file mode 100644 index 41be3784245..00000000000 --- a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr +++ /dev/null @@ -1,52 +0,0 @@ -error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable - --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14 - | -LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information - = help: add `#![feature(extended_varargs_abi_support)]` 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[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` - --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14 - | -LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention - -error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable - --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12 - | -LL | fn sysv(f: extern "sysv64" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information - = help: add `#![feature(extended_varargs_abi_support)]` 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[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` - --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12 - | -LL | fn sysv(f: extern "sysv64" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention - -error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable - --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11 - | -LL | fn win(f: extern "win64" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #100189 <https://github.com/rust-lang/rust/issues/100189> for more information - = help: add `#![feature(extended_varargs_abi_support)]` 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[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` - --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11 - | -LL | fn win(f: extern "win64" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0045, E0658. -For more information about an error, try `rustc --explain E0045`. diff --git a/tests/ui/c-variadic/fn-item-diagnostic-issue-69232.rs b/tests/ui/c-variadic/fn-item-diagnostic-issue-69232.rs new file mode 100644 index 00000000000..d0ef91b22b2 --- /dev/null +++ b/tests/ui/c-variadic/fn-item-diagnostic-issue-69232.rs @@ -0,0 +1,13 @@ +// https://github.com/rust-lang/rust/issues/69232 + +extern "C" { + fn foo(x: usize, ...); +} + +fn test() -> u8 { + 127 +} + +fn main() { + unsafe { foo(1, test) }; //~ ERROR can't pass a function item to a variadic function +} diff --git a/tests/ui/c-variadic/fn-item-diagnostic-issue-69232.stderr b/tests/ui/c-variadic/fn-item-diagnostic-issue-69232.stderr new file mode 100644 index 00000000000..6aa1c8a1091 --- /dev/null +++ b/tests/ui/c-variadic/fn-item-diagnostic-issue-69232.stderr @@ -0,0 +1,16 @@ +error[E0617]: can't pass a function item to a variadic function + --> $DIR/fn-item-diagnostic-issue-69232.rs:12:21 + | +LL | unsafe { foo(1, test) }; + | ^^^^ + | + = help: a function item is zero-sized and needs to be cast into a function pointer to be used in FFI + = note: for more information on function items, visit https://doc.rust-lang.org/reference/types/function-item.html +help: use a function pointer instead + | +LL | unsafe { foo(1, test as fn() -> u8) }; + | +++++++++++++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0617`. diff --git a/tests/ui/c-variadic/issue-32201.rs b/tests/ui/c-variadic/issue-32201.rs index f27bb1c2eb5..434711b7523 100644 --- a/tests/ui/c-variadic/issue-32201.rs +++ b/tests/ui/c-variadic/issue-32201.rs @@ -7,7 +7,8 @@ fn bar(_: *const u8) {} fn main() { unsafe { foo(0, bar); - //~^ ERROR can't pass `fn(*const u8) {bar}` to variadic function - //~| HELP cast the value to `fn(*const u8)` + //~^ ERROR can't pass a function item to a variadic function + //~| HELP a function item is zero-sized and needs to be cast into a function pointer to be used in FFI + ////~| HELP use a function pointer instead } } diff --git a/tests/ui/c-variadic/issue-32201.stderr b/tests/ui/c-variadic/issue-32201.stderr index 352db9f62f6..1cd85d7f07a 100644 --- a/tests/ui/c-variadic/issue-32201.stderr +++ b/tests/ui/c-variadic/issue-32201.stderr @@ -1,8 +1,15 @@ -error[E0617]: can't pass `fn(*const u8) {bar}` to variadic function +error[E0617]: can't pass a function item to a variadic function --> $DIR/issue-32201.rs:9:16 | LL | foo(0, bar); - | ^^^ help: cast the value to `fn(*const u8)`: `bar as fn(*const u8)` + | ^^^ + | + = help: a function item is zero-sized and needs to be cast into a function pointer to be used in FFI + = note: for more information on function items, visit https://doc.rust-lang.org/reference/types/function-item.html +help: use a function pointer instead + | +LL | foo(0, bar as fn(*const u8)); + | ++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/c-variadic/variadic-ffi-1.stderr b/tests/ui/c-variadic/variadic-ffi-1.stderr index 72d60a1439a..7a54d043356 100644 --- a/tests/ui/c-variadic/variadic-ffi-1.stderr +++ b/tests/ui/c-variadic/variadic-ffi-1.stderr @@ -1,4 +1,4 @@ -error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` +error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi` --> $DIR/variadic-ffi-1.rs:9:5 | LL | fn printf(_: *const u8, ...); @@ -62,37 +62,67 @@ error[E0617]: can't pass `f32` to variadic function --> $DIR/variadic-ffi-1.rs:28:19 | LL | foo(1, 2, 3f32); - | ^^^^ help: cast the value to `c_double`: `3f32 as c_double` + | ^^^^ + | +help: cast the value to `c_double` + | +LL | foo(1, 2, 3f32 as c_double); + | +++++++++++ error[E0617]: can't pass `bool` to variadic function --> $DIR/variadic-ffi-1.rs:29:19 | LL | foo(1, 2, true); - | ^^^^ help: cast the value to `c_int`: `true as c_int` + | ^^^^ + | +help: cast the value to `c_int` + | +LL | foo(1, 2, true as c_int); + | ++++++++ error[E0617]: can't pass `i8` to variadic function --> $DIR/variadic-ffi-1.rs:30:19 | LL | foo(1, 2, 1i8); - | ^^^ help: cast the value to `c_int`: `1i8 as c_int` + | ^^^ + | +help: cast the value to `c_int` + | +LL | foo(1, 2, 1i8 as c_int); + | ++++++++ error[E0617]: can't pass `u8` to variadic function --> $DIR/variadic-ffi-1.rs:31:19 | LL | foo(1, 2, 1u8); - | ^^^ help: cast the value to `c_uint`: `1u8 as c_uint` + | ^^^ + | +help: cast the value to `c_uint` + | +LL | foo(1, 2, 1u8 as c_uint); + | +++++++++ error[E0617]: can't pass `i16` to variadic function --> $DIR/variadic-ffi-1.rs:32:19 | LL | foo(1, 2, 1i16); - | ^^^^ help: cast the value to `c_int`: `1i16 as c_int` + | ^^^^ + | +help: cast the value to `c_int` + | +LL | foo(1, 2, 1i16 as c_int); + | ++++++++ error[E0617]: can't pass `u16` to variadic function --> $DIR/variadic-ffi-1.rs:33:19 | LL | foo(1, 2, 1u16); - | ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint` + | ^^^^ + | +help: cast the value to `c_uint` + | +LL | foo(1, 2, 1u16 as c_uint); + | +++++++++ error: aborting due to 11 previous errors diff --git a/tests/ui/c-variadic/variadic-ffi-2-arm.rs b/tests/ui/c-variadic/variadic-ffi-2-arm.rs index 3b0a71007a0..82f9df5053c 100644 --- a/tests/ui/c-variadic/variadic-ffi-2-arm.rs +++ b/tests/ui/c-variadic/variadic-ffi-2-arm.rs @@ -1,6 +1,5 @@ //@ only-arm //@ build-pass -#![feature(extended_varargs_abi_support)] fn aapcs(f: extern "aapcs" fn(usize, ...)) { f(22, 44); diff --git a/tests/ui/c-variadic/variadic-ffi-2.rs b/tests/ui/c-variadic/variadic-ffi-2.rs index bafb7e2b20c..17a1065279f 100644 --- a/tests/ui/c-variadic/variadic-ffi-2.rs +++ b/tests/ui/c-variadic/variadic-ffi-2.rs @@ -1,5 +1,4 @@ //@ ignore-arm stdcall isn't supported -#![feature(extended_varargs_abi_support)] #[allow(unsupported_fn_ptr_calling_conventions)] fn baz(f: extern "stdcall" fn(usize, ...)) { diff --git a/tests/ui/c-variadic/variadic-ffi-2.stderr b/tests/ui/c-variadic/variadic-ffi-2.stderr index e52de93a926..fbf273b1f1d 100644 --- a/tests/ui/c-variadic/variadic-ffi-2.stderr +++ b/tests/ui/c-variadic/variadic-ffi-2.stderr @@ -1,5 +1,5 @@ error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi` - --> $DIR/variadic-ffi-2.rs:5:11 + --> $DIR/variadic-ffi-2.rs:4:11 | LL | fn baz(f: extern "stdcall" fn(usize, ...)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention diff --git a/tests/ui/can-copy-pod.rs b/tests/ui/can-copy-pod.rs index dd4cf54040a..ffb8a08fa98 100644 --- a/tests/ui/can-copy-pod.rs +++ b/tests/ui/can-copy-pod.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ diff --git a/tests/ui/cancel-clean-via-immediate-rvalue-ref.rs b/tests/ui/cancel-clean-via-immediate-rvalue-ref.rs index 0575c29bffd..12d143bd989 100644 --- a/tests/ui/cancel-clean-via-immediate-rvalue-ref.rs +++ b/tests/ui/cancel-clean-via-immediate-rvalue-ref.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn foo(x: &mut Box<u8>) { *x = Box::new(5); diff --git a/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs b/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs index b04b1e0c326..cafb7389e29 100644 --- a/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs +++ b/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:ver-cfg-rel.rs +//@ proc-macro: ver-cfg-rel.rs //@ revisions: assume no_assume //@ [assume]compile-flags: -Z assume-incomplete-release diff --git a/tests/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs b/tests/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs index e06ee94a1e9..5d3e9c7a32f 100644 --- a/tests/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs +++ b/tests/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, TokenTree as Tt}; use std::str::FromStr; diff --git a/tests/ui/cfg/cfg-attr-cfg.rs b/tests/ui/cfg/cfg-attr-cfg.rs index 67d97e760d7..08b9374cfd7 100644 --- a/tests/ui/cfg/cfg-attr-cfg.rs +++ b/tests/ui/cfg/cfg-attr-cfg.rs @@ -2,7 +2,6 @@ // main is conditionally compiled, but the conditional compilation // is conditional too! -//@ pretty-expanded FIXME #23616 #[cfg_attr(FALSE, cfg(bar))] fn main() { } diff --git a/tests/ui/cfg/cfg-attr-crate.rs b/tests/ui/cfg/cfg-attr-crate.rs index 444704d132a..44242a6a57d 100644 --- a/tests/ui/cfg/cfg-attr-crate.rs +++ b/tests/ui/cfg/cfg-attr-crate.rs @@ -1,7 +1,6 @@ //@ run-pass // https://github.com/rust-lang/rust/issues/21833#issuecomment-72353044 -//@ pretty-expanded FIXME #23616 #![cfg_attr(FALSE, no_core)] diff --git a/tests/ui/cfg/cfg-family.rs b/tests/ui/cfg/cfg-family.rs index caf59327f10..a13ae7f9616 100644 --- a/tests/ui/cfg/cfg-family.rs +++ b/tests/ui/cfg/cfg-family.rs @@ -1,5 +1,4 @@ //@ build-pass -//@ pretty-expanded FIXME #23616 //@ ignore-wasm32 no bare family //@ ignore-sgx diff --git a/tests/ui/cfg/cfg-match-arm.rs b/tests/ui/cfg/cfg-match-arm.rs index e646a63b8fb..f6cd52c475c 100644 --- a/tests/ui/cfg/cfg-match-arm.rs +++ b/tests/ui/cfg/cfg-match-arm.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 enum Foo { Bar, diff --git a/tests/ui/cfg/cfg-target-family.rs b/tests/ui/cfg/cfg-target-family.rs index ab3be302e64..0b1c323307a 100644 --- a/tests/ui/cfg/cfg-target-family.rs +++ b/tests/ui/cfg/cfg-target-family.rs @@ -1,7 +1,6 @@ //@ build-pass //@ ignore-sgx -//@ pretty-expanded FIXME #23616 #[cfg(target_family = "windows")] pub fn main() {} diff --git a/tests/ui/cfg/cfg_inner_static.rs b/tests/ui/cfg/cfg_inner_static.rs index f4e2dc092f8..8d188b0aed7 100644 --- a/tests/ui/cfg/cfg_inner_static.rs +++ b/tests/ui/cfg/cfg_inner_static.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:cfg_inner_static.rs -//@ pretty-expanded FIXME #23616 extern crate cfg_inner_static; diff --git a/tests/ui/cfg/conditional-compile-arch.rs b/tests/ui/cfg/conditional-compile-arch.rs index 678b32c6a4e..594d9344561 100644 --- a/tests/ui/cfg/conditional-compile-arch.rs +++ b/tests/ui/cfg/conditional-compile-arch.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #[cfg(target_arch = "x86")] pub fn main() { } diff --git a/tests/ui/check-cfg/and-more-diagnostic.rs b/tests/ui/check-cfg/and-more-diagnostic.rs new file mode 100644 index 00000000000..82867f3b435 --- /dev/null +++ b/tests/ui/check-cfg/and-more-diagnostic.rs @@ -0,0 +1,13 @@ +// This test makes sure that we don't emit a long list of possible values +// but that we stop at a fix point and say "and X more". +// +//@ check-pass +//@ no-auto-check-cfg +//@ compile-flags: --check-cfg=cfg() +//@ normalize-stderr-test: "and \d+ more" -> "and X more" +//@ normalize-stderr-test: "`[a-zA-Z0-9_-]+`" -> "`xxx`" + +fn main() { + cfg!(target_feature = "zebra"); + //~^ WARNING unexpected `cfg` condition value +} diff --git a/tests/ui/check-cfg/and-more-diagnostic.stderr b/tests/ui/check-cfg/and-more-diagnostic.stderr new file mode 100644 index 00000000000..2ac80c84c37 --- /dev/null +++ b/tests/ui/check-cfg/and-more-diagnostic.stderr @@ -0,0 +1,12 @@ +warning: unexpected `xxx` condition value: `xxx` + --> $DIR/and-more-diagnostic.rs:11:10 + | +LL | cfg!(target_feature = "zebra"); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `xxx` are: `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, and `xxx` and X more + = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/check-cfg/mix.rs b/tests/ui/check-cfg/mix.rs index ac244f4fc09..e9a2de2f672 100644 --- a/tests/ui/check-cfg/mix.rs +++ b/tests/ui/check-cfg/mix.rs @@ -75,8 +75,6 @@ fn test_cfg_macro() { //~^ WARNING unexpected `cfg` condition value //~| WARNING unexpected `cfg` condition value //~| WARNING unexpected `cfg` condition value - cfg!(target_feature = "zebra"); - //~^ WARNING unexpected `cfg` condition value } fn main() {} diff --git a/tests/ui/check-cfg/mix.stderr b/tests/ui/check-cfg/mix.stderr index 0a993214f5a..231236799c6 100644 --- a/tests/ui/check-cfg/mix.stderr +++ b/tests/ui/check-cfg/mix.stderr @@ -245,14 +245,5 @@ LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:78:10 - | -LL | cfg!(target_feature = "zebra"); - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 251 more - = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration - -warning: 27 warnings emitted +warning: 26 warnings emitted diff --git a/tests/ui/check-cfg/target_feature.rs b/tests/ui/check-cfg/target_feature.rs new file mode 100644 index 00000000000..6028dae66c4 --- /dev/null +++ b/tests/ui/check-cfg/target_feature.rs @@ -0,0 +1,18 @@ +// This test prints all the possible values for the `target_feature` cfg +// as a way to assert the expected values and reflect on any changes made +// to the `target_feature` cfg in the compiler. +// +// The output of this test does not reflect the actual output seen by +// users which will see a truncated list of possible values (at worst). +// +// In case of test output differences, just `--bless` the test. +// +//@ check-pass +//@ no-auto-check-cfg +//@ compile-flags: --check-cfg=cfg() -Zcheck-cfg-all-expected +//@ normalize-stderr-test: "`, `" -> "`\n`" + +fn main() { + cfg!(target_feature = "_UNEXPECTED_VALUE"); + //~^ WARNING unexpected `cfg` condition value +} diff --git a/tests/ui/check-cfg/target_feature.stderr b/tests/ui/check-cfg/target_feature.stderr new file mode 100644 index 00000000000..2674a97a551 --- /dev/null +++ b/tests/ui/check-cfg/target_feature.stderr @@ -0,0 +1,297 @@ +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/target_feature.rs:16:10 + | +LL | cfg!(target_feature = "_UNEXPECTED_VALUE"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_feature` are: `10e60` +`2e3` +`3e3r1` +`3e3r2` +`3e3r3` +`3e7` +`7e10` +`a` +`aclass` +`adx` +`aes` +`altivec` +`alu32` +`amx-bf16` +`amx-complex` +`amx-fp16` +`amx-int8` +`amx-tile` +`atomics` +`avx` +`avx2` +`avx512bf16` +`avx512bitalg` +`avx512bw` +`avx512cd` +`avx512dq` +`avx512f` +`avx512fp16` +`avx512ifma` +`avx512vbmi` +`avx512vbmi2` +`avx512vl` +`avx512vnni` +`avx512vp2intersect` +`avx512vpopcntdq` +`avxifma` +`avxneconvert` +`avxvnni` +`avxvnniint16` +`avxvnniint8` +`backchain` +`bf16` +`bmi1` +`bmi2` +`bti` +`bulk-memory` +`c` +`cache` +`cmpxchg16b` +`crc` +`crt-static` +`cssc` +`d` +`d32` +`dit` +`doloop` +`dotprod` +`dpb` +`dpb2` +`dsp` +`dsp1e2` +`dspe60` +`e` +`e1` +`e2` +`ecv` +`edsp` +`elrw` +`ermsb` +`exception-handling` +`extended-const` +`f` +`f16c` +`f32mm` +`f64mm` +`faminmax` +`fcma` +`fdivdu` +`fhm` +`flagm` +`flagm2` +`float1e2` +`float1e3` +`float3e4` +`float7e60` +`floate1` +`fma` +`fp-armv8` +`fp16` +`fp64` +`fp8` +`fp8dot2` +`fp8dot4` +`fp8fma` +`fpuv2_df` +`fpuv2_sf` +`fpuv3_df` +`fpuv3_hf` +`fpuv3_hi` +`fpuv3_sf` +`frecipe` +`frintts` +`fxsr` +`gfni` +`hard-float` +`hard-float-abi` +`hard-tp` +`hbc` +`high-registers` +`hvx` +`hvx-length128b` +`hwdiv` +`i8mm` +`jsconv` +`lahfsahf` +`lasx` +`lbt` +`leoncasa` +`lor` +`lse` +`lse128` +`lse2` +`lsx` +`lut` +`lvz` +`lzcnt` +`m` +`mclass` +`mops` +`movbe` +`mp` +`mp1e2` +`msa` +`mte` +`multivalue` +`mutable-globals` +`neon` +`nontrapping-fptoint` +`nvic` +`paca` +`pacg` +`pan` +`partword-atomics` +`pauth-lr` +`pclmulqdq` +`pmuv3` +`popcnt` +`power10-vector` +`power8-altivec` +`power8-vector` +`power9-altivec` +`power9-vector` +`prfchw` +`quadword-atomics` +`rand` +`ras` +`rclass` +`rcpc` +`rcpc2` +`rcpc3` +`rdm` +`rdrand` +`rdseed` +`reference-types` +`relax` +`relaxed-simd` +`reserve-x18` +`rtm` +`sb` +`sha` +`sha2` +`sha3` +`sha512` +`sign-ext` +`simd128` +`sm3` +`sm4` +`sme` +`sme-b16b16` +`sme-f16f16` +`sme-f64f64` +`sme-f8f16` +`sme-f8f32` +`sme-fa64` +`sme-i16i64` +`sme-lutv2` +`sme2` +`sme2p1` +`spe` +`ssbs` +`sse` +`sse2` +`sse3` +`sse4.1` +`sse4.2` +`sse4a` +`ssse3` +`ssve-fp8dot2` +`ssve-fp8dot4` +`ssve-fp8fma` +`sve` +`sve-b16b16` +`sve2` +`sve2-aes` +`sve2-bitperm` +`sve2-sha3` +`sve2-sm4` +`sve2p1` +`tail-call` +`tbm` +`thumb-mode` +`thumb2` +`tme` +`trust` +`trustzone` +`ual` +`unaligned-scalar-mem` +`v` +`v5te` +`v6` +`v6k` +`v6t2` +`v7` +`v8` +`v8.1a` +`v8.2a` +`v8.3a` +`v8.4a` +`v8.5a` +`v8.6a` +`v8.7a` +`v8.8a` +`v8.9a` +`v8plus` +`v9` +`v9.1a` +`v9.2a` +`v9.3a` +`v9.4a` +`v9.5a` +`v9a` +`vaes` +`vdsp2e60f` +`vdspv1` +`vdspv2` +`vector` +`vfp2` +`vfp3` +`vfp4` +`vh` +`virt` +`virtualization` +`vpclmulqdq` +`vsx` +`wfxt` +`wide-arithmetic` +`xop` +`xsave` +`xsavec` +`xsaveopt` +`xsaves` +`zaamo` +`zabha` +`zalrsc` +`zba` +`zbb` +`zbc` +`zbkb` +`zbkc` +`zbkx` +`zbs` +`zdinx` +`zfh` +`zfhmin` +`zfinx` +`zhinx` +`zhinxmin` +`zk` +`zkn` +`zknd` +`zkne` +`zknh` +`zkr` +`zks` +`zksed` +`zksh`, and `zkt` + = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/check-cfg/well-known-values.rs b/tests/ui/check-cfg/well-known-values.rs index 1fda4b2089e..40b7b2db836 100644 --- a/tests/ui/check-cfg/well-known-values.rs +++ b/tests/ui/check-cfg/well-known-values.rs @@ -60,8 +60,8 @@ //~^ WARN unexpected `cfg` condition value target_family = "_UNEXPECTED_VALUE", //~^ WARN unexpected `cfg` condition value - target_feature = "_UNEXPECTED_VALUE", - //~^ WARN unexpected `cfg` condition value + // target_feature = "_UNEXPECTED_VALUE", + // ^ tested in target_feature.rs target_has_atomic = "_UNEXPECTED_VALUE", //~^ WARN unexpected `cfg` condition value target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE", diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr index ca6a173d638..7c03d0570db 100644 --- a/tests/ui/check-cfg/well-known-values.stderr +++ b/tests/ui/check-cfg/well-known-values.stderr @@ -169,15 +169,6 @@ LL | target_family = "_UNEXPECTED_VALUE", = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:63:5 - | -LL | target_feature = "_UNEXPECTED_VALUE", - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `cssc`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `ecv`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `faminmax`, `fcma`, `fdivdu`, `fhm`, `flagm`, `flagm2`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fp8`, `fp8dot2`, `fp8dot4`, `fp8fma`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `hbc`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `leoncasa`, `lor`, `lse`, `lse128`, `lse2`, `lsx`, `lut`, `lvz`, `lzcnt`, `m`, `mclass`, `mops`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `partword-atomics`, `pauth-lr`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `quadword-atomics`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rcpc3`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sha512`, `sign-ext`, `simd128`, `sm3`, `sm4`, `sme`, `sme-b16b16`, `sme-f16f16`, `sme-f64f64`, `sme-f8f16`, `sme-f8f32`, `sme-fa64`, `sme-i16i64`, `sme-lutv2`, `sme2`, `sme2p1`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `ssve-fp8dot2`, `ssve-fp8dot4`, `ssve-fp8fma`, `sve`, `sve-b16b16`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `sve2p1`, `tail-call`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `v8.8a`, `v8.9a`, `v8plus`, `v9`, `v9.1a`, `v9.2a`, `v9.3a`, `v9.4a`, `v9.5a`, `v9a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `wfxt`, `wide-arithmetic`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zaamo`, `zabha`, `zalrsc`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt` - = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration - -warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` --> $DIR/well-known-values.rs:65:5 | LL | target_has_atomic = "_UNEXPECTED_VALUE", @@ -297,5 +288,5 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux` = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration -warning: 30 warnings emitted +warning: 29 warnings emitted diff --git a/tests/ui/cleanup-shortcircuit.rs b/tests/ui/cleanup-shortcircuit.rs index 312491fee24..40a5dfa94e3 100644 --- a/tests/ui/cleanup-shortcircuit.rs +++ b/tests/ui/cleanup-shortcircuit.rs @@ -1,7 +1,6 @@ //@ run-pass // Test that cleanups for the RHS of shortcircuiting operators work. -//@ pretty-expanded FIXME #23616 #![allow(deref_nullptr)] diff --git a/tests/ui/closures/2229_closure_analysis/bad-pattern.stderr b/tests/ui/closures/2229_closure_analysis/bad-pattern.stderr index 5f980c46a1f..b5ad8eb790f 100644 --- a/tests/ui/closures/2229_closure_analysis/bad-pattern.stderr +++ b/tests/ui/closures/2229_closure_analysis/bad-pattern.stderr @@ -5,7 +5,7 @@ LL | let 0 = v1; | ^ pattern `1_u32..=u32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `u32` help: you might want to use `if let` to ignore the variant that isn't matched | @@ -23,7 +23,7 @@ LL | let (0 | 1) = v1; | ^^^^^ pattern `2_u32..=u32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `u32` help: you might want to use `if let` to ignore the variant that isn't matched | @@ -37,7 +37,7 @@ LL | let 1.. = v1; | ^^^ pattern `0_u32` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `u32` help: you might want to use `if let` to ignore the variant that isn't matched | @@ -51,7 +51,7 @@ LL | let [0, 0, 0, 0] = v2; | ^^^^^^^^^^^^ pattern `[1_u32..=u32::MAX, _, _, _]` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `[u32; 4]` help: you might want to use `if let` to ignore the variant that isn't matched | @@ -65,7 +65,7 @@ LL | let [0] = v4; | ^^^ patterns `&[]` and `&[_, _, ..]` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `&[u32]` help: you might want to use `if let` to ignore the variants that aren't matched | @@ -79,7 +79,7 @@ LL | let Refutable::A = v3; | ^^^^^^^^^^^^ pattern `Refutable::B` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Refutable` defined here --> $DIR/bad-pattern.rs:4:6 | @@ -104,7 +104,7 @@ LL | let PAT = v1; | ^^^ pattern `1_u32..=u32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `u32` help: introduce a variable instead | diff --git a/tests/ui/closures/correct-args-on-call-suggestion.rs b/tests/ui/closures/correct-args-on-call-suggestion.rs new file mode 100644 index 00000000000..fa7915a7c03 --- /dev/null +++ b/tests/ui/closures/correct-args-on-call-suggestion.rs @@ -0,0 +1,7 @@ +// Ensure we give the right args when we suggest calling a closure. + +fn main() { + let x = |a: i32, b: i32| a + b; + let y: i32 = x; + //~^ ERROR mismatched types +} diff --git a/tests/ui/closures/correct-args-on-call-suggestion.stderr b/tests/ui/closures/correct-args-on-call-suggestion.stderr new file mode 100644 index 00000000000..2613c7776b2 --- /dev/null +++ b/tests/ui/closures/correct-args-on-call-suggestion.stderr @@ -0,0 +1,20 @@ +error[E0308]: mismatched types + --> $DIR/correct-args-on-call-suggestion.rs:5:18 + | +LL | let x = |a: i32, b: i32| a + b; + | ---------------- the found closure +LL | let y: i32 = x; + | --- ^ expected `i32`, found closure + | | + | expected due to this + | + = note: expected type `i32` + found closure `{closure@$DIR/correct-args-on-call-suggestion.rs:4:13: 4:29}` +help: use parentheses to call this closure + | +LL | let y: i32 = x(/* i32 */, /* i32 */); + | ++++++++++++++++++++++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/closures/issue-10682.rs b/tests/ui/closures/issue-10682.rs index 25636b9063b..265e72aaa69 100644 --- a/tests/ui/closures/issue-10682.rs +++ b/tests/ui/closures/issue-10682.rs @@ -2,7 +2,6 @@ // Regression test for issue #10682 // Nested `proc` usage can't use outer owned data -//@ pretty-expanded FIXME #23616 fn work(_: Box<isize>) {} fn foo<F:FnOnce()>(_: F) {} diff --git a/tests/ui/closures/issue-1460.rs b/tests/ui/closures/issue-1460.rs index c201f026bca..ceb030b92c8 100644 --- a/tests/ui/closures/issue-1460.rs +++ b/tests/ui/closures/issue-1460.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { {|i: u32| if 1 == i { }}; //~ WARN unused closure that must be used diff --git a/tests/ui/closures/issue-1460.stderr b/tests/ui/closures/issue-1460.stderr index d4a8c8955e2..15eaf7a9a11 100644 --- a/tests/ui/closures/issue-1460.stderr +++ b/tests/ui/closures/issue-1460.stderr @@ -1,5 +1,5 @@ warning: unused closure that must be used - --> $DIR/issue-1460.rs:6:6 + --> $DIR/issue-1460.rs:5:6 | LL | {|i: u32| if 1 == i { }}; | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/closures/issue-868.rs b/tests/ui/closures/issue-868.rs index 170597b4bd5..70debbc6c87 100644 --- a/tests/ui/closures/issue-868.rs +++ b/tests/ui/closures/issue-868.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_parens)] #![allow(unit_bindings)] -//@ pretty-expanded FIXME #23616 fn f<T, F>(g: F) -> T where F: FnOnce() -> T { g() } diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs index 9e0ffa75c22..da1327dace5 100644 --- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs @@ -39,4 +39,4 @@ type WithTransparentTraitObject = //~^ ERROR return value of `"C-cmse-nonsecure-call"` function too large to pass via registers [E0798] type WithVarArgs = extern "C-cmse-nonsecure-call" fn(u32, ...); -//~^ ERROR C-variadic function must have a compatible calling convention, like `C` or `cdecl` [E0045] +//~^ ERROR C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi` [E0045] diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr index 7cb8e135ea3..f20e67e3d94 100644 --- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr @@ -68,7 +68,7 @@ LL | extern "C-cmse-nonsecure-call" fn(WrapperTransparent) -> WrapperTranspa = note: functions with the `"C-cmse-nonsecure-call"` ABI must pass their result via the available return registers = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size -error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` +error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi` --> $DIR/generics.rs:41:20 | LL | type WithVarArgs = extern "C-cmse-nonsecure-call" fn(u32, ...); diff --git a/tests/ui/codegen/init-large-type.rs b/tests/ui/codegen/init-large-type.rs index b9fc6612e16..08697198f24 100644 --- a/tests/ui/codegen/init-large-type.rs +++ b/tests/ui/codegen/init-large-type.rs @@ -6,7 +6,6 @@ // Doing it incorrectly causes massive slowdown in LLVM during // optimisation. -//@ pretty-expanded FIXME #23616 //@ needs-threads #![feature(intrinsics)] diff --git a/tests/ui/codegen/mismatched-data-layout.json b/tests/ui/codegen/mismatched-data-layout.json index 4cb0602dc75..7adc8832524 100644 --- a/tests/ui/codegen/mismatched-data-layout.json +++ b/tests/ui/codegen/mismatched-data-layout.json @@ -5,7 +5,7 @@ "target-endian": "little", "target-pointer-width": "64", "target-c-int-width": "32", - "os": "unknown", + "os": "none", "linker-flavor": "ld.lld", "linker": "rust-lld", "executables": true diff --git a/tests/ui/codegen/mismatched-data-layouts.stderr b/tests/ui/codegen/mismatched-data-layouts.stderr index 1fe242266df..b7d5d82bee0 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-7814813422914914169`, `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-7193370089426056427`, `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/huge_multispan_highlight.rs b/tests/ui/codemap_tests/huge_multispan_highlight.rs index 7d7b7570823..6f6834b01bd 100644 --- a/tests/ui/codemap_tests/huge_multispan_highlight.rs +++ b/tests/ui/codemap_tests/huge_multispan_highlight.rs @@ -1,7 +1,7 @@ //@ revisions: ascii unicode //@ compile-flags: --color=always //@[ascii] compile-flags: --error-format=human -//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode +//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode //@ ignore-windows fn main() { let _ = match true { diff --git a/tests/ui/coercion/coerce-loop-issue-122561.rs b/tests/ui/coercion/coerce-loop-issue-122561.rs index e08884ad6a4..50a2aacc91a 100644 --- a/tests/ui/coercion/coerce-loop-issue-122561.rs +++ b/tests/ui/coercion/coerce-loop-issue-122561.rs @@ -39,8 +39,7 @@ fn for_single_line() -> bool { for i in 0.. { return false; } } // b. format the suggestion correctly so // that it's readable fn for_in_arg(a: &[(); for x in 0..2 {}]) -> bool { -//~^ ERROR `for` is not allowed in a `const` -//~| ERROR mismatched types + //~^ ERROR mismatched types true } @@ -84,16 +83,14 @@ fn loop_() -> bool { const C: i32 = { for i in 0.. { - //~^ ERROR `for` is not allowed in a `const` - //~| ERROR mismatched types + //~^ ERROR mismatched types } }; fn main() { let _ = [10; { for i in 0..5 { - //~^ ERROR `for` is not allowed in a `const` - //~| ERROR mismatched types + //~^ ERROR mismatched types } }]; @@ -105,6 +102,5 @@ fn main() { let _ = |a: &[(); for x in 0..2 {}]| {}; - //~^ ERROR `for` is not allowed in a `const` - //~| ERROR mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/coercion/coerce-loop-issue-122561.stderr b/tests/ui/coercion/coerce-loop-issue-122561.stderr index 0f77fd1364d..90e9f41c291 100644 --- a/tests/ui/coercion/coerce-loop-issue-122561.stderr +++ b/tests/ui/coercion/coerce-loop-issue-122561.stderr @@ -1,5 +1,5 @@ warning: denote infinite loops with `loop { ... }` - --> $DIR/coerce-loop-issue-122561.rs:48:5 + --> $DIR/coerce-loop-issue-122561.rs:47:5 | LL | while true { | ^^^^^^^^^^ help: use `loop` @@ -7,57 +7,11 @@ LL | while true { = note: `#[warn(while_true)]` on by default warning: denote infinite loops with `loop { ... }` - --> $DIR/coerce-loop-issue-122561.rs:72:5 + --> $DIR/coerce-loop-issue-122561.rs:71:5 | LL | while true { | ^^^^^^^^^^ help: use `loop` -error[E0658]: `for` is not allowed in a `const` - --> $DIR/coerce-loop-issue-122561.rs:41:24 - | -LL | fn for_in_arg(a: &[(); for x in 0..2 {}]) -> bool { - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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]: `for` is not allowed in a `const` - --> $DIR/coerce-loop-issue-122561.rs:86:5 - | -LL | / for i in 0.. { -LL | | -LL | | -LL | | } - | |_____^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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]: `for` is not allowed in a `const` - --> $DIR/coerce-loop-issue-122561.rs:94:9 - | -LL | / for i in 0..5 { -LL | | -LL | | -LL | | } - | |_________^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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]: `for` is not allowed in a `const` - --> $DIR/coerce-loop-issue-122561.rs:107:23 - | -LL | let _ = |a: &[(); for x in 0..2 {}]| {}; - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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[E0308]: mismatched types --> $DIR/coerce-loop-issue-122561.rs:41:24 | @@ -71,11 +25,10 @@ LL | fn for_in_arg(a: &[(); for x in 0..2 {} /* `usize` value */]) -> bool { | +++++++++++++++++++ error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:86:5 + --> $DIR/coerce-loop-issue-122561.rs:85:5 | LL | / for i in 0.. { LL | | -LL | | LL | | } | |_____^ expected `i32`, found `()` | @@ -174,7 +127,7 @@ LL | fn for_single_line() -> bool { for i in 0.. { return false; } /* `bool` val | ++++++++++++++++++ error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:48:5 + --> $DIR/coerce-loop-issue-122561.rs:47:5 | LL | fn while_inifinite() -> bool { | ---- expected `bool` because of return type @@ -193,7 +146,7 @@ LL + /* `bool` value */ | error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:57:5 + --> $DIR/coerce-loop-issue-122561.rs:56:5 | LL | fn while_finite() -> bool { | ---- expected `bool` because of return type @@ -213,7 +166,7 @@ LL + /* `bool` value */ | error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:65:5 + --> $DIR/coerce-loop-issue-122561.rs:64:5 | LL | fn while_zero_times() -> bool { | ---- expected `bool` because of return type @@ -231,7 +184,7 @@ LL + /* `bool` value */ | error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:72:5 + --> $DIR/coerce-loop-issue-122561.rs:71:5 | LL | fn while_never_type() -> ! { | - expected `!` because of return type @@ -251,11 +204,10 @@ LL + /* `loop {}` or `panic!("...")` */ | error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:94:9 + --> $DIR/coerce-loop-issue-122561.rs:92:9 | LL | / for i in 0..5 { LL | | -LL | | LL | | } | |_________^ expected `usize`, found `()` | @@ -267,7 +219,7 @@ LL + /* `usize` value */ | error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:101:9 + --> $DIR/coerce-loop-issue-122561.rs:98:9 | LL | / while false { LL | | @@ -282,7 +234,7 @@ LL + /* `usize` value */ | error[E0308]: mismatched types - --> $DIR/coerce-loop-issue-122561.rs:107:23 + --> $DIR/coerce-loop-issue-122561.rs:104:23 | LL | let _ = |a: &[(); for x in 0..2 {}]| {}; | ^^^^^^^^^^^^^^^^ expected `usize`, found `()` @@ -293,7 +245,6 @@ help: consider returning a value here LL | let _ = |a: &[(); for x in 0..2 {} /* `usize` value */]| {}; | +++++++++++++++++++ -error: aborting due to 18 previous errors; 2 warnings emitted +error: aborting due to 14 previous errors; 2 warnings emitted -Some errors have detailed explanations: E0308, E0658. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/coercion/coerce-overloaded-autoderef.rs b/tests/ui/coercion/coerce-overloaded-autoderef.rs index 0605f20e9a3..03d0b0df543 100644 --- a/tests/ui/coercion/coerce-overloaded-autoderef.rs +++ b/tests/ui/coercion/coerce-overloaded-autoderef.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_braces)] #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 use std::rc::Rc; diff --git a/tests/ui/coercion/coerce-reborrow-imm-ptr-arg.rs b/tests/ui/coercion/coerce-reborrow-imm-ptr-arg.rs index 139c1d18d2b..f43b6dad71d 100644 --- a/tests/ui/coercion/coerce-reborrow-imm-ptr-arg.rs +++ b/tests/ui/coercion/coerce-reborrow-imm-ptr-arg.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn negate(x: &isize) -> isize { -*x diff --git a/tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs b/tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs index d8edd8648c4..afcec17d55b 100644 --- a/tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs +++ b/tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn sum(x: &[isize]) -> isize { let mut sum = 0; diff --git a/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr b/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr index 46723c5a297..5dea3f70fdb 100644 --- a/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr +++ b/tests/ui/coercion/coerce-reborrow-multi-arg-fail.stderr @@ -16,7 +16,7 @@ LL | fn test<T>(_a: T, _b: T) {} | ^^^^ - ----- ----- this parameter needs to match the `&mut {integer}` type of `_a` | | | | | `_b` needs to match the `&mut {integer}` type of this parameter - | `_a` and `_b` all reference this parameter T + | `_a` and `_b` both reference this parameter `T` error: aborting due to 1 previous error diff --git a/tests/ui/coercion/coerce-reborrow-mut-ptr-arg.rs b/tests/ui/coercion/coerce-reborrow-mut-ptr-arg.rs index 7a08e9fdbe5..0367e384829 100644 --- a/tests/ui/coercion/coerce-reborrow-mut-ptr-arg.rs +++ b/tests/ui/coercion/coerce-reborrow-mut-ptr-arg.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct SpeechMaker { speeches: usize diff --git a/tests/ui/coercion/coerce-reborrow-mut-ptr-rcvr.rs b/tests/ui/coercion/coerce-reborrow-mut-ptr-rcvr.rs index fc41beb45cc..b9479f6bdf8 100644 --- a/tests/ui/coercion/coerce-reborrow-mut-ptr-rcvr.rs +++ b/tests/ui/coercion/coerce-reborrow-mut-ptr-rcvr.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct SpeechMaker { speeches: usize diff --git a/tests/ui/coercion/coerce-unify-return.rs b/tests/ui/coercion/coerce-unify-return.rs index def42d9dc14..54998a35382 100644 --- a/tests/ui/coercion/coerce-unify-return.rs +++ b/tests/ui/coercion/coerce-unify-return.rs @@ -2,7 +2,6 @@ // Check that coercions unify the expected return type of a polymorphic // function call, instead of leaving the type variables as they were. -//@ pretty-expanded FIXME #23616 struct Foo; impl Foo { diff --git a/tests/ui/coercion/coerce-unsize-subtype.rs b/tests/ui/coercion/coerce-unsize-subtype.rs index 5ef9a108892..a3e762e4c5f 100644 --- a/tests/ui/coercion/coerce-unsize-subtype.rs +++ b/tests/ui/coercion/coerce-unsize-subtype.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 use std::rc::Rc; diff --git a/tests/ui/coercion/issue-14589.rs b/tests/ui/coercion/issue-14589.rs index b25ba3758e1..1e99cc4f6a8 100644 --- a/tests/ui/coercion/issue-14589.rs +++ b/tests/ui/coercion/issue-14589.rs @@ -2,7 +2,6 @@ // All 3 expressions should work in that the argument gets // coerced to a trait object -//@ pretty-expanded FIXME #23616 fn main() { send::<Box<dyn Foo>>(Box::new(Output(0))); diff --git a/tests/ui/coercion/issue-14589.stderr b/tests/ui/coercion/issue-14589.stderr index 37b7fce7462..5d7b840a8d7 100644 --- a/tests/ui/coercion/issue-14589.stderr +++ b/tests/ui/coercion/issue-14589.stderr @@ -1,5 +1,5 @@ warning: method `dummy` is never used - --> $DIR/issue-14589.rs:22:16 + --> $DIR/issue-14589.rs:21:16 | LL | trait Foo { fn dummy(&self) { }} | --- ^^^^^ diff --git a/tests/ui/coherence/coherence-bigint-int.rs b/tests/ui/coherence/coherence-bigint-int.rs index 0a9ddf5e2d1..739c035cc90 100644 --- a/tests/ui/coherence/coherence-bigint-int.rs +++ b/tests/ui/coherence/coherence-bigint-int.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:coherence_lib.rs -//@ pretty-expanded FIXME #23616 extern crate coherence_lib as lib; use lib::Remote1; diff --git a/tests/ui/coherence/coherence-bigint-vecint.rs b/tests/ui/coherence/coherence-bigint-vecint.rs index 6822c6c44b7..c26defead3f 100644 --- a/tests/ui/coherence/coherence-bigint-vecint.rs +++ b/tests/ui/coherence/coherence-bigint-vecint.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:coherence_lib.rs -//@ pretty-expanded FIXME #23616 extern crate coherence_lib as lib; use lib::Remote1; diff --git a/tests/ui/coherence/coherence-blanket.rs b/tests/ui/coherence/coherence-blanket.rs index db10b8e654f..cc95e15a412 100644 --- a/tests/ui/coherence/coherence-blanket.rs +++ b/tests/ui/coherence/coherence-blanket.rs @@ -2,7 +2,6 @@ #![allow(unused_imports)] //@ aux-build:coherence_lib.rs -//@ pretty-expanded FIXME #23616 extern crate coherence_lib as lib; use lib::Remote1; diff --git a/tests/ui/coherence/coherence-covered-type-parameter.rs b/tests/ui/coherence/coherence-covered-type-parameter.rs index b6332a04424..3f349343382 100644 --- a/tests/ui/coherence/coherence-covered-type-parameter.rs +++ b/tests/ui/coherence/coherence-covered-type-parameter.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] //@ aux-build:coherence_lib.rs -//@ pretty-expanded FIXME #23616 extern crate coherence_lib as lib; use lib::Remote; diff --git a/tests/ui/coherence/coherence-iterator-vec-any-elem.rs b/tests/ui/coherence/coherence-iterator-vec-any-elem.rs index a406e4408a4..1e43595d1eb 100644 --- a/tests/ui/coherence/coherence-iterator-vec-any-elem.rs +++ b/tests/ui/coherence/coherence-iterator-vec-any-elem.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] //@ aux-build:coherence_lib.rs -//@ pretty-expanded FIXME #23616 extern crate coherence_lib as lib; use lib::Remote1; diff --git a/tests/ui/coherence/coherence-iterator-vec.rs b/tests/ui/coherence/coherence-iterator-vec.rs index 29553484931..02c3a9d2cee 100644 --- a/tests/ui/coherence/coherence-iterator-vec.rs +++ b/tests/ui/coherence/coherence-iterator-vec.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] //@ aux-build:coherence_lib.rs -//@ pretty-expanded FIXME #23616 extern crate coherence_lib as lib; use lib::Remote1; diff --git a/tests/ui/coherence/coherence-multidispatch-tuple.rs b/tests/ui/coherence/coherence-multidispatch-tuple.rs index ac7b2578d77..6a2de80c0ea 100644 --- a/tests/ui/coherence/coherence-multidispatch-tuple.rs +++ b/tests/ui/coherence/coherence-multidispatch-tuple.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(unused_imports)] -//@ pretty-expanded FIXME #23616 use std::fmt::Debug; use std::default::Default; diff --git a/tests/ui/coherence/coherence-negative-impls-safe-rpass.rs b/tests/ui/coherence/coherence-negative-impls-safe-rpass.rs index d69872ba8cf..5935e972e49 100644 --- a/tests/ui/coherence/coherence-negative-impls-safe-rpass.rs +++ b/tests/ui/coherence/coherence-negative-impls-safe-rpass.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![feature(negative_impls)] diff --git a/tests/ui/coherence/fuzzing/best-obligation-ICE.rs b/tests/ui/coherence/fuzzing/best-obligation-ICE.rs new file mode 100644 index 00000000000..49f40b579d4 --- /dev/null +++ b/tests/ui/coherence/fuzzing/best-obligation-ICE.rs @@ -0,0 +1,20 @@ +// A regression test for #129444. This previously ICE'd as +// computing the best obligation for one ambiguous obligation +// added spurious inference constraints which caused another +// candidate to pass. +trait Trait { + type Assoc; +} + +struct W<T: Trait>(*mut T); +impl<T> Trait for W<W<W<T>>> {} +//~^ ERROR the trait bound `W<W<T>>: Trait` is not satisfied +//~| ERROR the trait bound `W<T>: Trait` is not satisfied +//~| ERROR the trait bound `T: Trait` is not satisfied +//~| ERROR not all trait items implemented, missing: `Assoc` + +trait NoOverlap {} +impl<T: Trait> NoOverlap for T {} +impl<T: Trait<Assoc = u32>> NoOverlap for W<T> {} +//~^ ERROR conflicting implementations of trait `NoOverlap` for type `W<W<W<W<_>>>>` +fn main() {} diff --git a/tests/ui/coherence/fuzzing/best-obligation-ICE.stderr b/tests/ui/coherence/fuzzing/best-obligation-ICE.stderr new file mode 100644 index 00000000000..88de8023f6d --- /dev/null +++ b/tests/ui/coherence/fuzzing/best-obligation-ICE.stderr @@ -0,0 +1,69 @@ +error[E0277]: the trait bound `W<W<T>>: Trait` is not satisfied + --> $DIR/best-obligation-ICE.rs:10:19 + | +LL | impl<T> Trait for W<W<W<T>>> {} + | ^^^^^^^^^^ the trait `Trait` is not implemented for `W<W<T>>` + | +note: required by a bound in `W` + --> $DIR/best-obligation-ICE.rs:9:13 + | +LL | struct W<T: Trait>(*mut T); + | ^^^^^ required by this bound in `W` +help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement + | +LL | impl<T> Trait for W<W<W<T>>> where W<W<T>>: Trait {} + | ++++++++++++++++++++ + +error[E0277]: the trait bound `W<T>: Trait` is not satisfied + --> $DIR/best-obligation-ICE.rs:10:19 + | +LL | impl<T> Trait for W<W<W<T>>> {} + | ^^^^^^^^^^ the trait `Trait` is not implemented for `W<T>` + | +note: required by a bound in `W` + --> $DIR/best-obligation-ICE.rs:9:13 + | +LL | struct W<T: Trait>(*mut T); + | ^^^^^ required by this bound in `W` +help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement + | +LL | impl<T> Trait for W<W<W<T>>> where W<T>: Trait {} + | +++++++++++++++++ + +error[E0277]: the trait bound `T: Trait` is not satisfied + --> $DIR/best-obligation-ICE.rs:10:19 + | +LL | impl<T> Trait for W<W<W<T>>> {} + | ^^^^^^^^^^ the trait `Trait` is not implemented for `T` + | +note: required by a bound in `W` + --> $DIR/best-obligation-ICE.rs:9:13 + | +LL | struct W<T: Trait>(*mut T); + | ^^^^^ required by this bound in `W` +help: consider restricting type parameter `T` + | +LL | impl<T: Trait> Trait for W<W<W<T>>> {} + | +++++++ + +error[E0046]: not all trait items implemented, missing: `Assoc` + --> $DIR/best-obligation-ICE.rs:10:1 + | +LL | type Assoc; + | ---------- `Assoc` from trait +... +LL | impl<T> Trait for W<W<W<T>>> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Assoc` in implementation + +error[E0119]: conflicting implementations of trait `NoOverlap` for type `W<W<W<W<_>>>>` + --> $DIR/best-obligation-ICE.rs:18:1 + | +LL | impl<T: Trait> NoOverlap for T {} + | ------------------------------ first implementation here +LL | impl<T: Trait<Assoc = u32>> NoOverlap for W<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `W<W<W<W<_>>>>` + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0046, E0119, E0277. +For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/confuse-field-and-method/issue-18343.stderr b/tests/ui/confuse-field-and-method/issue-18343.stderr index a51fd4f02aa..e50c971d837 100644 --- a/tests/ui/confuse-field-and-method/issue-18343.stderr +++ b/tests/ui/confuse-field-and-method/issue-18343.stderr @@ -7,7 +7,7 @@ LL | struct Obj<F> where F: FnMut() -> u32 { LL | o.closure(); | ^^^^^^^ field, not a method | -help: to call the function stored in `closure`, surround the field access with parentheses +help: to call the closure stored in `closure`, surround the field access with parentheses | LL | (o.closure)(); | + + diff --git a/tests/ui/confuse-field-and-method/issue-2392.stderr b/tests/ui/confuse-field-and-method/issue-2392.stderr index 440fbb27c00..77930de44a7 100644 --- a/tests/ui/confuse-field-and-method/issue-2392.stderr +++ b/tests/ui/confuse-field-and-method/issue-2392.stderr @@ -7,7 +7,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 { LL | o_closure.closure(); | ^^^^^^^ field, not a method | -help: to call the function stored in `closure`, surround the field access with parentheses +help: to call the closure stored in `closure`, surround the field access with parentheses | LL | (o_closure.closure)(); | + + @@ -46,7 +46,7 @@ LL | struct BoxedObj { LL | boxed_fn.boxed_closure(); | ^^^^^^^^^^^^^ field, not a method | -help: to call the function stored in `boxed_closure`, surround the field access with parentheses +help: to call the trait object stored in `boxed_closure`, surround the field access with parentheses | LL | (boxed_fn.boxed_closure)(); | + + @@ -60,7 +60,7 @@ LL | struct BoxedObj { LL | boxed_closure.boxed_closure(); | ^^^^^^^^^^^^^ field, not a method | -help: to call the function stored in `boxed_closure`, surround the field access with parentheses +help: to call the trait object stored in `boxed_closure`, surround the field access with parentheses | LL | (boxed_closure.boxed_closure)(); | + + @@ -99,7 +99,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 { LL | check_expression().closure(); | ^^^^^^^ field, not a method | -help: to call the function stored in `closure`, surround the field access with parentheses +help: to call the trait object stored in `closure`, surround the field access with parentheses | LL | (check_expression().closure)(); | + + @@ -113,7 +113,7 @@ LL | struct FuncContainer { LL | (*self.container).f1(1); | ^^ field, not a method | -help: to call the function stored in `f1`, surround the field access with parentheses +help: to call the function pointer stored in `f1`, surround the field access with parentheses | LL | ((*self.container).f1)(1); | + + @@ -127,7 +127,7 @@ LL | struct FuncContainer { LL | (*self.container).f2(1); | ^^ field, not a method | -help: to call the function stored in `f2`, surround the field access with parentheses +help: to call the function pointer stored in `f2`, surround the field access with parentheses | LL | ((*self.container).f2)(1); | + + @@ -141,7 +141,7 @@ LL | struct FuncContainer { LL | (*self.container).f3(1); | ^^ field, not a method | -help: to call the function stored in `f3`, surround the field access with parentheses +help: to call the function pointer stored in `f3`, surround the field access with parentheses | LL | ((*self.container).f3)(1); | + + diff --git a/tests/ui/confuse-field-and-method/issue-32128.stderr b/tests/ui/confuse-field-and-method/issue-32128.stderr index 3d860d8c85a..aaec15a41dc 100644 --- a/tests/ui/confuse-field-and-method/issue-32128.stderr +++ b/tests/ui/confuse-field-and-method/issue-32128.stderr @@ -7,7 +7,7 @@ LL | struct Example { LL | demo.example(1); | ^^^^^^^ field, not a method | -help: to call the function stored in `example`, surround the field access with parentheses +help: to call the trait object stored in `example`, surround the field access with parentheses | LL | (demo.example)(1); | + + diff --git a/tests/ui/confuse-field-and-method/issue-33784.stderr b/tests/ui/confuse-field-and-method/issue-33784.stderr index 8acd1f8ff1e..59a6f4fccd8 100644 --- a/tests/ui/confuse-field-and-method/issue-33784.stderr +++ b/tests/ui/confuse-field-and-method/issue-33784.stderr @@ -4,7 +4,7 @@ error[E0599]: no method named `closure` found for reference `&Obj<{closure@$DIR/ LL | p.closure(); | ^^^^^^^ field, not a method | -help: to call the function stored in `closure`, surround the field access with parentheses +help: to call the closure stored in `closure`, surround the field access with parentheses | LL | (p.closure)(); | + + @@ -19,7 +19,7 @@ error[E0599]: no method named `fn_ptr` found for reference `&&Obj<{closure@$DIR/ LL | q.fn_ptr(); | ^^^^^^ field, not a method | -help: to call the function stored in `fn_ptr`, surround the field access with parentheses +help: to call the function pointer stored in `fn_ptr`, surround the field access with parentheses | LL | (q.fn_ptr)(); | + + @@ -30,7 +30,7 @@ error[E0599]: no method named `c_fn_ptr` found for reference `&D` in the current LL | s.c_fn_ptr(); | ^^^^^^^^ field, not a method | -help: to call the function stored in `c_fn_ptr`, surround the field access with parentheses +help: to call the function pointer stored in `c_fn_ptr`, surround the field access with parentheses | LL | (s.c_fn_ptr)(); | + + diff --git a/tests/ui/const-generics/const-arg-in-const-arg.min.stderr b/tests/ui/const-generics/const-arg-in-const-arg.min.stderr index ce7fce25993..06a6a5f59d6 100644 --- a/tests/ui/const-generics/const-arg-in-const-arg.min.stderr +++ b/tests/ui/const-generics/const-arg-in-const-arg.min.stderr @@ -53,7 +53,7 @@ LL | let _: [u8; baz::<'b>(&())]; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:26:23 + --> $DIR/const-arg-in-const-arg.rs:27:23 | LL | let _ = [0; bar::<N>()]; | ^ cannot perform const operation using `N` @@ -62,7 +62,7 @@ LL | let _ = [0; bar::<N>()]; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:28:23 + --> $DIR/const-arg-in-const-arg.rs:29:23 | LL | let _ = [0; faz::<'a>(&())]; | ^^ cannot perform const operation using `'a` @@ -71,7 +71,7 @@ LL | let _ = [0; faz::<'a>(&())]; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:30:23 + --> $DIR/const-arg-in-const-arg.rs:31:23 | LL | let _ = [0; baz::<'a>(&())]; | ^^ cannot perform const operation using `'a` @@ -80,7 +80,7 @@ LL | let _ = [0; baz::<'a>(&())]; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:31:23 + --> $DIR/const-arg-in-const-arg.rs:32:23 | LL | let _ = [0; faz::<'b>(&())]; | ^^ cannot perform const operation using `'b` @@ -89,7 +89,7 @@ LL | let _ = [0; faz::<'b>(&())]; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:33:23 + --> $DIR/const-arg-in-const-arg.rs:34:23 | LL | let _ = [0; baz::<'b>(&())]; | ^^ cannot perform const operation using `'b` @@ -98,7 +98,7 @@ LL | let _ = [0; baz::<'b>(&())]; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:34:24 + --> $DIR/const-arg-in-const-arg.rs:35:24 | LL | let _: Foo<{ foo::<T>() }>; | ^ cannot perform const operation using `T` @@ -107,7 +107,7 @@ LL | let _: Foo<{ foo::<T>() }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:35:24 + --> $DIR/const-arg-in-const-arg.rs:36:24 | LL | let _: Foo<{ bar::<N>() }>; | ^ cannot perform const operation using `N` @@ -116,7 +116,7 @@ LL | let _: Foo<{ bar::<N>() }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:37:24 + --> $DIR/const-arg-in-const-arg.rs:38:24 | LL | let _: Foo<{ faz::<'a>(&()) }>; | ^^ cannot perform const operation using `'a` @@ -125,7 +125,7 @@ LL | let _: Foo<{ faz::<'a>(&()) }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:39:24 + --> $DIR/const-arg-in-const-arg.rs:40:24 | LL | let _: Foo<{ baz::<'a>(&()) }>; | ^^ cannot perform const operation using `'a` @@ -134,7 +134,7 @@ LL | let _: Foo<{ baz::<'a>(&()) }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:40:24 + --> $DIR/const-arg-in-const-arg.rs:41:24 | LL | let _: Foo<{ faz::<'b>(&()) }>; | ^^ cannot perform const operation using `'b` @@ -143,7 +143,7 @@ LL | let _: Foo<{ faz::<'b>(&()) }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:42:24 + --> $DIR/const-arg-in-const-arg.rs:43:24 | LL | let _: Foo<{ baz::<'b>(&()) }>; | ^^ cannot perform const operation using `'b` @@ -152,7 +152,7 @@ LL | let _: Foo<{ baz::<'b>(&()) }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:43:27 + --> $DIR/const-arg-in-const-arg.rs:44:27 | LL | let _ = Foo::<{ foo::<T>() }>; | ^ cannot perform const operation using `T` @@ -161,7 +161,7 @@ LL | let _ = Foo::<{ foo::<T>() }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:44:27 + --> $DIR/const-arg-in-const-arg.rs:45:27 | LL | let _ = Foo::<{ bar::<N>() }>; | ^ cannot perform const operation using `N` @@ -170,7 +170,7 @@ LL | let _ = Foo::<{ bar::<N>() }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:46:27 + --> $DIR/const-arg-in-const-arg.rs:47:27 | LL | let _ = Foo::<{ faz::<'a>(&()) }>; | ^^ cannot perform const operation using `'a` @@ -179,7 +179,7 @@ LL | let _ = Foo::<{ faz::<'a>(&()) }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:48:27 + --> $DIR/const-arg-in-const-arg.rs:49:27 | LL | let _ = Foo::<{ baz::<'a>(&()) }>; | ^^ cannot perform const operation using `'a` @@ -188,7 +188,7 @@ LL | let _ = Foo::<{ baz::<'a>(&()) }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:49:27 + --> $DIR/const-arg-in-const-arg.rs:50:27 | LL | let _ = Foo::<{ faz::<'b>(&()) }>; | ^^ cannot perform const operation using `'b` @@ -197,7 +197,7 @@ LL | let _ = Foo::<{ faz::<'b>(&()) }>; = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:51:27 + --> $DIR/const-arg-in-const-arg.rs:52:27 | LL | let _ = Foo::<{ baz::<'b>(&()) }>; | ^^ cannot perform const operation using `'b` @@ -241,7 +241,7 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } | ^^ error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-arg-in-const-arg.rs:35:24 + --> $DIR/const-arg-in-const-arg.rs:36:24 | LL | let _: Foo<{ bar::<N>() }>; | ^ @@ -252,7 +252,7 @@ LL | let _: Foo<{ bar::<{ N }>() }>; | + + error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:37:24 + --> $DIR/const-arg-in-const-arg.rs:38:24 | LL | let _: Foo<{ faz::<'a>(&()) }>; | ^^ @@ -264,7 +264,7 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } | ^^ error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:40:24 + --> $DIR/const-arg-in-const-arg.rs:41:24 | LL | let _: Foo<{ faz::<'b>(&()) }>; | ^^ @@ -283,8 +283,16 @@ LL | let _ = [0; foo::<T>()]; | = note: this may fail depending on what value the parameter takes +error: constant expression depends on a generic parameter + --> $DIR/const-arg-in-const-arg.rs:25:13 + | +LL | let _ = [0; foo::<T>()]; + | ^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-arg-in-const-arg.rs:26:23 + --> $DIR/const-arg-in-const-arg.rs:27:23 | LL | let _ = [0; bar::<N>()]; | ^ @@ -295,7 +303,7 @@ LL | let _ = [0; bar::<{ N }>()]; | + + error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:28:23 + --> $DIR/const-arg-in-const-arg.rs:29:23 | LL | let _ = [0; faz::<'a>(&())]; | ^^ @@ -307,7 +315,7 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } | ^^ error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:31:23 + --> $DIR/const-arg-in-const-arg.rs:32:23 | LL | let _ = [0; faz::<'b>(&())]; | ^^ @@ -319,7 +327,7 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } | ^^ error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-arg-in-const-arg.rs:44:27 + --> $DIR/const-arg-in-const-arg.rs:45:27 | LL | let _ = Foo::<{ bar::<N>() }>; | ^ @@ -330,7 +338,7 @@ LL | let _ = Foo::<{ bar::<{ N }>() }>; | + + error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:46:27 + --> $DIR/const-arg-in-const-arg.rs:47:27 | LL | let _ = Foo::<{ faz::<'a>(&()) }>; | ^^ @@ -342,7 +350,7 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } | ^^ error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:49:27 + --> $DIR/const-arg-in-const-arg.rs:50:27 | LL | let _ = Foo::<{ faz::<'b>(&()) }>; | ^^ @@ -353,7 +361,7 @@ note: the late bound lifetime parameter is introduced here LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } | ^^ -error: aborting due to 36 previous errors +error: aborting due to 37 previous errors Some errors have detailed explanations: E0747, E0794. For more information about an error, try `rustc --explain E0747`. diff --git a/tests/ui/const-generics/const-arg-in-const-arg.rs b/tests/ui/const-generics/const-arg-in-const-arg.rs index 27b74489fe8..0e1c6552edf 100644 --- a/tests/ui/const-generics/const-arg-in-const-arg.rs +++ b/tests/ui/const-generics/const-arg-in-const-arg.rs @@ -23,6 +23,7 @@ fn test<'a, 'b, T, const N: usize>() where &'b (): Sized { let _: [u8; baz::<'b>(&())]; //[min]~ ERROR generic parameters may not let _ = [0; foo::<T>()]; //[min]~ ERROR constant expression depends on a generic parameter + //[min]~^ ERROR constant expression depends on a generic parameter let _ = [0; bar::<N>()]; //[min]~ ERROR generic parameters may not //[min]~^ ERROR unresolved item provided when a constant was expected let _ = [0; faz::<'a>(&())]; //[min]~ ERROR generic parameters may not diff --git a/tests/ui/const-generics/const-argument-cross-crate-mismatch.stderr b/tests/ui/const-generics/const-argument-cross-crate-mismatch.stderr index d5eefd35753..f58821283e1 100644 --- a/tests/ui/const-generics/const-argument-cross-crate-mismatch.stderr +++ b/tests/ui/const-generics/const-argument-cross-crate-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-argument-cross-crate-mismatch.rs:6:67 | LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8])); - | ------------------------- ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements + | ------------------------- ^^^^^^^^^^ expected an array with a size of 3, found one with a size of 2 | | | arguments to this struct are incorrect | @@ -16,7 +16,7 @@ error[E0308]: mismatched types --> $DIR/const-argument-cross-crate-mismatch.rs:8:65 | LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]); - | ------------------------- ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements + | ------------------------- ^^^^^^^^^^^^^^^ expected an array with a size of 2, found one with a size of 3 | | | arguments to this struct are incorrect | diff --git a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion.rs b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-1.rs index 2fdd703ab6f..5ea445520f1 100644 --- a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion.rs +++ b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-1.rs @@ -85,6 +85,14 @@ macro_rules! braced_braced_expr { () => {{ braced_expr!() }}; } +macro_rules! closure { + () => { |()| () }; +} + +macro_rules! empty { + () => {}; +} + #[rustfmt::skip] mod array_paren_call { // Arrays where the expanded result is a `Res::Err` @@ -128,6 +136,14 @@ mod array_paren_call { fn array_33() -> [(); braced_expr!()] { loop {} } fn array_34() -> [(); { unbraced_expr!() }] { loop {} } fn array_35() -> [(); { braced_expr!() }] { loop {} } + + // Arrays whose expanded form contains a nested definition + fn array_36() -> [(); closure!()] { loop {} } + fn array_37() -> [(); { closure!() }] { loop {} } + + // Arrays whose macro expansion is empty + fn array_38() -> [(); empty!()] { loop {} } + fn array_39() -> [(); { empty!() }] { loop {} } } #[rustfmt::skip] @@ -173,6 +189,14 @@ mod array_brace_call { fn array_33() -> [(); braced_expr!{}] { loop {} } fn array_34() -> [(); { unbraced_expr!{} }] { loop {} } fn array_35() -> [(); { braced_expr!{} }] { loop {} } + + // Arrays whose expanded form contains a nested definition + fn array_36() -> [(); closure!{}] { loop {} } + fn array_37() -> [(); { closure!{} }] { loop {} } + + // Arrays whose macro expansion is empty + fn array_38() -> [(); empty!{}] { loop {} } + fn array_39() -> [(); { empty!{} }] { loop {} } } #[rustfmt::skip] @@ -218,6 +242,14 @@ mod array_square_call { fn array_33() -> [(); braced_expr![]] { loop {} } fn array_34() -> [(); { unbraced_expr![] }] { loop {} } fn array_35() -> [(); { braced_expr![] }] { loop {} } + + // Arrays whose expanded form contains a nested definition + fn array_36() -> [(); closure![]] { loop {} } + fn array_37() -> [(); { closure![] }] { loop {} } + + // Arrays whose macro expansion is empty + fn array_38() -> [(); empty![]] { loop {} } + fn array_39() -> [(); { empty![] }] { loop {} } } struct Foo<const N: usize>; @@ -255,18 +287,26 @@ mod adt_paren_call { fn adt_23<const ident: usize>() -> Foo<{ braced_ident!() }> { loop {} } // An ADT where the expanded result is a complex expr - fn array_24() -> Foo<unbraced_unbraced_expr!()> { loop {} } - fn array_25() -> Foo<braced_unbraced_expr!()> { loop {} } - fn array_26() -> Foo<unbraced_braced_expr!()> { loop {} } - fn array_27() -> Foo<braced_braced_expr!()> { loop {} } - fn array_28() -> Foo<{ unbraced_unbraced_expr!() }> { loop {} } - fn array_29() -> Foo<{ braced_unbraced_expr!() }> { loop {} } - fn array_30() -> Foo<{ unbraced_braced_expr!() }> { loop {} } - fn array_31() -> Foo<{ braced_braced_expr!() }> { loop {} } - fn array_32() -> Foo<unbraced_expr!()> { loop {} } - fn array_33() -> Foo<braced_expr!()> { loop {} } - fn array_34() -> Foo<{ unbraced_expr!() }> { loop {} } - fn array_35() -> Foo<{ braced_expr!() }> { loop {} } + fn adt_24() -> Foo<unbraced_unbraced_expr!()> { loop {} } + fn adt_25() -> Foo<braced_unbraced_expr!()> { loop {} } + fn adt_26() -> Foo<unbraced_braced_expr!()> { loop {} } + fn adt_27() -> Foo<braced_braced_expr!()> { loop {} } + fn adt_28() -> Foo<{ unbraced_unbraced_expr!() }> { loop {} } + fn adt_29() -> Foo<{ braced_unbraced_expr!() }> { loop {} } + fn adt_30() -> Foo<{ unbraced_braced_expr!() }> { loop {} } + fn adt_31() -> Foo<{ braced_braced_expr!() }> { loop {} } + fn adt_32() -> Foo<unbraced_expr!()> { loop {} } + fn adt_33() -> Foo<braced_expr!()> { loop {} } + fn adt_34() -> Foo<{ unbraced_expr!() }> { loop {} } + fn adt_35() -> Foo<{ braced_expr!() }> { loop {} } + + // An ADT whose expanded form contains a nested definition + fn adt_36() -> Foo<closure!()> { loop {} } + fn adt_37() -> Foo<{ closure!() }> { loop {} } + + // An ADT whose macro expansion is empty + fn adt_38() -> Foo<empty!()> { loop {} } + fn adt_39() -> Foo<{ empty!() }> { loop {} } } #[rustfmt::skip] @@ -302,18 +342,26 @@ mod adt_brace_call { fn adt_23<const ident: usize>() -> Foo<{ braced_ident!{} }> { loop {} } // An ADT where the expanded result is a complex expr - fn array_24() -> Foo<unbraced_unbraced_expr!{}> { loop {} } - fn array_25() -> Foo<braced_unbraced_expr!{}> { loop {} } - fn array_26() -> Foo<unbraced_braced_expr!{}> { loop {} } - fn array_27() -> Foo<braced_braced_expr!{}> { loop {} } - fn array_28() -> Foo<{ unbraced_unbraced_expr!{} }> { loop {} } - fn array_29() -> Foo<{ braced_unbraced_expr!{} }> { loop {} } - fn array_30() -> Foo<{ unbraced_braced_expr!{} }> { loop {} } - fn array_31() -> Foo<{ braced_braced_expr!{} }> { loop {} } - fn array_32() -> Foo<unbraced_expr!{}> { loop {} } - fn array_33() -> Foo<braced_expr!{}> { loop {} } - fn array_34() -> Foo<{ unbraced_expr!{} }> { loop {} } - fn array_35() -> Foo<{ braced_expr!{} }> { loop {} } + fn adt_24() -> Foo<unbraced_unbraced_expr!{}> { loop {} } + fn adt_25() -> Foo<braced_unbraced_expr!{}> { loop {} } + fn adt_26() -> Foo<unbraced_braced_expr!{}> { loop {} } + fn adt_27() -> Foo<braced_braced_expr!{}> { loop {} } + fn adt_28() -> Foo<{ unbraced_unbraced_expr!{} }> { loop {} } + fn adt_29() -> Foo<{ braced_unbraced_expr!{} }> { loop {} } + fn adt_30() -> Foo<{ unbraced_braced_expr!{} }> { loop {} } + fn adt_31() -> Foo<{ braced_braced_expr!{} }> { loop {} } + fn adt_32() -> Foo<unbraced_expr!{}> { loop {} } + fn adt_33() -> Foo<braced_expr!{}> { loop {} } + fn adt_34() -> Foo<{ unbraced_expr!{} }> { loop {} } + fn adt_35() -> Foo<{ braced_expr!{} }> { loop {} } + + // An ADT whose expanded form contains a nested definition + fn adt_36() -> Foo<closure!{}> { loop {} } + fn adt_37() -> Foo<{ closure!{} }> { loop {} } + + // An ADT whose macro expansion is empty + fn adt_38() -> Foo<empty!{}> { loop {} } + fn adt_39() -> Foo<{ empty!{} }> { loop {} } } #[rustfmt::skip] @@ -349,18 +397,185 @@ mod adt_square_call { fn adt_23<const ident: usize>() -> Foo<{ braced_ident![] }> { loop {} } // An ADT where the expanded result is a complex expr - fn array_24() -> Foo<unbraced_unbraced_expr![]> { loop {} } - fn array_25() -> Foo<braced_unbraced_expr![]> { loop {} } - fn array_26() -> Foo<unbraced_braced_expr![]> { loop {} } - fn array_27() -> Foo<braced_braced_expr![]> { loop {} } - fn array_28() -> Foo<{ unbraced_unbraced_expr![] }> { loop {} } - fn array_29() -> Foo<{ braced_unbraced_expr![] }> { loop {} } - fn array_30() -> Foo<{ unbraced_braced_expr![] }> { loop {} } - fn array_31() -> Foo<{ braced_braced_expr![] }> { loop {} } - fn array_32() -> Foo<unbraced_expr![]> { loop {} } - fn array_33() -> Foo<braced_expr![]> { loop {} } - fn array_34() -> Foo<{ unbraced_expr![] }> { loop {} } - fn array_35() -> Foo<{ braced_expr![] }> { loop {} } + fn adt_24() -> Foo<unbraced_unbraced_expr![]> { loop {} } + fn adt_25() -> Foo<braced_unbraced_expr![]> { loop {} } + fn adt_26() -> Foo<unbraced_braced_expr![]> { loop {} } + fn adt_27() -> Foo<braced_braced_expr![]> { loop {} } + fn adt_28() -> Foo<{ unbraced_unbraced_expr![] }> { loop {} } + fn adt_29() -> Foo<{ braced_unbraced_expr![] }> { loop {} } + fn adt_30() -> Foo<{ unbraced_braced_expr![] }> { loop {} } + fn adt_31() -> Foo<{ braced_braced_expr![] }> { loop {} } + fn adt_32() -> Foo<unbraced_expr![]> { loop {} } + fn adt_33() -> Foo<braced_expr![]> { loop {} } + fn adt_34() -> Foo<{ unbraced_expr![] }> { loop {} } + fn adt_35() -> Foo<{ braced_expr![] }> { loop {} } + + // An ADT whose expanded form contains a nested definition + fn adt_36() -> Foo<closure![]> { loop {} } + fn adt_37() -> Foo<{ closure![] }> { loop {} } + + // An ADT whose macro expansion is empty + fn adt_38() -> Foo<empty![]> { loop {} } + fn adt_39() -> Foo<{ empty![] }> { loop {} } +} + +#[rustfmt::skip] +mod repeat_paren_call { + // A repeat expr where the expanded result is a `Res::Err` + fn repeat_0() { [(); unbraced_unbraced_ident!()]; } + fn repeat_1() { [(); braced_unbraced_ident!()]; } + fn repeat_2() { [(); unbraced_braced_ident!()]; } + fn repeat_3() { [(); braced_braced_ident!()]; } + fn repeat_4() { [(); { unbraced_unbraced_ident!() }]; } + fn repeat_5() { [(); { braced_unbraced_ident!() }]; } + fn repeat_6() { [(); { unbraced_braced_ident!() }]; } + fn repeat_7() { [(); { braced_braced_ident!() }]; } + fn repeat_8() { [(); unbraced_ident!()]; } + fn repeat_9() { [(); braced_ident!()]; } + fn repeat_10() { [(); { unbraced_ident!() }]; } + fn repeat_11() { [(); { braced_ident!() }]; } + + // A repeat expr where the expanded result is a `Res::ConstParam` + fn repeat_12<const ident: usize>() { [(); unbraced_unbraced_ident!()]; } + fn repeat_13<const ident: usize>() { [(); braced_unbraced_ident!()]; } + fn repeat_14<const ident: usize>() { [(); unbraced_braced_ident!()]; } + fn repeat_15<const ident: usize>() { [(); braced_braced_ident!()]; } + fn repeat_16<const ident: usize>() { [(); { unbraced_unbraced_ident!() }]; } + fn repeat_17<const ident: usize>() { [(); { braced_unbraced_ident!() }]; } + fn repeat_18<const ident: usize>() { [(); { unbraced_braced_ident!() }]; } + fn repeat_19<const ident: usize>() { [(); { braced_braced_ident!() }]; } + fn repeat_20<const ident: usize>() { [(); unbraced_ident!()]; } + fn repeat_21<const ident: usize>() { [(); braced_ident!()]; } + fn repeat_22<const ident: usize>() { [(); { unbraced_ident!() }]; } + fn repeat_23<const ident: usize>() { [(); { braced_ident!() }]; } + + // A repeat expr where the expanded result is a complex expr + fn repeat_24() { [(); unbraced_unbraced_expr!()]; } + fn repeat_25() { [(); braced_unbraced_expr!()]; } + fn repeat_26() { [(); unbraced_braced_expr!()]; } + fn repeat_27() { [(); braced_braced_expr!()]; } + fn repeat_28() { [(); { unbraced_unbraced_expr!() }]; } + fn repeat_29() { [(); { braced_unbraced_expr!() }]; } + fn repeat_30() { [(); { unbraced_braced_expr!() }]; } + fn repeat_31() { [(); { braced_braced_expr!() }]; } + fn repeat_32() { [(); unbraced_expr!()]; } + fn repeat_33() { [(); braced_expr!()]; } + fn repeat_34() { [(); { unbraced_expr!() }]; } + fn repeat_35() { [(); { braced_expr!() }]; } + + // A repeat expr whose expanded form contains a nested definition + fn repeat_36() { [(); closure!()] } + fn repeat_37() { [(); { closure!() }] } + + // A repeat expr whose macro expansion is empty + fn repeat_38() { [(); empty!()] } + fn repeat_39() { [(); { empty!() }] } +} + +#[rustfmt::skip] +mod repeat_brace_call { + // A repeat expr where the expanded result is a `Res::Err` + fn repeat_0() { [(); unbraced_unbraced_ident!{}]; } + fn repeat_1() { [(); braced_unbraced_ident!{}]; } + fn repeat_2() { [(); unbraced_braced_ident!{}]; } + fn repeat_3() { [(); braced_braced_ident!{}]; } + fn repeat_4() { [(); { unbraced_unbraced_ident!{} }]; } + fn repeat_5() { [(); { braced_unbraced_ident!{} }]; } + fn repeat_6() { [(); { unbraced_braced_ident!{} }]; } + fn repeat_7() { [(); { braced_braced_ident!{} }]; } + fn repeat_8() { [(); unbraced_ident!{}]; } + fn repeat_9() { [(); braced_ident!{}]; } + fn repeat_10() { [(); { unbraced_ident!{} }]; } + fn repeat_11() { [(); { braced_ident!{} }]; } + + // A repeat expr where the expanded result is a `Res::ConstParam` + fn repeat_12<const ident: usize>() { [(); unbraced_unbraced_ident!{}]; } + fn repeat_13<const ident: usize>() { [(); braced_unbraced_ident!{}]; } + fn repeat_14<const ident: usize>() { [(); unbraced_braced_ident!{}]; } + fn repeat_15<const ident: usize>() { [(); braced_braced_ident!{}]; } + fn repeat_16<const ident: usize>() { [(); { unbraced_unbraced_ident!{} }]; } + fn repeat_17<const ident: usize>() { [(); { braced_unbraced_ident!{} }]; } + fn repeat_18<const ident: usize>() { [(); { unbraced_braced_ident!{} }]; } + fn repeat_19<const ident: usize>() { [(); { braced_braced_ident!{} }]; } + fn repeat_20<const ident: usize>() { [(); unbraced_ident!{}]; } + fn repeat_21<const ident: usize>() { [(); braced_ident!{}]; } + fn repeat_22<const ident: usize>() { [(); { unbraced_ident!{} }]; } + fn repeat_23<const ident: usize>() { [(); { braced_ident!{} }]; } + + // A repeat expr where the expanded result is a complex expr + fn repeat_24() { [(); unbraced_unbraced_expr!{}]; } + fn repeat_25() { [(); braced_unbraced_expr!{}]; } + fn repeat_26() { [(); unbraced_braced_expr!{}]; } + fn repeat_27() { [(); braced_braced_expr!{}]; } + fn repeat_28() { [(); { unbraced_unbraced_expr!{} }]; } + fn repeat_29() { [(); { braced_unbraced_expr!{} }]; } + fn repeat_30() { [(); { unbraced_braced_expr!{} }]; } + fn repeat_31() { [(); { braced_braced_expr!{} }]; } + fn repeat_32() { [(); unbraced_expr!{}]; } + fn repeat_33() { [(); braced_expr!{}]; } + fn repeat_34() { [(); { unbraced_expr!{} }]; } + fn repeat_35() { [(); { braced_expr!{} }]; } + + // A repeat expr whose expanded form contains a nested definition + fn repeat_36() { [(); closure!{}] } + fn repeat_37() { [(); { closure!{} }] } + + // A repeat expr whose macro expansion is empty + fn repeat_38() { [(); empty!{}] } + fn repeat_39() { [(); { empty!{} }] } +} + +#[rustfmt::skip] +mod repeat_square_call { + // A repeat expr where the expanded result is a `Res::Err` + fn repeat_0() { [(); unbraced_unbraced_ident![]]; } + fn repeat_1() { [(); braced_unbraced_ident![]]; } + fn repeat_2() { [(); unbraced_braced_ident![]]; } + fn repeat_3() { [(); braced_braced_ident![]]; } + fn repeat_4() { [(); { unbraced_unbraced_ident![] }]; } + fn repeat_5() { [(); { braced_unbraced_ident![] }]; } + fn repeat_6() { [(); { unbraced_braced_ident![] }]; } + fn repeat_7() { [(); { braced_braced_ident![] }]; } + fn repeat_8() { [(); unbraced_ident![]]; } + fn repeat_9() { [(); braced_ident![]]; } + fn repeat_10() { [(); { unbraced_ident![] }]; } + fn repeat_11() { [(); { braced_ident![] }]; } + + // A repeat expr where the expanded result is a `Res::ConstParam` + fn repeat_12<const ident: usize>() { [(); unbraced_unbraced_ident![]]; } + fn repeat_13<const ident: usize>() { [(); braced_unbraced_ident![]]; } + fn repeat_14<const ident: usize>() { [(); unbraced_braced_ident![]]; } + fn repeat_15<const ident: usize>() { [(); braced_braced_ident![]]; } + fn repeat_16<const ident: usize>() { [(); { unbraced_unbraced_ident![] }]; } + fn repeat_17<const ident: usize>() { [(); { braced_unbraced_ident![] }]; } + fn repeat_18<const ident: usize>() { [(); { unbraced_braced_ident![] }]; } + fn repeat_19<const ident: usize>() { [(); { braced_braced_ident![] }]; } + fn repeat_20<const ident: usize>() { [(); unbraced_ident![]]; } + fn repeat_21<const ident: usize>() { [(); braced_ident![]]; } + fn repeat_22<const ident: usize>() { [(); { unbraced_ident![] }]; } + fn repeat_23<const ident: usize>() { [(); { braced_ident![] }]; } + + // A repeat expr where the expanded result is a complex expr + fn repeat_24() { [(); unbraced_unbraced_expr![]]; } + fn repeat_25() { [(); braced_unbraced_expr![]]; } + fn repeat_26() { [(); unbraced_braced_expr![]]; } + fn repeat_27() { [(); braced_braced_expr![]]; } + fn repeat_28() { [(); { unbraced_unbraced_expr![] }]; } + fn repeat_29() { [(); { braced_unbraced_expr![] }]; } + fn repeat_30() { [(); { unbraced_braced_expr![] }]; } + fn repeat_31() { [(); { braced_braced_expr![] }]; } + fn repeat_32() { [(); unbraced_expr![]]; } + fn repeat_33() { [(); braced_expr![]]; } + fn repeat_34() { [(); { unbraced_expr![] }]; } + fn repeat_35() { [(); { braced_expr![] }]; } + + // A repeat expr whose expanded form contains a nested definition + fn repeat_36() { [(); closure![]] } + fn repeat_37() { [(); { closure![] }] } + + // A repeat expr whose macro expansion is empty + fn repeat_38() { [(); empty![]] } + fn repeat_39() { [(); { empty![] }] } } fn main() {} diff --git a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-3-pass.rs b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-3-pass.rs new file mode 100644 index 00000000000..fb6190324c6 --- /dev/null +++ b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-3-pass.rs @@ -0,0 +1,46 @@ +// Additional checks for macro expansion in const args + +//@ check-pass + +macro_rules! closure { + () => { |()| () }; +} + +macro_rules! indir_semi { + ($nested:ident) => { $nested!(); }; +} + +macro_rules! indir { + ($nested:ident) => { $nested!() }; +} + +macro_rules! empty { + () => {}; +} + +macro_rules! arg { + () => { N }; +} + +struct Adt<const N: usize>; + +fn array1() -> [(); { closure!(); 0 }] { loop {} } +fn array2() -> [(); { indir!(closure); 0}] { loop {} } +fn array3() -> [(); { indir_semi!{ closure } 0 }] { loop {} } +fn array4<const N: usize>() -> [(); { indir!{ empty } arg!{} }] { loop {} } +fn array5<const N: usize>() -> [(); { empty!{} arg!() }] { loop {} } +fn array6<const N: usize>() -> [(); { empty!{} N }] { loop {} } +fn array7<const N: usize>() -> [(); { arg!{} empty!{} }] { loop {} } +fn array8<const N: usize>() -> [(); { empty!{} arg!{} empty!{} }] { loop {} } + +fn adt1() -> Adt<{ closure!(); 0 }> { loop {} } +fn adt2() -> Adt<{ indir!(closure); 0}> { loop {} } +fn adt3() -> Adt<{ indir_semi!{ closure } 0 }> { loop {} } +fn adt4<const N: usize>() -> Adt<{ indir!{ empty } arg!{} }> { loop {} } +fn adt5<const N: usize>() -> Adt<{ empty!{} arg!() }> { loop {} } +fn adt6<const N: usize>() -> Adt<{ empty!{} N }> { loop {} } +fn adt7<const N: usize>() -> Adt<{ arg!{} empty!{} }> { loop {} } +fn adt8<const N: usize>() -> Adt<{ empty!{} arg!{} empty!{} }> { loop {} } + + +fn main() {} diff --git a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.rs b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.rs new file mode 100644 index 00000000000..3353d6cf2da --- /dev/null +++ b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.rs @@ -0,0 +1,18 @@ +macro_rules! empty { + () => {}; +} + +macro_rules! arg { + () => { + N + //~^ ERROR generic parameters may not be used in const operations + //~| ERROR generic parameters may not be used in const operations + }; +} + +struct Foo<const N: usize>; +fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} } +fn bar<const N: usize>() -> [(); { empty!{}; N }] { loop {} } +//~^ ERROR generic parameters may not be used in const operations + +fn main() {} diff --git a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr new file mode 100644 index 00000000000..4722968b203 --- /dev/null +++ b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr @@ -0,0 +1,37 @@ +error: generic parameters may not be used in const operations + --> $DIR/const_arg_trivial_macro_expansion-4.rs:7:9 + | +LL | N + | ^ cannot perform const operation using `N` +... +LL | fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} } + | ------ in this macro invocation + | + = help: const parameters may only be used as standalone arguments, i.e. `N` + = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions + = note: this error originates in the macro `arg` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: generic parameters may not be used in const operations + --> $DIR/const_arg_trivial_macro_expansion-4.rs:7:9 + | +LL | N + | ^ cannot perform const operation using `N` +... +LL | fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} } + | ------ in this macro invocation + | + = help: const parameters may only be used as standalone arguments, i.e. `N` + = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions + = note: this error originates in the macro `arg` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: generic parameters may not be used in const operations + --> $DIR/const_arg_trivial_macro_expansion-4.rs:15:46 + | +LL | fn bar<const N: usize>() -> [(); { empty!{}; N }] { loop {} } + | ^ cannot perform const operation using `N` + | + = help: const parameters may only be used as standalone arguments, i.e. `N` + = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions + +error: aborting due to 3 previous errors + diff --git a/tests/ui/const-generics/generic-param-mismatch.stderr b/tests/ui/const-generics/generic-param-mismatch.stderr index be6b3b90ec7..099ce03317d 100644 --- a/tests/ui/const-generics/generic-param-mismatch.stderr +++ b/tests/ui/const-generics/generic-param-mismatch.stderr @@ -4,10 +4,7 @@ error[E0308]: mismatched types LL | fn test<const N: usize, const M: usize>() -> [u8; M] { | ------- expected `[u8; M]` because of return type LL | [0; N] - | ^^^^^^ expected `M`, found `N` - | - = note: expected array `[u8; M]` - found array `[u8; N]` + | ^^^^^^ expected an array with a size of M, found one with a size of N error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs b/tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs new file mode 100644 index 00000000000..c1f725db126 --- /dev/null +++ b/tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs @@ -0,0 +1,12 @@ +//@ check-pass + +#![feature(generic_arg_infer)] +#![crate_type = "lib"] + +// Test that encoding the hallucinated `DefId` for the `_` const argument doesn't +// ICE (see #133468). This requires this to be a library crate. + +pub fn foo() { + let s: [u8; 10]; + s = [0; _]; +} diff --git a/tests/ui/const-generics/generic_const_exprs/bad-multiply.rs b/tests/ui/const-generics/generic_const_exprs/bad-multiply.rs new file mode 100644 index 00000000000..1af6d5742b1 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/bad-multiply.rs @@ -0,0 +1,18 @@ +// regression test for #124350 + +struct Node<const D: usize> {} + +impl<const D: usize> Node<D> +where + SmallVec<{ D * 2 }>:, + //~^ ERROR generic parameters may not be used in const operations + //~| ERROR constant provided when a type was expected +{ + fn new() -> Self { + Node::new() + } +} + +struct SmallVec<T1>(T1); + +fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr b/tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr new file mode 100644 index 00000000000..a8d6cebabe7 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr @@ -0,0 +1,18 @@ +error: generic parameters may not be used in const operations + --> $DIR/bad-multiply.rs:7:16 + | +LL | SmallVec<{ D * 2 }>:, + | ^ cannot perform const operation using `D` + | + = help: const parameters may only be used as standalone arguments, i.e. `D` + = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions + +error[E0747]: constant provided when a type was expected + --> $DIR/bad-multiply.rs:7:14 + | +LL | SmallVec<{ D * 2 }>:, + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0747`. diff --git a/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr b/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr index 632ece0ddcb..7e318f8786f 100644 --- a/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr +++ b/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr @@ -1,12 +1,4 @@ error: overly complex generic constant - --> $DIR/dependence_lint.rs:17:9 - | -LL | [0; if false { size_of::<T>() } else { 3 }]; // lint on stable, error with gce - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants - | - = help: consider moving this anonymous constant into a `const` function - -error: overly complex generic constant --> $DIR/dependence_lint.rs:21:17 | LL | let _: [u8; if true { size_of::<T>() } else { 3 }]; // error on stable, error with gce @@ -36,5 +28,13 @@ help: try adding a `where` bound LL | fn foo<T>() where [(); size_of::<*mut T>()]: { | ++++++++++++++++++++++++++++++++ +error: overly complex generic constant + --> $DIR/dependence_lint.rs:17:9 + | +LL | [0; if false { size_of::<T>() } else { 3 }]; // lint on stable, error with gce + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants + | + = help: consider moving this anonymous constant into a `const` function + error: aborting due to 4 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr b/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr index 14c67e2528a..8efd433fd1f 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr @@ -10,12 +10,10 @@ error[E0308]: mismatched types --> $DIR/issue-62504.rs:18:21 | LL | ArrayHolder([0; Self::SIZE]) - | ----------- ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` + | ----------- ^^^^^^^^^^^^^^^ expected an array with a size of X, found one with a size of Self::SIZE | | | arguments to this struct are incorrect | - = note: expected array `[u32; X]` - found array `[u32; Self::SIZE]` note: tuple struct defined here --> $DIR/issue-62504.rs:14:8 | diff --git a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs new file mode 100644 index 00000000000..e5af632da75 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs @@ -0,0 +1,18 @@ +// Regression test for #133271. +#![feature(generic_const_exprs)] +//~^ WARN the feature `generic_const_exprs` is incomplete + +struct Foo; +impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo +//~^ ERROR the const parameter `NUM` is not constrained by the impl trait, self type, or predicates +where + [(); 1 + 0]: Sized, +{ + fn unimplemented(self, _: &Foo) -> Self::Output { + //~^ ERROR method `unimplemented` is not a member of trait `std::ops::Add` + //~| ERROR type annotations needed + loop {} + } +} + +fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr new file mode 100644 index 00000000000..ade18eb88b9 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr @@ -0,0 +1,46 @@ +error[E0407]: method `unimplemented` is not a member of trait `std::ops::Add` + --> $DIR/post-analysis-user-facing-param-env.rs:11:5 + | +LL | / fn unimplemented(self, _: &Foo) -> Self::Output { +LL | | +LL | | +LL | | loop {} +LL | | } + | |_____^ not a member of trait `std::ops::Add` + +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/post-analysis-user-facing-param-env.rs:2:12 + | +LL | #![feature(generic_const_exprs)] + | ^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information + = note: `#[warn(incomplete_features)]` on by default + +error[E0207]: the const parameter `NUM` is not constrained by the impl trait, self type, or predicates + --> $DIR/post-analysis-user-facing-param-env.rs:6:10 + | +LL | impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo + | ^^^^^^^^^^^^^^^^ unconstrained const parameter + | + = note: expressions using a const parameter must map each value to a distinct output value + = note: proving the result of expressions other than the parameter are unique is not supported + +error[E0284]: type annotations needed + --> $DIR/post-analysis-user-facing-param-env.rs:11:40 + | +LL | fn unimplemented(self, _: &Foo) -> Self::Output { + | ^^^^^^^^^^^^ cannot infer the value of const parameter `NUM` + | +note: required for `Foo` to implement `Add<&'a Foo>` + --> $DIR/post-analysis-user-facing-param-env.rs:6:28 + | +LL | impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo + | ---------------- ^^^^^^^^^^^^^^^^^^^^^^ ^^^ + | | + | unsatisfied trait bound introduced here + +error: aborting due to 3 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0207, E0284, E0407. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr index 30a45ce377e..4eb374b2020 100644 --- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr +++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr @@ -72,6 +72,20 @@ help: add `#![feature(adt_const_params)]` to the crate attributes to enable more LL + #![feature(adt_const_params)] | +note: erroneous constant encountered + --> $DIR/unevaluated-const-ice-119731.rs:22:19 + | +LL | impl v17<512, v0> { + | ^^ + +note: erroneous constant encountered + --> $DIR/unevaluated-const-ice-119731.rs:22:19 + | +LL | impl v17<512, v0> { + | ^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0} --> $DIR/unevaluated-const-ice-119731.rs:28:37 | diff --git a/tests/crashes/128176.rs b/tests/ui/const-generics/issues/cg-in-dyn-issue-128176.rs index 970ad9ff2cd..d163238c6d5 100644 --- a/tests/crashes/128176.rs +++ b/tests/ui/const-generics/issues/cg-in-dyn-issue-128176.rs @@ -1,7 +1,11 @@ -//@ known-bug: rust-lang/rust#128176 +//@ check-pass + +// Regression test for #128176. #![feature(generic_const_exprs)] #![feature(dyn_compatible_for_dispatch)] +#![allow(incomplete_features)] + trait X { type Y<const N: i16>; } diff --git a/tests/ui/const-generics/issues/issue-83765.stderr b/tests/ui/const-generics/issues/issue-83765.stderr index c3292314f23..6b62012c14f 100644 --- a/tests/ui/const-generics/issues/issue-83765.stderr +++ b/tests/ui/const-generics/issues/issue-83765.stderr @@ -10,11 +10,11 @@ note: ...which requires computing candidate for `<LazyUpdim<'_, T, <T as TensorD LL | trait TensorDimension { | ^^^^^^^^^^^^^^^^^^^^^ = note: ...which again requires resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM`, completing the cycle -note: cycle used when computing candidate for `<LazyUpdim<'_, T, { T::DIM }, DIM> as TensorDimension>` - --> $DIR/issue-83765.rs:4:1 +note: cycle used when checking assoc item `<impl at $DIR/issue-83765.rs:50:1: 50:94>::size` is compatible with trait definition + --> $DIR/issue-83765.rs:51:5 | -LL | trait TensorDimension { - | ^^^^^^^^^^^^^^^^^^^^^ +LL | fn size(&self) -> [usize; DIM] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error[E0391]: cycle detected when resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM` @@ -29,11 +29,11 @@ note: ...which requires computing candidate for `<LazyUpdim<'_, T, <T as TensorD LL | trait TensorDimension { | ^^^^^^^^^^^^^^^^^^^^^ = note: ...which again requires resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM`, completing the cycle -note: cycle used when checking that `<impl at $DIR/issue-83765.rs:56:1: 56:97>` is well-formed - --> $DIR/issue-83765.rs:56:1 +note: cycle used when checking assoc item `<impl at $DIR/issue-83765.rs:56:1: 56:97>::bget` is compatible with trait definition + --> $DIR/issue-83765.rs:58:5 | -LL | impl<'a, T: Broadcastable, const DIM: usize> Broadcastable for LazyUpdim<'a, T, { T::DIM }, DIM> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | fn bget(&self, index: [usize; DIM]) -> Option<Self::Element> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error[E0308]: method not compatible with trait diff --git a/tests/ui/const-generics/kind_mismatch.rs b/tests/ui/const-generics/kind_mismatch.rs index bab58d5952a..ecdc01a5ef9 100644 --- a/tests/ui/const-generics/kind_mismatch.rs +++ b/tests/ui/const-generics/kind_mismatch.rs @@ -20,5 +20,4 @@ pub fn remove_key<K, S: SubsetExcept<K>>() -> S { fn main() { let map: KeyHolder<0> = remove_key::<_, _>(); - //~^ ERROR: the trait bound `KeyHolder<0>: SubsetExcept<_>` is not satisfied } diff --git a/tests/ui/const-generics/kind_mismatch.stderr b/tests/ui/const-generics/kind_mismatch.stderr index e13bc6ee058..1487b189619 100644 --- a/tests/ui/const-generics/kind_mismatch.stderr +++ b/tests/ui/const-generics/kind_mismatch.stderr @@ -14,26 +14,6 @@ LL | impl<K> ContainsKey<K> for KeyHolder<K> {} | | | help: consider changing this type parameter to a const parameter: `const K: u8` -error[E0277]: the trait bound `KeyHolder<0>: SubsetExcept<_>` is not satisfied - --> $DIR/kind_mismatch.rs:22:45 - | -LL | let map: KeyHolder<0> = remove_key::<_, _>(); - | ^ the trait `ContainsKey<0>` is not implemented for `KeyHolder<0>` - | -note: required for `KeyHolder<0>` to implement `SubsetExcept<_>` - --> $DIR/kind_mismatch.rs:15:28 - | -LL | impl<P, T: ContainsKey<0>> SubsetExcept<P> for T {} - | -------------- ^^^^^^^^^^^^^^^ ^ - | | - | unsatisfied trait bound introduced here -note: required by a bound in `remove_key` - --> $DIR/kind_mismatch.rs:17:25 - | -LL | pub fn remove_key<K, S: SubsetExcept<K>>() -> S { - | ^^^^^^^^^^^^^^^ required by this bound in `remove_key` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0277, E0747. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0747`. diff --git a/tests/ui/const-generics/not_wf_param_in_rpitit.rs b/tests/ui/const-generics/not_wf_param_in_rpitit.rs index b454562ad49..cb1e90923e7 100644 --- a/tests/ui/const-generics/not_wf_param_in_rpitit.rs +++ b/tests/ui/const-generics/not_wf_param_in_rpitit.rs @@ -3,9 +3,6 @@ trait Trait<const N: dyn Trait = bar> { //~^ ERROR: cannot find value `bar` in this scope //~| ERROR: cycle detected when computing type of `Trait::N` - //~| ERROR: the trait `Trait` cannot be made into an object - //~| ERROR: the trait `Trait` cannot be made into an object - //~| ERROR: the trait `Trait` cannot be made into an object async fn a() {} } diff --git a/tests/ui/const-generics/not_wf_param_in_rpitit.stderr b/tests/ui/const-generics/not_wf_param_in_rpitit.stderr index 2500409e828..42ae012fa55 100644 --- a/tests/ui/const-generics/not_wf_param_in_rpitit.stderr +++ b/tests/ui/const-generics/not_wf_param_in_rpitit.stderr @@ -18,77 +18,7 @@ LL | trait Trait<const N: dyn Trait = bar> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/not_wf_param_in_rpitit.rs:3:22 - | -LL | trait Trait<const N: dyn Trait = bar> { - | ^^^^^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/not_wf_param_in_rpitit.rs:9:14 - | -LL | trait Trait<const N: dyn Trait = bar> { - | ----- this trait cannot be made into an object... -... -LL | async fn a() {} - | ^ ...because associated function `a` has no `self` parameter -help: consider turning `a` into a method by giving it a `&self` argument - | -LL | async fn a(&self) {} - | +++++ -help: alternatively, consider constraining `a` so it does not apply to trait objects - | -LL | async fn a() where Self: Sized {} - | +++++++++++++++++ - -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/not_wf_param_in_rpitit.rs:3:13 - | -LL | trait Trait<const N: dyn Trait = bar> { - | ^^^^^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/not_wf_param_in_rpitit.rs:9:14 - | -LL | trait Trait<const N: dyn Trait = bar> { - | ----- this trait cannot be made into an object... -... -LL | async fn a() {} - | ^ ...because associated function `a` has no `self` parameter -help: consider turning `a` into a method by giving it a `&self` argument - | -LL | async fn a(&self) {} - | +++++ -help: alternatively, consider constraining `a` so it does not apply to trait objects - | -LL | async fn a() where Self: Sized {} - | +++++++++++++++++ - -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/not_wf_param_in_rpitit.rs:3:13 - | -LL | trait Trait<const N: dyn Trait = bar> { - | ^^^^^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/not_wf_param_in_rpitit.rs:9:14 - | -LL | trait Trait<const N: dyn Trait = bar> { - | ----- this trait cannot be made into an object... -... -LL | async fn a() {} - | ^ ...because associated function `a` has no `self` parameter - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: consider turning `a` into a method by giving it a `&self` argument - | -LL | async fn a(&self) {} - | +++++ -help: alternatively, consider constraining `a` so it does not apply to trait objects - | -LL | async fn a() where Self: Sized {} - | +++++++++++++++++ - -error: aborting due to 5 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0038, E0391, E0425. -For more information about an error, try `rustc --explain E0038`. +Some errors have detailed explanations: E0391, E0425. +For more information about an error, try `rustc --explain E0391`. diff --git a/tests/ui/consts/array-literal-len-mismatch.stderr b/tests/ui/consts/array-literal-len-mismatch.stderr index a11506ecb6d..39b8a647324 100644 --- a/tests/ui/consts/array-literal-len-mismatch.stderr +++ b/tests/ui/consts/array-literal-len-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/array-literal-len-mismatch.rs:1:26 | LL | const NUMBERS: [u8; 3] = [10, 20]; - | - ^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements + | - ^^^^^^^^ expected an array with a size of 3, found one with a size of 2 | | | help: consider specifying the actual array length: `2` diff --git a/tests/ui/consts/bad-array-size-in-type-err.rs b/tests/ui/consts/bad-array-size-in-type-err.rs new file mode 100644 index 00000000000..cb02ad3205d --- /dev/null +++ b/tests/ui/consts/bad-array-size-in-type-err.rs @@ -0,0 +1,10 @@ +struct BadArraySize<const N: u8> { + arr: [i32; N], + //~^ ERROR the constant `N` is not of type `usize` +} + +fn main() { + let _ = BadArraySize::<2> { arr: [0, 0, 0] }; + //~^ ERROR mismatched types + //~| ERROR the constant `2` is not of type `usize` +} diff --git a/tests/ui/consts/bad-array-size-in-type-err.stderr b/tests/ui/consts/bad-array-size-in-type-err.stderr new file mode 100644 index 00000000000..25d14d80c3e --- /dev/null +++ b/tests/ui/consts/bad-array-size-in-type-err.stderr @@ -0,0 +1,21 @@ +error: the constant `N` is not of type `usize` + --> $DIR/bad-array-size-in-type-err.rs:2:10 + | +LL | arr: [i32; N], + | ^^^^^^^^ expected `usize`, found `u8` + +error[E0308]: mismatched types + --> $DIR/bad-array-size-in-type-err.rs:7:38 + | +LL | let _ = BadArraySize::<2> { arr: [0, 0, 0] }; + | ^^^^^^^^^ expected an array with a size of 2, found one with a size of 3 + +error: the constant `2` is not of type `usize` + --> $DIR/bad-array-size-in-type-err.rs:7:38 + | +LL | let _ = BadArraySize::<2> { arr: [0, 0, 0] }; + | ^^^^^^^^^ expected `usize`, found `u8` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/consts/const-array-oob-arith.rs b/tests/ui/consts/const-array-oob-arith.rs index 9332cbbd4d7..0f6e76768cd 100644 --- a/tests/ui/consts/const-array-oob-arith.rs +++ b/tests/ui/consts/const-array-oob-arith.rs @@ -4,10 +4,10 @@ const VAL: i32 = ARR[IDX]; const BONG: [i32; (ARR[0] - 41) as usize] = [5]; const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; //~^ ERROR: mismatched types -//~| expected an array with a fixed size of 2 elements, found one with 1 element +//~| expected an array const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; //~^ ERROR: mismatched types -//~| expected an array with a fixed size of 1 element, found one with 2 elements +//~| expected an array fn main() { let _ = VAL; diff --git a/tests/ui/consts/const-array-oob-arith.stderr b/tests/ui/consts/const-array-oob-arith.stderr index 029d94273fa..d3299082aa1 100644 --- a/tests/ui/consts/const-array-oob-arith.stderr +++ b/tests/ui/consts/const-array-oob-arith.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-array-oob-arith.rs:5:45 | LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; - | ---------------------- ^^^ expected an array with a fixed size of 2 elements, found one with 1 element + | ---------------------- ^^^ expected an array with a size of 2, found one with a size of 1 | | | help: consider specifying the actual array length: `1` @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/const-array-oob-arith.rs:8:44 | LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; - | ---------------------- ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements + | ---------------------- ^^^^^^^ expected an array with a size of 1, found one with a size of 2 | | | help: consider specifying the actual array length: `2` diff --git a/tests/ui/consts/const-block-const-bound.rs b/tests/ui/consts/const-block-const-bound.rs index 933eb6cfc0a..596aac09b31 100644 --- a/tests/ui/consts/const-block-const-bound.rs +++ b/tests/ui/consts/const-block-const-bound.rs @@ -1,7 +1,7 @@ //@ known-bug: #103507 #![allow(unused)] -#![feature(const_trait_impl, negative_impls)] +#![feature(const_trait_impl, negative_impls, const_destruct)] use std::marker::Destruct; diff --git a/tests/ui/consts/const-block-const-bound.stderr b/tests/ui/consts/const-block-const-bound.stderr index 5e24959146b..0931eff2175 100644 --- a/tests/ui/consts/const-block-const-bound.stderr +++ b/tests/ui/consts/const-block-const-bound.stderr @@ -1,25 +1,17 @@ -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-block-const-bound.rs:8:15 - | -LL | const fn f<T: ~const Destruct>(x: T) {} - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-block-const-bound.rs:8:15 +error[E0277]: the trait bound `UnconstDrop: const Destruct` is not satisfied + --> $DIR/const-block-const-bound.rs:18:11 | -LL | const fn f<T: ~const Destruct>(x: T) {} - | ^^^^^^ +LL | f(UnconstDrop); + | - ^^^^^^^^^^^ + | | + | required by a bound introduced by this call | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/const-block-const-bound.rs:8:32 +note: required by a bound in `f` + --> $DIR/const-block-const-bound.rs:8:15 | LL | const fn f<T: ~const Destruct>(x: T) {} - | ^ - value is dropped here - | | - | the destructor for this type cannot be evaluated in constant functions + | ^^^^^^ required by this bound in `f` -error: aborting due to 3 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0493`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/consts/const-bound.rs b/tests/ui/consts/const-bound.rs index 682a2dcbbc6..00a833ba3f7 100644 --- a/tests/ui/consts/const-bound.rs +++ b/tests/ui/consts/const-bound.rs @@ -3,7 +3,6 @@ // Make sure const bounds work on things, and test that a few types // are const. -//@ pretty-expanded FIXME #23616 fn foo<T: Sync>(x: T) -> T { x } diff --git a/tests/ui/consts/const-eval-fail-too-big.rs b/tests/ui/consts/const-eval-fail-too-big.rs new file mode 100644 index 00000000000..4b5dbc1d7a4 --- /dev/null +++ b/tests/ui/consts/const-eval-fail-too-big.rs @@ -0,0 +1,12 @@ +//Error output test for #78834: Type is too big for the target architecture +struct B< + A: Sized = [(); { + let x = [0u8; !0usize]; + //~^ ERROR evaluation of constant value failed + 1 + }], +> { + a: A, +} + +fn main() {} diff --git a/tests/ui/consts/const-eval-fail-too-big.stderr b/tests/ui/consts/const-eval-fail-too-big.stderr new file mode 100644 index 00000000000..ae666483233 --- /dev/null +++ b/tests/ui/consts/const-eval-fail-too-big.stderr @@ -0,0 +1,9 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/const-eval-fail-too-big.rs:4:28 + | +LL | let x = [0u8; !0usize]; + | ^^^^^^^^^^^^^^ values of the type `[u8; usize::MAX]` are too big for the target architecture + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/const-eval/float_methods.rs b/tests/ui/consts/const-eval/float_methods.rs index 49c31f68c5f..853f75825ac 100644 --- a/tests/ui/consts/const-eval/float_methods.rs +++ b/tests/ui/consts/const-eval/float_methods.rs @@ -1,7 +1,6 @@ //@ run-pass //! Tests the float intrinsics: min, max, abs, copysign -#![feature(const_float_methods)] #![feature(f16, f128)] const F16_MIN: f16 = 1.0_f16.min(0.5_f16); diff --git a/tests/ui/consts/const-expr-in-fixed-length-vec.rs b/tests/ui/consts/const-expr-in-fixed-length-vec.rs index 60b4895f5f9..f4d651af115 100644 --- a/tests/ui/consts/const-expr-in-fixed-length-vec.rs +++ b/tests/ui/consts/const-expr-in-fixed-length-vec.rs @@ -2,7 +2,6 @@ // Check that constant expressions can be used for declaring the // type of a fixed length vector. -//@ pretty-expanded FIXME #23616 pub fn main() { diff --git a/tests/ui/consts/const-expr-in-vec-repeat.rs b/tests/ui/consts/const-expr-in-vec-repeat.rs index 5345a1c4c42..e270d4c1eb3 100644 --- a/tests/ui/consts/const-expr-in-vec-repeat.rs +++ b/tests/ui/consts/const-expr-in-vec-repeat.rs @@ -1,7 +1,6 @@ //@ run-pass // Check that constant expressions can be used in vec repeat syntax. -//@ pretty-expanded FIXME #23616 pub fn main() { diff --git a/tests/ui/consts/const-fn-error.rs b/tests/ui/consts/const-fn-error.rs index 42061ef0670..b7151782423 100644 --- a/tests/ui/consts/const-fn-error.rs +++ b/tests/ui/consts/const-fn-error.rs @@ -3,9 +3,8 @@ const X : usize = 2; const fn f(x: usize) -> usize { let mut sum = 0; for i in 0..x { - //~^ ERROR cannot convert - //~| ERROR `for` is not allowed in a `const fn` - //~| ERROR cannot call non-const fn + //~^ ERROR cannot use `for` + //~| ERROR cannot use `for` sum += i; } sum diff --git a/tests/ui/consts/const-fn-error.stderr b/tests/ui/consts/const-fn-error.stderr index 42a6f2704c9..3d4cf6539c8 100644 --- a/tests/ui/consts/const-fn-error.stderr +++ b/tests/ui/consts/const-fn-error.stderr @@ -1,37 +1,20 @@ -error[E0658]: `for` is not allowed in a `const fn` - --> $DIR/const-fn-error.rs:5:5 - | -LL | / for i in 0..x { -LL | | -LL | | -LL | | -LL | | sum += i; -LL | | } - | |_____^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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[E0015]: cannot convert `std::ops::Range<usize>` into an iterator in constant functions +error[E0015]: cannot use `for` loop on `std::ops::Range<usize>` in constant functions --> $DIR/const-fn-error.rs:5:14 | LL | for i in 0..x { | ^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: cannot call non-const fn `<std::ops::Range<usize> as Iterator>::next` in constant functions +error[E0015]: cannot use `for` loop on `std::ops::Range<usize>` in constant functions --> $DIR/const-fn-error.rs:5:14 | LL | for i in 0..x { | ^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0015, E0658. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/const-for-feature-gate.rs b/tests/ui/consts/const-for-feature-gate.rs index d74178662b3..b643e63c096 100644 --- a/tests/ui/consts/const-for-feature-gate.rs +++ b/tests/ui/consts/const-for-feature-gate.rs @@ -2,9 +2,8 @@ const _: () = { for _ in 0..5 {} - //~^ error: `for` is not allowed in a `const` - //~| ERROR: cannot convert - //~| ERROR: cannot call + //~^ ERROR cannot use `for` + //~| ERROR cannot use `for` }; fn main() {} diff --git a/tests/ui/consts/const-for-feature-gate.stderr b/tests/ui/consts/const-for-feature-gate.stderr index 6e099a3159d..29db5d24ac8 100644 --- a/tests/ui/consts/const-for-feature-gate.stderr +++ b/tests/ui/consts/const-for-feature-gate.stderr @@ -1,32 +1,20 @@ -error[E0658]: `for` is not allowed in a `const` - --> $DIR/const-for-feature-gate.rs:4:5 - | -LL | for _ in 0..5 {} - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/const-for-feature-gate.rs:4:14 | LL | for _ in 0..5 {} | ^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants -error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/const-for-feature-gate.rs:4:14 | LL | for _ in 0..5 {} | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0015, E0658. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/const-for.rs b/tests/ui/consts/const-for.rs index 4f8034e73f0..6f7895457c5 100644 --- a/tests/ui/consts/const-for.rs +++ b/tests/ui/consts/const-for.rs @@ -2,8 +2,8 @@ const _: () = { for _ in 0..5 {} - //~^ error: cannot call - //~| error: cannot convert + //~^ ERROR cannot use `for` + //~| ERROR cannot use `for` }; fn main() {} diff --git a/tests/ui/consts/const-for.stderr b/tests/ui/consts/const-for.stderr index 78336dc93e8..d1308a8dedc 100644 --- a/tests/ui/consts/const-for.stderr +++ b/tests/ui/consts/const-for.stderr @@ -1,20 +1,19 @@ -error[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/const-for.rs:4:14 | LL | for _ in 0..5 {} | ^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants -error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/const-for.rs:4:14 | LL | for _ in 0..5 {} | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 2 previous errors diff --git a/tests/ui/consts/const-integer-bool-ops.stderr b/tests/ui/consts/const-integer-bool-ops.stderr index 4e503e5a5c0..d58a8e93ff6 100644 --- a/tests/ui/consts/const-integer-bool-ops.stderr +++ b/tests/ui/consts/const-integer-bool-ops.stderr @@ -16,6 +16,12 @@ error[E0308]: mismatched types LL | const X: usize = 42 && 39; | ^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:8:18 + | +LL | const ARR: [i32; X] = [99; 34]; + | ^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:10:19 | @@ -34,6 +40,12 @@ error[E0308]: mismatched types LL | const X1: usize = 42 || 39; | ^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:17:19 + | +LL | const ARR1: [i32; X1] = [99; 47]; + | ^^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:19:19 | @@ -52,6 +64,12 @@ error[E0308]: mismatched types LL | const X2: usize = -42 || -39; | ^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:26:19 + | +LL | const ARR2: [i32; X2] = [99; 18446744073709551607]; + | ^^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:28:19 | @@ -70,42 +88,84 @@ error[E0308]: mismatched types LL | const X3: usize = -42 && -39; | ^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:35:19 + | +LL | const ARR3: [i32; X3] = [99; 6]; + | ^^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:37:18 | LL | const Y: usize = 42.0 == 42.0; | ^^^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:40:19 + | +LL | const ARRR: [i32; Y] = [99; 1]; + | ^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:42:19 | LL | const Y1: usize = 42.0 >= 42.0; | ^^^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:45:20 + | +LL | const ARRR1: [i32; Y1] = [99; 1]; + | ^^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:47:19 | LL | const Y2: usize = 42.0 <= 42.0; | ^^^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:50:20 + | +LL | const ARRR2: [i32; Y2] = [99; 1]; + | ^^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:52:19 | LL | const Y3: usize = 42.0 > 42.0; | ^^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:55:20 + | +LL | const ARRR3: [i32; Y3] = [99; 0]; + | ^^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:57:19 | LL | const Y4: usize = 42.0 < 42.0; | ^^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:60:20 + | +LL | const ARRR4: [i32; Y4] = [99; 0]; + | ^^ + error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:62:19 | LL | const Y5: usize = 42.0 != 42.0; | ^^^^^^^^^^^^ expected `usize`, found `bool` +note: erroneous constant encountered + --> $DIR/const-integer-bool-ops.rs:65:20 + | +LL | const ARRR5: [i32; Y5] = [99; 0]; + | ^^ + error: aborting due to 18 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/consts/const-match-check.eval1.stderr b/tests/ui/consts/const-match-check.eval1.stderr index 84890214861..b1827009d2a 100644 --- a/tests/ui/consts/const-match-check.eval1.stderr +++ b/tests/ui/consts/const-match-check.eval1.stderr @@ -5,7 +5,7 @@ LL | A = { let 0 = 0; 0 }, | ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | diff --git a/tests/ui/consts/const-match-check.eval2.stderr b/tests/ui/consts/const-match-check.eval2.stderr index 0aa12eb86dd..04ac58bfe40 100644 --- a/tests/ui/consts/const-match-check.eval2.stderr +++ b/tests/ui/consts/const-match-check.eval2.stderr @@ -5,7 +5,7 @@ LL | let x: [i32; { let 0 = 0; 0 }] = []; | ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | diff --git a/tests/ui/consts/const-match-check.matchck.stderr b/tests/ui/consts/const-match-check.matchck.stderr index bcca4c2a647..05ddc4c8219 100644 --- a/tests/ui/consts/const-match-check.matchck.stderr +++ b/tests/ui/consts/const-match-check.matchck.stderr @@ -5,7 +5,7 @@ LL | const X: i32 = { let 0 = 0; 0 }; | ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | @@ -23,7 +23,7 @@ LL | static Y: i32 = { let 0 = 0; 0 }; | ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | @@ -41,7 +41,7 @@ LL | const X: i32 = { let 0 = 0; 0 }; | ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | @@ -59,7 +59,7 @@ LL | const X: i32 = { let 0 = 0; 0 }; | ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | diff --git a/tests/ui/consts/const-mut-refs/issue-76510.stderr b/tests/ui/consts/const-mut-refs/issue-76510.stderr index aff86e83578..a63be676fda 100644 --- a/tests/ui/consts/const-mut-refs/issue-76510.stderr +++ b/tests/ui/consts/const-mut-refs/issue-76510.stderr @@ -4,6 +4,12 @@ error[E0764]: mutable references are not allowed in the final value of constants LL | const S: &'static mut str = &mut " hello "; | ^^^^^^^^^^^^^^ +note: erroneous constant encountered + --> $DIR/issue-76510.rs:7:70 + | +LL | let s = transmute::<(*const u8, usize), &ManuallyDrop<str>>((S.as_ptr(), 3)); + | ^ + error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0764`. diff --git a/tests/ui/consts/const-pattern-irrefutable.stderr b/tests/ui/consts/const-pattern-irrefutable.stderr index afb67a3a118..646426c9426 100644 --- a/tests/ui/consts/const-pattern-irrefutable.stderr +++ b/tests/ui/consts/const-pattern-irrefutable.stderr @@ -8,7 +8,7 @@ LL | let a = 4; | ^ patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `u8` help: introduce a variable instead | @@ -25,7 +25,7 @@ LL | let c = 4; | ^ patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `u8` help: introduce a variable instead | @@ -42,7 +42,7 @@ LL | let d = (4, 4); | ^ patterns `(0_u8..=1_u8, _)` and `(3_u8..=u8::MAX, _)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `(u8, u8)` help: introduce a variable instead | @@ -59,7 +59,7 @@ LL | let e = S { | ^ pattern `S { foo: 1_u8..=u8::MAX }` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `S` defined here --> $DIR/const-pattern-irrefutable.rs:15:8 | diff --git a/tests/ui/consts/const-size_of_val-align_of_val-extern-type.rs b/tests/ui/consts/const-size_of_val-align_of_val-extern-type.rs index 4df3a793b4c..598904d3c44 100644 --- a/tests/ui/consts/const-size_of_val-align_of_val-extern-type.rs +++ b/tests/ui/consts/const-size_of_val-align_of_val-extern-type.rs @@ -1,6 +1,5 @@ #![feature(extern_types)] #![feature(core_intrinsics)] -#![feature(const_size_of_val, const_align_of_val)] use std::intrinsics::{min_align_of_val, size_of_val}; diff --git a/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr b/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr index ad2de0f4d31..4c0252123a4 100644 --- a/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr +++ b/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr @@ -1,11 +1,11 @@ error[E0080]: evaluation of constant value failed - --> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31 + --> $DIR/const-size_of_val-align_of_val-extern-type.rs:10:31 | LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout error[E0080]: evaluation of constant value failed - --> $DIR/const-size_of_val-align_of_val-extern-type.rs:12:32 + --> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:32 | LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout diff --git a/tests/ui/consts/const-size_of_val-align_of_val.rs b/tests/ui/consts/const-size_of_val-align_of_val.rs index ee9dfca0170..d4b5a903517 100644 --- a/tests/ui/consts/const-size_of_val-align_of_val.rs +++ b/tests/ui/consts/const-size_of_val-align_of_val.rs @@ -1,7 +1,6 @@ //@ run-pass -#![feature(const_size_of_val, const_align_of_val)] -#![feature(const_size_of_val_raw, const_align_of_val_raw, layout_for_ptr)] +#![feature(layout_for_ptr)] use std::{mem, ptr}; diff --git a/tests/ui/consts/const-struct-offsets.rs b/tests/ui/consts/const-struct-offsets.rs index ee97fe3cab9..491b7095b70 100644 --- a/tests/ui/consts/const-struct-offsets.rs +++ b/tests/ui/consts/const-struct-offsets.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![allow(non_upper_case_globals)] enum Foo { diff --git a/tests/ui/consts/const-try-feature-gate.rs b/tests/ui/consts/const-try-feature-gate.rs index 1cc045bf612..09985079e8e 100644 --- a/tests/ui/consts/const-try-feature-gate.rs +++ b/tests/ui/consts/const-try-feature-gate.rs @@ -2,9 +2,8 @@ const fn t() -> Option<()> { Some(())?; - //~^ error: `?` is not allowed in a `const fn` - //~| ERROR: cannot convert - //~| ERROR: cannot determine + //~^ ERROR `?` is not allowed + //~| ERROR `?` is not allowed None } diff --git a/tests/ui/consts/const-try-feature-gate.stderr b/tests/ui/consts/const-try-feature-gate.stderr index dc1dabc2f4f..0ad19d05b38 100644 --- a/tests/ui/consts/const-try-feature-gate.stderr +++ b/tests/ui/consts/const-try-feature-gate.stderr @@ -1,34 +1,19 @@ -error[E0658]: `?` is not allowed in a `const fn` +error[E0015]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/const-try-feature-gate.rs:4:5 | LL | Some(())?; | ^^^^^^^^^ | - = note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information - = help: add `#![feature(const_try)]` 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[E0015]: `?` cannot determine the branch of `Option<()>` in constant functions - --> $DIR/const-try-feature-gate.rs:4:5 - | -LL | Some(())?; - | ^^^^^^^^^ - | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions +error[E0015]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/const-try-feature-gate.rs:4:5 | LL | Some(())?; | ^^^^^^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0015, E0658. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/const-try.rs b/tests/ui/consts/const-try.rs index d30b22accef..26aa9230a39 100644 --- a/tests/ui/consts/const-try.rs +++ b/tests/ui/consts/const-try.rs @@ -33,8 +33,8 @@ impl const Try for TryMe { const fn t() -> TryMe { TryMe?; - //~^ ERROR `?` cannot determine the branch of `TryMe` in constant functions - //~| ERROR `?` cannot convert from residual of `TryMe` in constant functions + //~^ ERROR `?` is not allowed on + //~| ERROR `?` is not allowed on TryMe } diff --git a/tests/ui/consts/const-try.stderr b/tests/ui/consts/const-try.stderr index 1f4f814cb93..abb03a74c82 100644 --- a/tests/ui/consts/const-try.stderr +++ b/tests/ui/consts/const-try.stderr @@ -16,7 +16,7 @@ LL | impl const Try for TryMe { = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` = note: adding a non-const method body in the future would be a breaking change -error[E0015]: `?` cannot determine the branch of `TryMe` in constant functions +error[E0015]: `?` is not allowed on `TryMe` in constant functions --> $DIR/const-try.rs:35:5 | LL | TryMe?; @@ -24,7 +24,7 @@ LL | TryMe?; | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `TryMe` in constant functions +error[E0015]: `?` is not allowed on `TryMe` in constant functions --> $DIR/const-try.rs:35:5 | LL | TryMe?; diff --git a/tests/ui/consts/const-tup-index-span.stderr b/tests/ui/consts/const-tup-index-span.stderr index 792e18aa8fd..2a3f0cfb06d 100644 --- a/tests/ui/consts/const-tup-index-span.stderr +++ b/tests/ui/consts/const-tup-index-span.stderr @@ -11,6 +11,12 @@ help: use a trailing comma to create a tuple with one element LL | const TUP: (usize,) = (5usize << 64,); | + ++ +note: erroneous constant encountered + --> $DIR/const-tup-index-span.rs:6:18 + | +LL | const ARR: [i32; TUP.0] = []; + | ^^^ + error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/consts/const-unit-struct.rs b/tests/ui/consts/const-unit-struct.rs index 096cd1e8384..2dadb000f4c 100644 --- a/tests/ui/consts/const-unit-struct.rs +++ b/tests/ui/consts/const-unit-struct.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct Foo; diff --git a/tests/ui/consts/const-vec-of-fns.rs b/tests/ui/consts/const-vec-of-fns.rs index a14cb06db61..fa7eda789ef 100644 --- a/tests/ui/consts/const-vec-of-fns.rs +++ b/tests/ui/consts/const-vec-of-fns.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_upper_case_globals)] /*! diff --git a/tests/ui/consts/const-vec-syntax.rs b/tests/ui/consts/const-vec-syntax.rs index 5537a8cec90..d305d45a8cd 100644 --- a/tests/ui/consts/const-vec-syntax.rs +++ b/tests/ui/consts/const-vec-syntax.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn f(_: &[isize]) {} diff --git a/tests/ui/consts/constifconst-call-in-const-position.stderr b/tests/ui/consts/constifconst-call-in-const-position.stderr index 6add83dc52c..c778299560f 100644 --- a/tests/ui/consts/constifconst-call-in-const-position.stderr +++ b/tests/ui/consts/constifconst-call-in-const-position.stderr @@ -2,13 +2,13 @@ error[E0277]: the trait bound `T: const Tr` is not satisfied --> $DIR/constifconst-call-in-const-position.rs:17:38 | LL | const fn foo<T: ~const Tr>() -> [u8; T::a()] { - | ^^^^^^ + | ^ error[E0277]: the trait bound `T: const Tr` is not satisfied --> $DIR/constifconst-call-in-const-position.rs:18:9 | LL | [0; T::a()] - | ^^^^^^ + | ^ error: aborting due to 2 previous errors diff --git a/tests/ui/consts/control-flow/drop-fail.precise.stderr b/tests/ui/consts/control-flow/drop-fail.precise.stderr index 93b5f257efb..32afc51c3ee 100644 --- a/tests/ui/consts/control-flow/drop-fail.precise.stderr +++ b/tests/ui/consts/control-flow/drop-fail.precise.stderr @@ -1,14 +1,20 @@ error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time - --> $DIR/drop-fail.rs:8:9 + --> $DIR/drop-fail.rs:9:9 | LL | let x = Some(Vec::new()); | ^ the destructor for this type cannot be evaluated in constants +... +LL | }; + | - value is dropped here error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time - --> $DIR/drop-fail.rs:39:9 + --> $DIR/drop-fail.rs:40:9 | LL | let mut tmp = None; | ^^^^^^^ the destructor for this type cannot be evaluated in constants +... +LL | }; + | - value is dropped here error: aborting due to 2 previous errors diff --git a/tests/ui/consts/control-flow/drop-fail.rs b/tests/ui/consts/control-flow/drop-fail.rs index 25afe5d08d9..2b73e37b23d 100644 --- a/tests/ui/consts/control-flow/drop-fail.rs +++ b/tests/ui/consts/control-flow/drop-fail.rs @@ -1,5 +1,6 @@ //@ revisions: stock precise +#![feature(const_destruct)] #![cfg_attr(precise, feature(const_precise_live_drops))] // `x` is *not* always moved into the final value and may be dropped inside the initializer. diff --git a/tests/ui/consts/control-flow/drop-fail.stock.stderr b/tests/ui/consts/control-flow/drop-fail.stock.stderr index 2cc8568026e..8fe60fd7367 100644 --- a/tests/ui/consts/control-flow/drop-fail.stock.stderr +++ b/tests/ui/consts/control-flow/drop-fail.stock.stderr @@ -1,5 +1,5 @@ error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time - --> $DIR/drop-fail.rs:8:9 + --> $DIR/drop-fail.rs:9:9 | LL | let x = Some(Vec::new()); | ^ the destructor for this type cannot be evaluated in constants @@ -8,7 +8,7 @@ LL | }; | - value is dropped here error[E0493]: destructor of `(Vec<i32>,)` cannot be evaluated at compile-time - --> $DIR/drop-fail.rs:21:9 + --> $DIR/drop-fail.rs:22:9 | LL | let vec_tuple = (Vec::new(),); | ^^^^^^^^^ the destructor for this type cannot be evaluated in constants @@ -17,7 +17,7 @@ LL | }; | - value is dropped here error[E0493]: destructor of `Result<Vec<i32>, Vec<i32>>` cannot be evaluated at compile-time - --> $DIR/drop-fail.rs:29:9 + --> $DIR/drop-fail.rs:30:9 | LL | let x: Result<_, Vec<i32>> = Ok(Vec::new()); | ^ the destructor for this type cannot be evaluated in constants @@ -26,7 +26,7 @@ LL | }; | - value is dropped here error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time - --> $DIR/drop-fail.rs:39:9 + --> $DIR/drop-fail.rs:40:9 | LL | let mut tmp = None; | ^^^^^^^ the destructor for this type cannot be evaluated in constants diff --git a/tests/ui/consts/control-flow/loop.rs b/tests/ui/consts/control-flow/loop.rs index f8d9f3ddb9b..b02c31c4c25 100644 --- a/tests/ui/consts/control-flow/loop.rs +++ b/tests/ui/consts/control-flow/loop.rs @@ -50,15 +50,15 @@ const _: i32 = { const _: i32 = { let mut x = 0; - for i in 0..4 { //~ ERROR `for` is not allowed in a `const` - //~^ ERROR: cannot call - //~| ERROR: cannot convert + for i in 0..4 { + //~^ ERROR: cannot use `for` + //~| ERROR: cannot use `for` x += i; } - for i in 0..4 { //~ ERROR `for` is not allowed in a `const` - //~^ ERROR: cannot call - //~| ERROR: cannot convert + for i in 0..4 { + //~^ ERROR: cannot use `for` + //~| ERROR: cannot use `for` x += i; } diff --git a/tests/ui/consts/control-flow/loop.stderr b/tests/ui/consts/control-flow/loop.stderr index 5e43c70e9df..b91371f9dc2 100644 --- a/tests/ui/consts/control-flow/loop.stderr +++ b/tests/ui/consts/control-flow/loop.stderr @@ -1,68 +1,37 @@ -error[E0658]: `for` is not allowed in a `const` - --> $DIR/loop.rs:53:5 - | -LL | / for i in 0..4 { -LL | | -LL | | -LL | | x += i; -LL | | } - | |_____^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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]: `for` is not allowed in a `const` - --> $DIR/loop.rs:59:5 - | -LL | / for i in 0..4 { -LL | | -LL | | -LL | | x += i; -LL | | } - | |_____^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/loop.rs:53:14 | LL | for i in 0..4 { | ^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants -error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/loop.rs:53:14 | LL | for i in 0..4 { | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/loop.rs:59:14 | LL | for i in 0..4 { | ^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants -error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants +error[E0015]: cannot use `for` loop on `std::ops::Range<i32>` in constants --> $DIR/loop.rs:59:14 | LL | for i in 0..4 { | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 6 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0015, E0658. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/control-flow/try.rs b/tests/ui/consts/control-flow/try.rs index 5c6957df405..67083e1a39b 100644 --- a/tests/ui/consts/control-flow/try.rs +++ b/tests/ui/consts/control-flow/try.rs @@ -3,9 +3,9 @@ const fn opt() -> Option<i32> { let x = Some(2); - x?; //~ ERROR `?` is not allowed in a `const fn` - //~^ ERROR: cannot convert - //~| ERROR: cannot determine + x?; + //~^ ERROR: `?` is not allowed + //~| ERROR: `?` is not allowed None } diff --git a/tests/ui/consts/control-flow/try.stderr b/tests/ui/consts/control-flow/try.stderr index 5e2c77318e7..62a3e3ce6bc 100644 --- a/tests/ui/consts/control-flow/try.stderr +++ b/tests/ui/consts/control-flow/try.stderr @@ -1,34 +1,19 @@ -error[E0658]: `?` is not allowed in a `const fn` +error[E0015]: `?` is not allowed on `Option<i32>` in constant functions --> $DIR/try.rs:6:5 | LL | x?; | ^^ | - = note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information - = help: add `#![feature(const_try)]` 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[E0015]: `?` cannot determine the branch of `Option<i32>` in constant functions - --> $DIR/try.rs:6:5 - | -LL | x?; - | ^^ - | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `Option<i32>` in constant functions +error[E0015]: `?` is not allowed on `Option<i32>` in constant functions --> $DIR/try.rs:6:5 | LL | x?; | ^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0015, E0658. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/drop_zst.stderr b/tests/ui/consts/drop_zst.stderr index e3c6785290d..4d1af7ef935 100644 --- a/tests/ui/consts/drop_zst.stderr +++ b/tests/ui/consts/drop_zst.stderr @@ -3,6 +3,8 @@ error[E0493]: destructor of `S` cannot be evaluated at compile-time | LL | let s = S; | ^ the destructor for this type cannot be evaluated in constant functions +LL | } + | - value is dropped here error: aborting due to 1 previous error diff --git a/tests/ui/consts/fn_trait_refs.rs b/tests/ui/consts/fn_trait_refs.rs index 4defe4dedc7..af233efd738 100644 --- a/tests/ui/consts/fn_trait_refs.rs +++ b/tests/ui/consts/fn_trait_refs.rs @@ -5,6 +5,7 @@ #![feature(unboxed_closures)] #![feature(const_trait_impl)] #![feature(const_cmp)] +#![feature(const_destruct)] use std::marker::Destruct; diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr index a686bc23c0f..11e13c3efdd 100644 --- a/tests/ui/consts/fn_trait_refs.stderr +++ b/tests/ui/consts/fn_trait_refs.stderr @@ -11,19 +11,13 @@ LL | #![feature(const_cmp)] | ^^^^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:8 + --> $DIR/fn_trait_refs.rs:14:8 | LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:24 - | -LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:8 + --> $DIR/fn_trait_refs.rs:14:8 | LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ @@ -31,7 +25,7 @@ LL | T: ~const Fn<()> + ~const Destruct, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:8 + --> $DIR/fn_trait_refs.rs:14:8 | LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ @@ -39,27 +33,13 @@ LL | T: ~const Fn<()> + ~const Destruct, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:24 - | -LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:8 + --> $DIR/fn_trait_refs.rs:21:8 | LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:27 - | -LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:8 + --> $DIR/fn_trait_refs.rs:21:8 | LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^ @@ -67,7 +47,7 @@ LL | T: ~const FnMut<()> + ~const Destruct, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:8 + --> $DIR/fn_trait_refs.rs:21:8 | LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^ @@ -75,21 +55,13 @@ LL | T: ~const FnMut<()> + ~const Destruct, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:27 - | -LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:27:8 + --> $DIR/fn_trait_refs.rs:28:8 | LL | T: ~const FnOnce<()>, | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:27:8 + --> $DIR/fn_trait_refs.rs:28:8 | LL | T: ~const FnOnce<()>, | ^^^^^^ @@ -97,7 +69,7 @@ LL | T: ~const FnOnce<()>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:27:8 + --> $DIR/fn_trait_refs.rs:28:8 | LL | T: ~const FnOnce<()>, | ^^^^^^ @@ -105,19 +77,13 @@ LL | T: ~const FnOnce<()>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:8 + --> $DIR/fn_trait_refs.rs:35:8 | LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:24 - | -LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:8 + --> $DIR/fn_trait_refs.rs:35:8 | LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ @@ -125,7 +91,7 @@ LL | T: ~const Fn<()> + ~const Destruct, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:8 + --> $DIR/fn_trait_refs.rs:35:8 | LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ @@ -133,27 +99,13 @@ LL | T: ~const Fn<()> + ~const Destruct, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:24 - | -LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:8 + --> $DIR/fn_trait_refs.rs:49:8 | LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:27 - | -LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:8 + --> $DIR/fn_trait_refs.rs:49:8 | LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^ @@ -161,39 +113,100 @@ LL | T: ~const FnMut<()> + ~const Destruct, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:8 + --> $DIR/fn_trait_refs.rs:49:8 | LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:27 +error[E0277]: the trait bound `fn() -> i32 {one}: const Destruct` is not satisfied + --> $DIR/fn_trait_refs.rs:70:32 + | +LL | let test_one = test_fn(one); + | ------- ^^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `test_fn` + --> $DIR/fn_trait_refs.rs:35:24 + | +LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output) + | ------- required by a bound in this function +LL | where +LL | T: ~const Fn<()> + ~const Destruct, + | ^^^^^^ required by this bound in `test_fn` + +error[E0277]: the trait bound `fn() -> i32 {two}: const Destruct` is not satisfied + --> $DIR/fn_trait_refs.rs:73:36 + | +LL | let test_two = test_fn_mut(two); + | ----------- ^^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `test_fn_mut` + --> $DIR/fn_trait_refs.rs:49:27 | +LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output) + | ----------- required by a bound in this function +LL | where LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^ + | ^^^^^^ required by this bound in `test_fn_mut` + +error[E0277]: the trait bound `&T: ~const Destruct` is not satisfied + --> $DIR/fn_trait_refs.rs:39:19 | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +LL | tester_fn(&f), + | --------- ^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `tester_fn` + --> $DIR/fn_trait_refs.rs:14:24 + | +LL | const fn tester_fn<T>(f: T) -> T::Output + | --------- required by a bound in this function +LL | where +LL | T: ~const Fn<()> + ~const Destruct, + | ^^^^^^ required by this bound in `tester_fn` -error[E0015]: cannot call non-const operator in constants - --> $DIR/fn_trait_refs.rs:70:17 +error[E0277]: the trait bound `&T: ~const Destruct` is not satisfied + --> $DIR/fn_trait_refs.rs:41:23 + | +LL | tester_fn_mut(&f), + | ------------- ^^ + | | + | required by a bound introduced by this call | -LL | assert!(test_one == (1, 1, 1)); - | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `tester_fn_mut` + --> $DIR/fn_trait_refs.rs:21:27 | - = note: calls in constants are limited to constant functions, tuple structs and tuple variants +LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output + | ------------- required by a bound in this function +LL | where +LL | T: ~const FnMut<()> + ~const Destruct, + | ^^^^^^ required by this bound in `tester_fn_mut` -error[E0015]: cannot call non-const operator in constants - --> $DIR/fn_trait_refs.rs:73:17 +error[E0277]: the trait bound `&mut T: ~const Destruct` is not satisfied + --> $DIR/fn_trait_refs.rs:53:23 + | +LL | tester_fn_mut(&mut f), + | ------------- ^^^^^^ + | | + | required by a bound introduced by this call | -LL | assert!(test_two == (2, 2)); - | ^^^^^^^^^^^^^^^^^^ +note: required by a bound in `tester_fn_mut` + --> $DIR/fn_trait_refs.rs:21:27 | - = note: calls in constants are limited to constant functions, tuple structs and tuple variants +LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output + | ------------- required by a bound in this function +LL | where +LL | T: ~const FnMut<()> + ~const Destruct, + | ^^^^^^ required by this bound in `tester_fn_mut` error[E0015]: cannot call non-const closure in constant functions - --> $DIR/fn_trait_refs.rs:15:5 + --> $DIR/fn_trait_refs.rs:16:5 | LL | f() | ^^^ @@ -204,17 +217,8 @@ help: consider further restricting this bound LL | T: ~const Fn<()> + ~const Destruct + ~const Fn(), | +++++++++++++ -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/fn_trait_refs.rs:11:23 - | -LL | const fn tester_fn<T>(f: T) -> T::Output - | ^ the destructor for this type cannot be evaluated in constant functions -... -LL | } - | - value is dropped here - error[E0015]: cannot call non-const closure in constant functions - --> $DIR/fn_trait_refs.rs:22:5 + --> $DIR/fn_trait_refs.rs:23:5 | LL | f() | ^^^ @@ -225,17 +229,8 @@ help: consider further restricting this bound LL | T: ~const FnMut<()> + ~const Destruct + ~const FnMut(), | ++++++++++++++++ -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/fn_trait_refs.rs:18:27 - | -LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output - | ^^^^^ the destructor for this type cannot be evaluated in constant functions -... -LL | } - | - value is dropped here - error[E0015]: cannot call non-const closure in constant functions - --> $DIR/fn_trait_refs.rs:29:5 + --> $DIR/fn_trait_refs.rs:30:5 | LL | f() | ^^^ @@ -246,25 +241,7 @@ help: consider further restricting this bound LL | T: ~const FnOnce<()> + ~const FnOnce(), | +++++++++++++++++ -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/fn_trait_refs.rs:32:21 - | -LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output) - | ^^^^^ the destructor for this type cannot be evaluated in constant functions -... -LL | } - | - value is dropped here - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/fn_trait_refs.rs:46:25 - | -LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output) - | ^^^^^ the destructor for this type cannot be evaluated in constant functions -... -LL | } - | - value is dropped here - -error: aborting due to 34 previous errors +error: aborting due to 25 previous errors -Some errors have detailed explanations: E0015, E0493, E0635. +Some errors have detailed explanations: E0015, E0277, E0635. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/issue-13837.rs b/tests/ui/consts/issue-13837.rs index 305512cc41c..85e278539b2 100644 --- a/tests/ui/consts/issue-13837.rs +++ b/tests/ui/consts/issue-13837.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct TestStruct { x: *const [isize; 2] diff --git a/tests/ui/consts/issue-36163.stderr b/tests/ui/consts/issue-36163.stderr index 52d3e003f0a..8a7a0981f41 100644 --- a/tests/ui/consts/issue-36163.stderr +++ b/tests/ui/consts/issue-36163.stderr @@ -1,10 +1,10 @@ -error[E0391]: cycle detected when simplifying constant for the type system `Foo::{constant#0}` +error[E0391]: cycle detected when simplifying constant for the type system `Foo::B::{constant#0}` --> $DIR/issue-36163.rs:4:9 | LL | B = A, | ^ | -note: ...which requires const-evaluating + checking `Foo::{constant#0}`... +note: ...which requires const-evaluating + checking `Foo::B::{constant#0}`... --> $DIR/issue-36163.rs:4:9 | LL | B = A, @@ -19,7 +19,7 @@ note: ...which requires const-evaluating + checking `A`... | LL | const A: isize = Foo::B as isize; | ^^^^^^^^^^^^^^^ - = note: ...which again requires simplifying constant for the type system `Foo::{constant#0}`, completing the cycle + = note: ...which again requires simplifying constant for the type system `Foo::B::{constant#0}`, completing the cycle note: cycle used when checking that `Foo` is well-formed --> $DIR/issue-36163.rs:3:1 | diff --git a/tests/ui/consts/issue-54954.stderr b/tests/ui/consts/issue-54954.stderr index b8c983eb7b8..ed6aa9c44a3 100644 --- a/tests/ui/consts/issue-54954.stderr +++ b/tests/ui/consts/issue-54954.stderr @@ -19,6 +19,24 @@ LL | | core::mem::size_of::<T>() LL | | } | |_____- `Tt::const_val` defined here +note: erroneous constant encountered + --> $DIR/issue-54954.rs:11:15 + | +LL | fn f(z: [f32; ARR_LEN]) -> [f32; ARR_LEN] { + | ^^^^^^^ + +note: erroneous constant encountered + --> $DIR/issue-54954.rs:11:34 + | +LL | fn f(z: [f32; ARR_LEN]) -> [f32; ARR_LEN] { + | ^^^^^^^ + +note: erroneous constant encountered + --> $DIR/issue-54954.rs:16:22 + | +LL | let _ = f([1f32; ARR_LEN]); + | ^^^^^^^ + error: aborting due to 2 previous errors Some errors have detailed explanations: E0379, E0790. diff --git a/tests/ui/consts/missing_assoc_const_type2.stderr b/tests/ui/consts/missing_assoc_const_type2.stderr index 1255ca2d102..3279a077464 100644 --- a/tests/ui/consts/missing_assoc_const_type2.stderr +++ b/tests/ui/consts/missing_assoc_const_type2.stderr @@ -4,5 +4,11 @@ error: missing type for `const` item LL | const FIRST: = 10; | ^ help: provide a type for the associated constant: `u8` +note: erroneous constant encountered + --> $DIR/missing_assoc_const_type2.rs:18:5 + | +LL | TwoDigits::FIRST as usize + | ^^^^^^^^^^^^^^^^ + error: aborting due to 1 previous error diff --git a/tests/ui/consts/missing_span_in_backtrace.rs b/tests/ui/consts/missing_span_in_backtrace.rs index ea457c96f15..703cc7fbf89 100644 --- a/tests/ui/consts/missing_span_in_backtrace.rs +++ b/tests/ui/consts/missing_span_in_backtrace.rs @@ -1,7 +1,7 @@ //@ compile-flags: -Z ui-testing=no -#![feature(const_swap)] +#![feature(const_swap_nonoverlapping)] use std::{ mem::{self, MaybeUninit}, ptr, diff --git a/tests/ui/consts/promoted-const-drop.rs b/tests/ui/consts/promoted-const-drop.rs index c6ea0d0c924..e09c30ea785 100644 --- a/tests/ui/consts/promoted-const-drop.rs +++ b/tests/ui/consts/promoted-const-drop.rs @@ -3,7 +3,6 @@ struct A(); impl const Drop for A { - //~^ ERROR const `impl` for trait `Drop` which is not marked with `#[const_trait]` fn drop(&mut self) {} } diff --git a/tests/ui/consts/promoted-const-drop.stderr b/tests/ui/consts/promoted-const-drop.stderr index e015f756206..3f2182e7d41 100644 --- a/tests/ui/consts/promoted-const-drop.stderr +++ b/tests/ui/consts/promoted-const-drop.stderr @@ -1,14 +1,5 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/promoted-const-drop.rs:5:12 - | -LL | impl const Drop for A { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0716]: temporary value dropped while borrowed - --> $DIR/promoted-const-drop.rs:13:26 + --> $DIR/promoted-const-drop.rs:12:26 | LL | let _: &'static A = &A(); | ---------- ^^^ creates a temporary value which is freed while still in use @@ -19,7 +10,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0716]: temporary value dropped while borrowed - --> $DIR/promoted-const-drop.rs:14:28 + --> $DIR/promoted-const-drop.rs:13:28 | LL | let _: &'static [A] = &[C]; | ------------ ^^^ creates a temporary value which is freed while still in use @@ -28,6 +19,6 @@ LL | let _: &'static [A] = &[C]; LL | } | - temporary value is freed at the end of this statement -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0716`. diff --git a/tests/ui/consts/promoted_const_call.stderr b/tests/ui/consts/promoted_const_call.stderr index bcb9dfb704b..dd70bb601c4 100644 --- a/tests/ui/consts/promoted_const_call.stderr +++ b/tests/ui/consts/promoted_const_call.stderr @@ -1,31 +1,10 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/promoted_const_call.rs:6:12 - | -LL | impl const Drop for Panic { fn drop(&mut self) { panic!(); } } - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0716]: temporary value dropped while borrowed - --> $DIR/promoted_const_call.rs:10:26 - | -LL | let _: &'static _ = &id(&Panic); - | ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use - | | - | type annotation requires that borrow lasts for `'static` -... -LL | }; - | - temporary value is freed at the end of this statement - -error[E0716]: temporary value dropped while borrowed +error[E0493]: destructor of `Panic` cannot be evaluated at compile-time --> $DIR/promoted_const_call.rs:10:30 | LL | let _: &'static _ = &id(&Panic); - | ---------- ^^^^^ - temporary value is freed at the end of this statement - | | | - | | creates a temporary value which is freed while still in use - | type annotation requires that borrow lasts for `'static` + | ^^^^^ - value is dropped here + | | + | the destructor for this type cannot be evaluated in constants error[E0716]: temporary value dropped while borrowed --> $DIR/promoted_const_call.rs:16:26 @@ -69,6 +48,7 @@ LL | let _: &'static _ = &&(Panic, 0).1; LL | } | - temporary value is freed at the end of this statement -error: aborting due to 7 previous errors +error: aborting due to 5 previous errors -For more information about this error, try `rustc --explain E0716`. +Some errors have detailed explanations: E0493, E0716. +For more information about an error, try `rustc --explain E0493`. diff --git a/tests/ui/consts/promoted_const_call2.stderr b/tests/ui/consts/promoted_const_call2.stderr index 177f7aed17d..bdb43385d20 100644 --- a/tests/ui/consts/promoted_const_call2.stderr +++ b/tests/ui/consts/promoted_const_call2.stderr @@ -22,7 +22,9 @@ error[E0493]: destructor of `String` cannot be evaluated at compile-time --> $DIR/promoted_const_call2.rs:4:30 | LL | let _: &'static _ = &id(&String::new()); - | ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants + | ^^^^^^^^^^^^^ - value is dropped here + | | + | the destructor for this type cannot be evaluated in constants error[E0716]: temporary value dropped while borrowed --> $DIR/promoted_const_call2.rs:11:26 diff --git a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr index 50e920f05f9..f5d767efceb 100644 --- a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr +++ b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.stderr @@ -4,12 +4,6 @@ error[E0080]: evaluation of constant value failed LL | const _: &'static Data = &Data([0; (1 << 47) - 1]); | ^^^^^^^^^^^^^^^^^^ tried to allocate more memory than available to compiler -note: erroneous constant encountered - --> $DIR/promoted_running_out_of_memory_issue-130687.rs:8:26 - | -LL | const _: &'static Data = &Data([0; (1 << 47) - 1]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/promoted_size_overflow.rs b/tests/ui/consts/promoted_size_overflow.rs new file mode 100644 index 00000000000..3d606905e78 --- /dev/null +++ b/tests/ui/consts/promoted_size_overflow.rs @@ -0,0 +1,7 @@ +//@ only-64bit +pub struct Data([u8; usize::MAX >> 2]); +const _: &'static [Data] = &[]; +//~^ERROR: evaluation of constant value failed +//~| too big for the target architecture + +fn main() {} diff --git a/tests/ui/consts/promoted_size_overflow.stderr b/tests/ui/consts/promoted_size_overflow.stderr new file mode 100644 index 00000000000..cfb8260bed0 --- /dev/null +++ b/tests/ui/consts/promoted_size_overflow.stderr @@ -0,0 +1,9 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/promoted_size_overflow.rs:3:29 + | +LL | const _: &'static [Data] = &[]; + | ^^ values of the type `[u8; 4611686018427387903]` are too big for the target architecture + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/qualif-indirect-mutation-fail.stderr b/tests/ui/consts/qualif-indirect-mutation-fail.stderr index 433dfba2257..f706b7cf699 100644 --- a/tests/ui/consts/qualif-indirect-mutation-fail.stderr +++ b/tests/ui/consts/qualif-indirect-mutation-fail.stderr @@ -3,6 +3,9 @@ error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time | LL | let mut x = None; | ^^^^^ the destructor for this type cannot be evaluated in constants +... +LL | }; + | - value is dropped here error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL @@ -26,6 +29,8 @@ error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time | LL | let _z = x; | ^^ the destructor for this type cannot be evaluated in constants +LL | }; + | - value is dropped here error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL @@ -49,42 +54,62 @@ error[E0493]: destructor of `(u32, Option<String>)` cannot be evaluated at compi | LL | let mut a: (u32, Option<String>) = (0, None); | ^^^^^ the destructor for this type cannot be evaluated in constant functions +LL | let _ = &mut a.1; +LL | } + | - value is dropped here error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time --> $DIR/qualif-indirect-mutation-fail.rs:34:9 | LL | let x: Option<T> = None; | ^ the destructor for this type cannot be evaluated in constant functions +LL | let _ = x.is_some(); +LL | } + | - value is dropped here error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time --> $DIR/qualif-indirect-mutation-fail.rs:42:9 | LL | let _y = x; | ^^ the destructor for this type cannot be evaluated in constant functions +LL | } + | - value is dropped here error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time --> $DIR/qualif-indirect-mutation-fail.rs:50:9 | LL | let mut y: Option<String> = None; | ^^^^^ the destructor for this type cannot be evaluated in constant functions +LL | std::ptr::addr_of_mut!(y); +LL | } + | - value is dropped here error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time --> $DIR/qualif-indirect-mutation-fail.rs:47:9 | LL | let mut x: Option<String> = None; | ^^^^^ the destructor for this type cannot be evaluated in constant functions +... +LL | } + | - value is dropped here error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time --> $DIR/qualif-indirect-mutation-fail.rs:60:9 | LL | let y: Option<String> = None; | ^ the destructor for this type cannot be evaluated in constant functions +LL | std::ptr::addr_of!(y); +LL | } + | - value is dropped here error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time --> $DIR/qualif-indirect-mutation-fail.rs:57:9 | LL | let x: Option<String> = None; | ^ the destructor for this type cannot be evaluated in constant functions +... +LL | } + | - value is dropped here error: aborting due to 11 previous errors diff --git a/tests/ui/consts/too_generic_eval_ice.rs b/tests/ui/consts/too_generic_eval_ice.rs index 8b3f4b714e1..0d46a4c8276 100644 --- a/tests/ui/consts/too_generic_eval_ice.rs +++ b/tests/ui/consts/too_generic_eval_ice.rs @@ -7,6 +7,7 @@ impl<A, B> Foo<A, B> { [5; Self::HOST_SIZE] == [6; 0] //~^ ERROR constant expression depends on a generic parameter //~| ERROR constant expression depends on a generic parameter + //~| ERROR constant expression depends on a generic parameter //~| ERROR can't compare `[{integer}; Self::HOST_SIZE]` with `[{integer}; 0]` } } diff --git a/tests/ui/consts/too_generic_eval_ice.stderr b/tests/ui/consts/too_generic_eval_ice.stderr index 58a61b938d6..b48be16a24c 100644 --- a/tests/ui/consts/too_generic_eval_ice.stderr +++ b/tests/ui/consts/too_generic_eval_ice.stderr @@ -7,6 +7,14 @@ LL | [5; Self::HOST_SIZE] == [6; 0] = note: this may fail depending on what value the parameter takes error: constant expression depends on a generic parameter + --> $DIR/too_generic_eval_ice.rs:7:9 + | +LL | [5; Self::HOST_SIZE] == [6; 0] + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: constant expression depends on a generic parameter --> $DIR/too_generic_eval_ice.rs:7:30 | LL | [5; Self::HOST_SIZE] == [6; 0] @@ -32,6 +40,6 @@ LL | [5; Self::HOST_SIZE] == [6; 0] `[T; N]` implements `PartialEq<[U]>` and 3 others -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/consts/try-operator.stderr b/tests/ui/consts/try-operator.stderr index 40d96ed3a10..fc37039d260 100644 --- a/tests/ui/consts/try-operator.stderr +++ b/tests/ui/consts/try-operator.stderr @@ -4,44 +4,36 @@ error[E0635]: unknown feature `const_convert` LL | #![feature(const_convert)] | ^^^^^^^^^^^^^ -error[E0015]: `?` cannot determine the branch of `Result<(), ()>` in constant functions +error[E0015]: `?` is not allowed on `Result<(), ()>` in constant functions --> $DIR/try-operator.rs:10:9 | LL | Err(())?; | ^^^^^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/result.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `Result<bool, ()>` in constant functions +error[E0015]: `?` is not allowed on `Result<bool, ()>` in constant functions --> $DIR/try-operator.rs:10:9 | LL | Err(())?; | ^^^^^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/result.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot determine the branch of `Option<()>` in constant functions +error[E0015]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/try-operator.rs:18:9 | LL | None?; | ^^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions +error[E0015]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/try-operator.rs:18:9 | LL | None?; | ^^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants error: aborting due to 5 previous errors diff --git a/tests/ui/consts/uninhabited-const-issue-61744.rs b/tests/ui/consts/uninhabited-const-issue-61744.rs index 6168268bfed..19ee842c36b 100644 --- a/tests/ui/consts/uninhabited-const-issue-61744.rs +++ b/tests/ui/consts/uninhabited-const-issue-61744.rs @@ -5,15 +5,15 @@ pub const unsafe fn fake_type<T>() -> T { } pub const unsafe fn hint_unreachable() -> ! { - fake_type() + fake_type() //~ inside } trait Const { - const CONSTANT: i32 = unsafe { fake_type() }; + const CONSTANT: i32 = unsafe { fake_type() }; //~ inside } impl<T> Const for T {} pub fn main() -> () { - dbg!(i32::CONSTANT); //~ constant + dbg!(i32::CONSTANT); } diff --git a/tests/ui/consts/uninhabited-const-issue-61744.stderr b/tests/ui/consts/uninhabited-const-issue-61744.stderr index c6dd11ee5db..7575ad730b3 100644 --- a/tests/ui/consts/uninhabited-const-issue-61744.stderr +++ b/tests/ui/consts/uninhabited-const-issue-61744.stderr @@ -645,20 +645,6 @@ note: inside `<i32 as Const>::CONSTANT` LL | const CONSTANT: i32 = unsafe { fake_type() }; | ^^^^^^^^^^^ -note: erroneous constant encountered - --> $DIR/uninhabited-const-issue-61744.rs:18:10 - | -LL | dbg!(i32::CONSTANT); - | ^^^^^^^^^^^^^ - -note: erroneous constant encountered - --> $DIR/uninhabited-const-issue-61744.rs:18:10 - | -LL | dbg!(i32::CONSTANT); - | ^^^^^^^^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/coroutine/async-gen-deduce-yield.rs b/tests/ui/coroutine/async-gen-deduce-yield.rs index aee920e9773..f85e4a52e9b 100644 --- a/tests/ui/coroutine/async-gen-deduce-yield.rs +++ b/tests/ui/coroutine/async-gen-deduce-yield.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 -Zunstable-options +//@ compile-flags: --edition 2024 //@ check-pass #![feature(async_iterator, gen_blocks)] diff --git a/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs b/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs index 62b9bafcd60..3875e26b544 100644 --- a/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs +++ b/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 -Zunstable-options +//@ compile-flags: --edition 2024 //@ check-pass #![feature(async_iterator, gen_blocks, noop_waker)] diff --git a/tests/ui/coroutine/async_gen_fn.none.stderr b/tests/ui/coroutine/async_gen_fn.none.stderr index 047f4d82486..2fc7419ab1c 100644 --- a/tests/ui/coroutine/async_gen_fn.none.stderr +++ b/tests/ui/coroutine/async_gen_fn.none.stderr @@ -4,7 +4,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async gen fn foo() {} | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` diff --git a/tests/ui/coroutine/async_gen_fn.rs b/tests/ui/coroutine/async_gen_fn.rs index e8be0434b9e..b9adeec3f40 100644 --- a/tests/ui/coroutine/async_gen_fn.rs +++ b/tests/ui/coroutine/async_gen_fn.rs @@ -1,5 +1,5 @@ //@ revisions: e2024 none -//@[e2024] compile-flags: --edition 2024 -Zunstable-options +//@[e2024] edition: 2024 async gen fn foo() {} //[none]~^ ERROR: `async fn` is not permitted in Rust 2015 diff --git a/tests/ui/coroutine/async_gen_fn_iter.rs b/tests/ui/coroutine/async_gen_fn_iter.rs index 42288712c70..3f7e7aa0ac2 100644 --- a/tests/ui/coroutine/async_gen_fn_iter.rs +++ b/tests/ui/coroutine/async_gen_fn_iter.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ run-pass #![feature(gen_blocks, async_iterator)] diff --git a/tests/ui/coroutine/break-inside-coroutine-issue-124495.rs b/tests/ui/coroutine/break-inside-coroutine-issue-124495.rs index 97c3d06c023..d0597fdd8e1 100644 --- a/tests/ui/coroutine/break-inside-coroutine-issue-124495.rs +++ b/tests/ui/coroutine/break-inside-coroutine-issue-124495.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Z unstable-options #![feature(gen_blocks)] #![feature(async_closure)] diff --git a/tests/ui/coroutine/break-inside-coroutine-issue-124495.stderr b/tests/ui/coroutine/break-inside-coroutine-issue-124495.stderr index 77dc214bcec..bdd26d39d82 100644 --- a/tests/ui/coroutine/break-inside-coroutine-issue-124495.stderr +++ b/tests/ui/coroutine/break-inside-coroutine-issue-124495.stderr @@ -1,5 +1,5 @@ error[E0267]: `break` inside `async` function - --> $DIR/break-inside-coroutine-issue-124495.rs:8:5 + --> $DIR/break-inside-coroutine-issue-124495.rs:7:5 | LL | async fn async_fn() { | ------------------- enclosing `async` function @@ -7,7 +7,7 @@ LL | break; | ^^^^^ cannot `break` inside `async` function error[E0267]: `break` inside `gen` function - --> $DIR/break-inside-coroutine-issue-124495.rs:12:5 + --> $DIR/break-inside-coroutine-issue-124495.rs:11:5 | LL | gen fn gen_fn() { | --------------- enclosing `gen` function @@ -15,7 +15,7 @@ LL | break; | ^^^^^ cannot `break` inside `gen` function error[E0267]: `break` inside `async gen` function - --> $DIR/break-inside-coroutine-issue-124495.rs:16:5 + --> $DIR/break-inside-coroutine-issue-124495.rs:15:5 | LL | async gen fn async_gen_fn() { | --------------------------- enclosing `async gen` function @@ -23,7 +23,7 @@ LL | break; | ^^^^^ cannot `break` inside `async gen` function error[E0267]: `break` inside `async` block - --> $DIR/break-inside-coroutine-issue-124495.rs:20:21 + --> $DIR/break-inside-coroutine-issue-124495.rs:19:21 | LL | let _ = async { break; }; | ----- ^^^^^ cannot `break` inside `async` block @@ -31,7 +31,7 @@ LL | let _ = async { break; }; | enclosing `async` block error[E0267]: `break` inside `async` closure - --> $DIR/break-inside-coroutine-issue-124495.rs:22:24 + --> $DIR/break-inside-coroutine-issue-124495.rs:21:24 | LL | let _ = async || { break; }; | -------- ^^^^^ cannot `break` inside `async` closure @@ -39,7 +39,7 @@ LL | let _ = async || { break; }; | enclosing `async` closure error[E0267]: `break` inside `gen` block - --> $DIR/break-inside-coroutine-issue-124495.rs:24:19 + --> $DIR/break-inside-coroutine-issue-124495.rs:23:19 | LL | let _ = gen { break; }; | --- ^^^^^ cannot `break` inside `gen` block @@ -47,7 +47,7 @@ LL | let _ = gen { break; }; | enclosing `gen` block error[E0267]: `break` inside `async gen` block - --> $DIR/break-inside-coroutine-issue-124495.rs:26:25 + --> $DIR/break-inside-coroutine-issue-124495.rs:25:25 | LL | let _ = async gen { break; }; | --------- ^^^^^ cannot `break` inside `async gen` block diff --git a/tests/ui/coroutine/const_gen_fn.rs b/tests/ui/coroutine/const_gen_fn.rs index 986693f33ab..2701139ffed 100644 --- a/tests/ui/coroutine/const_gen_fn.rs +++ b/tests/ui/coroutine/const_gen_fn.rs @@ -1,5 +1,4 @@ //@ edition:2024 -//@ compile-flags: -Zunstable-options #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/const_gen_fn.stderr b/tests/ui/coroutine/const_gen_fn.stderr index b58446ac88f..4f3c73d1678 100644 --- a/tests/ui/coroutine/const_gen_fn.stderr +++ b/tests/ui/coroutine/const_gen_fn.stderr @@ -1,5 +1,5 @@ error: functions cannot be both `const` and `gen` - --> $DIR/const_gen_fn.rs:6:1 + --> $DIR/const_gen_fn.rs:5:1 | LL | const gen fn a() {} | ^^^^^-^^^---------- @@ -8,7 +8,7 @@ LL | const gen fn a() {} | `const` because of this error: functions cannot be both `const` and `async gen` - --> $DIR/const_gen_fn.rs:9:1 + --> $DIR/const_gen_fn.rs:8:1 | LL | const async gen fn b() {} | ^^^^^-^^^^^^^^^---------- diff --git a/tests/ui/coroutine/gen_block.rs b/tests/ui/coroutine/gen_block.rs index 7e87a572b90..6734de3b667 100644 --- a/tests/ui/coroutine/gen_block.rs +++ b/tests/ui/coroutine/gen_block.rs @@ -1,5 +1,5 @@ //@ revisions: e2024 none -//@[e2024] compile-flags: --edition 2024 -Zunstable-options +//@[e2024] edition: 2024 #![cfg_attr(e2024, feature(gen_blocks))] #![feature(stmt_expr_attributes)] diff --git a/tests/ui/coroutine/gen_block_is_coro.rs b/tests/ui/coroutine/gen_block_is_coro.rs index c98e1e60388..bccc3e86ee4 100644 --- a/tests/ui/coroutine/gen_block_is_coro.rs +++ b/tests/ui/coroutine/gen_block_is_coro.rs @@ -1,4 +1,5 @@ -//@compile-flags: --edition 2024 -Zunstable-options --diagnostic-width=300 +//@ edition: 2024 +//@ compile-flags: --diagnostic-width=300 #![feature(coroutines, coroutine_trait, gen_blocks)] use std::ops::Coroutine; diff --git a/tests/ui/coroutine/gen_block_is_coro.stderr b/tests/ui/coroutine/gen_block_is_coro.stderr index 083e738f3ec..444f0eca1d5 100644 --- a/tests/ui/coroutine/gen_block_is_coro.stderr +++ b/tests/ui/coroutine/gen_block_is_coro.stderr @@ -1,26 +1,26 @@ -error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}: Coroutine` is not satisfied - --> $DIR/gen_block_is_coro.rs:6:13 +error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:8:5: 8:8}: Coroutine` is not satisfied + --> $DIR/gen_block_is_coro.rs:7:13 | LL | fn foo() -> impl Coroutine<Yield = u32, Return = ()> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:8:5: 8:8}` LL | gen { yield 42 } - | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:7:5: 7:8}` here + | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:8:5: 8:8}` here -error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:11:5: 11:8}: Coroutine` is not satisfied - --> $DIR/gen_block_is_coro.rs:10:13 +error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:12:5: 12:8}: Coroutine` is not satisfied + --> $DIR/gen_block_is_coro.rs:11:13 | LL | fn bar() -> impl Coroutine<Yield = i64, Return = ()> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:11:5: 11:8}` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:12:5: 12:8}` LL | gen { yield 42 } - | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:11:5: 11:8}` here + | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:12:5: 12:8}` here -error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:15:5: 15:8}: Coroutine` is not satisfied - --> $DIR/gen_block_is_coro.rs:14:13 +error[E0277]: the trait bound `{gen block@$DIR/gen_block_is_coro.rs:16:5: 16:8}: Coroutine` is not satisfied + --> $DIR/gen_block_is_coro.rs:15:13 | LL | fn baz() -> impl Coroutine<Yield = i32, Return = ()> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:15:5: 15:8}` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Coroutine` is not implemented for `{gen block@$DIR/gen_block_is_coro.rs:16:5: 16:8}` LL | gen { yield 42 } - | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:15:5: 15:8}` here + | ---------------- return type was inferred to be `{gen block@$DIR/gen_block_is_coro.rs:16:5: 16:8}` here error: aborting due to 3 previous errors diff --git a/tests/ui/coroutine/gen_block_is_fused_iter.rs b/tests/ui/coroutine/gen_block_is_fused_iter.rs index f3e19a7f54f..e4eab6195ee 100644 --- a/tests/ui/coroutine/gen_block_is_fused_iter.rs +++ b/tests/ui/coroutine/gen_block_is_fused_iter.rs @@ -1,5 +1,5 @@ //@ revisions: next old -//@compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 //@[next] compile-flags: -Znext-solver //@ check-pass #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/gen_block_is_iter.rs b/tests/ui/coroutine/gen_block_is_iter.rs index 396d7737132..032360fbee0 100644 --- a/tests/ui/coroutine/gen_block_is_iter.rs +++ b/tests/ui/coroutine/gen_block_is_iter.rs @@ -1,5 +1,5 @@ //@ revisions: next old -//@compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 //@[next] compile-flags: -Znext-solver //@ check-pass #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/gen_block_is_no_future.rs b/tests/ui/coroutine/gen_block_is_no_future.rs index a5bb8533719..eca8a9b6320 100644 --- a/tests/ui/coroutine/gen_block_is_no_future.rs +++ b/tests/ui/coroutine/gen_block_is_no_future.rs @@ -1,4 +1,4 @@ -//@compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 #![feature(gen_blocks)] fn foo() -> impl std::future::Future { //~ ERROR is not a future diff --git a/tests/ui/coroutine/gen_block_iterate.rs b/tests/ui/coroutine/gen_block_iterate.rs index a9cb5ef3e2c..afeb56cc2f3 100644 --- a/tests/ui/coroutine/gen_block_iterate.rs +++ b/tests/ui/coroutine/gen_block_iterate.rs @@ -1,5 +1,5 @@ //@ revisions: next old -//@compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 //@[next] compile-flags: -Znext-solver //@ run-pass #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/gen_block_move.fixed b/tests/ui/coroutine/gen_block_move.fixed index 0327ca75f9e..e58c9b3f9fe 100644 --- a/tests/ui/coroutine/gen_block_move.fixed +++ b/tests/ui/coroutine/gen_block_move.fixed @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 //@ run-rustfix #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/gen_block_move.rs b/tests/ui/coroutine/gen_block_move.rs index 53d0149872a..e249404a0a1 100644 --- a/tests/ui/coroutine/gen_block_move.rs +++ b/tests/ui/coroutine/gen_block_move.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 //@ run-rustfix #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/gen_block_panic.rs b/tests/ui/coroutine/gen_block_panic.rs index ada56a5bd6f..b6362d5046a 100644 --- a/tests/ui/coroutine/gen_block_panic.rs +++ b/tests/ui/coroutine/gen_block_panic.rs @@ -1,4 +1,4 @@ -//@compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 //@ run-pass //@ needs-unwind #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/gen_fn.rs b/tests/ui/coroutine/gen_fn.rs index d47b7e576d0..2f50d5db9ac 100644 --- a/tests/ui/coroutine/gen_fn.rs +++ b/tests/ui/coroutine/gen_fn.rs @@ -1,5 +1,5 @@ //@ revisions: e2024 none -//@[e2024] compile-flags: --edition 2024 -Zunstable-options +//@[e2024] edition: 2024 gen fn foo() {} //[none]~^ ERROR: expected one of `#`, `async`, `const`, `default`, `extern`, `fn`, `pub`, `safe`, `unsafe`, or `use`, found `gen` diff --git a/tests/ui/coroutine/gen_fn_iter.rs b/tests/ui/coroutine/gen_fn_iter.rs index ae09d678fe3..9cd75551ad4 100644 --- a/tests/ui/coroutine/gen_fn_iter.rs +++ b/tests/ui/coroutine/gen_fn_iter.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ run-pass #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/gen_fn_lifetime_capture.rs b/tests/ui/coroutine/gen_fn_lifetime_capture.rs index 517096d092e..bee6c2e8803 100644 --- a/tests/ui/coroutine/gen_fn_lifetime_capture.rs +++ b/tests/ui/coroutine/gen_fn_lifetime_capture.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ check-pass #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/other-attribute-on-gen.rs b/tests/ui/coroutine/other-attribute-on-gen.rs index 0f26dc6860d..5f4584ee022 100644 --- a/tests/ui/coroutine/other-attribute-on-gen.rs +++ b/tests/ui/coroutine/other-attribute-on-gen.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ run-pass #![feature(gen_blocks)] #![feature(optimize_attribute)] diff --git a/tests/ui/coroutine/return-types-diverge.rs b/tests/ui/coroutine/return-types-diverge.rs index 5b639eea09a..7aa8fc028ce 100644 --- a/tests/ui/coroutine/return-types-diverge.rs +++ b/tests/ui/coroutine/return-types-diverge.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 //@ check-pass #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/return-types.rs b/tests/ui/coroutine/return-types.rs index ad2080fd88b..4fecc550531 100644 --- a/tests/ui/coroutine/return-types.rs +++ b/tests/ui/coroutine/return-types.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 #![feature(gen_blocks)] diff --git a/tests/ui/coroutine/self_referential_gen_block.rs b/tests/ui/coroutine/self_referential_gen_block.rs index dccd83768c4..322cbf4f18a 100644 --- a/tests/ui/coroutine/self_referential_gen_block.rs +++ b/tests/ui/coroutine/self_referential_gen_block.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 -Zunstable-options +//@ edition: 2024 #![feature(gen_blocks)] //! This test checks that we don't allow self-referential generators diff --git a/tests/ui/crate-leading-sep.rs b/tests/ui/crate-leading-sep.rs index fbc940aed26..6f4dd0bcfd7 100644 --- a/tests/ui/crate-leading-sep.rs +++ b/tests/ui/crate-leading-sep.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dropping_copy_types)] diff --git a/tests/ui/crate-loading/auxiliary/proc-macro.rs b/tests/ui/crate-loading/auxiliary/proc-macro.rs index ad227c069d2..a87a2b243a1 100644 --- a/tests/ui/crate-loading/auxiliary/proc-macro.rs +++ b/tests/ui/crate-loading/auxiliary/proc-macro.rs @@ -1,7 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic #![crate_name = "reproduction"] -#![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/crate-loading/cross-compiled-proc-macro.rs b/tests/ui/crate-loading/cross-compiled-proc-macro.rs index 51431c05865..b727f22e188 100644 --- a/tests/ui/crate-loading/cross-compiled-proc-macro.rs +++ b/tests/ui/crate-loading/cross-compiled-proc-macro.rs @@ -1,6 +1,6 @@ //@ edition:2018 //@ compile-flags:--extern reproduction -//@ aux-build:proc-macro.rs +//@ proc-macro: proc-macro.rs //@ check-pass reproduction::mac!(); diff --git a/tests/ui/crate-method-reexport-grrrrrrr.rs b/tests/ui/crate-method-reexport-grrrrrrr.rs index 870c6851a66..aca399f4e20 100644 --- a/tests/ui/crate-method-reexport-grrrrrrr.rs +++ b/tests/ui/crate-method-reexport-grrrrrrr.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 // This is a regression test that the metadata for the // name_pool::methods impl in the other crate is reachable from this diff --git a/tests/ui/crate-name-attr-used.rs b/tests/ui/crate-name-attr-used.rs index 8e958aa0eaa..5d5a58c32c7 100644 --- a/tests/ui/crate-name-attr-used.rs +++ b/tests/ui/crate-name-attr-used.rs @@ -1,7 +1,6 @@ //@ run-pass //@ compile-flags:--crate-name crate_name_attr_used -F unused-attributes -//@ pretty-expanded FIXME #23616 #![crate_name = "crate_name_attr_used"] diff --git a/tests/ui/cross-crate/cci_capture_clause.rs b/tests/ui/cross-crate/cci_capture_clause.rs index 73e1020d7cf..22fe49c2ba0 100644 --- a/tests/ui/cross-crate/cci_capture_clause.rs +++ b/tests/ui/cross-crate/cci_capture_clause.rs @@ -4,7 +4,6 @@ // This test makes sure we can do cross-crate inlining on functions // that use capture clauses. -//@ pretty-expanded FIXME #23616 //@ needs-threads extern crate cci_capture_clause; diff --git a/tests/ui/cross-crate/cross-crate-const-pat.rs b/tests/ui/cross-crate/cross-crate-const-pat.rs index 4ff55adb804..31521089160 100644 --- a/tests/ui/cross-crate/cross-crate-const-pat.rs +++ b/tests/ui/cross-crate/cross-crate-const-pat.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:cci_const.rs -//@ pretty-expanded FIXME #23616 extern crate cci_const; diff --git a/tests/ui/cross-crate/moves-based-on-type-cross-crate.rs b/tests/ui/cross-crate/moves-based-on-type-cross-crate.rs index 640a1789cbe..3e05717326c 100644 --- a/tests/ui/cross-crate/moves-based-on-type-cross-crate.rs +++ b/tests/ui/cross-crate/moves-based-on-type-cross-crate.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:moves_based_on_type_lib.rs -//@ pretty-expanded FIXME #23616 extern crate moves_based_on_type_lib; use moves_based_on_type_lib::f; diff --git a/tests/ui/cross-crate/static-addresses.rs b/tests/ui/cross-crate/static-addresses.rs index 66ac467e9ac..2783b44671d 100644 --- a/tests/ui/cross-crate/static-addresses.rs +++ b/tests/ui/cross-crate/static-addresses.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:xcrate_static_addresses.rs -//@ pretty-expanded FIXME #23616 extern crate xcrate_static_addresses; diff --git a/tests/ui/cross-crate/trait-lifetime-param.rs b/tests/ui/cross-crate/trait-lifetime-param.rs index 28955e62d95..89983492fe4 100644 --- a/tests/ui/cross-crate/trait-lifetime-param.rs +++ b/tests/ui/cross-crate/trait-lifetime-param.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] //@ aux-build:xcrate-trait-lifetime-param.rs -//@ pretty-expanded FIXME #23616 extern crate xcrate_trait_lifetime_param as other; diff --git a/tests/ui/cross-crate/unit-struct-2.rs b/tests/ui/cross-crate/unit-struct-2.rs index c2e3a761129..2177a8800db 100644 --- a/tests/ui/cross-crate/unit-struct-2.rs +++ b/tests/ui/cross-crate/unit-struct-2.rs @@ -1,6 +1,5 @@ //@ run-pass //@ aux-build:xcrate_unit_struct.rs -//@ pretty-expanded FIXME #23616 #![allow(non_upper_case_globals)] extern crate xcrate_unit_struct; diff --git a/tests/ui/default-method-parsing.rs b/tests/ui/default-method-parsing.rs index 2580a04221f..84c3ab747c8 100644 --- a/tests/ui/default-method-parsing.rs +++ b/tests/ui/default-method-parsing.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Foo { fn m(&self, _:isize) { } diff --git a/tests/ui/deref.rs b/tests/ui/deref.rs index b491c517d94..0a6f3cc81f6 100644 --- a/tests/ui/deref.rs +++ b/tests/ui/deref.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let x: Box<isize> = Box::new(10); diff --git a/tests/ui/derives/auxiliary/derive-marker-tricky.rs b/tests/ui/derives/auxiliary/derive-marker-tricky.rs index 0f1c30811a2..f31baa43c3d 100644 --- a/tests/ui/derives/auxiliary/derive-marker-tricky.rs +++ b/tests/ui/derives/auxiliary/derive-marker-tricky.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/derives/derive-marker-tricky.rs b/tests/ui/derives/derive-marker-tricky.rs index ad03b6c2cd2..3831bd48581 100644 --- a/tests/ui/derives/derive-marker-tricky.rs +++ b/tests/ui/derives/derive-marker-tricky.rs @@ -2,7 +2,7 @@ // a built-in derive in non-trivial scope (e.g. in a nested module). //@ check-pass -//@ aux-build:derive-marker-tricky.rs +//@ proc-macro: derive-marker-tricky.rs extern crate derive_marker_tricky; diff --git a/tests/ui/deriving/auxiliary/another-proc-macro.rs b/tests/ui/deriving/auxiliary/another-proc-macro.rs index c992cde4066..47f3c5b9c4b 100644 --- a/tests/ui/deriving/auxiliary/another-proc-macro.rs +++ b/tests/ui/deriving/auxiliary/another-proc-macro.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/deriving/built-in-proc-macro-scope.rs b/tests/ui/deriving/built-in-proc-macro-scope.rs index 6c473aefc5b..e67197b7e20 100644 --- a/tests/ui/deriving/built-in-proc-macro-scope.rs +++ b/tests/ui/deriving/built-in-proc-macro-scope.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build: another-proc-macro.rs +//@ proc-macro: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_coerce_pointee)] diff --git a/tests/ui/deriving/built-in-proc-macro-scope.stdout b/tests/ui/deriving/built-in-proc-macro-scope.stdout index 07767dc229f..db97c7145ea 100644 --- a/tests/ui/deriving/built-in-proc-macro-scope.stdout +++ b/tests/ui/deriving/built-in-proc-macro-scope.stdout @@ -1,7 +1,7 @@ #![feature(prelude_import)] #![no_std] //@ check-pass -//@ aux-build: another-proc-macro.rs +//@ proc-macro: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_coerce_pointee)] diff --git a/tests/ui/deriving/deriving-clone-enum.rs b/tests/ui/deriving/deriving-clone-enum.rs index 59301c1d094..96b9ba4f24c 100644 --- a/tests/ui/deriving/deriving-clone-enum.rs +++ b/tests/ui/deriving/deriving-clone-enum.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #[derive(Clone)] enum E { diff --git a/tests/ui/deriving/deriving-clone-generic-enum.rs b/tests/ui/deriving/deriving-clone-generic-enum.rs index 7f0dd872ffd..08c91c487ba 100644 --- a/tests/ui/deriving/deriving-clone-generic-enum.rs +++ b/tests/ui/deriving/deriving-clone-generic-enum.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #[derive(Clone)] enum E<T,U> { diff --git a/tests/ui/deriving/deriving-clone-generic-struct.rs b/tests/ui/deriving/deriving-clone-generic-struct.rs index cbdfa8a7c9a..f2fc6d5e4d7 100644 --- a/tests/ui/deriving/deriving-clone-generic-struct.rs +++ b/tests/ui/deriving/deriving-clone-generic-struct.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs b/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs index f0bbce707f3..178075e273d 100644 --- a/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs +++ b/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #[derive(Clone)] #[allow(dead_code)] diff --git a/tests/ui/deriving/deriving-clone-struct.rs b/tests/ui/deriving/deriving-clone-struct.rs index b357aa82a2a..896ce51bf3d 100644 --- a/tests/ui/deriving/deriving-clone-struct.rs +++ b/tests/ui/deriving/deriving-clone-struct.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/deriving/deriving-clone-tuple-struct.rs b/tests/ui/deriving/deriving-clone-tuple-struct.rs index 727860465fc..622ffb7b1f4 100644 --- a/tests/ui/deriving/deriving-clone-tuple-struct.rs +++ b/tests/ui/deriving/deriving-clone-tuple-struct.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/deriving/deriving-enum-single-variant.rs b/tests/ui/deriving/deriving-enum-single-variant.rs index dfdfef01298..43d229c442c 100644 --- a/tests/ui/deriving/deriving-enum-single-variant.rs +++ b/tests/ui/deriving/deriving-enum-single-variant.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] pub type task_id = isize; diff --git a/tests/ui/deriving/deriving-in-macro.rs b/tests/ui/deriving/deriving-in-macro.rs index e86b40d30dc..493c1415c7f 100644 --- a/tests/ui/deriving/deriving-in-macro.rs +++ b/tests/ui/deriving/deriving-in-macro.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] macro_rules! define_vec { diff --git a/tests/ui/deriving/deriving-meta-multiple.rs b/tests/ui/deriving/deriving-meta-multiple.rs index 07dabd9e9c3..7c2d3566fbf 100644 --- a/tests/ui/deriving/deriving-meta-multiple.rs +++ b/tests/ui/deriving/deriving-meta-multiple.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_must_use)] #![allow(unused_imports)] -//@ pretty-expanded FIXME #23616 #![allow(deprecated)] use std::hash::{Hash, SipHasher}; diff --git a/tests/ui/deriving/deriving-meta.rs b/tests/ui/deriving/deriving-meta.rs index 34d31d9ef9e..70b5821edae 100644 --- a/tests/ui/deriving/deriving-meta.rs +++ b/tests/ui/deriving/deriving-meta.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_must_use)] #![allow(unused_imports)] -//@ pretty-expanded FIXME #23616 #![allow(deprecated)] use std::hash::{Hash, SipHasher}; diff --git a/tests/ui/deriving/deriving-via-extension-hash-struct.rs b/tests/ui/deriving/deriving-via-extension-hash-struct.rs index ad2a84b6bf9..2b1bc9e108b 100644 --- a/tests/ui/deriving/deriving-via-extension-hash-struct.rs +++ b/tests/ui/deriving/deriving-via-extension-hash-struct.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #[derive(Hash)] struct Foo { diff --git a/tests/ui/deriving/issue-15689-2.rs b/tests/ui/deriving/issue-15689-2.rs index 790c72f6d4d..a1f66cc0643 100644 --- a/tests/ui/deriving/issue-15689-2.rs +++ b/tests/ui/deriving/issue-15689-2.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #[derive(Clone)] enum Test<'a> { diff --git a/tests/ui/deriving/issue-6341.rs b/tests/ui/deriving/issue-6341.rs index 5c2d0abfa8c..83b0da9a318 100644 --- a/tests/ui/deriving/issue-6341.rs +++ b/tests/ui/deriving/issue-6341.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 #[derive(PartialEq)] struct A { x: usize } diff --git a/tests/ui/deriving/proc-macro-attribute-mixing.rs b/tests/ui/deriving/proc-macro-attribute-mixing.rs index 80a0d068ce7..2c11c3f72ca 100644 --- a/tests/ui/deriving/proc-macro-attribute-mixing.rs +++ b/tests/ui/deriving/proc-macro-attribute-mixing.rs @@ -5,7 +5,7 @@ // are in scope. //@ check-pass -//@ aux-build: another-proc-macro.rs +//@ proc-macro: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_coerce_pointee)] diff --git a/tests/ui/deriving/proc-macro-attribute-mixing.stdout b/tests/ui/deriving/proc-macro-attribute-mixing.stdout index 03128c6c957..ad743d013d2 100644 --- a/tests/ui/deriving/proc-macro-attribute-mixing.stdout +++ b/tests/ui/deriving/proc-macro-attribute-mixing.stdout @@ -7,7 +7,7 @@ // are in scope. //@ check-pass -//@ aux-build: another-proc-macro.rs +//@ proc-macro: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded #![feature(derive_coerce_pointee)] diff --git a/tests/ui/destructuring-assignment/non-exhaustive-destructure.stderr b/tests/ui/destructuring-assignment/non-exhaustive-destructure.stderr index b9ceaa4af7b..88f7d2da47c 100644 --- a/tests/ui/destructuring-assignment/non-exhaustive-destructure.stderr +++ b/tests/ui/destructuring-assignment/non-exhaustive-destructure.stderr @@ -5,7 +5,7 @@ LL | None = Some(3); | ^^^^ pattern `Some(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Option<i32>` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/tests/ui/diagnostic-width/E0271.rs b/tests/ui/diagnostic-width/E0271.rs index ce41ad2952b..dedae4365e8 100644 --- a/tests/ui/diagnostic-width/E0271.rs +++ b/tests/ui/diagnostic-width/E0271.rs @@ -1,6 +1,6 @@ //@ revisions: ascii unicode //@[ascii] compile-flags: --diagnostic-width=40 -//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode --diagnostic-width=40 +//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode --diagnostic-width=40 //@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash" trait Future { type Error; diff --git a/tests/ui/diagnostic-width/flag-human.rs b/tests/ui/diagnostic-width/flag-human.rs index 1af41659141..8e656293b41 100644 --- a/tests/ui/diagnostic-width/flag-human.rs +++ b/tests/ui/diagnostic-width/flag-human.rs @@ -1,6 +1,6 @@ //@ revisions: ascii unicode //@[ascii] compile-flags: --diagnostic-width=20 -//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode --diagnostic-width=20 +//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode --diagnostic-width=20 // This test checks that `-Z output-width` effects the human error output by restricting it to an // arbitrarily low value so that the effect is visible. diff --git a/tests/ui/diagnostic-width/long-E0308.rs b/tests/ui/diagnostic-width/long-E0308.rs index 73f81f5872a..695852f83ac 100644 --- a/tests/ui/diagnostic-width/long-E0308.rs +++ b/tests/ui/diagnostic-width/long-E0308.rs @@ -1,6 +1,6 @@ //@ revisions: ascii unicode //@[ascii] compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes -//@[unicode] compile-flags: -Zunstable-options=yes --json=diagnostic-unicode --diagnostic-width=60 -Zwrite-long-types-to-disk=yes +//@[unicode] compile-flags: -Zunstable-options --json=diagnostic-unicode --diagnostic-width=60 -Zwrite-long-types-to-disk=yes //@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash" mod a { diff --git a/tests/ui/diagnostic-width/non-1-width-unicode-multiline-label.rs b/tests/ui/diagnostic-width/non-1-width-unicode-multiline-label.rs index 61c4b31e03a..e630db8ba42 100644 --- a/tests/ui/diagnostic-width/non-1-width-unicode-multiline-label.rs +++ b/tests/ui/diagnostic-width/non-1-width-unicode-multiline-label.rs @@ -1,5 +1,5 @@ //@ revisions: ascii unicode -//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode +//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode // ignore-tidy-linelength fn main() { diff --git a/tests/ui/diagnostic-width/non-whitespace-trimming-2.rs b/tests/ui/diagnostic-width/non-whitespace-trimming-2.rs index 283506bd6c9..de2f42a4a72 100644 --- a/tests/ui/diagnostic-width/non-whitespace-trimming-2.rs +++ b/tests/ui/diagnostic-width/non-whitespace-trimming-2.rs @@ -1,5 +1,5 @@ //@ revisions: ascii unicode -//@[unicode] compile-flags: -Zunstable-options=yes --error-format=human-unicode +//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode // ignore-tidy-linelength fn main() { diff --git a/tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs b/tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs index 4edae48923a..3fe84317d70 100644 --- a/tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs +++ b/tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/diagnostic_namespace/existing_proc_macros.rs b/tests/ui/diagnostic_namespace/existing_proc_macros.rs index 014ec46f1b9..55b6b0ab441 100644 --- a/tests/ui/diagnostic_namespace/existing_proc_macros.rs +++ b/tests/ui/diagnostic_namespace/existing_proc_macros.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:proc-macro-helper.rs +//@ proc-macro: proc-macro-helper.rs extern crate proc_macro_helper; diff --git a/tests/ui/double-ref.rs b/tests/ui/double-ref.rs index 62591deb868..eecf68ff209 100644 --- a/tests/ui/double-ref.rs +++ b/tests/ui/double-ref.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn check_expr() { let _: & usize = &1; diff --git a/tests/ui/drop/auxiliary/edition-2024-macros.rs b/tests/ui/drop/auxiliary/edition-2024-macros.rs index 236340bfed4..44befbc9843 100644 --- a/tests/ui/drop/auxiliary/edition-2024-macros.rs +++ b/tests/ui/drop/auxiliary/edition-2024-macros.rs @@ -1,5 +1,4 @@ //@ edition:2024 -//@ compile-flags: -Zunstable-options #[macro_export] macro_rules! edition_2024_block { diff --git a/tests/ui/drop/drop-on-empty-block-exit.rs b/tests/ui/drop/drop-on-empty-block-exit.rs index 63bc403a721..107ea9022f8 100644 --- a/tests/ui/drop/drop-on-empty-block-exit.rs +++ b/tests/ui/drop/drop-on-empty-block-exit.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] enum t { foo(Box<isize>), } diff --git a/tests/ui/drop/drop-on-ret.rs b/tests/ui/drop/drop-on-ret.rs index f8ce899adf0..4bd50e6a72d 100644 --- a/tests/ui/drop/drop-on-ret.rs +++ b/tests/ui/drop/drop-on-ret.rs @@ -2,7 +2,6 @@ -//@ pretty-expanded FIXME #23616 fn f() -> isize { if true { diff --git a/tests/ui/drop/drop-uninhabited-enum.rs b/tests/ui/drop/drop-uninhabited-enum.rs index f018ffa0977..2ac6dc8e9ea 100644 --- a/tests/ui/drop/drop-uninhabited-enum.rs +++ b/tests/ui/drop/drop-uninhabited-enum.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 enum Foo { } diff --git a/tests/ui/drop/drop_order.rs b/tests/ui/drop/drop_order.rs index 7a999c7c330..d1a5b9bc5e2 100644 --- a/tests/ui/drop/drop_order.rs +++ b/tests/ui/drop/drop_order.rs @@ -2,7 +2,6 @@ //@ compile-flags: -Z validate-mir //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 -//@ [edition2024] compile-flags: -Z unstable-options //@ [edition2024] edition: 2024 #![feature(let_chains)] diff --git a/tests/ui/drop/drop_order_if_let_rescope.rs b/tests/ui/drop/drop_order_if_let_rescope.rs index cea84bbaa2b..7445e3a6a5f 100644 --- a/tests/ui/drop/drop_order_if_let_rescope.rs +++ b/tests/ui/drop/drop_order_if_let_rescope.rs @@ -1,6 +1,6 @@ //@ run-pass //@ edition:2024 -//@ compile-flags: -Z validate-mir -Zunstable-options +//@ compile-flags: -Z validate-mir #![feature(let_chains)] diff --git a/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs b/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs index e055c20d777..a3583c48c39 100644 --- a/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs +++ b/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs @@ -1,5 +1,5 @@ //@ edition: 2024 -//@ compile-flags: -Z validate-mir -Zunstable-options +//@ compile-flags: -Z validate-mir #![deny(if_let_rescope)] diff --git a/tests/ui/drop/issue-10028.rs b/tests/ui/drop/issue-10028.rs index 41914254522..1ca1fbf504d 100644 --- a/tests/ui/drop/issue-10028.rs +++ b/tests/ui/drop/issue-10028.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] //@ aux-build:issue-10028.rs -//@ pretty-expanded FIXME #23616 extern crate issue_10028 as issue10028; diff --git a/tests/ui/drop/issue-2734.rs b/tests/ui/drop/issue-2734.rs index 028f86ebb3a..4616ea1f013 100644 --- a/tests/ui/drop/issue-2734.rs +++ b/tests/ui/drop/issue-2734.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 trait hax { fn dummy(&self) { } diff --git a/tests/ui/drop/issue-2735.rs b/tests/ui/drop/issue-2735.rs index 8fa3ac45d08..cd7e0b8f461 100644 --- a/tests/ui/drop/issue-2735.rs +++ b/tests/ui/drop/issue-2735.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 trait hax { fn dummy(&self) { } 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 48b7f3e11a6..7f9a0159950 100644 --- a/tests/ui/drop/lint-if-let-rescope-gated.edition2021.stderr +++ b/tests/ui/drop/lint-if-let-rescope-gated.edition2021.stderr @@ -1,5 +1,5 @@ error: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/lint-if-let-rescope-gated.rs:27:8 + --> $DIR/lint-if-let-rescope-gated.rs:26:8 | LL | if let Some(_value) = Droppy.get() { | ^^^^^^^^^^^^^^^^^^^------^^^^^^ @@ -9,12 +9,12 @@ LL | if let Some(_value) = Droppy.get() { = warning: this changes meaning in Rust 2024 = note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085> help: the value is now dropped here in Edition 2024 - --> $DIR/lint-if-let-rescope-gated.rs:31:5 + --> $DIR/lint-if-let-rescope-gated.rs:30:5 | LL | } else { | ^ note: the lint level is defined here - --> $DIR/lint-if-let-rescope-gated.rs:11:9 + --> $DIR/lint-if-let-rescope-gated.rs:10:9 | LL | #![deny(if_let_rescope)] | ^^^^^^^^^^^^^^ diff --git a/tests/ui/drop/lint-if-let-rescope-gated.rs b/tests/ui/drop/lint-if-let-rescope-gated.rs index ba0246573b4..f5538a37eef 100644 --- a/tests/ui/drop/lint-if-let-rescope-gated.rs +++ b/tests/ui/drop/lint-if-let-rescope-gated.rs @@ -5,7 +5,6 @@ //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 //@ [edition2024] edition: 2024 -//@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] check-pass #![deny(if_let_rescope)] diff --git a/tests/ui/drop/lint-if-let-rescope.fixed b/tests/ui/drop/lint-if-let-rescope.fixed index fec2e3b2ae7..182190aa323 100644 --- a/tests/ui/drop/lint-if-let-rescope.fixed +++ b/tests/ui/drop/lint-if-let-rescope.fixed @@ -14,7 +14,7 @@ impl Drop for Droppy { } } impl Droppy { - fn get(&self) -> Option<u8> { + const fn get(&self) -> Option<u8> { None } } @@ -62,11 +62,10 @@ fn main() { //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 } - if let () = { match Droppy.get() { Some(_value) => {} _ => {}} } { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + if let () = { if let Some(_value) = Droppy.get() {} } { + // This should not lint. + // This `if let` sits is a tail expression of a block. + // In Edition 2024, the temporaries are dropped before exiting the surrounding block. } #[rustfmt::skip] @@ -94,4 +93,17 @@ fn main() { //~| HELP: the value is now dropped here in Edition 2024 //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 } + + // We want to keep the `if let`s below as direct descendents of match arms, + // so the formatting is suppressed. + #[rustfmt::skip] + match droppy().get() { + _ => if let Some(_value) = droppy().get() {}, + // Should not lint + // There is implicitly a block surrounding the `if let`. + // Given that it is a tail expression, the temporaries are dropped duly before + // the execution is exiting the `match`. + } + + if let Some(_value) = droppy().get() {} } diff --git a/tests/ui/drop/lint-if-let-rescope.rs b/tests/ui/drop/lint-if-let-rescope.rs index ee184695b97..e1b38be0a0f 100644 --- a/tests/ui/drop/lint-if-let-rescope.rs +++ b/tests/ui/drop/lint-if-let-rescope.rs @@ -14,7 +14,7 @@ impl Drop for Droppy { } } impl Droppy { - fn get(&self) -> Option<u8> { + const fn get(&self) -> Option<u8> { None } } @@ -63,10 +63,9 @@ fn main() { } if let () = { if let Some(_value) = Droppy.get() {} } { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + // This should not lint. + // This `if let` sits is a tail expression of a block. + // In Edition 2024, the temporaries are dropped before exiting the surrounding block. } #[rustfmt::skip] @@ -94,4 +93,17 @@ fn main() { //~| HELP: the value is now dropped here in Edition 2024 //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 } + + // We want to keep the `if let`s below as direct descendents of match arms, + // so the formatting is suppressed. + #[rustfmt::skip] + match droppy().get() { + _ => if let Some(_value) = droppy().get() {}, + // Should not lint + // There is implicitly a block surrounding the `if let`. + // Given that it is a tail expression, the temporaries are dropped duly before + // the execution is exiting the `match`. + } + + if let Some(_value) = droppy().get() {} } diff --git a/tests/ui/drop/lint-if-let-rescope.stderr b/tests/ui/drop/lint-if-let-rescope.stderr index ef60d141b79..cfb7070c097 100644 --- a/tests/ui/drop/lint-if-let-rescope.stderr +++ b/tests/ui/drop/lint-if-let-rescope.stderr @@ -112,27 +112,7 @@ LL | if let Some(1) = { match Droppy.get() { Some(_value) => { Some(1) } _ = | ~~~~~ +++++++++++++++++ ~~~~ + error: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/lint-if-let-rescope.rs:65:22 - | -LL | if let () = { 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 issue #124085 <https://github.com/rust-lang/rust/issues/124085> -help: the value is now dropped here in Edition 2024 - --> $DIR/lint-if-let-rescope.rs:65:55 - | -LL | if let () = { if let Some(_value) = Droppy.get() {} } { - | ^ -help: a `match` with a single arm can preserve the drop order up to Edition 2021 - | -LL | if let () = { match Droppy.get() { Some(_value) => {} _ => {}} } { - | ~~~~~ +++++++++++++++++ ++++++++ - -error: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/lint-if-let-rescope.rs:73:12 + --> $DIR/lint-if-let-rescope.rs:72:12 | LL | if (if let Some(_value) = droppy().get() { true } else { false }) { | ^^^^^^^^^^^^^^^^^^^--------^^^^^^ @@ -142,7 +122,7 @@ LL | if (if let Some(_value) = droppy().get() { true } else { false }) { = warning: this changes meaning in Rust 2024 = note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085> help: the value is now dropped here in Edition 2024 - --> $DIR/lint-if-let-rescope.rs:73:53 + --> $DIR/lint-if-let-rescope.rs:72:53 | LL | if (if let Some(_value) = droppy().get() { true } else { false }) { | ^ @@ -152,7 +132,7 @@ LL | if (match droppy().get() { Some(_value) => { true } _ => { false }}) { | ~~~~~ +++++++++++++++++ ~~~~ + error: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/lint-if-let-rescope.rs:79:21 + --> $DIR/lint-if-let-rescope.rs:78:21 | LL | } else if (((if let Some(_value) = droppy().get() { true } else { false }))) { | ^^^^^^^^^^^^^^^^^^^--------^^^^^^ @@ -162,7 +142,7 @@ LL | } else if (((if let Some(_value) = droppy().get() { true } else { false = warning: this changes meaning in Rust 2024 = note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085> help: the value is now dropped here in Edition 2024 - --> $DIR/lint-if-let-rescope.rs:79:62 + --> $DIR/lint-if-let-rescope.rs:78:62 | LL | } else if (((if let Some(_value) = droppy().get() { true } else { false }))) { | ^ @@ -172,7 +152,7 @@ LL | } else if (((match droppy().get() { Some(_value) => { true } _ => { fal | ~~~~~ +++++++++++++++++ ~~~~ + error: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/lint-if-let-rescope.rs:91:15 + --> $DIR/lint-if-let-rescope.rs:90:15 | LL | while (if let Some(_value) = droppy().get() { false } else { true }) { | ^^^^^^^^^^^^^^^^^^^--------^^^^^^ @@ -182,7 +162,7 @@ LL | while (if let Some(_value) = droppy().get() { false } else { true }) { = warning: this changes meaning in Rust 2024 = note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085> help: the value is now dropped here in Edition 2024 - --> $DIR/lint-if-let-rescope.rs:91:57 + --> $DIR/lint-if-let-rescope.rs:90:57 | LL | while (if let Some(_value) = droppy().get() { false } else { true }) { | ^ @@ -191,5 +171,5 @@ help: a `match` with a single arm can preserve the drop order up to Edition 2021 LL | while (match droppy().get() { Some(_value) => { false } _ => { true }}) { | ~~~~~ +++++++++++++++++ ~~~~ + -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors diff --git a/tests/ui/drop/lint-tail-expr-drop-order-gated.rs b/tests/ui/drop/lint-tail-expr-drop-order-gated.rs index 508e7bdbf99..361862100e6 100644 --- a/tests/ui/drop/lint-tail-expr-drop-order-gated.rs +++ b/tests/ui/drop/lint-tail-expr-drop-order-gated.rs @@ -3,7 +3,6 @@ // Only `cargo fix --edition 2024` shall activate this lint. //@ check-pass -//@ compile-flags: -Z unstable-options //@ edition: 2024 #![deny(tail_expr_drop_order)] diff --git a/tests/ui/drop/nondrop-cycle.rs b/tests/ui/drop/nondrop-cycle.rs index 9b32d1319c9..fbee1be179f 100644 --- a/tests/ui/drop/nondrop-cycle.rs +++ b/tests/ui/drop/nondrop-cycle.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::cell::Cell; diff --git a/tests/ui/drop/tail-expr-drop-order-negative.edition2024.stderr b/tests/ui/drop/tail-expr-drop-order-negative.edition2024.stderr index bcce796570e..2c0b238eb5f 100644 --- a/tests/ui/drop/tail-expr-drop-order-negative.edition2024.stderr +++ b/tests/ui/drop/tail-expr-drop-order-negative.edition2024.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/tail-expr-drop-order-negative.rs:9:15 + --> $DIR/tail-expr-drop-order-negative.rs:8:15 | LL | x.replace(std::cell::RefCell::new(123).borrow()).is_some() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement diff --git a/tests/ui/drop/tail-expr-drop-order-negative.rs b/tests/ui/drop/tail-expr-drop-order-negative.rs index 5ad04d0a67e..3b20691f8ea 100644 --- a/tests/ui/drop/tail-expr-drop-order-negative.rs +++ b/tests/ui/drop/tail-expr-drop-order-negative.rs @@ -1,5 +1,4 @@ //@ revisions: edition2021 edition2024 -//@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] edition: 2024 //@ [edition2021] check-pass diff --git a/tests/ui/drop/tail-expr-drop-order.rs b/tests/ui/drop/tail-expr-drop-order.rs index 80968b823f9..f74530fce1e 100644 --- a/tests/ui/drop/tail-expr-drop-order.rs +++ b/tests/ui/drop/tail-expr-drop-order.rs @@ -1,6 +1,6 @@ //@ aux-build:edition-2021-macros.rs //@ aux-build:edition-2024-macros.rs -//@ compile-flags: -Z validate-mir -Zunstable-options +//@ compile-flags: -Z validate-mir //@ edition: 2024 //@ run-pass diff --git a/tests/ui/drop/use_inline_dtor.rs b/tests/ui/drop/use_inline_dtor.rs index 03f476cff2a..9d3cbd0b8b4 100644 --- a/tests/ui/drop/use_inline_dtor.rs +++ b/tests/ui/drop/use_inline_dtor.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:inline_dtor.rs -//@ pretty-expanded FIXME #23616 extern crate inline_dtor; diff --git a/tests/ui/dropck/cleanup-arm-conditional.rs b/tests/ui/dropck/cleanup-arm-conditional.rs index 94b38080189..31331f24d6f 100644 --- a/tests/ui/dropck/cleanup-arm-conditional.rs +++ b/tests/ui/dropck/cleanup-arm-conditional.rs @@ -5,7 +5,6 @@ // Test that cleanup scope for temporaries created in a match // arm is confined to the match arm itself. -//@ pretty-expanded FIXME #23616 #![feature(os)] diff --git a/tests/ui/dropck/const_drop_is_valid.rs b/tests/ui/dropck/const_drop_is_valid.rs deleted file mode 100644 index 26ef2d61deb..00000000000 --- a/tests/ui/dropck/const_drop_is_valid.rs +++ /dev/null @@ -1,8 +0,0 @@ -struct A(); - -impl const Drop for A {} -//~^ ERROR: const trait impls are experimental -//~| const `impl` for trait `Drop` which is not marked with `#[const_trait]` -//~| not all trait items implemented, missing: `drop` - -fn main() {} diff --git a/tests/ui/dropck/const_drop_is_valid.stderr b/tests/ui/dropck/const_drop_is_valid.stderr deleted file mode 100644 index 5837e1623a1..00000000000 --- a/tests/ui/dropck/const_drop_is_valid.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0658]: const trait impls are experimental - --> $DIR/const_drop_is_valid.rs:3:6 - | -LL | impl const Drop for A {} - | ^^^^^ - | - = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> 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 - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const_drop_is_valid.rs:3:12 - | -LL | impl const Drop for A {} - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0046]: not all trait items implemented, missing: `drop` - --> $DIR/const_drop_is_valid.rs:3:1 - | -LL | impl const Drop for A {} - | ^^^^^^^^^^^^^^^^^^^^^ missing `drop` in implementation - | - = help: implement the missing item: `fn drop(&mut self) { todo!() }` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0046, E0658. -For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/dupe-first-attr.rs b/tests/ui/dupe-first-attr.rs index ec9e354e73d..c254df050c1 100644 --- a/tests/ui/dupe-first-attr.rs +++ b/tests/ui/dupe-first-attr.rs @@ -3,7 +3,6 @@ // Regression test for a problem with the first mod attribute // being applied to every mod -//@ pretty-expanded FIXME #23616 #[cfg(target_os = "linux")] mod hello {} diff --git a/tests/ui/dyn-compatibility/missing-assoc-type.rs b/tests/ui/dyn-compatibility/missing-assoc-type.rs index c83be544c0a..21f7fd92e80 100644 --- a/tests/ui/dyn-compatibility/missing-assoc-type.rs +++ b/tests/ui/dyn-compatibility/missing-assoc-type.rs @@ -3,8 +3,5 @@ trait Foo { } fn bar(x: &dyn Foo) {} //~ ERROR the trait `Foo` cannot be made into an object -//~^ ERROR the trait `Foo` cannot be made into an object -//~| ERROR the trait `Foo` cannot be made into an object -//~| ERROR the trait `Foo` cannot be made into an object fn main() {} diff --git a/tests/ui/dyn-compatibility/missing-assoc-type.stderr b/tests/ui/dyn-compatibility/missing-assoc-type.stderr index f8450ba212d..184201dd1ce 100644 --- a/tests/ui/dyn-compatibility/missing-assoc-type.stderr +++ b/tests/ui/dyn-compatibility/missing-assoc-type.stderr @@ -13,53 +13,6 @@ LL | type Bar<T>; | ^^^ ...because it contains the generic associated type `Bar` = help: consider moving `Bar` to another trait -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/missing-assoc-type.rs:5:16 - | -LL | fn bar(x: &dyn Foo) {} - | ^^^ `Foo` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/missing-assoc-type.rs:2:10 - | -LL | trait Foo { - | --- this trait cannot be made into an object... -LL | type Bar<T>; - | ^^^ ...because it contains the generic associated type `Bar` - = help: consider moving `Bar` to another trait - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/missing-assoc-type.rs:5:16 - | -LL | fn bar(x: &dyn Foo) {} - | ^^^ `Foo` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/missing-assoc-type.rs:2:10 - | -LL | trait Foo { - | --- this trait cannot be made into an object... -LL | type Bar<T>; - | ^^^ ...because it contains the generic associated type `Bar` - = help: consider moving `Bar` to another trait - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/missing-assoc-type.rs:5:12 - | -LL | fn bar(x: &dyn Foo) {} - | ^^^^^^^ `Foo` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/missing-assoc-type.rs:2:10 - | -LL | trait Foo { - | --- this trait cannot be made into an object... -LL | type Bar<T>; - | ^^^ ...because it contains the generic associated type `Bar` - = help: consider moving `Bar` to another trait - -error: aborting due to 4 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/dynamically-sized-types/dst-coercions.rs b/tests/ui/dynamically-sized-types/dst-coercions.rs index 6b3c85cf83b..4813dda439b 100644 --- a/tests/ui/dynamically-sized-types/dst-coercions.rs +++ b/tests/ui/dynamically-sized-types/dst-coercions.rs @@ -2,7 +2,6 @@ #![allow(unused_variables)] // Test coercions involving DST and/or raw pointers -//@ pretty-expanded FIXME #23616 struct S; trait T { fn dummy(&self) { } } //~ WARN method `dummy` is never used diff --git a/tests/ui/dynamically-sized-types/dst-coercions.stderr b/tests/ui/dynamically-sized-types/dst-coercions.stderr index e4721ce50a0..e7c48783df0 100644 --- a/tests/ui/dynamically-sized-types/dst-coercions.stderr +++ b/tests/ui/dynamically-sized-types/dst-coercions.stderr @@ -1,5 +1,5 @@ warning: method `dummy` is never used - --> $DIR/dst-coercions.rs:8:14 + --> $DIR/dst-coercions.rs:7:14 | LL | trait T { fn dummy(&self) { } } | - ^^^^^ diff --git a/tests/ui/early-ret-binop-add.rs b/tests/ui/early-ret-binop-add.rs index 5daf79c214c..3fec66f35fb 100644 --- a/tests/ui/early-ret-binop-add.rs +++ b/tests/ui/early-ret-binop-add.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(unreachable_code)] -//@ pretty-expanded FIXME #23616 use std::ops::Add; diff --git a/tests/ui/editions/async-block-2015.rs b/tests/ui/editions/async-block-2015.rs index 3daf4930c5b..a079b4aad91 100644 --- a/tests/ui/editions/async-block-2015.rs +++ b/tests/ui/editions/async-block-2015.rs @@ -1,7 +1,7 @@ async fn foo() { //~^ ERROR `async fn` is not permitted in Rust 2015 //~| NOTE to use `async fn`, switch to Rust 2018 or later -//~| HELP pass `--edition 2021` to `rustc` +//~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide let x = async {}; @@ -11,7 +11,7 @@ async fn foo() { let x = 42; //~^ ERROR expected identifier, found keyword `let` //~| NOTE expected identifier, found keyword - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide 42 }; @@ -19,7 +19,7 @@ async fn foo() { 42 //~^ ERROR expected identifier, found `42` //~| NOTE expected identifier - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide }; y.await; diff --git a/tests/ui/editions/async-block-2015.stderr b/tests/ui/editions/async-block-2015.stderr index b792b8c1e0d..574bcacc1cf 100644 --- a/tests/ui/editions/async-block-2015.stderr +++ b/tests/ui/editions/async-block-2015.stderr @@ -4,7 +4,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | async fn foo() { | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected identifier, found keyword `let` @@ -15,7 +15,7 @@ LL | let y = async { LL | let x = 42; | ^^^ expected identifier, found keyword | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected identifier, found `42` @@ -26,7 +26,7 @@ LL | let z = async { LL | 42 | ^^ expected identifier | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0422]: cannot find struct, variant or union type `async` in this scope diff --git a/tests/ui/editions/edition-cstr-2015-2018.rs b/tests/ui/editions/edition-cstr-2015-2018.rs index 4c35c48646a..4d4274251f0 100644 --- a/tests/ui/editions/edition-cstr-2015-2018.rs +++ b/tests/ui/editions/edition-cstr-2015-2018.rs @@ -7,7 +7,7 @@ macro_rules! contain { () => { c"str" } } //~| NOTE expected one of 8 possible tokens //~| NOTE you may be trying to write a c-string literal //~| NOTE c-string literals require Rust 2021 or later - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide fn check_macro_construct() { @@ -29,7 +29,7 @@ fn check_basic() { //~| NOTE expected one of 8 possible tokens //~| NOTE you may be trying to write a c-string literal //~| NOTE c-string literals require Rust 2021 or later - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -39,7 +39,7 @@ fn check_craw() { //~| NOTE expected one of 8 possible tokens //~| NOTE you may be trying to write a c-string literal //~| NOTE c-string literals require Rust 2021 or later - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } @@ -49,7 +49,7 @@ fn check_craw_hash() { //~| NOTE expected one of 8 possible tokens //~| NOTE you may be trying to write a c-string literal //~| NOTE c-string literals require Rust 2021 or later - //~| HELP pass `--edition 2021` to `rustc` + //~| HELP pass `--edition 2024` to `rustc` //~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide } diff --git a/tests/ui/editions/edition-cstr-2015-2018.stderr b/tests/ui/editions/edition-cstr-2015-2018.stderr index b864df308ef..62cb8576552 100644 --- a/tests/ui/editions/edition-cstr-2015-2018.stderr +++ b/tests/ui/editions/edition-cstr-2015-2018.stderr @@ -6,7 +6,7 @@ LL | c"str"; | = note: you may be trying to write a c-string literal = note: c-string literals require Rust 2021 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` @@ -17,7 +17,7 @@ LL | cr"str"; | = note: you may be trying to write a c-string literal = note: c-string literals require Rust 2021 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `#` @@ -28,7 +28,7 @@ LL | cr##"str"##; | = note: you may be trying to write a c-string literal = note: c-string literals require Rust 2021 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"` @@ -59,7 +59,7 @@ LL | contain!(); | = note: you may be trying to write a c-string literal = note: c-string literals require Rust 2021 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide = note: this error originates in the macro `contain` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/editions/never-type-fallback-breaking.e2021.fixed b/tests/ui/editions/never-type-fallback-breaking.e2021.fixed index 75bc598d17b..91d30de74c7 100644 --- a/tests/ui/editions/never-type-fallback-breaking.e2021.fixed +++ b/tests/ui/editions/never-type-fallback-breaking.e2021.fixed @@ -2,7 +2,6 @@ // //@[e2021] edition: 2021 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options // //@[e2021] run-pass //@[e2021] run-rustfix diff --git a/tests/ui/editions/never-type-fallback-breaking.e2021.stderr b/tests/ui/editions/never-type-fallback-breaking.e2021.stderr index 454e88d4569..6fdb548c431 100644 --- a/tests/ui/editions/never-type-fallback-breaking.e2021.stderr +++ b/tests/ui/editions/never-type-fallback-breaking.e2021.stderr @@ -1,5 +1,5 @@ warning: this function depends on never type fallback being `()` - --> $DIR/never-type-fallback-breaking.rs:17:1 + --> $DIR/never-type-fallback-breaking.rs:16:1 | LL | fn m() { | ^^^^^^ @@ -8,7 +8,7 @@ LL | fn m() { = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail - --> $DIR/never-type-fallback-breaking.rs:21:17 + --> $DIR/never-type-fallback-breaking.rs:20:17 | LL | true => Default::default(), | ^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | let x: () = match true { | ++++ warning: this function depends on never type fallback being `()` - --> $DIR/never-type-fallback-breaking.rs:29:1 + --> $DIR/never-type-fallback-breaking.rs:28:1 | LL | fn q() -> Option<()> { | ^^^^^^^^^^^^^^^^^^^^ @@ -28,7 +28,7 @@ LL | fn q() -> Option<()> { = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail - --> $DIR/never-type-fallback-breaking.rs:36:5 + --> $DIR/never-type-fallback-breaking.rs:35:5 | LL | deserialize()?; | ^^^^^^^^^^^^^ @@ -38,7 +38,7 @@ LL | deserialize::<()>()?; | ++++++ warning: this function depends on never type fallback being `()` - --> $DIR/never-type-fallback-breaking.rs:46:1 + --> $DIR/never-type-fallback-breaking.rs:45:1 | LL | fn meow() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | fn meow() -> Result<(), ()> { = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = help: specify the types explicitly note: in edition 2024, the requirement `(): From<!>` will fail - --> $DIR/never-type-fallback-breaking.rs:49:5 + --> $DIR/never-type-fallback-breaking.rs:48:5 | LL | help(1)?; | ^^^^^^^ diff --git a/tests/ui/editions/never-type-fallback-breaking.e2024.stderr b/tests/ui/editions/never-type-fallback-breaking.e2024.stderr index 6258247f8b2..9d79dfb4099 100644 --- a/tests/ui/editions/never-type-fallback-breaking.e2024.stderr +++ b/tests/ui/editions/never-type-fallback-breaking.e2024.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `!: Default` is not satisfied - --> $DIR/never-type-fallback-breaking.rs:21:17 + --> $DIR/never-type-fallback-breaking.rs:20:17 | LL | true => Default::default(), | ^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `!` @@ -8,7 +8,7 @@ LL | true => Default::default(), = help: did you intend to use the type `()` here instead? error[E0277]: the trait bound `!: Default` is not satisfied - --> $DIR/never-type-fallback-breaking.rs:36:5 + --> $DIR/never-type-fallback-breaking.rs:35:5 | LL | deserialize()?; | ^^^^^^^^^^^^^ the trait `Default` is not implemented for `!` @@ -16,13 +16,13 @@ LL | deserialize()?; = note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information) = help: did you intend to use the type `()` here instead? note: required by a bound in `deserialize` - --> $DIR/never-type-fallback-breaking.rs:32:23 + --> $DIR/never-type-fallback-breaking.rs:31:23 | LL | fn deserialize<T: Default>() -> Option<T> { | ^^^^^^^ required by this bound in `deserialize` error[E0277]: the trait bound `(): From<!>` is not satisfied - --> $DIR/never-type-fallback-breaking.rs:49:5 + --> $DIR/never-type-fallback-breaking.rs:48:5 | LL | help(1)?; | ^^^^^^^ the trait `From<!>` is not implemented for `()` @@ -39,7 +39,7 @@ LL | help(1)?; and 4 others = note: required for `!` to implement `Into<()>` note: required by a bound in `help` - --> $DIR/never-type-fallback-breaking.rs:43:20 + --> $DIR/never-type-fallback-breaking.rs:42:20 | LL | fn help<'a: 'a, T: Into<()>, U>(_: U) -> Result<T, ()> { | ^^^^^^^^ required by this bound in `help` diff --git a/tests/ui/editions/never-type-fallback-breaking.rs b/tests/ui/editions/never-type-fallback-breaking.rs index 32e83e74139..24e33ff6bf6 100644 --- a/tests/ui/editions/never-type-fallback-breaking.rs +++ b/tests/ui/editions/never-type-fallback-breaking.rs @@ -2,7 +2,6 @@ // //@[e2021] edition: 2021 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options // //@[e2021] run-pass //@[e2021] run-rustfix diff --git a/tests/ui/editions/never-type-fallback.rs b/tests/ui/editions/never-type-fallback.rs index a5b75219295..987fb305763 100644 --- a/tests/ui/editions/never-type-fallback.rs +++ b/tests/ui/editions/never-type-fallback.rs @@ -2,7 +2,6 @@ // //@[e2021] edition: 2021 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options // //@ run-pass //@ check-run-results diff --git a/tests/ui/empty-allocation-rvalue-non-null.rs b/tests/ui/empty-allocation-rvalue-non-null.rs index 25c36679033..0cd4fde73ed 100644 --- a/tests/ui/empty-allocation-rvalue-non-null.rs +++ b/tests/ui/empty-allocation-rvalue-non-null.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 pub fn main() { let x: () = *Box::new(()); diff --git a/tests/ui/empty/empty-never-array.stderr b/tests/ui/empty/empty-never-array.stderr index 0104a435538..f9f39a6371e 100644 --- a/tests/ui/empty/empty-never-array.stderr +++ b/tests/ui/empty/empty-never-array.stderr @@ -5,7 +5,7 @@ LL | let Helper::U(u) = Helper::T(t, []); | ^^^^^^^^^^^^ pattern `Helper::T(_, _)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Helper<T, U>` defined here --> $DIR/empty-never-array.rs:3:6 | diff --git a/tests/ui/enum-discriminant/issue-41394.stderr b/tests/ui/enum-discriminant/issue-41394.stderr index e81562df04f..9bf4fc79b1b 100644 --- a/tests/ui/enum-discriminant/issue-41394.stderr +++ b/tests/ui/enum-discriminant/issue-41394.stderr @@ -6,6 +6,12 @@ LL | A = "" + 1 | | | &str +note: erroneous constant encountered + --> $DIR/issue-41394.rs:7:9 + | +LL | A = Foo::A as isize + | ^^^^^^^^^^^^^^^ + error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0369`. diff --git a/tests/ui/enum-discriminant/ptr_niche.rs b/tests/ui/enum-discriminant/ptr_niche.rs new file mode 100644 index 00000000000..32df08bce63 --- /dev/null +++ b/tests/ui/enum-discriminant/ptr_niche.rs @@ -0,0 +1,38 @@ +//@ run-pass +//! Check that we can codegen setting and getting discriminants, including non-null niches, +//! for enums with a pointer-like ABI. This used to crash llvm. + +#![feature(rustc_attrs)] +use std::{ptr, mem}; + + +#[rustc_layout_scalar_valid_range_start(1)] +#[rustc_layout_scalar_valid_range_end(100)] +#[derive(Copy, Clone)] +struct PointerWithRange(#[allow(dead_code)] *const u8); + + +fn main() { + let val = unsafe { PointerWithRange(ptr::without_provenance(90)) }; + + let ptr = Some(val); + assert!(ptr.is_some()); + let raw = unsafe { mem::transmute::<_, usize>(ptr) }; + assert_eq!(raw, 90); + + let ptr = Some(Some(val)); + assert!(ptr.is_some()); + assert!(ptr.unwrap().is_some()); + let raw = unsafe { mem::transmute::<_, usize>(ptr) }; + assert_eq!(raw, 90); + + let ptr: Option<PointerWithRange> = None; + assert!(ptr.is_none()); + let raw = unsafe { mem::transmute::<_, usize>(ptr) }; + assert!(!(1..=100).contains(&raw)); + + let ptr: Option<Option<PointerWithRange>> = None; + assert!(ptr.is_none()); + let raw = unsafe { mem::transmute::<_, usize>(ptr) }; + assert!(!(1..=100).contains(&raw)); +} diff --git a/tests/ui/enum/issue-1821.rs b/tests/ui/enum/issue-1821.rs index 76d60962c38..2cfdee566a6 100644 --- a/tests/ui/enum/issue-1821.rs +++ b/tests/ui/enum/issue-1821.rs @@ -5,7 +5,6 @@ // Issue #1821 - Don't recurse trying to typecheck this -//@ pretty-expanded FIXME #23616 enum t { foo(Vec<t>) diff --git a/tests/ui/enum/issue-19340-1.rs b/tests/ui/enum/issue-19340-1.rs index c1ba0d23b6f..97936923442 100644 --- a/tests/ui/enum/issue-19340-1.rs +++ b/tests/ui/enum/issue-19340-1.rs @@ -2,7 +2,6 @@ #![allow(unused_variables)] //@ aux-build:issue-19340-1.rs -//@ pretty-expanded FIXME #23616 extern crate issue_19340_1 as lib; diff --git a/tests/ui/enum/issue-19340-2.rs b/tests/ui/enum/issue-19340-2.rs index dd1bda78a97..0930cd5da09 100644 --- a/tests/ui/enum/issue-19340-2.rs +++ b/tests/ui/enum/issue-19340-2.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 enum Homura { Madoka { diff --git a/tests/ui/error-codes/E0005.stderr b/tests/ui/error-codes/E0005.stderr index 4be37e2e454..c643ee07a37 100644 --- a/tests/ui/error-codes/E0005.stderr +++ b/tests/ui/error-codes/E0005.stderr @@ -5,7 +5,7 @@ LL | let Some(y) = x; | ^^^^^^^ pattern `None` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Option<i32>` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/error-codes/E0045.stderr b/tests/ui/error-codes/E0045.stderr index 25b2f2654da..b8ee31a4049 100644 --- a/tests/ui/error-codes/E0045.stderr +++ b/tests/ui/error-codes/E0045.stderr @@ -1,4 +1,4 @@ -error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` +error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi` --> $DIR/E0045.rs:1:17 | LL | extern "Rust" { fn foo(x: u8, ...); } diff --git a/tests/ui/error-codes/E0617.rs b/tests/ui/error-codes/E0617.rs index b71ba0ed88b..4a38174bc6f 100644 --- a/tests/ui/error-codes/E0617.rs +++ b/tests/ui/error-codes/E0617.rs @@ -20,7 +20,8 @@ fn main() { //~^ ERROR can't pass `u16` to variadic function //~| HELP cast the value to `c_uint` printf(::std::ptr::null(), printf); - //~^ ERROR can't pass `unsafe extern "C" fn(*const i8, ...) {printf}` to variadic function - //~| HELP cast the value to `unsafe extern "C" fn(*const i8, ...)` + //~^ ERROR can't pass a function item to a variadic function + //~| HELP a function item is zero-sized and needs to be cast into a function pointer to be used in FFI + //~| HELP use a function pointer instead } } diff --git a/tests/ui/error-codes/E0617.stderr b/tests/ui/error-codes/E0617.stderr index ea91ad08292..b2eee129960 100644 --- a/tests/ui/error-codes/E0617.stderr +++ b/tests/ui/error-codes/E0617.stderr @@ -2,42 +2,69 @@ error[E0617]: can't pass `f32` to variadic function --> $DIR/E0617.rs:7:36 | LL | printf(::std::ptr::null(), 0f32); - | ^^^^ help: cast the value to `c_double`: `0f32 as c_double` + | ^^^^ + | +help: cast the value to `c_double` + | +LL | printf(::std::ptr::null(), 0f32 as c_double); + | +++++++++++ error[E0617]: can't pass `i8` to variadic function --> $DIR/E0617.rs:10:36 | LL | printf(::std::ptr::null(), 0i8); - | ^^^ help: cast the value to `c_int`: `0i8 as c_int` + | ^^^ + | +help: cast the value to `c_int` + | +LL | printf(::std::ptr::null(), 0i8 as c_int); + | ++++++++ error[E0617]: can't pass `i16` to variadic function --> $DIR/E0617.rs:13:36 | LL | printf(::std::ptr::null(), 0i16); - | ^^^^ help: cast the value to `c_int`: `0i16 as c_int` + | ^^^^ + | +help: cast the value to `c_int` + | +LL | printf(::std::ptr::null(), 0i16 as c_int); + | ++++++++ error[E0617]: can't pass `u8` to variadic function --> $DIR/E0617.rs:16:36 | LL | printf(::std::ptr::null(), 0u8); - | ^^^ help: cast the value to `c_uint`: `0u8 as c_uint` + | ^^^ + | +help: cast the value to `c_uint` + | +LL | printf(::std::ptr::null(), 0u8 as c_uint); + | +++++++++ error[E0617]: can't pass `u16` to variadic function --> $DIR/E0617.rs:19:36 | LL | printf(::std::ptr::null(), 0u16); - | ^^^^ help: cast the value to `c_uint`: `0u16 as c_uint` + | ^^^^ + | +help: cast the value to `c_uint` + | +LL | printf(::std::ptr::null(), 0u16 as c_uint); + | +++++++++ -error[E0617]: can't pass `unsafe extern "C" fn(*const i8, ...) {printf}` to variadic function +error[E0617]: can't pass a function item to a variadic function --> $DIR/E0617.rs:22:36 | LL | printf(::std::ptr::null(), printf); | ^^^^^^ | -help: cast the value to `unsafe extern "C" fn(*const i8, ...)` + = help: a function item is zero-sized and needs to be cast into a function pointer to be used in FFI + = note: for more information on function items, visit https://doc.rust-lang.org/reference/types/function-item.html +help: use a function pointer instead | LL | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...)); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | +++++++++++++++++++++++++++++++++++++++ error: aborting due to 6 previous errors diff --git a/tests/ui/error-codes/E0622.rs b/tests/ui/error-codes/E0622.rs index ae7378a707e..08c6d171296 100644 --- a/tests/ui/error-codes/E0622.rs +++ b/tests/ui/error-codes/E0622.rs @@ -1,6 +1,6 @@ #![feature(intrinsics)] extern "rust-intrinsic" { - pub static breakpoint : unsafe extern "rust-intrinsic" fn(); + pub static atomic_singlethreadfence_seqcst : unsafe extern "rust-intrinsic" fn(); //~^ ERROR intrinsic must be a function [E0622] } -fn main() { unsafe { breakpoint(); } } +fn main() { unsafe { atomic_singlethreadfence_seqcst(); } } diff --git a/tests/ui/error-codes/E0622.stderr b/tests/ui/error-codes/E0622.stderr index c59776b211f..739ec984fc6 100644 --- a/tests/ui/error-codes/E0622.stderr +++ b/tests/ui/error-codes/E0622.stderr @@ -1,8 +1,8 @@ error[E0622]: intrinsic must be a function --> $DIR/E0622.rs:3:5 | -LL | pub static breakpoint : unsafe extern "rust-intrinsic" fn(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected a function +LL | pub static atomic_singlethreadfence_seqcst : unsafe extern "rust-intrinsic" fn(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected a function error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0746.stderr b/tests/ui/error-codes/E0746.stderr index cfc747cb1e2..ce3e9736969 100644 --- a/tests/ui/error-codes/E0746.stderr +++ b/tests/ui/error-codes/E0746.stderr @@ -19,8 +19,11 @@ error[E0746]: return type cannot have an unboxed trait object LL | fn bar() -> dyn Trait { | ^^^^^^^^^ doesn't have a size known at compile-time | - = help: if there were a single returned type, you could use `impl Trait` instead -help: box the return type, and wrap all of the returned values in `Box::new` +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +LL | fn bar() -> impl Trait { + | ~~~~ +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn bar() -> Box<dyn Trait> { LL | if true { diff --git a/tests/ui/error-emitter/unicode-output.rs b/tests/ui/error-emitter/unicode-output.rs index ba6db37b66c..5c083c4e575 100644 --- a/tests/ui/error-emitter/unicode-output.rs +++ b/tests/ui/error-emitter/unicode-output.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Zunstable-options=yes --error-format=human-unicode --color=always +//@ compile-flags: -Zunstable-options --error-format=human-unicode --color=always //@ edition:2018 //@ only-linux diff --git a/tests/ui/explicit-i-suffix.rs b/tests/ui/explicit-i-suffix.rs index 29c7391521e..0a6ed49ae27 100644 --- a/tests/ui/explicit-i-suffix.rs +++ b/tests/ui/explicit-i-suffix.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ pretty-expanded FIXME #23616 pub fn main() { let x: isize = 8; diff --git a/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr b/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr index 4a1e50b4111..46769cdea8a 100644 --- a/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr +++ b/tests/ui/explicit-tail-calls/ctfe-id-unlimited.return.stderr @@ -25,12 +25,6 @@ note: inside `ID_ED` LL | const ID_ED: u32 = rec_id(ORIGINAL); | ^^^^^^^^^^^^^^^^ -note: erroneous constant encountered - --> $DIR/ctfe-id-unlimited.rs:31:40 - | -LL | const ASSERT: () = assert!(ORIGINAL == ID_ED); - | ^^^^^ - error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/expr/if/if-ret.rs b/tests/ui/expr/if/if-ret.rs index 3aad21d34a2..2698c5bbf6e 100644 --- a/tests/ui/expr/if/if-ret.rs +++ b/tests/ui/expr/if/if-ret.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_parens)] -//@ pretty-expanded FIXME #23616 fn foo() { if (return) { } } //~ WARNING unreachable block in `if` diff --git a/tests/ui/expr/if/if-ret.stderr b/tests/ui/expr/if/if-ret.stderr index 8ced271aabc..e5464affd2f 100644 --- a/tests/ui/expr/if/if-ret.stderr +++ b/tests/ui/expr/if/if-ret.stderr @@ -1,5 +1,5 @@ warning: unreachable block in `if` or `while` expression - --> $DIR/if-ret.rs:6:24 + --> $DIR/if-ret.rs:5:24 | LL | fn foo() { if (return) { } } | -------- ^^^ unreachable block in `if` or `while` expression diff --git a/tests/ui/expr/scope.rs b/tests/ui/expr/scope.rs index 57321ce2aa0..3a1c8b87da8 100644 --- a/tests/ui/expr/scope.rs +++ b/tests/ui/expr/scope.rs @@ -1,7 +1,6 @@ //@ run-pass // Regression test for issue #762 -//@ pretty-expanded FIXME #23616 pub fn f() { } pub fn main() { return ::f(); } diff --git a/tests/ui/extern/extern-1.rs b/tests/ui/extern/extern-1.rs index c0f770ab9f2..226bc1effb1 100644 --- a/tests/ui/extern/extern-1.rs +++ b/tests/ui/extern/extern-1.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 extern "C" fn f() { } diff --git a/tests/ui/extern/extern-calling-convention-test.rs b/tests/ui/extern/extern-calling-convention-test.rs index 7c533df1986..68315ed0934 100644 --- a/tests/ui/extern/extern-calling-convention-test.rs +++ b/tests/ui/extern/extern-calling-convention-test.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:extern_calling_convention.rs -//@ pretty-expanded FIXME #23616 extern crate extern_calling_convention; diff --git a/tests/ui/extern/extern-foreign-crate.rs b/tests/ui/extern/extern-foreign-crate.rs index 939090ab5fc..690a6501368 100644 --- a/tests/ui/extern/extern-foreign-crate.rs +++ b/tests/ui/extern/extern-foreign-crate.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 extern crate std as mystd; diff --git a/tests/ui/extern/extern-mod-abi.rs b/tests/ui/extern/extern-mod-abi.rs index 8700a379d29..29892c468dd 100644 --- a/tests/ui/extern/extern-mod-abi.rs +++ b/tests/ui/extern/extern-mod-abi.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 extern "C" { fn pow(x: f64, y: f64) -> f64; diff --git a/tests/ui/extern/extern-mod-ordering-exe.rs b/tests/ui/extern/extern-mod-ordering-exe.rs index c735f6bae7a..9f5e52e3395 100644 --- a/tests/ui/extern/extern-mod-ordering-exe.rs +++ b/tests/ui/extern/extern-mod-ordering-exe.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:extern_mod_ordering_lib.rs -//@ pretty-expanded FIXME #23616 extern crate extern_mod_ordering_lib; diff --git a/tests/ui/extern/extern-pub.rs b/tests/ui/extern/extern-pub.rs index 80f1e295d4d..b272bc5359f 100644 --- a/tests/ui/extern/extern-pub.rs +++ b/tests/ui/extern/extern-pub.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 extern "C" { pub fn free(p: *const u8); diff --git a/tests/ui/extern/extern-rust.rs b/tests/ui/extern/extern-rust.rs index bacdc7aeecb..b4a4a49810e 100644 --- a/tests/ui/extern/extern-rust.rs +++ b/tests/ui/extern/extern-rust.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #[repr(C)] pub struct Foo(u32); diff --git a/tests/ui/extern/extern-types-field-offset.run.stderr b/tests/ui/extern/extern-types-field-offset.run.stderr index f1407398980..1b04b860db5 100644 --- a/tests/ui/extern/extern-types-field-offset.run.stderr +++ b/tests/ui/extern/extern-types-field-offset.run.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at core/src/panicking.rs:$LINE:$COL: +thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `Opaque` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. diff --git a/tests/ui/extern/extern-types-size_of_val.align.run.stderr b/tests/ui/extern/extern-types-size_of_val.align.run.stderr index faad1aa13fa..20c4d8785e8 100644 --- a/tests/ui/extern/extern-types-size_of_val.align.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.align.run.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at core/src/panicking.rs:$LINE:$COL: +thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. diff --git a/tests/ui/extern/extern-types-size_of_val.size.run.stderr b/tests/ui/extern/extern-types-size_of_val.size.run.stderr index faad1aa13fa..20c4d8785e8 100644 --- a/tests/ui/extern/extern-types-size_of_val.size.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.size.run.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at core/src/panicking.rs:$LINE:$COL: +thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. diff --git a/tests/ui/extern/issue-10025.rs b/tests/ui/extern/issue-10025.rs index 0bdcf7c5c58..140012f4a16 100644 --- a/tests/ui/extern/issue-10025.rs +++ b/tests/ui/extern/issue-10025.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] unsafe extern fn foo() {} diff --git a/tests/ui/extern/issue-10763.rs b/tests/ui/extern/issue-10763.rs index 2381f22f162..6966f5571df 100644 --- a/tests/ui/extern/issue-10763.rs +++ b/tests/ui/extern/issue-10763.rs @@ -1,6 +1,5 @@ //@ build-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 extern "Rust" fn foo() {} diff --git a/tests/ui/extern/issue-10764-rpass.rs b/tests/ui/extern/issue-10764-rpass.rs index 4de387e3d66..761bf4e28b7 100644 --- a/tests/ui/extern/issue-10764-rpass.rs +++ b/tests/ui/extern/issue-10764-rpass.rs @@ -1,4 +1,3 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 extern "Rust" fn main() {} diff --git a/tests/ui/extern/issue-1251.rs b/tests/ui/extern/issue-1251.rs index 5581bddaddc..ba42fef298c 100644 --- a/tests/ui/extern/issue-1251.rs +++ b/tests/ui/extern/issue-1251.rs @@ -1,7 +1,6 @@ //@ build-pass #![allow(unused_attributes)] #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 mod rustrt { extern "C" { diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs new file mode 100644 index 00000000000..7aec7455b2e --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs @@ -0,0 +1,23 @@ +//@ needs-asm-support +//@ compile-flags: --target s390x-unknown-linux-gnu +//@ needs-llvm-components: systemz + +#![feature(no_core, lang_items, rustc_attrs)] +#![crate_type = "rlib"] +#![no_core] + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} + +unsafe fn main() { + asm!("", in("v0") 0); + //~^ ERROR register class `vreg` can only be used as a clobber in stable + //~| ERROR type `i32` cannot be used with this register class +} diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr new file mode 100644 index 00000000000..0791ce4543c --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr @@ -0,0 +1,23 @@ +error[E0658]: register class `vreg` can only be used as a clobber in stable + --> $DIR/feature-gate-asm_experimental_reg.rs:20:14 + | +LL | asm!("", in("v0") 0); + | ^^^^^^^^^^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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]: type `i32` cannot be used with this register class in stable + --> $DIR/feature-gate-asm_experimental_reg.rs:20:23 + | +LL | asm!("", in("v0") 0); + | ^ + | + = note: see issue #133416 <https://github.com/rust-lang/rust/issues/133416> for more information + = help: add `#![feature(asm_experimental_reg)]` 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: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-asm_goto_with_outputs.rs b/tests/ui/feature-gates/feature-gate-asm_goto_with_outputs.rs new file mode 100644 index 00000000000..294827f78d2 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-asm_goto_with_outputs.rs @@ -0,0 +1,13 @@ +//@ only-x86_64 + +#![feature(asm_goto)] + +use std::arch::asm; + +fn main() { + let mut _out: u64; + unsafe { + asm!("mov {}, 1", "jmp {}", out(reg) _out, label {}); + //~^ ERROR using both label and output operands for inline assembly is unstable + } +} diff --git a/tests/ui/feature-gates/feature-gate-asm_goto_with_outputs.stderr b/tests/ui/feature-gates/feature-gate-asm_goto_with_outputs.stderr new file mode 100644 index 00000000000..ff7a7d5760a --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-asm_goto_with_outputs.stderr @@ -0,0 +1,13 @@ +error[E0658]: using both label and output operands for inline assembly is unstable + --> $DIR/feature-gate-asm_goto_with_outputs.rs:10:52 + | +LL | asm!("mov {}, 1", "jmp {}", out(reg) _out, label {}); + | ^^^^^^^^ + | + = note: see issue #119364 <https://github.com/rust-lang/rust/issues/119364> for more information + = help: add `#![feature(asm_goto_with_outputs)]` 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: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-async-trait-bounds.rs b/tests/ui/feature-gates/feature-gate-async-trait-bounds.rs new file mode 100644 index 00000000000..db5d7aa06d2 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-async-trait-bounds.rs @@ -0,0 +1,7 @@ +//@ edition: 2021 + +fn test(_: impl async Fn()) {} +//~^ ERROR `async` trait bounds are unstable +//~| ERROR use of unstable library feature `async_closure` + +fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-async-trait-bounds.stderr b/tests/ui/feature-gates/feature-gate-async-trait-bounds.stderr new file mode 100644 index 00000000000..abc7e37c45f --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-async-trait-bounds.stderr @@ -0,0 +1,24 @@ +error[E0658]: `async` trait bounds are unstable + --> $DIR/feature-gate-async-trait-bounds.rs:3:17 + | +LL | fn test(_: impl async Fn()) {} + | ^^^^^ + | + = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = help: use the desugared name of the async trait, such as `AsyncFn` + +error[E0658]: use of unstable library feature `async_closure` + --> $DIR/feature-gate-async-trait-bounds.rs:3:23 + | +LL | fn test(_: impl async Fn()) {} + | ^^^^ + | + = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information + = help: add `#![feature(async_closure)]` 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: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-coroutines.rs b/tests/ui/feature-gates/feature-gate-coroutines.rs index a686357d910..f20dc56f122 100644 --- a/tests/ui/feature-gates/feature-gate-coroutines.rs +++ b/tests/ui/feature-gates/feature-gate-coroutines.rs @@ -1,5 +1,5 @@ //@ revisions: e2024 none -//@[e2024] compile-flags: --edition 2024 -Zunstable-options +//@[e2024] edition: 2024 fn main() { yield true; //~ ERROR yield syntax is experimental diff --git a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index 4836ffe1723..b596da8463f 100644 --- a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -5,7 +5,7 @@ LL | let Ok(_x) = &foo(); | ^^^^^^ pattern `&Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `&Result<u32, !>` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.rs b/tests/ui/feature-gates/feature-gate-gen_blocks.rs index d9bfeac36ed..01fd922b0e9 100644 --- a/tests/ui/feature-gates/feature-gate-gen_blocks.rs +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.rs @@ -1,5 +1,5 @@ //@ revisions: e2024 none -//@[e2024] compile-flags: --edition 2024 -Zunstable-options +//@[e2024] edition: 2024 fn test_gen() { gen {}; diff --git a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.rs b/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.rs deleted file mode 100644 index 7842d44ac4f..00000000000 --- a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.rs +++ /dev/null @@ -1,4 +0,0 @@ -// This feature doesn't *currently* fire on any specific code; it's just a -// behavior change. Future changes might. -#[rustc_error] //~ the -fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr b/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr deleted file mode 100644 index a5ab1b0d631..00000000000 --- a/tests/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable - --> $DIR/feature-gate-generic_associated_types_extended.rs:3:1 - | -LL | #[rustc_error] - | ^^^^^^^^^^^^^^ - | - = help: add `#![feature(rustc_attrs)]` 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: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-simd.rs b/tests/ui/feature-gates/feature-gate-simd.rs index e7aef5a97f2..9a27cb73f00 100644 --- a/tests/ui/feature-gates/feature-gate-simd.rs +++ b/tests/ui/feature-gates/feature-gate-simd.rs @@ -1,5 +1,3 @@ -//@ pretty-expanded FIXME #23616 - #[repr(simd)] //~ ERROR SIMD types are experimental struct RGBA { rgba: [f32; 4], diff --git a/tests/ui/feature-gates/feature-gate-simd.stderr b/tests/ui/feature-gates/feature-gate-simd.stderr index b020db35a51..834baa0a564 100644 --- a/tests/ui/feature-gates/feature-gate-simd.stderr +++ b/tests/ui/feature-gates/feature-gate-simd.stderr @@ -1,5 +1,5 @@ error[E0658]: SIMD types are experimental and possibly buggy - --> $DIR/feature-gate-simd.rs:3:1 + --> $DIR/feature-gate-simd.rs:1:1 | LL | #[repr(simd)] | ^^^^^^^^^^^^^ diff --git a/tests/ui/feature-gates/feature-gate-unsafe_fields.rs b/tests/ui/feature-gates/feature-gate-unsafe_fields.rs new file mode 100644 index 00000000000..8f9b411df46 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-unsafe_fields.rs @@ -0,0 +1,25 @@ +//@ compile-flags: --crate-type=lib +//@ revisions: with_gate without_gate +//@ [with_gate] check-pass + +#![cfg_attr(with_gate, feature(unsafe_fields))] //[with_gate]~ WARNING + +#[cfg(any())] +struct Foo { + unsafe field: (), //[without_gate]~ ERROR +} + +// This should not parse as an unsafe field definition. +struct FooTuple(unsafe fn()); + +#[cfg(any())] +enum Bar { + Variant { unsafe field: () }, //[without_gate]~ ERROR + // This should not parse as an unsafe field definition. + VariantTuple(unsafe fn()), +} + +#[cfg(any())] +union Baz { + unsafe field: (), //[without_gate]~ ERROR +} diff --git a/tests/ui/feature-gates/feature-gate-unsafe_fields.with_gate.stderr b/tests/ui/feature-gates/feature-gate-unsafe_fields.with_gate.stderr new file mode 100644 index 00000000000..a7deeb057d8 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-unsafe_fields.with_gate.stderr @@ -0,0 +1,11 @@ +warning: the feature `unsafe_fields` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/feature-gate-unsafe_fields.rs:5:32 + | +LL | #![cfg_attr(with_gate, feature(unsafe_fields))] + | ^^^^^^^^^^^^^ + | + = note: see issue #132922 <https://github.com/rust-lang/rust/issues/132922> for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/feature-gates/feature-gate-unsafe_fields.without_gate.stderr b/tests/ui/feature-gates/feature-gate-unsafe_fields.without_gate.stderr new file mode 100644 index 00000000000..ad0f5fd59ac --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-unsafe_fields.without_gate.stderr @@ -0,0 +1,33 @@ +error[E0658]: `unsafe` fields are experimental + --> $DIR/feature-gate-unsafe_fields.rs:9:5 + | +LL | unsafe field: (), + | ^^^^^^ + | + = note: see issue #132922 <https://github.com/rust-lang/rust/issues/132922> for more information + = help: add `#![feature(unsafe_fields)]` 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]: `unsafe` fields are experimental + --> $DIR/feature-gate-unsafe_fields.rs:17:15 + | +LL | Variant { unsafe field: () }, + | ^^^^^^ + | + = note: see issue #132922 <https://github.com/rust-lang/rust/issues/132922> for more information + = help: add `#![feature(unsafe_fields)]` 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]: `unsafe` fields are experimental + --> $DIR/feature-gate-unsafe_fields.rs:24:5 + | +LL | unsafe field: (), + | ^^^^^^ + | + = note: see issue #132922 <https://github.com/rust-lang/rust/issues/132922> for more information + = help: add `#![feature(unsafe_fields)]` 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: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/filter-block-view-items.rs b/tests/ui/filter-block-view-items.rs index f582c51a3a6..975ab19ddf2 100644 --- a/tests/ui/filter-block-view-items.rs +++ b/tests/ui/filter-block-view-items.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { // Make sure that this view item is filtered out because otherwise it would diff --git a/tests/ui/fmt/auxiliary/format-string-proc-macro.rs b/tests/ui/fmt/auxiliary/format-string-proc-macro.rs index 5c00c9c0800..f473fee0987 100644 --- a/tests/ui/fmt/auxiliary/format-string-proc-macro.rs +++ b/tests/ui/fmt/auxiliary/format-string-proc-macro.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; diff --git a/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs index 3a0b7ba4666..8ba6fcc46d4 100644 --- a/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs +++ b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs @@ -1,4 +1,4 @@ -//@ aux-build:format-string-proc-macro.rs +//@ proc-macro: format-string-proc-macro.rs #[macro_use] extern crate format_string_proc_macro; diff --git a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs index 24531e4ece4..26d483e43ae 100644 --- a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs +++ b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs @@ -1,4 +1,4 @@ -//@ aux-build:format-string-proc-macro.rs +//@ proc-macro: format-string-proc-macro.rs extern crate format_string_proc_macro; diff --git a/tests/ui/fmt/format-args-capture-issue-106408.rs b/tests/ui/fmt/format-args-capture-issue-106408.rs index 7c29e37441c..10f944dd9ba 100644 --- a/tests/ui/fmt/format-args-capture-issue-106408.rs +++ b/tests/ui/fmt/format-args-capture-issue-106408.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:format-string-proc-macro.rs +//@ proc-macro: format-string-proc-macro.rs extern crate format_string_proc_macro; diff --git a/tests/ui/fmt/format-args-capture-macro-hygiene.rs b/tests/ui/fmt/format-args-capture-macro-hygiene.rs index 2ef81f2cd42..21e445624a5 100644 --- a/tests/ui/fmt/format-args-capture-macro-hygiene.rs +++ b/tests/ui/fmt/format-args-capture-macro-hygiene.rs @@ -1,4 +1,4 @@ -//@ aux-build:format-string-proc-macro.rs +//@ proc-macro: format-string-proc-macro.rs #[macro_use] extern crate format_string_proc_macro; diff --git a/tests/ui/fmt/format-expanded-string.rs b/tests/ui/fmt/format-expanded-string.rs index d9b96bdece3..1466dabd7f7 100644 --- a/tests/ui/fmt/format-expanded-string.rs +++ b/tests/ui/fmt/format-expanded-string.rs @@ -1,4 +1,4 @@ -//@ aux-build:format-string-proc-macro.rs +//@ proc-macro: format-string-proc-macro.rs #[macro_use] extern crate format_string_proc_macro; diff --git a/tests/ui/fmt/indoc-issue-106408.rs b/tests/ui/fmt/indoc-issue-106408.rs index 36e5c23a394..8c302e5b03a 100644 --- a/tests/ui/fmt/indoc-issue-106408.rs +++ b/tests/ui/fmt/indoc-issue-106408.rs @@ -1,4 +1,4 @@ -//@ aux-build:format-string-proc-macro.rs +//@ proc-macro: format-string-proc-macro.rs //@ check-pass extern crate format_string_proc_macro; diff --git a/tests/ui/fmt/respanned-literal-issue-106191.rs b/tests/ui/fmt/respanned-literal-issue-106191.rs index 0a127b1a0ca..39f09b6e63a 100644 --- a/tests/ui/fmt/respanned-literal-issue-106191.rs +++ b/tests/ui/fmt/respanned-literal-issue-106191.rs @@ -1,4 +1,4 @@ -//@ aux-build:format-string-proc-macro.rs +//@ proc-macro: format-string-proc-macro.rs extern crate format_string_proc_macro; diff --git a/tests/ui/fn/fn-item-type.stderr b/tests/ui/fn/fn-item-type.stderr index 76cdbcceac8..5cc529543d2 100644 --- a/tests/ui/fn/fn-item-type.stderr +++ b/tests/ui/fn/fn-item-type.stderr @@ -17,7 +17,7 @@ LL | fn eq<T>(x: T, y: T) {} | ^^ - ---- ---- this parameter needs to match the fn item type of `x` | | | | | `y` needs to match the fn item type of this parameter - | `x` and `y` all reference this parameter T + | `x` and `y` both reference this parameter `T` = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize` error[E0308]: mismatched types @@ -39,7 +39,7 @@ LL | fn eq<T>(x: T, y: T) {} | ^^ - ---- ---- this parameter needs to match the fn item type of `x` | | | | | `y` needs to match the fn item type of this parameter - | `x` and `y` all reference this parameter T + | `x` and `y` both reference this parameter `T` = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize` error[E0308]: mismatched types @@ -61,7 +61,7 @@ LL | fn eq<T>(x: T, y: T) {} | ^^ - ---- ---- this parameter needs to match the fn item type of `x` | | | | | `y` needs to match the fn item type of this parameter - | `x` and `y` all reference this parameter T + | `x` and `y` both reference this parameter `T` = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize` error[E0308]: mismatched types @@ -83,7 +83,7 @@ LL | fn eq<T>(x: T, y: T) {} | ^^ - ---- ---- this parameter needs to match the fn item type of `x` | | | | | `y` needs to match the fn item type of this parameter - | `x` and `y` all reference this parameter T + | `x` and `y` both reference this parameter `T` = help: consider casting both fn items to fn pointers using `as fn()` error[E0308]: mismatched types @@ -105,7 +105,7 @@ LL | fn eq<T>(x: T, y: T) {} | ^^ - ---- ---- this parameter needs to match the fn item type of `x` | | | | | `y` needs to match the fn item type of this parameter - | `x` and `y` all reference this parameter T + | `x` and `y` both reference this parameter `T` error: aborting due to 5 previous errors diff --git a/tests/ui/fn/issue-1451.rs b/tests/ui/fn/issue-1451.rs index 735b766bd0c..40b107ca7cc 100644 --- a/tests/ui/fn/issue-1451.rs +++ b/tests/ui/fn/issue-1451.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![allow(non_snake_case)] #![allow(unused_variables)] diff --git a/tests/ui/fn/param-mismatch-no-names.rs b/tests/ui/fn/param-mismatch-no-names.rs new file mode 100644 index 00000000000..05f3de190ea --- /dev/null +++ b/tests/ui/fn/param-mismatch-no-names.rs @@ -0,0 +1,8 @@ +fn same_type<T>(_: T, _: T) {} + +fn f<X, Y>(x: X, y: Y) { + same_type([x], Some(y)); + //~^ ERROR mismatched types +} + +fn main() {} diff --git a/tests/ui/fn/param-mismatch-no-names.stderr b/tests/ui/fn/param-mismatch-no-names.stderr new file mode 100644 index 00000000000..d9d360d5ae4 --- /dev/null +++ b/tests/ui/fn/param-mismatch-no-names.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/param-mismatch-no-names.rs:4:20 + | +LL | same_type([x], Some(y)); + | --------- --- ^^^^^^^ expected `[X; 1]`, found `Option<Y>` + | | | + | | expected all arguments to be this `[X; 1]` type because they need to match the type of this parameter + | arguments to this function are incorrect + | + = note: expected array `[X; 1]` + found enum `Option<Y>` +note: function defined here + --> $DIR/param-mismatch-no-names.rs:1:4 + | +LL | fn same_type<T>(_: T, _: T) {} + | ^^^^^^^^^ - ---- ---- this parameter needs to match the `[X; 1]` type of parameter #1 + | | | + | | parameter #2 needs to match the `[X; 1]` type of this parameter + | parameter #1 and parameter #2 both reference this parameter `T` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/for-loop-while/break-value.rs b/tests/ui/for-loop-while/break-value.rs index 1289231fc30..eb9ccb21203 100644 --- a/tests/ui/for-loop-while/break-value.rs +++ b/tests/ui/for-loop-while/break-value.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unreachable_code)] -//@ pretty-expanded FIXME #23616 fn int_id(x: isize) -> isize { return x; } diff --git a/tests/ui/for-loop-while/issue-1257.rs b/tests/ui/for-loop-while/issue-1257.rs index cdd4c806358..369302f9f12 100644 --- a/tests/ui/for-loop-while/issue-1257.rs +++ b/tests/ui/for-loop-while/issue-1257.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main () { let mut line = "".to_string(); diff --git a/tests/ui/for-loop-while/labeled-break.rs b/tests/ui/for-loop-while/labeled-break.rs index 0dfbdc02f5b..9c53350f227 100644 --- a/tests/ui/for-loop-while/labeled-break.rs +++ b/tests/ui/for-loop-while/labeled-break.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { 'foo: loop { diff --git a/tests/ui/for-loop-while/liveness-assign-imm-local-after-loop.rs b/tests/ui/for-loop-while/liveness-assign-imm-local-after-loop.rs index be6dc33c8be..31f2ecf2aff 100644 --- a/tests/ui/for-loop-while/liveness-assign-imm-local-after-loop.rs +++ b/tests/ui/for-loop-while/liveness-assign-imm-local-after-loop.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_assignments)] -//@ pretty-expanded FIXME #23616 #![allow(unreachable_code)] #![allow(unused_variables)] diff --git a/tests/ui/for-loop-while/liveness-move-in-loop.rs b/tests/ui/for-loop-while/liveness-move-in-loop.rs index 0ae92a78a04..0c35479cf12 100644 --- a/tests/ui/for-loop-while/liveness-move-in-loop.rs +++ b/tests/ui/for-loop-while/liveness-move-in-loop.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn take(x: isize) -> isize {x} diff --git a/tests/ui/for-loop-while/long-while.rs b/tests/ui/for-loop-while/long-while.rs index 6db06baa873..5b9fbb10453 100644 --- a/tests/ui/for-loop-while/long-while.rs +++ b/tests/ui/for-loop-while/long-while.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/tests/ui/for-loop-while/loop-diverges.rs b/tests/ui/for-loop-while/loop-diverges.rs index fdf46387795..77d15e3c321 100644 --- a/tests/ui/for-loop-while/loop-diverges.rs +++ b/tests/ui/for-loop-while/loop-diverges.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_parens)] -//@ pretty-expanded FIXME #23616 /* Make sure a loop{} can be the tailexpr in the body of a diverging function */ diff --git a/tests/ui/for-loop-while/loop-label-shadowing.rs b/tests/ui/for-loop-while/loop-label-shadowing.rs index e3dfbe65d8c..030da69cbb7 100644 --- a/tests/ui/for-loop-while/loop-label-shadowing.rs +++ b/tests/ui/for-loop-while/loop-label-shadowing.rs @@ -1,7 +1,6 @@ //@ run-pass // Issue #12512. -//@ pretty-expanded FIXME #23616 fn main() { let mut foo = Vec::new(); diff --git a/tests/ui/for-loop-while/loop-labeled-break-value.rs b/tests/ui/for-loop-while/loop-labeled-break-value.rs index 0ab07ffd7e2..702bda1b90a 100644 --- a/tests/ui/for-loop-while/loop-labeled-break-value.rs +++ b/tests/ui/for-loop-while/loop-labeled-break-value.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { 'outer: loop { diff --git a/tests/ui/for-loop-while/loop-no-reinit-needed-post-bot.rs b/tests/ui/for-loop-while/loop-no-reinit-needed-post-bot.rs index 531c3dc377d..cf4474d815b 100644 --- a/tests/ui/for-loop-while/loop-no-reinit-needed-post-bot.rs +++ b/tests/ui/for-loop-while/loop-no-reinit-needed-post-bot.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct S; // Ensure S is moved, not copied, on assignment. diff --git a/tests/ui/for-loop-while/while-flow-graph.rs b/tests/ui/for-loop-while/while-flow-graph.rs index 9148b42a606..e964d019588 100644 --- a/tests/ui/for-loop-while/while-flow-graph.rs +++ b/tests/ui/for-loop-while/while-flow-graph.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let x: isize = 10; while x == 10 && x == 11 { let _y = 0xf00_usize; } } diff --git a/tests/ui/foreign/foreign-mod-unused-const.rs b/tests/ui/foreign/foreign-mod-unused-const.rs index 2cc0a4f6018..4e40f92fdd4 100644 --- a/tests/ui/foreign/foreign-mod-unused-const.rs +++ b/tests/ui/foreign/foreign-mod-unused-const.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 mod foo { extern "C" { diff --git a/tests/ui/foreign/foreign2.rs b/tests/ui/foreign/foreign2.rs index 178a04255cc..a2f8385c845 100644 --- a/tests/ui/foreign/foreign2.rs +++ b/tests/ui/foreign/foreign2.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] #![feature(rustc_private)] diff --git a/tests/ui/foreign/nil-decl-in-foreign.rs b/tests/ui/foreign/nil-decl-in-foreign.rs index 355278d99da..6adf08246e7 100644 --- a/tests/ui/foreign/nil-decl-in-foreign.rs +++ b/tests/ui/foreign/nil-decl-in-foreign.rs @@ -3,7 +3,6 @@ #![allow(improper_ctypes)] #![allow(dead_code)] // Issue #901 -//@ pretty-expanded FIXME #23616 mod libc { extern "C" { diff --git a/tests/ui/fuel/optimization-fuel-0.rs b/tests/ui/fuel/optimization-fuel-0.rs deleted file mode 100644 index cbcb1d329a3..00000000000 --- a/tests/ui/fuel/optimization-fuel-0.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ run-pass - -#![crate_name="foo"] - -use std::mem::size_of; - -//@ compile-flags: -Z fuel=foo=0 - -#[allow(dead_code)] -struct S1(u8, u16, u8); -#[allow(dead_code)] -struct S2(u8, u16, u8); - -fn main() { - assert_eq!(size_of::<S1>(), 6); - assert_eq!(size_of::<S2>(), 6); -} diff --git a/tests/ui/fuel/optimization-fuel-0.stderr b/tests/ui/fuel/optimization-fuel-0.stderr deleted file mode 100644 index f0e2ebfc37a..00000000000 --- a/tests/ui/fuel/optimization-fuel-0.stderr +++ /dev/null @@ -1,4 +0,0 @@ -warning: optimization-fuel-exhausted: Reorder fields of "S1" - -warning: 1 warning emitted - diff --git a/tests/ui/fuel/optimization-fuel-1.rs b/tests/ui/fuel/optimization-fuel-1.rs deleted file mode 100644 index 97edb0bd259..00000000000 --- a/tests/ui/fuel/optimization-fuel-1.rs +++ /dev/null @@ -1,18 +0,0 @@ -//@ run-pass - -#![crate_name="foo"] - -use std::mem::size_of; - -//@ compile-flags: -Z fuel=foo=1 - -#[allow(dead_code)] -struct S1(u8, u16, u8); -#[allow(dead_code)] -struct S2(u8, u16, u8); - -fn main() { - let optimized = (size_of::<S1>() == 4) as usize - +(size_of::<S2>() == 4) as usize; - assert_eq!(optimized, 1); -} diff --git a/tests/ui/fuel/optimization-fuel-1.stderr b/tests/ui/fuel/optimization-fuel-1.stderr deleted file mode 100644 index 53eafb05830..00000000000 --- a/tests/ui/fuel/optimization-fuel-1.stderr +++ /dev/null @@ -1,4 +0,0 @@ -warning: optimization-fuel-exhausted: Reorder fields of "S2" - -warning: 1 warning emitted - diff --git a/tests/ui/fuel/print-fuel.rs b/tests/ui/fuel/print-fuel.rs deleted file mode 100644 index fd7e568bea7..00000000000 --- a/tests/ui/fuel/print-fuel.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_name="foo"] -#![allow(dead_code)] - -// (#55495: The --error-format is to sidestep an issue in our test harness) -//@ compile-flags: -C opt-level=0 --error-format human -Z print-fuel=foo -//@ check-pass - -struct S1(u8, u16, u8); -struct S2(u8, u16, u8); -struct S3(u8, u16, u8); - -fn main() { -} diff --git a/tests/ui/fuel/print-fuel.stderr b/tests/ui/fuel/print-fuel.stderr deleted file mode 100644 index cc88cc077bb..00000000000 --- a/tests/ui/fuel/print-fuel.stderr +++ /dev/null @@ -1 +0,0 @@ -Fuel used by foo: 3 diff --git a/tests/ui/functions-closures/closure-bounds-can-capture-chan.rs b/tests/ui/functions-closures/closure-bounds-can-capture-chan.rs index 4f38ea02d9c..318ca54ffd6 100644 --- a/tests/ui/functions-closures/closure-bounds-can-capture-chan.rs +++ b/tests/ui/functions-closures/closure-bounds-can-capture-chan.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::sync::mpsc::channel; diff --git a/tests/ui/functions-closures/fn-abi.rs b/tests/ui/functions-closures/fn-abi.rs index d33158e8917..350132f0f55 100644 --- a/tests/ui/functions-closures/fn-abi.rs +++ b/tests/ui/functions-closures/fn-abi.rs @@ -2,7 +2,6 @@ // Ensure that declarations and types which use `extern fn` both have the same // ABI (#9309). -//@ pretty-expanded FIXME #23616 //@ aux-build:fn-abi.rs extern crate fn_abi; diff --git a/tests/ui/functions-closures/fn-bare-coerce-to-block.rs b/tests/ui/functions-closures/fn-bare-coerce-to-block.rs index 18015a41564..9c80463d59e 100644 --- a/tests/ui/functions-closures/fn-bare-coerce-to-block.rs +++ b/tests/ui/functions-closures/fn-bare-coerce-to-block.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn bare() {} diff --git a/tests/ui/functions-closures/fn-coerce-field.rs b/tests/ui/functions-closures/fn-coerce-field.rs index dd7be374c84..7a9e1e5e82c 100644 --- a/tests/ui/functions-closures/fn-coerce-field.rs +++ b/tests/ui/functions-closures/fn-coerce-field.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] struct r<F> where F: FnOnce() { diff --git a/tests/ui/functions-closures/fn-item-type-coerce.rs b/tests/ui/functions-closures/fn-item-type-coerce.rs index e858f9e9e19..a5a0a4995bf 100644 --- a/tests/ui/functions-closures/fn-item-type-coerce.rs +++ b/tests/ui/functions-closures/fn-item-type-coerce.rs @@ -2,7 +2,6 @@ #![allow(unused_variables)] // Test implicit coercions from a fn item type to a fn pointer type. -//@ pretty-expanded FIXME #23616 fn foo(x: isize) -> isize { x * 2 } fn bar(x: isize) -> isize { x * 4 } diff --git a/tests/ui/functions-closures/fn-lval.rs b/tests/ui/functions-closures/fn-lval.rs index aa080f6b985..7b5e4d66517 100644 --- a/tests/ui/functions-closures/fn-lval.rs +++ b/tests/ui/functions-closures/fn-lval.rs @@ -2,7 +2,6 @@ -//@ pretty-expanded FIXME #23616 fn foo(_f: fn(isize) -> isize) { } diff --git a/tests/ui/functions-closures/fn-type-infer.rs b/tests/ui/functions-closures/fn-type-infer.rs index b1624e476ef..eb9e5b10467 100644 --- a/tests/ui/functions-closures/fn-type-infer.rs +++ b/tests/ui/functions-closures/fn-type-infer.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/tests/ui/generic-associated-types/extended/lending_iterator.rs b/tests/ui/generic-associated-types/extended/lending_iterator.rs index 7cd32413001..8d815f6dc78 100644 --- a/tests/ui/generic-associated-types/extended/lending_iterator.rs +++ b/tests/ui/generic-associated-types/extended/lending_iterator.rs @@ -1,9 +1,4 @@ -//@ revisions: base extended -//@[base] check-fail -//@[extended] check-pass - -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] +//@ known-bug: #133805 pub trait FromLendingIterator<A>: Sized { fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self; @@ -11,7 +6,6 @@ pub trait FromLendingIterator<A>: Sized { impl<A> FromLendingIterator<A> for Vec<A> { fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self { - //[base]~^ impl has stricter let mut v = vec![]; while let Some(item) = iter.next() { v.push(item); @@ -32,7 +26,6 @@ pub trait LendingIterator { Self: for<'q> LendingIterator<Item<'q> = A>, { <B as FromLendingIterator<A>>::from_iter(self) - //[base]~^ ERROR: does not live long enough } } diff --git a/tests/ui/generic-associated-types/extended/lending_iterator.base.stderr b/tests/ui/generic-associated-types/extended/lending_iterator.stderr index b19280b45c2..84f5ed07bda 100644 --- a/tests/ui/generic-associated-types/extended/lending_iterator.base.stderr +++ b/tests/ui/generic-associated-types/extended/lending_iterator.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/lending_iterator.rs:13:45 + --> $DIR/lending_iterator.rs:8:45 | LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self; | ------------------------------------------------------------------------ definition of `from_iter` from trait @@ -8,7 +8,7 @@ LL | fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> | ^^^^^^^^^^^^ impl has extra requirement `I: 'x` error: `Self` does not live long enough - --> $DIR/lending_iterator.rs:34:9 + --> $DIR/lending_iterator.rs:28:9 | LL | <B as FromLendingIterator<A>>::from_iter(self) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/generic-associated-types/extended/lending_iterator_2.rs b/tests/ui/generic-associated-types/extended/lending_iterator_2.rs index f4b0dae0a91..0545d4d12bb 100644 --- a/tests/ui/generic-associated-types/extended/lending_iterator_2.rs +++ b/tests/ui/generic-associated-types/extended/lending_iterator_2.rs @@ -1,9 +1,4 @@ -//@ revisions: base extended -//@[base] check-fail -//@[extended] check-pass - -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] +//@ known-bug: #133805 pub trait FromLendingIterator<A>: Sized { fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self; @@ -11,7 +6,6 @@ pub trait FromLendingIterator<A>: Sized { impl<A> FromLendingIterator<A> for Vec<A> { fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self { - //[base]~^ impl has stricter let mut v = vec![]; while let Some(item) = iter.next() { v.push(item); diff --git a/tests/ui/generic-associated-types/extended/lending_iterator_2.base.stderr b/tests/ui/generic-associated-types/extended/lending_iterator_2.stderr index 717d867057e..47c32a28aea 100644 --- a/tests/ui/generic-associated-types/extended/lending_iterator_2.base.stderr +++ b/tests/ui/generic-associated-types/extended/lending_iterator_2.stderr @@ -1,5 +1,5 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/lending_iterator_2.rs:13:45 + --> $DIR/lending_iterator_2.rs:8:45 | LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self; | ------------------------------------------------------------------------ definition of `from_iter` from trait diff --git a/tests/ui/generic-associated-types/gat-in-trait-path.rs b/tests/ui/generic-associated-types/gat-in-trait-path.rs index 7eb0aabb333..cd759a73cf2 100644 --- a/tests/ui/generic-associated-types/gat-in-trait-path.rs +++ b/tests/ui/generic-associated-types/gat-in-trait-path.rs @@ -1,10 +1,6 @@ -//@ revisions: base extended -//@[base] check-fail -//@[extended] check-pass +//@ check-fail #![feature(associated_type_defaults)] -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] trait Foo { type A<'a> where Self: 'a; @@ -24,12 +20,12 @@ impl<T> Foo for Fooer<T> { } fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {} -//[base]~^ the trait `Foo` cannot be made into an object +//~^ the trait `Foo` cannot be made into an object fn main() { let foo = Fooer(5); f(Box::new(foo)); - //[base]~^ the trait `Foo` cannot be made into an object - //[base]~| the trait `Foo` cannot be made into an object + //~^ the trait `Foo` cannot be made into an object + //~| the trait `Foo` cannot be made into an object } diff --git a/tests/ui/generic-associated-types/gat-in-trait-path.stderr b/tests/ui/generic-associated-types/gat-in-trait-path.stderr new file mode 100644 index 00000000000..b2176fa6de3 --- /dev/null +++ b/tests/ui/generic-associated-types/gat-in-trait-path.stderr @@ -0,0 +1,58 @@ +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/gat-in-trait-path.rs:22:17 + | +LL | fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/gat-in-trait-path.rs:6:10 + | +LL | trait Foo { + | --- this trait cannot be made into an object... +LL | type A<'a> where Self: 'a; + | ^ ...because it contains the generic associated type `A` + = help: consider moving `A` to another trait + = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `Foo` for this new enum and using it instead: + Fooy + Fooer<T> + +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/gat-in-trait-path.rs:28:5 + | +LL | f(Box::new(foo)); + | ^^^^^^^^^^^^^ `Foo` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/gat-in-trait-path.rs:6:10 + | +LL | trait Foo { + | --- this trait cannot be made into an object... +LL | type A<'a> where Self: 'a; + | ^ ...because it contains the generic associated type `A` + = help: consider moving `A` to another trait + = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `Foo` for this new enum and using it instead: + Fooy + Fooer<T> + +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/gat-in-trait-path.rs:28:5 + | +LL | f(Box::new(foo)); + | ^^^^^^^^^^^^^ `Foo` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/gat-in-trait-path.rs:6:10 + | +LL | trait Foo { + | --- this trait cannot be made into an object... +LL | type A<'a> where Self: 'a; + | ^ ...because it contains the generic associated type `A` + = help: consider moving `A` to another trait + = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `Foo` for this new enum and using it instead: + Fooy + Fooer<T> + = note: required for the cast from `Box<Fooer<{integer}>>` to `Box<(dyn Foo<A<'a> = &'a ()> + 'static)>` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/generic-associated-types/issue-67510-pass.rs b/tests/ui/generic-associated-types/issue-67510-pass.rs index 1596f401bbc..a48d9c37cd4 100644 --- a/tests/ui/generic-associated-types/issue-67510-pass.rs +++ b/tests/ui/generic-associated-types/issue-67510-pass.rs @@ -1,15 +1,10 @@ -//@ revisions: base extended -//@[base] check-fail -//@[extended] check-pass - -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] +//@ check-fail trait X { type Y<'a>; } fn _func1<'a>(_x: Box<dyn X<Y<'a>=&'a ()>>) {} -//[base]~^ ERROR the trait `X` cannot be made into an object +//~^ ERROR the trait `X` cannot be made into an object fn main() {} diff --git a/tests/ui/generic-associated-types/issue-67510-pass.stderr b/tests/ui/generic-associated-types/issue-67510-pass.stderr new file mode 100644 index 00000000000..5560cb0f64d --- /dev/null +++ b/tests/ui/generic-associated-types/issue-67510-pass.stderr @@ -0,0 +1,18 @@ +error[E0038]: the trait `X` cannot be made into an object + --> $DIR/issue-67510-pass.rs:7:23 + | +LL | fn _func1<'a>(_x: Box<dyn X<Y<'a>=&'a ()>>) {} + | ^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/issue-67510-pass.rs:4:10 + | +LL | trait X { + | - this trait cannot be made into an object... +LL | type Y<'a>; + | ^ ...because it contains the generic associated type `Y` + = help: consider moving `Y` to another trait + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/generic-associated-types/issue-71176.rs b/tests/ui/generic-associated-types/issue-71176.rs index b33fda8e154..7fffe312f4b 100644 --- a/tests/ui/generic-associated-types/issue-71176.rs +++ b/tests/ui/generic-associated-types/issue-71176.rs @@ -16,6 +16,8 @@ struct Holder<B> { fn main() { Holder { - inner: Box::new(()), //~ ERROR: the trait `Provider` cannot be made into an object + inner: Box::new(()), + //~^ ERROR: the trait `Provider` cannot be made into an object + //~| ERROR: the trait `Provider` cannot be made into an object }; } diff --git a/tests/ui/generic-associated-types/issue-71176.stderr b/tests/ui/generic-associated-types/issue-71176.stderr index 15d5a3df6f2..1cd2ed0d313 100644 --- a/tests/ui/generic-associated-types/issue-71176.stderr +++ b/tests/ui/generic-associated-types/issue-71176.stderr @@ -80,7 +80,24 @@ LL | type A<'a>; = help: consider moving `A` to another trait = help: only type `()` implements the trait, consider using it directly instead -error: aborting due to 5 previous errors +error[E0038]: the trait `Provider` cannot be made into an object + --> $DIR/issue-71176.rs:19:16 + | +LL | inner: Box::new(()), + | ^^^^^^^^^^^^ `Provider` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/issue-71176.rs:2:10 + | +LL | trait Provider { + | -------- this trait cannot be made into an object... +LL | type A<'a>; + | ^ ...because it contains the generic associated type `A` + = help: consider moving `A` to another trait + = help: only type `()` implements the trait, consider using it directly instead + = note: required for the cast from `Box<()>` to `Box<(dyn Provider<A<'_> = _> + 'static), {type error}>` + +error: aborting due to 6 previous errors Some errors have detailed explanations: E0038, E0107. For more information about an error, try `rustc --explain E0038`. diff --git a/tests/ui/generic-associated-types/issue-76535.rs b/tests/ui/generic-associated-types/issue-76535.rs index cf26b65c85f..9e18c82c7f1 100644 --- a/tests/ui/generic-associated-types/issue-76535.rs +++ b/tests/ui/generic-associated-types/issue-76535.rs @@ -1,8 +1,3 @@ -//@ revisions: base extended - -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] - pub trait SubTrait {} pub trait SuperTrait { @@ -38,6 +33,6 @@ impl SuperTrait for SuperStruct { fn main() { let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); //~^ ERROR missing generics for associated type - //[base]~^^ ERROR the trait - //[base]~| ERROR the trait + //~^^ ERROR the trait + //~| ERROR the trait } diff --git a/tests/ui/generic-associated-types/issue-76535.stderr b/tests/ui/generic-associated-types/issue-76535.stderr new file mode 100644 index 00000000000..613ded6f1ef --- /dev/null +++ b/tests/ui/generic-associated-types/issue-76535.stderr @@ -0,0 +1,55 @@ +error[E0107]: missing generics for associated type `SuperTrait::SubType` + --> $DIR/issue-76535.rs:34:33 + | +LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); + | ^^^^^^^ expected 1 lifetime argument + | +note: associated type defined here, with 1 lifetime parameter: `'a` + --> $DIR/issue-76535.rs:4:10 + | +LL | type SubType<'a>: SubTrait where Self: 'a; + | ^^^^^^^ -- +help: add missing lifetime argument + | +LL | let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperStruct::new(0)); + | ++++ + +error[E0038]: the trait `SuperTrait` cannot be made into an object + --> $DIR/issue-76535.rs:34:14 + | +LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/issue-76535.rs:4:10 + | +LL | pub trait SuperTrait { + | ---------- this trait cannot be made into an object... +LL | type SubType<'a>: SubTrait where Self: 'a; + | ^^^^^^^ ...because it contains the generic associated type `SubType` + = help: consider moving `SubType` to another trait + = help: only type `SuperStruct` is seen to implement the trait in this crate, consider using it directly instead + = note: `SuperTrait` can be implemented in other crates; if you want to support your users passing their own types here, you can't refer to a specific type + +error[E0038]: the trait `SuperTrait` cannot be made into an object + --> $DIR/issue-76535.rs:34:57 + | +LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/issue-76535.rs:4:10 + | +LL | pub trait SuperTrait { + | ---------- this trait cannot be made into an object... +LL | type SubType<'a>: SubTrait where Self: 'a; + | ^^^^^^^ ...because it contains the generic associated type `SubType` + = help: consider moving `SubType` to another trait + = help: only type `SuperStruct` is seen to implement the trait in this crate, consider using it directly instead + = note: `SuperTrait` can be implemented in other crates; if you want to support your users passing their own types here, you can't refer to a specific type + = note: required for the cast from `Box<SuperStruct>` to `Box<dyn SuperTrait<SubType<'_> = SubStruct<'_>>>` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0038, E0107. +For more information about an error, try `rustc --explain E0038`. diff --git a/tests/ui/generic-associated-types/issue-78671.rs b/tests/ui/generic-associated-types/issue-78671.rs index ce4c040644a..0871def1731 100644 --- a/tests/ui/generic-associated-types/issue-78671.rs +++ b/tests/ui/generic-associated-types/issue-78671.rs @@ -1,15 +1,10 @@ -//@ revisions: base extended - -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] - trait CollectionFamily { type Member<T>; } fn floatify() { Box::new(Family) as &dyn CollectionFamily<Member=usize> //~^ ERROR: missing generics for associated type - //[base]~^^ ERROR: the trait `CollectionFamily` cannot be made into an object + //~| ERROR: the trait `CollectionFamily` cannot be made into an object } struct Family; diff --git a/tests/ui/generic-associated-types/issue-78671.stderr b/tests/ui/generic-associated-types/issue-78671.stderr new file mode 100644 index 00000000000..fbd76c73895 --- /dev/null +++ b/tests/ui/generic-associated-types/issue-78671.stderr @@ -0,0 +1,35 @@ +error[E0107]: missing generics for associated type `CollectionFamily::Member` + --> $DIR/issue-78671.rs:5:47 + | +LL | Box::new(Family) as &dyn CollectionFamily<Member=usize> + | ^^^^^^ expected 1 generic argument + | +note: associated type defined here, with 1 generic parameter: `T` + --> $DIR/issue-78671.rs:2:10 + | +LL | type Member<T>; + | ^^^^^^ - +help: add missing generic argument + | +LL | Box::new(Family) as &dyn CollectionFamily<Member<T>=usize> + | +++ + +error[E0038]: the trait `CollectionFamily` cannot be made into an object + --> $DIR/issue-78671.rs:5:25 + | +LL | Box::new(Family) as &dyn CollectionFamily<Member=usize> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `CollectionFamily` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/issue-78671.rs:2:10 + | +LL | trait CollectionFamily { + | ---------------- this trait cannot be made into an object... +LL | type Member<T>; + | ^^^^^^ ...because it contains the generic associated type `Member` + = help: consider moving `Member` to another trait + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0038, E0107. +For more information about an error, try `rustc --explain E0038`. diff --git a/tests/ui/generic-associated-types/issue-79422.rs b/tests/ui/generic-associated-types/issue-79422.rs index bf61dcaee3a..fba7a86990e 100644 --- a/tests/ui/generic-associated-types/issue-79422.rs +++ b/tests/ui/generic-associated-types/issue-79422.rs @@ -1,8 +1,3 @@ -//@ revisions: base extended - -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] - trait RefCont<'a, T> { fn t(&'a self) -> &'a T; } @@ -42,9 +37,8 @@ impl<K, V: Default> MapLike<K, V> for Source { fn main() { let m = Box::new(std::collections::BTreeMap::<u8, u8>::new()) - //[base]~^ ERROR the trait - //[extended]~^^ type mismatch + //~^ ERROR the trait as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>; //~^ ERROR missing generics for associated type - //[base]~^^ ERROR the trait + //~| ERROR the trait } diff --git a/tests/ui/generic-associated-types/issue-79422.stderr b/tests/ui/generic-associated-types/issue-79422.stderr new file mode 100644 index 00000000000..26567e5e927 --- /dev/null +++ b/tests/ui/generic-associated-types/issue-79422.stderr @@ -0,0 +1,57 @@ +error[E0107]: missing generics for associated type `MapLike::VRefCont` + --> $DIR/issue-79422.rs:41:36 + | +LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>; + | ^^^^^^^^ expected 1 lifetime argument + | +note: associated type defined here, with 1 lifetime parameter: `'a` + --> $DIR/issue-79422.rs:18:10 + | +LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a; + | ^^^^^^^^ -- +help: add missing lifetime argument + | +LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>; + | ++++ + +error[E0038]: the trait `MapLike` cannot be made into an object + --> $DIR/issue-79422.rs:41:12 + | +LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/issue-79422.rs:18:10 + | +LL | trait MapLike<K, V> { + | ------- this trait cannot be made into an object... +LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a; + | ^^^^^^^^ ...because it contains the generic associated type `VRefCont` + = help: consider moving `VRefCont` to another trait + = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `MapLike` for this new enum and using it instead: + std::collections::BTreeMap<K, V> + Source + +error[E0038]: the trait `MapLike` cannot be made into an object + --> $DIR/issue-79422.rs:39:13 + | +LL | let m = Box::new(std::collections::BTreeMap::<u8, u8>::new()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/issue-79422.rs:18:10 + | +LL | trait MapLike<K, V> { + | ------- this trait cannot be made into an object... +LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a; + | ^^^^^^^^ ...because it contains the generic associated type `VRefCont` + = help: consider moving `VRefCont` to another trait + = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `MapLike` for this new enum and using it instead: + std::collections::BTreeMap<K, V> + Source + = note: required for the cast from `Box<BTreeMap<u8, u8>>` to `Box<dyn MapLike<u8, u8, VRefCont<'_> = (dyn RefCont<'_, u8> + 'static)>>` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0038, E0107. +For more information about an error, try `rustc --explain E0038`. diff --git a/tests/ui/generic-associated-types/parse/in-trait-impl.rs b/tests/ui/generic-associated-types/parse/in-trait-impl.rs index 5ba42be3583..ef67fb18228 100644 --- a/tests/ui/generic-associated-types/parse/in-trait-impl.rs +++ b/tests/ui/generic-associated-types/parse/in-trait-impl.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only impl<T> Baz for T where T: Foo { type Quux<'a> = <T as Foo>::Bar<'a, 'static>; diff --git a/tests/ui/generic-associated-types/parse/in-trait.rs b/tests/ui/generic-associated-types/parse/in-trait.rs index 913eceec0da..2add908d727 100644 --- a/tests/ui/generic-associated-types/parse/in-trait.rs +++ b/tests/ui/generic-associated-types/parse/in-trait.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only use std::ops::Deref; use std::fmt::Debug; diff --git a/tests/ui/generic-associated-types/trait-objects.rs b/tests/ui/generic-associated-types/trait-objects.rs index 743a3df0acc..bad9289ee5e 100644 --- a/tests/ui/generic-associated-types/trait-objects.rs +++ b/tests/ui/generic-associated-types/trait-objects.rs @@ -1,8 +1,3 @@ -//@ revisions: base extended - -#![cfg_attr(extended, feature(generic_associated_types_extended))] -#![cfg_attr(extended, allow(incomplete_features))] - trait StreamingIterator { type Item<'a> where Self: 'a; fn size_hint(&self) -> (usize, Option<usize>); @@ -11,11 +6,10 @@ trait StreamingIterator { } fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize { - //[base]~^ the trait `StreamingIterator` cannot be made into an object + //~^ the trait `StreamingIterator` cannot be made into an object x.size_hint().0 - //[extended]~^ borrowed data escapes - //[base]~^^ the trait `StreamingIterator` cannot be made into an object - //[base]~| the trait `StreamingIterator` cannot be made into an object + //~^ the trait `StreamingIterator` cannot be made into an object + //~| the trait `StreamingIterator` cannot be made into an object } fn main() {} diff --git a/tests/ui/generic-associated-types/trait-objects.stderr b/tests/ui/generic-associated-types/trait-objects.stderr new file mode 100644 index 00000000000..3e74776f999 --- /dev/null +++ b/tests/ui/generic-associated-types/trait-objects.stderr @@ -0,0 +1,48 @@ +error[E0038]: the trait `StreamingIterator` cannot be made into an object + --> $DIR/trait-objects.rs:8:21 + | +LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/trait-objects.rs:2:10 + | +LL | trait StreamingIterator { + | ----------------- this trait cannot be made into an object... +LL | type Item<'a> where Self: 'a; + | ^^^^ ...because it contains the generic associated type `Item` + = help: consider moving `Item` to another trait + +error[E0038]: the trait `StreamingIterator` cannot be made into an object + --> $DIR/trait-objects.rs:10:7 + | +LL | x.size_hint().0 + | ^^^^^^^^^ `StreamingIterator` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/trait-objects.rs:2:10 + | +LL | trait StreamingIterator { + | ----------------- this trait cannot be made into an object... +LL | type Item<'a> where Self: 'a; + | ^^^^ ...because it contains the generic associated type `Item` + = help: consider moving `Item` to another trait + +error[E0038]: the trait `StreamingIterator` cannot be made into an object + --> $DIR/trait-objects.rs:10:5 + | +LL | x.size_hint().0 + | ^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/trait-objects.rs:2:10 + | +LL | trait StreamingIterator { + | ----------------- this trait cannot be made into an object... +LL | type Item<'a> where Self: 'a; + | ^^^^ ...because it contains the generic associated type `Item` + = help: consider moving `Item` to another trait + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/generics/generic-default-type-params-cross-crate.rs b/tests/ui/generics/generic-default-type-params-cross-crate.rs index 7da61572501..1b21e4cd191 100644 --- a/tests/ui/generics/generic-default-type-params-cross-crate.rs +++ b/tests/ui/generics/generic-default-type-params-cross-crate.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:default_type_params_xc.rs -//@ pretty-expanded FIXME #23616 extern crate default_type_params_xc; diff --git a/tests/ui/generics/generic-fn-twice.rs b/tests/ui/generics/generic-fn-twice.rs index f9e08401c6d..26d6f750c80 100644 --- a/tests/ui/generics/generic-fn-twice.rs +++ b/tests/ui/generics/generic-fn-twice.rs @@ -2,7 +2,6 @@ -//@ pretty-expanded FIXME #23616 mod foomod { pub fn foo<T>() { } diff --git a/tests/ui/generics/generic-newtype-struct.rs b/tests/ui/generics/generic-newtype-struct.rs index a1d539c8c22..4cb481044f2 100644 --- a/tests/ui/generics/generic-newtype-struct.rs +++ b/tests/ui/generics/generic-newtype-struct.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct S<T>(#[allow(dead_code)] T); diff --git a/tests/ui/generics/generic-tag-corruption.rs b/tests/ui/generics/generic-tag-corruption.rs index 78fdfe4ac7f..b7fd66a0523 100644 --- a/tests/ui/generics/generic-tag-corruption.rs +++ b/tests/ui/generics/generic-tag-corruption.rs @@ -3,7 +3,6 @@ // This used to cause memory corruption in stage 0. -//@ pretty-expanded FIXME #23616 enum thing<K> { some(#[allow(dead_code)] K), } diff --git a/tests/ui/generics/generic-tag-local.rs b/tests/ui/generics/generic-tag-local.rs index e7c394efa09..025827783c3 100644 --- a/tests/ui/generics/generic-tag-local.rs +++ b/tests/ui/generics/generic-tag-local.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum clam<T> { a(#[allow(dead_code)] T), } diff --git a/tests/ui/generics/generic-tag.rs b/tests/ui/generics/generic-tag.rs index cb46c3155a3..98350e93ece 100644 --- a/tests/ui/generics/generic-tag.rs +++ b/tests/ui/generics/generic-tag.rs @@ -2,7 +2,6 @@ #![allow(unused_assignments)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/tests/ui/generics/generic-type-synonym.rs b/tests/ui/generics/generic-type-synonym.rs index 879bd91cab5..a8a946d5ed2 100644 --- a/tests/ui/generics/generic-type-synonym.rs +++ b/tests/ui/generics/generic-type-synonym.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Foo<T> { a: T diff --git a/tests/ui/generics/generics-on-self-mod-segment.rs b/tests/ui/generics/generics-on-self-mod-segment.rs new file mode 100644 index 00000000000..ef229eeba53 --- /dev/null +++ b/tests/ui/generics/generics-on-self-mod-segment.rs @@ -0,0 +1,18 @@ +struct Ty; + +fn self_(_: self::<i32>::Ty) {} +//~^ ERROR type arguments are not allowed on module `generics_on_self_mod_segment` + +fn crate_(_: crate::<i32>::Ty) {} +//~^ ERROR type arguments are not allowed on module `generics_on_self_mod_segment` + +macro_rules! dollar_crate { + () => { + fn dollar_crate_(_: $crate::<i32>::Ty) {} + //~^ ERROR type arguments are not allowed on module `generics_on_self_mod_segment` + } +} + +dollar_crate!(); + +fn main() {} diff --git a/tests/ui/generics/generics-on-self-mod-segment.stderr b/tests/ui/generics/generics-on-self-mod-segment.stderr new file mode 100644 index 00000000000..4a2d5939a3e --- /dev/null +++ b/tests/ui/generics/generics-on-self-mod-segment.stderr @@ -0,0 +1,32 @@ +error[E0109]: type arguments are not allowed on module `generics_on_self_mod_segment` + --> $DIR/generics-on-self-mod-segment.rs:3:20 + | +LL | fn self_(_: self::<i32>::Ty) {} + | ---- ^^^ type argument not allowed + | | + | not allowed on module `generics_on_self_mod_segment` + +error[E0109]: type arguments are not allowed on module `generics_on_self_mod_segment` + --> $DIR/generics-on-self-mod-segment.rs:6:22 + | +LL | fn crate_(_: crate::<i32>::Ty) {} + | ----- ^^^ type argument not allowed + | | + | not allowed on module `generics_on_self_mod_segment` + +error[E0109]: type arguments are not allowed on module `generics_on_self_mod_segment` + --> $DIR/generics-on-self-mod-segment.rs:11:38 + | +LL | fn dollar_crate_(_: $crate::<i32>::Ty) {} + | ------ ^^^ type argument not allowed + | | + | not allowed on module `generics_on_self_mod_segment` +... +LL | dollar_crate!(); + | --------------- in this macro invocation + | + = note: this error originates in the macro `dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0109`. diff --git a/tests/ui/generics/mid-path-type-params.rs b/tests/ui/generics/mid-path-type-params.rs index f7dbd789079..5100e8e7353 100644 --- a/tests/ui/generics/mid-path-type-params.rs +++ b/tests/ui/generics/mid-path-type-params.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct S<T> { contents: T, diff --git a/tests/ui/generics/type-params-in-for-each.rs b/tests/ui/generics/type-params-in-for-each.rs index e98f7bbb66b..004b7754887 100644 --- a/tests/ui/generics/type-params-in-for-each.rs +++ b/tests/ui/generics/type-params-in-for-each.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct S<T> { a: T, diff --git a/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr b/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr index af11bc82d0c..65903dbe12e 100644 --- a/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr +++ b/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr @@ -15,7 +15,7 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `[i32::MIN..=2_i32, ..]` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `[i32; 8]` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr index 0f60cd397b9..aa3d2cd2d90 100644 --- a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr +++ b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr @@ -67,7 +67,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr index 204ee373bc5..63258f35383 100644 --- a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr +++ b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr @@ -94,7 +94,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -108,7 +108,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/half-open-range-patterns/range_pat_interactions1.stderr b/tests/ui/half-open-range-patterns/range_pat_interactions1.stderr index e2916725fbd..62be2ef7a4d 100644 --- a/tests/ui/half-open-range-patterns/range_pat_interactions1.stderr +++ b/tests/ui/half-open-range-patterns/range_pat_interactions1.stderr @@ -4,7 +4,7 @@ error: expected a pattern range bound, found an expression LL | 0..5+1 => errors_only.push(x), | ^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 5+1; diff --git a/tests/ui/half-open-range-patterns/range_pat_interactions2.stderr b/tests/ui/half-open-range-patterns/range_pat_interactions2.stderr index f54e07c3a63..dbe7f4482ee 100644 --- a/tests/ui/half-open-range-patterns/range_pat_interactions2.stderr +++ b/tests/ui/half-open-range-patterns/range_pat_interactions2.stderr @@ -16,7 +16,7 @@ error: expected a pattern range bound, found an expression LL | 0..=(5+1) => errors_only.push(x), | ^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 5+1; diff --git a/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr b/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr index 49515919904..17b65c1dae5 100644 --- a/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr +++ b/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr @@ -15,7 +15,7 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `[i32::MIN..=2_i32, ..]` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `[i32; 8]` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/hello.rs b/tests/ui/hello.rs index d23cbb61157..f329ee086f9 100644 --- a/tests/ui/hello.rs +++ b/tests/ui/hello.rs @@ -5,8 +5,6 @@ //@[e2021] edition:2021 //@[e2024] edition:2024 -//@[e2024] compile-flags: -Zunstable-options - fn main() { println!("hello"); } diff --git a/tests/ui/higher-ranked/builtin-closure-like-bounds.rs b/tests/ui/higher-ranked/builtin-closure-like-bounds.rs index dee290cc439..c177ee6fb3a 100644 --- a/tests/ui/higher-ranked/builtin-closure-like-bounds.rs +++ b/tests/ui/higher-ranked/builtin-closure-like-bounds.rs @@ -1,5 +1,4 @@ //@ edition:2024 -//@ compile-flags: -Zunstable-options //@ revisions: current next //@[next] compile-flags: -Znext-solver //@ check-pass diff --git a/tests/ui/higher-ranked/structually-relate-aliases.rs b/tests/ui/higher-ranked/structually-relate-aliases.rs index 73c2cd23d86..1ed3767643a 100644 --- a/tests/ui/higher-ranked/structually-relate-aliases.rs +++ b/tests/ui/higher-ranked/structually-relate-aliases.rs @@ -12,6 +12,5 @@ impl<T> Overlap<T> for T {} impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {} //~^ ERROR the trait bound `for<'a> T: ToUnit<'a>` is not satisfied -//~| ERROR the trait bound `for<'a> T: ToUnit<'a>` is not satisfied fn main() {} diff --git a/tests/ui/higher-ranked/structually-relate-aliases.stderr b/tests/ui/higher-ranked/structually-relate-aliases.stderr index e9d91e45e21..cf3e4cc85b9 100644 --- a/tests/ui/higher-ranked/structually-relate-aliases.stderr +++ b/tests/ui/higher-ranked/structually-relate-aliases.stderr @@ -10,17 +10,6 @@ help: consider restricting type parameter `T` LL | impl<T: for<'a> ToUnit<'a>> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {} | ++++++++++++++++++++ -error[E0277]: the trait bound `for<'a> T: ToUnit<'a>` is not satisfied - --> $DIR/structually-relate-aliases.rs:13:17 - | -LL | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `T` - | -help: consider restricting type parameter `T` - | -LL | impl<T: for<'a> ToUnit<'a>> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {} - | ++++++++++++++++++++ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-binder-levels-in-object-types.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-binder-levels-in-object-types.rs index 5dec55d5612..09f3f7845d9 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-binder-levels-in-object-types.rs +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-binder-levels-in-object-types.rs @@ -6,7 +6,6 @@ // `&Typer<'tcx>` was getting an incorrect binder level, yielding // weird compilation ICEs and so forth. -//@ pretty-expanded FIXME #23616 trait Typer<'tcx> { fn method(&self, data: &'tcx isize) -> &'tcx isize { data } diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-object-types-in-closures.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-object-types-in-closures.rs index f28b0776fda..745a2fcc4f0 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-object-types-in-closures.rs +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-debruijn-object-types-in-closures.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait Typer<'tcx> { fn method(&self, data: &'tcx isize) -> &'tcx isize { data } diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-parse.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-parse.rs index 0edddf9423e..7ecba7301ef 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-parse.rs +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-parse.rs @@ -2,7 +2,6 @@ // Test that we can parse all the various places that a `for` keyword // can appear representing universal quantification. -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] #![allow(dead_code)] diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus-where-clause.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus-where-clause.rs index b49c69d90cf..8c63dff8782 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus-where-clause.rs +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus-where-clause.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 // Test that `F : Fn(isize) -> isize + Send` is interpreted as two // distinct bounds on `F`. diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus.rs index d50fd8cb8f3..2c8d3ac0d41 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus.rs +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-precedence-of-plus.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 // Test that `Fn(isize) -> isize + 'static` parses as `(Fn(isize) -> isize) + // 'static` and not `Fn(isize) -> (isize + 'static)`. The latter would diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-resolve-lifetime.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-resolve-lifetime.rs index 4a0b8362d4b..271eedae89a 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-resolve-lifetime.rs +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-resolve-lifetime.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // A basic test of using a higher-ranked trait bound. -//@ pretty-expanded FIXME #23616 trait FnLike<A,R> { fn call(&self, arg: A) -> R; diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-passed-to-closure.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-passed-to-closure.rs index 255e5d68e50..7a75218da3a 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-passed-to-closure.rs +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-trait-object-passed-to-closure.rs @@ -4,7 +4,6 @@ // PrinterSupport<'b>`, gets properly expanded when it appears in a // closure type. This used to result in messed up De Bruijn indices. -//@ pretty-expanded FIXME #23616 trait PrinterSupport<'ast> { fn ast_map(&self) -> Option<&'ast usize> { None } diff --git a/tests/ui/hygiene/auxiliary/def-site-async-await.rs b/tests/ui/hygiene/auxiliary/def-site-async-await.rs index 41c4b871e73..88042b484a1 100644 --- a/tests/ui/hygiene/auxiliary/def-site-async-await.rs +++ b/tests/ui/hygiene/auxiliary/def-site-async-await.rs @@ -1,6 +1,5 @@ //@ edition:2018 - -extern crate opaque_hygiene; +//@ proc-macro: opaque-hygiene.rs pub async fn serve() { opaque_hygiene::make_it!(); diff --git a/tests/ui/hygiene/auxiliary/opaque-hygiene.rs b/tests/ui/hygiene/auxiliary/opaque-hygiene.rs index b6192d653f5..08dc592925a 100644 --- a/tests/ui/hygiene/auxiliary/opaque-hygiene.rs +++ b/tests/ui/hygiene/auxiliary/opaque-hygiene.rs @@ -1,8 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::{TokenStream, quote}; diff --git a/tests/ui/hygiene/issue-15221.rs b/tests/ui/hygiene/issue-15221.rs index ebb1a234051..7703cb2de4e 100644 --- a/tests/ui/hygiene/issue-15221.rs +++ b/tests/ui/hygiene/issue-15221.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(path_statements)] -//@ pretty-expanded FIXME #23616 macro_rules! inner { ($e:pat ) => ($e) diff --git a/tests/ui/hygiene/issue-77523-def-site-async-await.rs b/tests/ui/hygiene/issue-77523-def-site-async-await.rs index 102112381d3..ad6bd5e0b78 100644 --- a/tests/ui/hygiene/issue-77523-def-site-async-await.rs +++ b/tests/ui/hygiene/issue-77523-def-site-async-await.rs @@ -1,5 +1,4 @@ //@ build-pass -//@ aux-build:opaque-hygiene.rs //@ aux-build:def-site-async-await.rs // Regression test for issue #77523 diff --git a/tests/ui/impl-privacy-xc-1.rs b/tests/ui/impl-privacy-xc-1.rs index 1a2af8098f5..6a10986739c 100644 --- a/tests/ui/impl-privacy-xc-1.rs +++ b/tests/ui/impl-privacy-xc-1.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:impl_privacy_xc_1.rs -//@ pretty-expanded FIXME #23616 extern crate impl_privacy_xc_1; diff --git a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr index 8716088ccbd..9ed3d21c13c 100644 --- a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr +++ b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr @@ -261,8 +261,11 @@ error[E0746]: return type cannot have an unboxed trait object LL | fn bat() -> dyn Trait { | ^^^^^^^^^ doesn't have a size known at compile-time | - = help: if there were a single returned type, you could use `impl Trait` instead -help: box the return type, and wrap all of the returned values in `Box::new` +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +LL | fn bat() -> impl Trait { + | ~~~~ +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn bat() -> Box<dyn Trait> { LL | if true { @@ -277,8 +280,11 @@ error[E0746]: return type cannot have an unboxed trait object LL | fn bay() -> dyn Trait { | ^^^^^^^^^ doesn't have a size known at compile-time | - = help: if there were a single returned type, you could use `impl Trait` instead -help: box the return type, and wrap all of the returned values in `Box::new` +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +LL | fn bay() -> impl Trait { + | ~~~~ +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn bay() -> Box<dyn Trait> { LL | if true { diff --git a/tests/ui/impl-trait/example-calendar.rs b/tests/ui/impl-trait/example-calendar.rs index 1dadc5dfcb3..c3c01f01036 100644 --- a/tests/ui/impl-trait/example-calendar.rs +++ b/tests/ui/impl-trait/example-calendar.rs @@ -156,7 +156,7 @@ impl<'a, 'b> std::ops::Add<&'b NaiveDate> for &'a NaiveDate { } impl std::iter::Step for NaiveDate { - fn steps_between(_: &Self, _: &Self) -> Option<usize> { + fn steps_between(_: &Self, _: &Self) -> (usize, Option<usize>) { unimplemented!() } diff --git a/tests/ui/impl-trait/impl-trait-plus-priority.rs b/tests/ui/impl-trait/impl-trait-plus-priority.rs index 5441a015ac0..5575493a17d 100644 --- a/tests/ui/impl-trait/impl-trait-plus-priority.rs +++ b/tests/ui/impl-trait/impl-trait-plus-priority.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only fn f() -> impl A + {} // OK fn f() -> impl A + B {} // OK diff --git a/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr b/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr index 79581066a3a..1cfc2a6d944 100644 --- a/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr +++ b/tests/ui/impl-trait/in-trait/alias-bounds-when-not-wf.stderr @@ -8,10 +8,10 @@ LL | #![feature(lazy_type_alias)] = note: `#[warn(incomplete_features)]` on by default error[E0277]: the trait bound `usize: Foo` is not satisfied - --> $DIR/alias-bounds-when-not-wf.rs:16:13 + --> $DIR/alias-bounds-when-not-wf.rs:16:15 | LL | fn hello(_: W<A<usize>>) {} - | ^^^^^^^^^^^ the trait `Foo` is not implemented for `usize` + | ^^^^^^^^ the trait `Foo` is not implemented for `usize` | help: this trait has no implementations, consider adding one --> $DIR/alias-bounds-when-not-wf.rs:6:1 diff --git a/tests/ui/impl-trait/in-trait/do-not-imply-from-trait-impl.rs b/tests/ui/impl-trait/in-trait/do-not-imply-from-trait-impl.rs new file mode 100644 index 00000000000..30ca3d271b8 --- /dev/null +++ b/tests/ui/impl-trait/in-trait/do-not-imply-from-trait-impl.rs @@ -0,0 +1,30 @@ +// Make sure that we don't accidentally collect an RPITIT hidden type that does not +// hold for all instantiations of the trait signature. + +trait MkStatic { + fn mk_static(self) -> &'static str; +} + +impl MkStatic for &'static str { + fn mk_static(self) -> &'static str { self } +} + +trait Foo { + fn foo<'a: 'static, 'late>(&'late self) -> impl MkStatic; +} + +impl Foo for str { + fn foo<'a: 'static>(&'a self) -> impl MkStatic + 'static { + //~^ ERROR method not compatible with trait + self + } +} + +fn call_foo<T: Foo + ?Sized>(t: &T) -> &'static str { + t.foo().mk_static() +} + +fn main() { + let s = call_foo(String::from("hello, world").as_str()); + println!("> {s}"); +} diff --git a/tests/ui/impl-trait/in-trait/do-not-imply-from-trait-impl.stderr b/tests/ui/impl-trait/in-trait/do-not-imply-from-trait-impl.stderr new file mode 100644 index 00000000000..95d8699e19f --- /dev/null +++ b/tests/ui/impl-trait/in-trait/do-not-imply-from-trait-impl.stderr @@ -0,0 +1,22 @@ +error[E0308]: method not compatible with trait + --> $DIR/do-not-imply-from-trait-impl.rs:17:38 + | +LL | fn foo<'a: 'static>(&'a self) -> impl MkStatic + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected signature `fn(&'late _) -> _` + found signature `fn(&'a _) -> _` +note: the lifetime `'late` as defined here... + --> $DIR/do-not-imply-from-trait-impl.rs:13:25 + | +LL | fn foo<'a: 'static, 'late>(&'late self) -> impl MkStatic; + | ^^^^^ +note: ...does not necessarily outlive the lifetime `'a` as defined here + --> $DIR/do-not-imply-from-trait-impl.rs:17:12 + | +LL | fn foo<'a: 'static>(&'a self) -> impl MkStatic + 'static { + | ^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/impl-trait/in-trait/late-bound-in-object-assocty.rs b/tests/ui/impl-trait/in-trait/late-bound-in-object-assocty.rs index 83466535e13..42b33c6e31d 100644 --- a/tests/ui/impl-trait/in-trait/late-bound-in-object-assocty.rs +++ b/tests/ui/impl-trait/in-trait/late-bound-in-object-assocty.rs @@ -1,5 +1,5 @@ // Test for issue #132429 -//@compile-flags: -Zunstable-options --edition=2024 +//@ edition: 2024 //@check-pass use std::future::Future; diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr index 6f6b787b6fe..a23879eb6c3 100644 --- a/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr +++ b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr @@ -11,12 +11,12 @@ note: type in trait | LL | fn early<'early, T>(x: &'early T) -> impl Sized; | ^^^^^^^^^ - = note: expected signature `fn(&T)` - found signature `fn(&'late ())` + = note: expected signature `fn(&'early T)` + found signature `fn(&())` help: change the parameter type to match the trait | -LL | fn early<'late, T>(_: &T) {} - | ~~ +LL | fn early<'late, T>(_: &'early T) {} + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/refine-cycle.rs b/tests/ui/impl-trait/in-trait/refine-cycle.rs new file mode 100644 index 00000000000..78d672a7ed6 --- /dev/null +++ b/tests/ui/impl-trait/in-trait/refine-cycle.rs @@ -0,0 +1,26 @@ +//@ check-pass + +// Make sure that refinement checking doesn't cause a cycle in `Instance::resolve` +// which calls `compare_impl_item`. + +trait Foo { + fn test() -> impl IntoIterator<Item = ()> + Send; +} + +struct A; +impl Foo for A { + fn test() -> impl IntoIterator<Item = ()> + Send { + B::test() + } +} + +struct B; +impl Foo for B { + fn test() -> impl IntoIterator<Item = ()> + Send { + for () in A::test() {} + + [] + } +} + +fn main() {} diff --git a/tests/ui/impl-trait/in-trait/rpitit-hidden-types-self-implied-wf.stderr b/tests/ui/impl-trait/in-trait/rpitit-hidden-types-self-implied-wf.stderr index 3430055dab1..4c10422f985 100644 --- a/tests/ui/impl-trait/in-trait/rpitit-hidden-types-self-implied-wf.stderr +++ b/tests/ui/impl-trait/in-trait/rpitit-hidden-types-self-implied-wf.stderr @@ -6,9 +6,9 @@ LL | fn extend(s: &str) -> (Option<&'static &'_ ()>, &'static str) { | = note: the pointer is valid for the static lifetime note: but the referenced data is only valid for the anonymous lifetime defined here - --> $DIR/rpitit-hidden-types-self-implied-wf.rs:6:18 + --> $DIR/rpitit-hidden-types-self-implied-wf.rs:2:18 | -LL | fn extend(s: &str) -> (Option<&'static &'_ ()>, &'static str) { +LL | fn extend(_: &str) -> (impl Sized + '_, &'static str); | ^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.failure.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.failure.stderr index 56b83cbca77..b27d7870955 100644 --- a/tests/ui/impl-trait/in-trait/signature-mismatch.failure.stderr +++ b/tests/ui/impl-trait/in-trait/signature-mismatch.failure.stderr @@ -1,14 +1,15 @@ -error[E0623]: lifetime mismatch +error[E0477]: the type `impl Future<Output = Vec<u8>>` does not fulfill the required lifetime --> $DIR/signature-mismatch.rs:77:10 | -LL | &'a self, - | -------- this parameter and the return type are declared with different lifetimes... -... LL | ) -> impl Future<Output = Vec<u8>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | ...but data from `buff` is returned here + | +note: type must outlive the lifetime `'a` as defined here as required by this binding + --> $DIR/signature-mismatch.rs:73:32 + | +LL | fn async_fn_reduce_outlive<'a, 'b, T>( + | ^^ error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0623`. +For more information about this error, try `rustc --explain E0477`. diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.rs b/tests/ui/impl-trait/in-trait/signature-mismatch.rs index 55b9a0de5ff..a9885c6a298 100644 --- a/tests/ui/impl-trait/in-trait/signature-mismatch.rs +++ b/tests/ui/impl-trait/in-trait/signature-mismatch.rs @@ -75,7 +75,7 @@ impl AsyncTrait for Struct { buff: &'b [u8], t: T, ) -> impl Future<Output = Vec<u8>> { - //[failure]~^ ERROR lifetime mismatch + //[failure]~^ ERROR the type `impl Future<Output = Vec<u8>>` does not fulfill the required lifetime async move { let _t = t; vec![] diff --git a/tests/ui/impl-trait/issues/issue-79099.stderr b/tests/ui/impl-trait/issues/issue-79099.stderr index 6c26d5bd1b7..96825eabec7 100644 --- a/tests/ui/impl-trait/issues/issue-79099.stderr +++ b/tests/ui/impl-trait/issues/issue-79099.stderr @@ -6,7 +6,7 @@ LL | let f: impl core::future::Future<Output = u8> = async { 1 }; | | | `async` blocks are only allowed in Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0562]: `impl Trait` is not allowed in the type of variable bindings diff --git a/tests/ui/impl-trait/normalize-tait-in-const.rs b/tests/ui/impl-trait/normalize-tait-in-const.rs index 134b202d655..1fd543b72e7 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.rs +++ b/tests/ui/impl-trait/normalize-tait-in-const.rs @@ -1,7 +1,7 @@ //@ known-bug: #103507 #![feature(type_alias_impl_trait)] -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_destruct)] use std::marker::Destruct; diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index f9142664f1b..203fbfc1d2c 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -5,12 +5,6 @@ LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruc | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:26:62 - | -LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/normalize-tait-in-const.rs:26:35 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { @@ -18,13 +12,19 @@ LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruc | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: `~const` can only be applied to `#[const_trait]` traits +error[E0277]: the trait bound `for<'a, 'b> fn(&'a foo::Alias<'b>) {foo}: const Destruct` is not satisfied + --> $DIR/normalize-tait-in-const.rs:33:19 + | +LL | with_positive(foo); + | ------------- ^^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `with_positive` --> $DIR/normalize-tait-in-const.rs:26:62 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + | ^^^^^^ required by this bound in `with_positive` error[E0015]: cannot call non-const closure in constant functions --> $DIR/normalize-tait-in-const.rs:27:5 @@ -38,16 +38,7 @@ help: consider further restricting this bound LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct + ~const Fn(&foo::Alias<'_>)>(fun: F) { | ++++++++++++++++++++++++++++ -error[E0493]: destructor of `F` cannot be evaluated at compile-time - --> $DIR/normalize-tait-in-const.rs:26:79 - | -LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^ the destructor for this type cannot be evaluated in constant functions -LL | fun(filter_positive()); -LL | } - | - value is dropped here - -error: aborting due to 6 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0015, E0493. +Some errors have detailed explanations: E0015, E0277. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr index caaac5434c5..6f0f287fe12 100644 --- a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr +++ b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr @@ -74,7 +74,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied --> $DIR/opaque-used-in-extraneous-argument.rs:20:5 | LL | open_parent(&old_path) - | ^^^^^^^^^^^ --------- unexpected argument of type `&impl FnOnce<{type error}, Output = {type error}> + Fn<{type error}> + 'static` + | ^^^^^^^^^^^ --------- unexpected argument of type `&impl Fn<{type error}> + FnOnce<{type error}, Output = {type error}> + 'static` | note: function defined here --> $DIR/opaque-used-in-extraneous-argument.rs:12:4 diff --git a/tests/ui/impl-trait/precise-capturing/auxiliary/foreign.rs b/tests/ui/impl-trait/precise-capturing/auxiliary/foreign.rs index 49015bc48ba..09b7ef14e6b 100644 --- a/tests/ui/impl-trait/precise-capturing/auxiliary/foreign.rs +++ b/tests/ui/impl-trait/precise-capturing/auxiliary/foreign.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options use std::fmt::Display; diff --git a/tests/ui/impl-trait/precise-capturing/auxiliary/no-use-pm.rs b/tests/ui/impl-trait/precise-capturing/auxiliary/no-use-pm.rs index e197dcfef80..fab55f11a53 100644 --- a/tests/ui/impl-trait/precise-capturing/auxiliary/no-use-pm.rs +++ b/tests/ui/impl-trait/precise-capturing/auxiliary/no-use-pm.rs @@ -1,11 +1,6 @@ // A proc-macro in 2015 that has an RPIT without `use<>` that would cause a // problem with 2024 capturing rules. -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs b/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs index 46121308fa0..cac5ae177d2 100644 --- a/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs +++ b/tests/ui/impl-trait/precise-capturing/bound-modifiers.rs @@ -7,7 +7,7 @@ fn polarity() -> impl Sized + ?use<> {} fn asyncness() -> impl Sized + async use<> {} //~^ ERROR expected identifier, found keyword `use` //~| ERROR cannot find trait `r#use` in this scope -//~| ERROR async closures are unstable +//~| ERROR `async` trait bounds are unstable fn constness() -> impl Sized + const use<> {} //~^ ERROR expected identifier, found keyword `use` diff --git a/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr b/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr index 16e7470debf..d4b5b47b41b 100644 --- a/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr +++ b/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr @@ -46,16 +46,16 @@ error[E0405]: cannot find trait `r#use` in this scope LL | fn binder() -> impl Sized + for<'a> use<> {} | ^^^ not found in this scope -error[E0658]: async closures are unstable +error[E0658]: `async` trait bounds are unstable --> $DIR/bound-modifiers.rs:7:32 | LL | fn asyncness() -> impl Sized + async use<> {} | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` + = help: use the desugared name of the async trait, such as `AsyncFn` error[E0658]: const trait impls are experimental --> $DIR/bound-modifiers.rs:12:32 diff --git a/tests/ui/impl-trait/precise-capturing/capturing-implicit.rs b/tests/ui/impl-trait/precise-capturing/capturing-implicit.rs index 5ef8542d862..7b53b20ceff 100644 --- a/tests/ui/impl-trait/precise-capturing/capturing-implicit.rs +++ b/tests/ui/impl-trait/precise-capturing/capturing-implicit.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options #![feature(rustc_attrs)] #![feature(type_alias_impl_trait)] diff --git a/tests/ui/impl-trait/precise-capturing/capturing-implicit.stderr b/tests/ui/impl-trait/precise-capturing/capturing-implicit.stderr index b14ed20bd36..4d8c5cb40b4 100644 --- a/tests/ui/impl-trait/precise-capturing/capturing-implicit.stderr +++ b/tests/ui/impl-trait/precise-capturing/capturing-implicit.stderr @@ -1,5 +1,5 @@ error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list - --> $DIR/capturing-implicit.rs:8:11 + --> $DIR/capturing-implicit.rs:7:11 | LL | fn foo(x: &()) -> impl IntoIterator<Item = impl Sized> + use<> { | ^ -------------------------------------------- lifetime captured due to being mentioned in the bounds of the `impl Trait` @@ -7,13 +7,13 @@ LL | fn foo(x: &()) -> impl IntoIterator<Item = impl Sized> + use<> { | this lifetime parameter is captured error: ['_: o] - --> $DIR/capturing-implicit.rs:8:19 + --> $DIR/capturing-implicit.rs:7:19 | LL | fn foo(x: &()) -> impl IntoIterator<Item = impl Sized> + use<> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: ['_: o] - --> $DIR/capturing-implicit.rs:8:44 + --> $DIR/capturing-implicit.rs:7:44 | LL | fn foo(x: &()) -> impl IntoIterator<Item = impl Sized> + use<> { | ^^^^^^^^^^ diff --git a/tests/ui/impl-trait/precise-capturing/external-macro.rs b/tests/ui/impl-trait/precise-capturing/external-macro.rs index 492e8036461..9d4d8a1bb11 100644 --- a/tests/ui/impl-trait/precise-capturing/external-macro.rs +++ b/tests/ui/impl-trait/precise-capturing/external-macro.rs @@ -2,10 +2,9 @@ // has an RPIT will not fail when the call-site is 2024. // https://github.com/rust-lang/rust/issues/132917 -//@ aux-crate: no_use_pm=no-use-pm.rs +//@ proc-macro: no-use-pm.rs //@ aux-crate: no_use_macro=no-use-macro.rs //@ edition: 2024 -//@ compile-flags:-Z unstable-options //@ check-pass no_use_pm::pm_rpit!{} diff --git a/tests/ui/impl-trait/precise-capturing/foreign-2021.stderr b/tests/ui/impl-trait/precise-capturing/foreign-2021.stderr index 2a17ef72912..cd9ed0fb885 100644 --- a/tests/ui/impl-trait/precise-capturing/foreign-2021.stderr +++ b/tests/ui/impl-trait/precise-capturing/foreign-2021.stderr @@ -16,7 +16,7 @@ note: this call may capture more lifetimes than intended, because Rust 2024 has LL | let h = foreign::hello(&x); | ^^^^^^^^^^^^^^^^^^ help: if you can modify this crate, add a precise capturing bound to avoid overcapturing: `+ use<>` - --> $DIR/auxiliary/foreign.rs:6:31 + --> $DIR/auxiliary/foreign.rs:5:31 | LL | pub fn hello(x: &Vec<i32>) -> impl Display { 0 } | ^^^^^^^^^^^^ diff --git a/tests/ui/impl-trait/precise-capturing/migration-note.rs b/tests/ui/impl-trait/precise-capturing/migration-note.rs index 1d98750f6dd..36db07e5764 100644 --- a/tests/ui/impl-trait/precise-capturing/migration-note.rs +++ b/tests/ui/impl-trait/precise-capturing/migration-note.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options use std::fmt::Display; diff --git a/tests/ui/impl-trait/precise-capturing/migration-note.stderr b/tests/ui/impl-trait/precise-capturing/migration-note.stderr index a859a114dbc..c9403532dfa 100644 --- a/tests/ui/impl-trait/precise-capturing/migration-note.stderr +++ b/tests/ui/impl-trait/precise-capturing/migration-note.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/migration-note.rs:183:17 + --> $DIR/migration-note.rs:182:17 | LL | let x = vec![0]; | - binding `x` declared here @@ -14,7 +14,7 @@ LL | } | - `x` dropped here while still borrowed error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable - --> $DIR/migration-note.rs:20:5 + --> $DIR/migration-note.rs:19:5 | LL | let a = display_len(&x); | -- immutable borrow occurs here @@ -26,7 +26,7 @@ LL | println!("{a}"); | --- immutable borrow later used here | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:17:13 + --> $DIR/migration-note.rs:16:13 | LL | let a = display_len(&x); | ^^^^^^^^^^^^^^^ @@ -36,7 +36,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> { | ++++++++ error[E0597]: `x` does not live long enough - --> $DIR/migration-note.rs:30:25 + --> $DIR/migration-note.rs:29:25 | LL | let x = vec![1]; | - binding `x` declared here @@ -51,7 +51,7 @@ LL | } | - `x` dropped here while still borrowed | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:30:13 + --> $DIR/migration-note.rs:29:13 | LL | let a = display_len(&x); | ^^^^^^^^^^^^^^^ @@ -61,7 +61,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> { | ++++++++ error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/migration-note.rs:49:8 + --> $DIR/migration-note.rs:48:8 | LL | let x = vec![1]; | - binding `x` declared here @@ -76,7 +76,7 @@ LL | } | - borrow might be used here, when `a` is dropped and runs the destructor for type `impl std::fmt::Display` | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:44:13 + --> $DIR/migration-note.rs:43:13 | LL | let a = display_len(&x); | ^^^^^^^^^^^^^^^ @@ -90,7 +90,7 @@ LL | let a = display_len(&x.clone()); | ++++++++ error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/migration-note.rs:67:5 + --> $DIR/migration-note.rs:66:5 | LL | let a = display_len_mut(&mut x); | ------ first mutable borrow occurs here @@ -102,7 +102,7 @@ LL | println!("{a}"); | --- first borrow later used here | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:64:13 + --> $DIR/migration-note.rs:63:13 | LL | let a = display_len_mut(&mut x); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -112,7 +112,7 @@ LL | fn display_len_mut<T>(x: &mut Vec<T>) -> impl Display + use<T> { | ++++++++ error[E0597]: `x` does not live long enough - --> $DIR/migration-note.rs:77:29 + --> $DIR/migration-note.rs:76:29 | LL | let mut x = vec![1]; | ----- binding `x` declared here @@ -127,7 +127,7 @@ LL | } | - `x` dropped here while still borrowed | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:77:13 + --> $DIR/migration-note.rs:76:13 | LL | let a = display_len_mut(&mut x); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -137,7 +137,7 @@ LL | fn display_len_mut<T>(x: &mut Vec<T>) -> impl Display + use<T> { | ++++++++ error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/migration-note.rs:96:8 + --> $DIR/migration-note.rs:95:8 | LL | let mut x = vec![1]; | ----- binding `x` declared here @@ -152,7 +152,7 @@ LL | } | - borrow might be used here, when `a` is dropped and runs the destructor for type `impl std::fmt::Display` | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:91:13 + --> $DIR/migration-note.rs:90:13 | LL | let a = display_len_mut(&mut x); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -166,7 +166,7 @@ LL | let a = display_len_mut(&mut x.clone()); | ++++++++ error[E0506]: cannot assign to `s.f` because it is borrowed - --> $DIR/migration-note.rs:116:5 + --> $DIR/migration-note.rs:115:5 | LL | let a = display_field(&s.f); | ---- `s.f` is borrowed here @@ -178,7 +178,7 @@ LL | println!("{a}"); | --- borrow later used here | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:113:13 + --> $DIR/migration-note.rs:112:13 | LL | let a = display_field(&s.f); | ^^^^^^^^^^^^^^^^^^^ @@ -188,7 +188,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> { | ++++++++ error[E0506]: cannot assign to `s.f` because it is borrowed - --> $DIR/migration-note.rs:132:5 + --> $DIR/migration-note.rs:131:5 | LL | let a = display_field(&mut s.f); | -------- `s.f` is borrowed here @@ -200,7 +200,7 @@ LL | println!("{a}"); | --- borrow later used here | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:129:13 + --> $DIR/migration-note.rs:128:13 | LL | let a = display_field(&mut s.f); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -210,7 +210,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> { | ++++++++ error[E0503]: cannot use `s.f` because it was mutably borrowed - --> $DIR/migration-note.rs:144:5 + --> $DIR/migration-note.rs:143:5 | LL | let a = display_field(&mut s.f); | -------- `s.f` is borrowed here @@ -222,7 +222,7 @@ LL | println!("{a}"); | --- borrow later used here | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:141:13 + --> $DIR/migration-note.rs:140:13 | LL | let a = display_field(&mut s.f); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -232,7 +232,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> { | ++++++++ error[E0597]: `z.f` does not live long enough - --> $DIR/migration-note.rs:160:25 + --> $DIR/migration-note.rs:159:25 | LL | let z = Z { f: vec![1] }; | - binding `z` declared here @@ -248,7 +248,7 @@ LL | } | = note: values in a scope are dropped in the opposite order they are defined note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:160:13 + --> $DIR/migration-note.rs:159:13 | LL | x = display_len(&z.f); | ^^^^^^^^^^^^^^^^^ @@ -258,7 +258,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> { | ++++++++ error[E0716]: temporary value dropped while borrowed - --> $DIR/migration-note.rs:171:40 + --> $DIR/migration-note.rs:170:40 | LL | let x = { let x = display_len(&mut vec![0]); x }; | ^^^^^^^ - - borrow later used here @@ -268,7 +268,7 @@ LL | let x = { let x = display_len(&mut vec![0]); x }; | = note: consider using a `let` binding to create a longer lived value note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:171:23 + --> $DIR/migration-note.rs:170:23 | LL | let x = { let x = display_len(&mut vec![0]); x }; | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -279,7 +279,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> { | ++++++++ error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/migration-note.rs:199:10 + --> $DIR/migration-note.rs:198:10 | LL | let x = String::new(); | - binding `x` declared here @@ -294,12 +294,12 @@ LL | } | - borrow might be used here, when `y` is dropped and runs the destructor for type `impl Sized` | note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules - --> $DIR/migration-note.rs:196:13 + --> $DIR/migration-note.rs:195:13 | LL | let y = capture_apit(&x); | ^^^^^^^^^^^^^^^^ note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable - --> $DIR/migration-note.rs:190:21 + --> $DIR/migration-note.rs:189:21 | LL | fn capture_apit(x: &impl Sized) -> impl Sized {} | ^^^^^^^^^^ diff --git a/tests/ui/impl-trait/precise-capturing/redundant.rs b/tests/ui/impl-trait/precise-capturing/redundant.rs index e19d935f5b0..075d7c70ac6 100644 --- a/tests/ui/impl-trait/precise-capturing/redundant.rs +++ b/tests/ui/impl-trait/precise-capturing/redundant.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Zunstable-options --edition=2024 +//@ edition: 2024 //@ check-pass #![feature(precise_capturing_in_traits)] diff --git a/tests/ui/impl-trait/precise-capturing/rpitit-impl-captures-too-much.stderr b/tests/ui/impl-trait/precise-capturing/rpitit-impl-captures-too-much.stderr index e1856b92910..360f0d7e7f3 100644 --- a/tests/ui/impl-trait/precise-capturing/rpitit-impl-captures-too-much.stderr +++ b/tests/ui/impl-trait/precise-capturing/rpitit-impl-captures-too-much.stderr @@ -1,10 +1,11 @@ error: return type captures more lifetimes than trait definition --> $DIR/rpitit-impl-captures-too-much.rs:10:39 | +LL | fn hello(self_: Invariant<'_>) -> impl Sized + use<Self>; + | -- this lifetime was captured +... LL | fn hello(self_: Invariant<'_>) -> impl Sized + use<'_> {} - | -- ^^^^^^^^^^^^^^^^^^^^ - | | - | this lifetime was captured + | ^^^^^^^^^^^^^^^^^^^^ | note: hidden type must only reference lifetimes captured by this impl trait --> $DIR/rpitit-impl-captures-too-much.rs:6:39 diff --git a/tests/ui/impl-trait/transmute/in-defining-scope.rs b/tests/ui/impl-trait/transmute/in-defining-scope.rs index b9a9dbc10a5..4c8e1852a91 100644 --- a/tests/ui/impl-trait/transmute/in-defining-scope.rs +++ b/tests/ui/impl-trait/transmute/in-defining-scope.rs @@ -1,5 +1,5 @@ -// This causes a query cycle due to using `Reveal::All`, -// in #119821 const eval was changed to always use `Reveal::All` +// This causes a query cycle due to using `TypingEnv::PostAnalysis`, +// in #119821 const eval was changed to always use this mode. // // See that PR for more details. use std::mem::transmute; diff --git a/tests/ui/impl-trait/unsized_coercion.next.stderr b/tests/ui/impl-trait/unsized_coercion.next.stderr index 4cebd26a5be..bea5ddb0aef 100644 --- a/tests/ui/impl-trait/unsized_coercion.next.stderr +++ b/tests/ui/impl-trait/unsized_coercion.next.stderr @@ -1,35 +1,11 @@ error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time - --> $DIR/unsized_coercion.rs:15:17 + --> $DIR/unsized_coercion.rs:14:17 | LL | let x = hello(); | ^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `dyn Trait` -error[E0308]: mismatched types - --> $DIR/unsized_coercion.rs:19:5 - | -LL | fn hello() -> Box<impl Trait> { - | --------------- - | | | - | | the expected opaque type - | expected `Box<impl Trait>` because of return type -... -LL | Box::new(1u32) - | ^^^^^^^^^^^^^^ types differ - | - = note: expected struct `Box<impl Trait>` - found struct `Box<u32>` - -error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time - --> $DIR/unsized_coercion.rs:12:1 - | -LL | fn hello() -> Box<impl Trait> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `dyn Trait` - -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/impl-trait/unsized_coercion.rs b/tests/ui/impl-trait/unsized_coercion.rs index b3791b38abc..2cbf0d25d7e 100644 --- a/tests/ui/impl-trait/unsized_coercion.rs +++ b/tests/ui/impl-trait/unsized_coercion.rs @@ -10,13 +10,12 @@ trait Trait {} impl Trait for u32 {} fn hello() -> Box<impl Trait> { - //[next]~^ ERROR the size for values of type `dyn Trait` cannot be known at compilation time if true { let x = hello(); //[next]~^ ERROR: the size for values of type `dyn Trait` cannot be known at compilation time let y: Box<dyn Trait> = x; } - Box::new(1u32) //[next]~ ERROR: mismatched types + Box::new(1u32) } fn main() {} diff --git a/tests/ui/impl-trait/unsized_coercion3.next.stderr b/tests/ui/impl-trait/unsized_coercion3.next.stderr index d1e1809cf16..28771e01813 100644 --- a/tests/ui/impl-trait/unsized_coercion3.next.stderr +++ b/tests/ui/impl-trait/unsized_coercion3.next.stderr @@ -1,35 +1,11 @@ error[E0277]: the trait bound `dyn Send: Trait` is not satisfied - --> $DIR/unsized_coercion3.rs:14:17 + --> $DIR/unsized_coercion3.rs:13:17 | LL | let x = hello(); | ^^^^^^^ the trait `Trait` is not implemented for `dyn Send` | = help: the trait `Trait` is implemented for `u32` -error[E0308]: mismatched types - --> $DIR/unsized_coercion3.rs:19:5 - | -LL | fn hello() -> Box<impl Trait + ?Sized> { - | ------------------------ - | | | - | | the expected opaque type - | expected `Box<impl Trait + ?Sized>` because of return type -... -LL | Box::new(1u32) - | ^^^^^^^^^^^^^^ types differ - | - = note: expected struct `Box<impl Trait + ?Sized>` - found struct `Box<u32>` - -error[E0277]: the trait bound `dyn Send: Trait` is not satisfied - --> $DIR/unsized_coercion3.rs:11:1 - | -LL | fn hello() -> Box<impl Trait + ?Sized> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `dyn Send` - | - = help: the trait `Trait` is implemented for `u32` - -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/impl-trait/unsized_coercion3.old.stderr b/tests/ui/impl-trait/unsized_coercion3.old.stderr index 3bb9f9c2095..52a72b84a8d 100644 --- a/tests/ui/impl-trait/unsized_coercion3.old.stderr +++ b/tests/ui/impl-trait/unsized_coercion3.old.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time - --> $DIR/unsized_coercion3.rs:16:32 + --> $DIR/unsized_coercion3.rs:15:32 | LL | let y: Box<dyn Send> = x; | ^ doesn't have a size known at compile-time diff --git a/tests/ui/impl-trait/unsized_coercion3.rs b/tests/ui/impl-trait/unsized_coercion3.rs index c1dd5350e22..ebfbb2955de 100644 --- a/tests/ui/impl-trait/unsized_coercion3.rs +++ b/tests/ui/impl-trait/unsized_coercion3.rs @@ -9,7 +9,6 @@ trait Trait {} impl Trait for u32 {} fn hello() -> Box<impl Trait + ?Sized> { - //[next]~^ ERROR: the trait bound `dyn Send: Trait` is not satisfied if true { let x = hello(); //[next]~^ ERROR: the trait bound `dyn Send: Trait` is not satisfied @@ -17,7 +16,6 @@ fn hello() -> Box<impl Trait + ?Sized> { //[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know } Box::new(1u32) - //[next]~^ ERROR: mismatched types } fn main() {} diff --git a/tests/ui/impl-trait/variance.e2024.stderr b/tests/ui/impl-trait/variance.e2024.stderr index 011ab3259c4..361a165da66 100644 --- a/tests/ui/impl-trait/variance.e2024.stderr +++ b/tests/ui/impl-trait/variance.e2024.stderr @@ -1,23 +1,23 @@ error: ['a: *, 'a: o] - --> $DIR/variance.rs:14:36 + --> $DIR/variance.rs:13:36 | LL | fn not_captured_early<'a: 'a>() -> impl Sized {} | ^^^^^^^^^^ error: ['a: *, 'a: o] - --> $DIR/variance.rs:19:32 + --> $DIR/variance.rs:18:32 | LL | fn captured_early<'a: 'a>() -> impl Sized + Captures<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: ['a: o] - --> $DIR/variance.rs:21:40 + --> $DIR/variance.rs:20:40 | LL | fn not_captured_late<'a>(_: &'a ()) -> impl Sized {} | ^^^^^^^^^^ error: ['a: o] - --> $DIR/variance.rs:26:36 + --> $DIR/variance.rs:25:36 | LL | fn captured_late<'a>(_: &'a ()) -> impl Sized + Captures<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/impl-trait/variance.new.stderr b/tests/ui/impl-trait/variance.new.stderr index 011ab3259c4..361a165da66 100644 --- a/tests/ui/impl-trait/variance.new.stderr +++ b/tests/ui/impl-trait/variance.new.stderr @@ -1,23 +1,23 @@ error: ['a: *, 'a: o] - --> $DIR/variance.rs:14:36 + --> $DIR/variance.rs:13:36 | LL | fn not_captured_early<'a: 'a>() -> impl Sized {} | ^^^^^^^^^^ error: ['a: *, 'a: o] - --> $DIR/variance.rs:19:32 + --> $DIR/variance.rs:18:32 | LL | fn captured_early<'a: 'a>() -> impl Sized + Captures<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: ['a: o] - --> $DIR/variance.rs:21:40 + --> $DIR/variance.rs:20:40 | LL | fn not_captured_late<'a>(_: &'a ()) -> impl Sized {} | ^^^^^^^^^^ error: ['a: o] - --> $DIR/variance.rs:26:36 + --> $DIR/variance.rs:25:36 | LL | fn captured_late<'a>(_: &'a ()) -> impl Sized + Captures<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/impl-trait/variance.old.stderr b/tests/ui/impl-trait/variance.old.stderr index ac3bcd2723f..578d6fd14cd 100644 --- a/tests/ui/impl-trait/variance.old.stderr +++ b/tests/ui/impl-trait/variance.old.stderr @@ -1,23 +1,23 @@ error: ['a: *] - --> $DIR/variance.rs:14:36 + --> $DIR/variance.rs:13:36 | LL | fn not_captured_early<'a: 'a>() -> impl Sized {} | ^^^^^^^^^^ error: ['a: *, 'a: o] - --> $DIR/variance.rs:19:32 + --> $DIR/variance.rs:18:32 | LL | fn captured_early<'a: 'a>() -> impl Sized + Captures<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: [] - --> $DIR/variance.rs:21:40 + --> $DIR/variance.rs:20:40 | LL | fn not_captured_late<'a>(_: &'a ()) -> impl Sized {} | ^^^^^^^^^^ error: ['a: o] - --> $DIR/variance.rs:26:36 + --> $DIR/variance.rs:25:36 | LL | fn captured_late<'a>(_: &'a ()) -> impl Sized + Captures<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/impl-trait/variance.rs b/tests/ui/impl-trait/variance.rs index 43f7207a904..1e359f033ff 100644 --- a/tests/ui/impl-trait/variance.rs +++ b/tests/ui/impl-trait/variance.rs @@ -1,6 +1,5 @@ //@ revisions: old new e2024 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Z unstable-options #![cfg_attr(new, feature(lifetime_capture_rules_2024))] diff --git a/tests/ui/imports/export-glob-imports-target.rs b/tests/ui/imports/export-glob-imports-target.rs index 0133e8a94b5..6fde9fef0b6 100644 --- a/tests/ui/imports/export-glob-imports-target.rs +++ b/tests/ui/imports/export-glob-imports-target.rs @@ -7,7 +7,6 @@ // Modified to not use export since it's going away. --pcw -//@ pretty-expanded FIXME #23616 mod foo { use foo::bar::*; diff --git a/tests/ui/imports/export-multi.rs b/tests/ui/imports/export-multi.rs index b52e952f33c..4f7f7d3a6c0 100644 --- a/tests/ui/imports/export-multi.rs +++ b/tests/ui/imports/export-multi.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use m::f; use m::g; diff --git a/tests/ui/imports/import-crate-with-invalid-spans/main.rs b/tests/ui/imports/import-crate-with-invalid-spans/main.rs index 3234cf304f7..ed042f74f3f 100644 --- a/tests/ui/imports/import-crate-with-invalid-spans/main.rs +++ b/tests/ui/imports/import-crate-with-invalid-spans/main.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:crate_with_invalid_spans.rs -//@ pretty-expanded FIXME #23616 extern crate crate_with_invalid_spans; diff --git a/tests/ui/imports/import-from.rs b/tests/ui/imports/import-from.rs index c5ff4b3abc6..128002e0e2a 100644 --- a/tests/ui/imports/import-from.rs +++ b/tests/ui/imports/import-from.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use spam::{ham, eggs}; diff --git a/tests/ui/imports/import-in-block.rs b/tests/ui/imports/import-in-block.rs index c17e2cffa51..2588ea77023 100644 --- a/tests/ui/imports/import-in-block.rs +++ b/tests/ui/imports/import-in-block.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { use std::mem::replace; diff --git a/tests/ui/imports/import-trailing-comma.rs b/tests/ui/imports/import-trailing-comma.rs index 3803b56487f..4147357a22b 100644 --- a/tests/ui/imports/import-trailing-comma.rs +++ b/tests/ui/imports/import-trailing-comma.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use foo::bar::{baz, quux,}; diff --git a/tests/ui/imports/reexport-star.rs b/tests/ui/imports/reexport-star.rs index 3e41f12fa2d..461dc23b4dc 100644 --- a/tests/ui/imports/reexport-star.rs +++ b/tests/ui/imports/reexport-star.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 mod a { pub fn f() {} diff --git a/tests/ui/imports/use-mod.rs b/tests/ui/imports/use-mod.rs index 065079b21e5..cabea16e725 100644 --- a/tests/ui/imports/use-mod.rs +++ b/tests/ui/imports/use-mod.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_imports)] -//@ pretty-expanded FIXME #23616 pub use foo::bar::{self, First}; use self::bar::Second; diff --git a/tests/ui/inference/array-len-mismatch.stderr b/tests/ui/inference/array-len-mismatch.stderr index 7358e478397..7146e3803d5 100644 --- a/tests/ui/inference/array-len-mismatch.stderr +++ b/tests/ui/inference/array-len-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/array-len-mismatch.rs:6:26 | LL | let wrong: [u8; 3] = [10, 20]; - | ------- ^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements + | ------- ^^^^^^^^ expected an array with a size of 3, found one with a size of 2 | | | | | help: consider specifying the actual array length: `2` | expected due to this @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/array-len-mismatch.rs:9:26 | LL | let wrong: [u8; 3] = returns_arr(); - | ------- ^^^^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements + | ------- ^^^^^^^^^^^^^ expected an array with a size of 3, found one with a size of 2 | | | | | help: consider specifying the actual array length: `2` | expected due to this diff --git a/tests/ui/inference/infer-fn-tail-expr.rs b/tests/ui/inference/infer-fn-tail-expr.rs index 31b71e49bd6..e97522ed526 100644 --- a/tests/ui/inference/infer-fn-tail-expr.rs +++ b/tests/ui/inference/infer-fn-tail-expr.rs @@ -4,7 +4,6 @@ // issue #680 -//@ pretty-expanded FIXME #23616 fn f() -> Vec<isize> { Vec::new() } diff --git a/tests/ui/inference/newlambdas-ret-infer.rs b/tests/ui/inference/newlambdas-ret-infer.rs index 893b62e967d..980a2fdd905 100644 --- a/tests/ui/inference/newlambdas-ret-infer.rs +++ b/tests/ui/inference/newlambdas-ret-infer.rs @@ -4,7 +4,6 @@ // Test that the lambda kind is inferred correctly as a return // expression -//@ pretty-expanded FIXME #23616 fn unique() -> Box<dyn FnMut()+'static> { return Box::new(|| ()); } diff --git a/tests/ui/inference/newlambdas-ret-infer2.rs b/tests/ui/inference/newlambdas-ret-infer2.rs index cad8b02910b..40d45d3569c 100644 --- a/tests/ui/inference/newlambdas-ret-infer2.rs +++ b/tests/ui/inference/newlambdas-ret-infer2.rs @@ -4,7 +4,6 @@ // Test that the lambda kind is inferred correctly as a return // expression -//@ pretty-expanded FIXME #23616 fn unique() -> Box<dyn FnMut()+'static> { Box::new(|| ()) } diff --git a/tests/ui/inherent-impls-overlap-check/auxiliary/repeat.rs b/tests/ui/inherent-impls-overlap-check/auxiliary/repeat.rs index a2970cb5c80..b87c4b14abc 100644 --- a/tests/ui/inherent-impls-overlap-check/auxiliary/repeat.rs +++ b/tests/ui/inherent-impls-overlap-check/auxiliary/repeat.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{Ident, Group, TokenStream, TokenTree as Tt}; diff --git a/tests/ui/inherent-impls-overlap-check/no-overlap.rs b/tests/ui/inherent-impls-overlap-check/no-overlap.rs index 85565a221ac..df60031bae0 100644 --- a/tests/ui/inherent-impls-overlap-check/no-overlap.rs +++ b/tests/ui/inherent-impls-overlap-check/no-overlap.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:repeat.rs +//@ proc-macro: repeat.rs // This tests the allocating algo branch of the // inherent impls overlap checker. diff --git a/tests/ui/inherent-impls-overlap-check/overlap.rs b/tests/ui/inherent-impls-overlap-check/overlap.rs index 32653943698..114035a13b6 100644 --- a/tests/ui/inherent-impls-overlap-check/overlap.rs +++ b/tests/ui/inherent-impls-overlap-check/overlap.rs @@ -1,4 +1,4 @@ -//@ aux-build:repeat.rs +//@ proc-macro: repeat.rs #![allow(unused)] diff --git a/tests/ui/inline-const/const_block_pat_liveness.rs b/tests/ui/inline-const/const-block-pat-liveness.rs index 26393a4f65b..26393a4f65b 100644 --- a/tests/ui/inline-const/const_block_pat_liveness.rs +++ b/tests/ui/inline-const/const-block-pat-liveness.rs diff --git a/tests/ui/inline-const/cross_const_control_flow.rs b/tests/ui/inline-const/cross-const-control-flow-125846.rs index 109764a1812..109764a1812 100644 --- a/tests/ui/inline-const/cross_const_control_flow.rs +++ b/tests/ui/inline-const/cross-const-control-flow-125846.rs diff --git a/tests/ui/inline-const/cross_const_control_flow.stderr b/tests/ui/inline-const/cross-const-control-flow-125846.stderr index ecfa921edd2..4aa1c273504 100644 --- a/tests/ui/inline-const/cross_const_control_flow.stderr +++ b/tests/ui/inline-const/cross-const-control-flow-125846.stderr @@ -1,5 +1,5 @@ error[E0767]: use of unreachable label `'a` - --> $DIR/cross_const_control_flow.rs:9:25 + --> $DIR/cross-const-control-flow-125846.rs:9:25 | LL | 'a: { const { break 'a } } | -- ^^ unreachable label `'a` @@ -9,7 +9,7 @@ LL | 'a: { const { break 'a } } = note: labels are unreachable through functions, closures, async blocks and modules error[E0767]: use of unreachable label `'a` - --> $DIR/cross_const_control_flow.rs:22:28 + --> $DIR/cross-const-control-flow-125846.rs:22:28 | LL | 'a: { const { continue 'a } } | -- ^^ unreachable label `'a` @@ -19,7 +19,7 @@ LL | 'a: { const { continue 'a } } = note: labels are unreachable through functions, closures, async blocks and modules error[E0435]: attempt to use a non-constant value in a constant - --> $DIR/cross_const_control_flow.rs:41:14 + --> $DIR/cross-const-control-flow-125846.rs:41:14 | LL | const { &x }; | ^ non-constant value @@ -30,7 +30,7 @@ LL | const x: /* Type */ = 1; | ~~~~~ ++++++++++++ error[E0728]: `await` is only allowed inside `async` functions and blocks - --> $DIR/cross_const_control_flow.rs:35:22 + --> $DIR/cross-const-control-flow-125846.rs:35:22 | LL | const { async {}.await } | -----------^^^^^-- @@ -39,31 +39,31 @@ LL | const { async {}.await } | this is not `async` error[E0268]: `break` outside of a loop or labeled block - --> $DIR/cross_const_control_flow.rs:9:19 + --> $DIR/cross-const-control-flow-125846.rs:9:19 | LL | 'a: { const { break 'a } } | ^^^^^^^^ cannot `break` outside of a loop or labeled block error[E0268]: `break` outside of a loop or labeled block - --> $DIR/cross_const_control_flow.rs:16:17 + --> $DIR/cross-const-control-flow-125846.rs:16:17 | LL | const { break } | ^^^^^ cannot `break` outside of a loop or labeled block error[E0268]: `continue` outside of a loop - --> $DIR/cross_const_control_flow.rs:22:19 + --> $DIR/cross-const-control-flow-125846.rs:22:19 | LL | 'a: { const { continue 'a } } | ^^^^^^^^^^^ cannot `continue` outside of a loop error[E0268]: `continue` outside of a loop - --> $DIR/cross_const_control_flow.rs:29:17 + --> $DIR/cross-const-control-flow-125846.rs:29:17 | LL | const { continue } | ^^^^^^^^ cannot `continue` outside of a loop error[E0572]: return statement outside of function body - --> $DIR/cross_const_control_flow.rs:4:13 + --> $DIR/cross-const-control-flow-125846.rs:4:13 | LL | / fn foo() { LL | | const { return } diff --git a/tests/ui/inline-const/referencing_local_variables.rs b/tests/ui/inline-const/referencing-local-variables.rs index f9f0fef07f0..f9f0fef07f0 100644 --- a/tests/ui/inline-const/referencing_local_variables.rs +++ b/tests/ui/inline-const/referencing-local-variables.rs diff --git a/tests/ui/inline-const/referencing_local_variables.stderr b/tests/ui/inline-const/referencing-local-variables.stderr index 4a0a5406602..7e1cecdddcb 100644 --- a/tests/ui/inline-const/referencing_local_variables.stderr +++ b/tests/ui/inline-const/referencing-local-variables.stderr @@ -1,5 +1,5 @@ error[E0435]: attempt to use a non-constant value in a constant - --> $DIR/referencing_local_variables.rs:2:13 + --> $DIR/referencing-local-variables.rs:2:13 | LL | const fn test_me<T>(a: usize) -> usize { | - this would need to be a `const` diff --git a/tests/ui/inline-const/uninit_local.rs b/tests/ui/inline-const/uninit-local.rs index 548c053affc..548c053affc 100644 --- a/tests/ui/inline-const/uninit_local.rs +++ b/tests/ui/inline-const/uninit-local.rs diff --git a/tests/ui/inline-const/uninit_local.stderr b/tests/ui/inline-const/uninit-local.stderr index 37b78e337e7..fab65ffb5fa 100644 --- a/tests/ui/inline-const/uninit_local.stderr +++ b/tests/ui/inline-const/uninit-local.stderr @@ -1,5 +1,5 @@ error[E0381]: used binding `x` isn't initialized - --> $DIR/uninit_local.rs:4:15 + --> $DIR/uninit-local.rs:4:15 | LL | let x: bool; | - binding declared here but left uninitialized diff --git a/tests/ui/intrinsics/reify-intrinsic.stderr b/tests/ui/intrinsics/reify-intrinsic.stderr index a456e81e762..aea6d263a72 100644 --- a/tests/ui/intrinsics/reify-intrinsic.stderr +++ b/tests/ui/intrinsics/reify-intrinsic.stderr @@ -22,7 +22,7 @@ LL | std::intrinsics::floorf32, | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers | = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(_) -> _` - found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {floorf32}` + found fn item `unsafe fn(_) -> _ {floorf32}` error: aborting due to 3 previous errors diff --git a/tests/ui/invalid-compile-flags/fuel.rs b/tests/ui/invalid-compile-flags/fuel.rs deleted file mode 100644 index 855aa858122..00000000000 --- a/tests/ui/invalid-compile-flags/fuel.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ revisions: incremental threads -//@ dont-check-compiler-stderr -// -//@ [threads] compile-flags: -Zfuel=a=1 -Zthreads=2 -//@ [threads] error-pattern:optimization fuel is incompatible with multiple threads -// -//@ [incremental] incremental -//@ [incremental] compile-flags: -Zprint-fuel=a -//@ [incremental] error-pattern:optimization fuel is incompatible with incremental compilation - -fn main() {} diff --git a/tests/ui/issue-15924.rs b/tests/ui/issue-15924.rs index 77e1ae697c5..eb2aef9cee1 100644 --- a/tests/ui/issue-15924.rs +++ b/tests/ui/issue-15924.rs @@ -2,7 +2,6 @@ #![allow(unused_imports)] #![allow(unused_must_use)] -//@ pretty-expanded FIXME #23616 use std::fmt; use std::marker::PhantomData; diff --git a/tests/ui/issues/issue-10228.rs b/tests/ui/issues/issue-10228.rs index 7934afc7b9b..a59ccf926f9 100644 --- a/tests/ui/issues/issue-10228.rs +++ b/tests/ui/issues/issue-10228.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 enum StdioContainer { CreatePipe(bool) diff --git a/tests/ui/issues/issue-10456.rs b/tests/ui/issues/issue-10456.rs index a43cc5d36f1..51c740fd729 100644 --- a/tests/ui/issues/issue-10456.rs +++ b/tests/ui/issues/issue-10456.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 pub struct Foo; diff --git a/tests/ui/issues/issue-10638.rs b/tests/ui/issues/issue-10638.rs index f82023f2da5..c6c6939bda5 100644 --- a/tests/ui/issues/issue-10638.rs +++ b/tests/ui/issues/issue-10638.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { //// I am not a doc comment! diff --git a/tests/ui/issues/issue-10683.rs b/tests/ui/issues/issue-10683.rs index 675a8323fc4..5657ec1864b 100644 --- a/tests/ui/issues/issue-10683.rs +++ b/tests/ui/issues/issue-10683.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 static NAME: &'static str = "hello world"; diff --git a/tests/ui/issues/issue-10718.rs b/tests/ui/issues/issue-10718.rs index 5d3cf2621ac..68ac0bbe49f 100644 --- a/tests/ui/issues/issue-10718.rs +++ b/tests/ui/issues/issue-10718.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn f<F:FnOnce()>(p: F) { p(); diff --git a/tests/ui/issues/issue-10767.rs b/tests/ui/issues/issue-10767.rs index 7d74f1e9017..2060d15b4c7 100644 --- a/tests/ui/issues/issue-10767.rs +++ b/tests/ui/issues/issue-10767.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { fn f() { diff --git a/tests/ui/issues/issue-10806.rs b/tests/ui/issues/issue-10806.rs index 731edc8335d..72d99ae3a79 100644 --- a/tests/ui/issues/issue-10806.rs +++ b/tests/ui/issues/issue-10806.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_imports)] -//@ pretty-expanded FIXME #23616 pub fn foo() -> isize { 3 diff --git a/tests/ui/issues/issue-10853.rs b/tests/ui/issues/issue-10853.rs index 0b0bcb710ad..4c22393d9c0 100644 --- a/tests/ui/issues/issue-10853.rs +++ b/tests/ui/issues/issue-10853.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 #![deny(missing_docs)] #![doc="module"] diff --git a/tests/ui/issues/issue-10902.rs b/tests/ui/issues/issue-10902.rs index 72f08ec3f94..7cdf8808aa0 100644 --- a/tests/ui/issues/issue-10902.rs +++ b/tests/ui/issues/issue-10902.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub mod two_tuple { pub trait T { fn dummy(&self) { } } diff --git a/tests/ui/issues/issue-11085.rs b/tests/ui/issues/issue-11085.rs index f646ba35cbf..d0703b06395 100644 --- a/tests/ui/issues/issue-11085.rs +++ b/tests/ui/issues/issue-11085.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/issues/issue-11205.rs b/tests/ui/issues/issue-11205.rs index f21a52050ff..8530514f0ed 100644 --- a/tests/ui/issues/issue-11205.rs +++ b/tests/ui/issues/issue-11205.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/issues/issue-11224.rs b/tests/ui/issues/issue-11224.rs index 3a504604b6a..a7255e6299f 100644 --- a/tests/ui/issues/issue-11224.rs +++ b/tests/ui/issues/issue-11224.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-11224.rs -//@ pretty-expanded FIXME #23616 extern crate issue_11224 as unused; diff --git a/tests/ui/issues/issue-11384.rs b/tests/ui/issues/issue-11384.rs index 0d1cce71958..ad0affa4b0d 100644 --- a/tests/ui/issues/issue-11384.rs +++ b/tests/ui/issues/issue-11384.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Common { fn dummy(&self) { } } diff --git a/tests/ui/issues/issue-11529.rs b/tests/ui/issues/issue-11529.rs index db7ff85d46b..73940c22be4 100644 --- a/tests/ui/issues/issue-11529.rs +++ b/tests/ui/issues/issue-11529.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-11529.rs -//@ pretty-expanded FIXME #23616 extern crate issue_11529 as a; diff --git a/tests/ui/issues/issue-11820.rs b/tests/ui/issues/issue-11820.rs index 372ce2c2a16..ada844f8ee1 100644 --- a/tests/ui/issues/issue-11820.rs +++ b/tests/ui/issues/issue-11820.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(noop_method_call)] diff --git a/tests/ui/issues/issue-11869.rs b/tests/ui/issues/issue-11869.rs index 606a0c7b9d9..dd752227bbe 100644 --- a/tests/ui/issues/issue-11869.rs +++ b/tests/ui/issues/issue-11869.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct A { a: String diff --git a/tests/ui/issues/issue-12612.rs b/tests/ui/issues/issue-12612.rs index 0ffe7422fb3..ec0f3926aa5 100644 --- a/tests/ui/issues/issue-12612.rs +++ b/tests/ui/issues/issue-12612.rs @@ -3,7 +3,6 @@ //@ aux-build:issue-12612-1.rs //@ aux-build:issue-12612-2.rs -//@ pretty-expanded FIXME #23616 extern crate issue_12612_1 as foo; extern crate issue_12612_2 as bar; diff --git a/tests/ui/issues/issue-12660.rs b/tests/ui/issues/issue-12660.rs index 997c10ae5cf..3aa3426519a 100644 --- a/tests/ui/issues/issue-12660.rs +++ b/tests/ui/issues/issue-12660.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-12660-aux.rs -//@ pretty-expanded FIXME #23616 extern crate issue12660aux; diff --git a/tests/ui/issues/issue-12729.rs b/tests/ui/issues/issue-12729.rs index 43e692b895a..74014981df5 100644 --- a/tests/ui/issues/issue-12729.rs +++ b/tests/ui/issues/issue-12729.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub struct Foo; diff --git a/tests/ui/issues/issue-12909.rs b/tests/ui/issues/issue-12909.rs index 3af8c07d7a7..f2c33806aae 100644 --- a/tests/ui/issues/issue-12909.rs +++ b/tests/ui/issues/issue-12909.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 use std::collections::HashMap; diff --git a/tests/ui/issues/issue-13105.rs b/tests/ui/issues/issue-13105.rs index 1ef9a6b7e33..0dd78372a26 100644 --- a/tests/ui/issues/issue-13105.rs +++ b/tests/ui/issues/issue-13105.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Foo { #[allow(anonymous_parameters)] diff --git a/tests/ui/issues/issue-13167.rs b/tests/ui/issues/issue-13167.rs index 15ee02b9cd4..5f733e85948 100644 --- a/tests/ui/issues/issue-13167.rs +++ b/tests/ui/issues/issue-13167.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 //@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver diff --git a/tests/ui/issues/issue-13214.rs b/tests/ui/issues/issue-13214.rs index 7144094d8c2..8140ec943a0 100644 --- a/tests/ui/issues/issue-13214.rs +++ b/tests/ui/issues/issue-13214.rs @@ -3,7 +3,6 @@ // defining static with struct that contains enum // with &'static str variant used to cause ICE -//@ pretty-expanded FIXME #23616 pub enum Foo { Bar, diff --git a/tests/ui/issues/issue-13405.rs b/tests/ui/issues/issue-13405.rs index b2b26ab39c5..80b298d2f37 100644 --- a/tests/ui/issues/issue-13405.rs +++ b/tests/ui/issues/issue-13405.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 struct Foo<'a> { i: &'a bool, diff --git a/tests/ui/issues/issue-13620.rs b/tests/ui/issues/issue-13620.rs index 0225114e6c3..4d9db3aa7ce 100644 --- a/tests/ui/issues/issue-13620.rs +++ b/tests/ui/issues/issue-13620.rs @@ -2,7 +2,6 @@ //@ aux-build:issue-13620-1.rs //@ aux-build:issue-13620-2.rs -//@ pretty-expanded FIXME #23616 extern crate issue_13620_2 as crate2; diff --git a/tests/ui/issues/issue-13665.rs b/tests/ui/issues/issue-13665.rs index 3d5cffa9855..e1d8be16f45 100644 --- a/tests/ui/issues/issue-13665.rs +++ b/tests/ui/issues/issue-13665.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn foo<'r>() { let maybe_value_ref: Option<&'r u8> = None; diff --git a/tests/ui/issues/issue-13703.rs b/tests/ui/issues/issue-13703.rs index 9748ab3719e..b385e6b9d2e 100644 --- a/tests/ui/issues/issue-13703.rs +++ b/tests/ui/issues/issue-13703.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize } pub fn foo<'a, 'b>(x: Foo<'a, 'b>, _o: Option<& & ()>) { let _y = x.foo; } diff --git a/tests/ui/issues/issue-13763.rs b/tests/ui/issues/issue-13763.rs index 3044c671169..67b9bdc5f03 100644 --- a/tests/ui/issues/issue-13763.rs +++ b/tests/ui/issues/issue-13763.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 mod u8 { pub const BITS: usize = 8; diff --git a/tests/ui/issues/issue-13775.rs b/tests/ui/issues/issue-13775.rs index 1d7a40b72d3..500ec6782a8 100644 --- a/tests/ui/issues/issue-13775.rs +++ b/tests/ui/issues/issue-13775.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Foo { #[allow(anonymous_parameters)] diff --git a/tests/ui/issues/issue-13808.rs b/tests/ui/issues/issue-13808.rs index 91b771c6a68..d2961b35f2e 100644 --- a/tests/ui/issues/issue-13808.rs +++ b/tests/ui/issues/issue-13808.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 struct Foo<'a> { listener: Box<dyn FnMut() + 'a>, diff --git a/tests/ui/issues/issue-14082.rs b/tests/ui/issues/issue-14082.rs index 116002415df..16556e1d260 100644 --- a/tests/ui/issues/issue-14082.rs +++ b/tests/ui/issues/issue-14082.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 #![allow(unused_imports, dead_code)] diff --git a/tests/ui/issues/issue-14254.rs b/tests/ui/issues/issue-14254.rs index 9175ac8f92e..90ad375c262 100644 --- a/tests/ui/issues/issue-14254.rs +++ b/tests/ui/issues/issue-14254.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Foo: Sized { fn bar(&self); diff --git a/tests/ui/issues/issue-14330.rs b/tests/ui/issues/issue-14330.rs index f6461c834a5..11199db5901 100644 --- a/tests/ui/issues/issue-14330.rs +++ b/tests/ui/issues/issue-14330.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(unused_imports)] -//@ pretty-expanded FIXME #23616 #[macro_use] extern crate std as std2; diff --git a/tests/ui/issues/issue-14393.rs b/tests/ui/issues/issue-14393.rs index b7e64d6dca6..69c3fc15d31 100644 --- a/tests/ui/issues/issue-14393.rs +++ b/tests/ui/issues/issue-14393.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { match ("", 1_usize) { diff --git a/tests/ui/issues/issue-14399.rs b/tests/ui/issues/issue-14399.rs index cb768f63baa..a539e270fb0 100644 --- a/tests/ui/issues/issue-14399.rs +++ b/tests/ui/issues/issue-14399.rs @@ -4,7 +4,6 @@ // value was coerced to a trait object. (v.clone() returns Box<B1> // which is coerced to Box<A>). -//@ pretty-expanded FIXME #23616 #[derive(Clone)] struct B1; diff --git a/tests/ui/issues/issue-14399.stderr b/tests/ui/issues/issue-14399.stderr index d226ece6fb0..5821c3cc389 100644 --- a/tests/ui/issues/issue-14399.stderr +++ b/tests/ui/issues/issue-14399.stderr @@ -1,5 +1,5 @@ warning: method `foo` is never used - --> $DIR/issue-14399.rs:12:14 + --> $DIR/issue-14399.rs:11:14 | LL | trait A { fn foo(&self) {} } | - ^^^ diff --git a/tests/ui/issues/issue-14421.rs b/tests/ui/issues/issue-14421.rs index 4acbce66b6f..b7038584fce 100644 --- a/tests/ui/issues/issue-14421.rs +++ b/tests/ui/issues/issue-14421.rs @@ -3,7 +3,6 @@ //@ aux-build:issue-14421.rs -//@ pretty-expanded FIXME #23616 extern crate issue_14421 as bug_lib; diff --git a/tests/ui/issues/issue-14422.rs b/tests/ui/issues/issue-14422.rs index ed9e72390c5..b7bb2caa7f0 100644 --- a/tests/ui/issues/issue-14422.rs +++ b/tests/ui/issues/issue-14422.rs @@ -3,7 +3,6 @@ //@ aux-build:issue-14422.rs -//@ pretty-expanded FIXME #23616 extern crate issue_14422 as bug_lib; diff --git a/tests/ui/issues/issue-14919.rs b/tests/ui/issues/issue-14919.rs index 8a8324e57ea..3a834b13d07 100644 --- a/tests/ui/issues/issue-14919.rs +++ b/tests/ui/issues/issue-14919.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_must_use)] #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait Matcher { fn next_match(&mut self) -> Option<(usize, usize)>; diff --git a/tests/ui/issues/issue-14959.rs b/tests/ui/issues/issue-14959.rs index 401bd82ded3..57af1207ff9 100644 --- a/tests/ui/issues/issue-14959.rs +++ b/tests/ui/issues/issue-14959.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 #![feature(fn_traits, unboxed_closures)] diff --git a/tests/ui/issues/issue-15043.rs b/tests/ui/issues/issue-15043.rs index b00c878086d..a9bb46b649b 100644 --- a/tests/ui/issues/issue-15043.rs +++ b/tests/ui/issues/issue-15043.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(warnings)] diff --git a/tests/ui/issues/issue-15444.rs b/tests/ui/issues/issue-15444.rs index a9a33bd5de4..14708c7733c 100644 --- a/tests/ui/issues/issue-15444.rs +++ b/tests/ui/issues/issue-15444.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 trait MyTrait { fn foo(&self); diff --git a/tests/ui/issues/issue-15562.rs b/tests/ui/issues/issue-15562.rs index faa46cd5ece..d3a8f24c51b 100644 --- a/tests/ui/issues/issue-15562.rs +++ b/tests/ui/issues/issue-15562.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-15562.rs -//@ pretty-expanded FIXME #23616 extern crate issue_15562 as i; diff --git a/tests/ui/issues/issue-15774.rs b/tests/ui/issues/issue-15774.rs index 383003b2dd7..8eb327a0d5e 100644 --- a/tests/ui/issues/issue-15774.rs +++ b/tests/ui/issues/issue-15774.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![deny(warnings)] #![allow(unused_imports)] diff --git a/tests/ui/issues/issue-16256.rs b/tests/ui/issues/issue-16256.rs index f5873331c2d..1024e4511d6 100644 --- a/tests/ui/issues/issue-16256.rs +++ b/tests/ui/issues/issue-16256.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { let mut buf = Vec::new(); diff --git a/tests/ui/issues/issue-16256.stderr b/tests/ui/issues/issue-16256.stderr index d920530b57c..75c3ec1bd1c 100644 --- a/tests/ui/issues/issue-16256.stderr +++ b/tests/ui/issues/issue-16256.stderr @@ -1,5 +1,5 @@ warning: unused closure that must be used - --> $DIR/issue-16256.rs:6:5 + --> $DIR/issue-16256.rs:5:5 | LL | |c: u8| buf.push(c); | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/issues/issue-16441.rs b/tests/ui/issues/issue-16441.rs index 21608cf04c3..58cfb389297 100644 --- a/tests/ui/issues/issue-16441.rs +++ b/tests/ui/issues/issue-16441.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Empty; diff --git a/tests/ui/issues/issue-16452.rs b/tests/ui/issues/issue-16452.rs index 07dbf4729e6..4ab74f09059 100644 --- a/tests/ui/issues/issue-16452.rs +++ b/tests/ui/issues/issue-16452.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn main() { if true { return } diff --git a/tests/ui/issues/issue-16643.rs b/tests/ui/issues/issue-16643.rs index e00978ce66a..6cef11ffa87 100644 --- a/tests/ui/issues/issue-16643.rs +++ b/tests/ui/issues/issue-16643.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-16643.rs -//@ pretty-expanded FIXME #23616 extern crate issue_16643 as i; diff --git a/tests/ui/issues/issue-16783.rs b/tests/ui/issues/issue-16783.rs index a69ecb353bb..2ecc42b579d 100644 --- a/tests/ui/issues/issue-16783.rs +++ b/tests/ui/issues/issue-16783.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 pub fn main() { let x = [1, 2, 3]; diff --git a/tests/ui/issues/issue-16922-rpass.rs b/tests/ui/issues/issue-16922-rpass.rs index 6cce4179b7c..f7ffcfb1d94 100644 --- a/tests/ui/issues/issue-16922-rpass.rs +++ b/tests/ui/issues/issue-16922-rpass.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::any::Any; diff --git a/tests/ui/issues/issue-17121.rs b/tests/ui/issues/issue-17121.rs index 0a788b317cd..6bb89a4aa7b 100644 --- a/tests/ui/issues/issue-17121.rs +++ b/tests/ui/issues/issue-17121.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 use std::fs::File; use std::io::{self, BufReader, Read}; diff --git a/tests/ui/issues/issue-17322.rs b/tests/ui/issues/issue-17322.rs index 71ff38a0145..014e6b718f1 100644 --- a/tests/ui/issues/issue-17322.rs +++ b/tests/ui/issues/issue-17322.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::io::{self, Write}; diff --git a/tests/ui/issues/issue-17351.rs b/tests/ui/issues/issue-17351.rs index 15bff07f6e5..86049377198 100644 --- a/tests/ui/issues/issue-17351.rs +++ b/tests/ui/issues/issue-17351.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 trait Str { fn foo(&self) {} } //~ WARN method `foo` is never used impl Str for str {} diff --git a/tests/ui/issues/issue-17351.stderr b/tests/ui/issues/issue-17351.stderr index 3242d578dab..e4c84ab9315 100644 --- a/tests/ui/issues/issue-17351.stderr +++ b/tests/ui/issues/issue-17351.stderr @@ -1,5 +1,5 @@ warning: method `foo` is never used - --> $DIR/issue-17351.rs:4:16 + --> $DIR/issue-17351.rs:3:16 | LL | trait Str { fn foo(&self) {} } | --- ^^^ diff --git a/tests/ui/issues/issue-17361.rs b/tests/ui/issues/issue-17361.rs index 1b1eeb5a252..6f6fc42db38 100644 --- a/tests/ui/issues/issue-17361.rs +++ b/tests/ui/issues/issue-17361.rs @@ -1,7 +1,6 @@ //@ run-pass // Test that HIR ty lowering doesn't forget about mutability of `&mut str`. -//@ pretty-expanded FIXME #23616 fn main() { fn foo<T: ?Sized>(_: &mut T) {} diff --git a/tests/ui/issues/issue-17732.rs b/tests/ui/issues/issue-17732.rs index 4bf7ee286e1..e093ed7f41f 100644 --- a/tests/ui/issues/issue-17732.rs +++ b/tests/ui/issues/issue-17732.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 trait Person { type string; diff --git a/tests/ui/issues/issue-17771.rs b/tests/ui/issues/issue-17771.rs index d7c0ea3eb2a..2e27cfceb8c 100644 --- a/tests/ui/issues/issue-17771.rs +++ b/tests/ui/issues/issue-17771.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait Aaa { fn dummy(&self) { } } diff --git a/tests/ui/issues/issue-17904.rs b/tests/ui/issues/issue-17904.rs index 5eaa306e80e..fba71f70dd9 100644 --- a/tests/ui/issues/issue-17904.rs +++ b/tests/ui/issues/issue-17904.rs @@ -3,7 +3,6 @@ // Test that we can parse where clauses on various forms of tuple // structs. -//@ pretty-expanded FIXME #23616 struct Bar<T>(T) where T: Copy; struct Bleh<T, U>(T, U) where T: Copy, U: Sized; diff --git a/tests/ui/issues/issue-18110.rs b/tests/ui/issues/issue-18110.rs index 8ab9be19531..6d563a5bae1 100644 --- a/tests/ui/issues/issue-18110.rs +++ b/tests/ui/issues/issue-18110.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unreachable_code)] -//@ pretty-expanded FIXME #23616 fn main() { ({return},); diff --git a/tests/ui/issues/issue-18188.rs b/tests/ui/issues/issue-18188.rs index b99e6aea6bd..b3b008229a5 100644 --- a/tests/ui/issues/issue-18188.rs +++ b/tests/ui/issues/issue-18188.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 pub trait Promisable: Send + Sync {} impl<T: Send + Sync> Promisable for T {} diff --git a/tests/ui/issues/issue-18232.rs b/tests/ui/issues/issue-18232.rs index 5ace2231192..d526a67950c 100644 --- a/tests/ui/issues/issue-18232.rs +++ b/tests/ui/issues/issue-18232.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct Cursor<'a>(::std::marker::PhantomData<&'a ()>); diff --git a/tests/ui/issues/issue-18353.rs b/tests/ui/issues/issue-18353.rs index a9c0b3bcdbd..378caa9f369 100644 --- a/tests/ui/issues/issue-18353.rs +++ b/tests/ui/issues/issue-18353.rs @@ -3,7 +3,6 @@ // Test that wrapping an unsized struct in an enum which gets optimised does // not ICE. -//@ pretty-expanded FIXME #23616 struct Str { f: [u8] diff --git a/tests/ui/issues/issue-18501.rs b/tests/ui/issues/issue-18501.rs index 559428d4d08..54e53e434c4 100644 --- a/tests/ui/issues/issue-18501.rs +++ b/tests/ui/issues/issue-18501.rs @@ -4,7 +4,6 @@ // translating the def ID of the trait during AST decoding. //@ aux-build:issue-18501.rs -//@ pretty-expanded FIXME #23616 extern crate issue_18501 as issue; diff --git a/tests/ui/issues/issue-18539.rs b/tests/ui/issues/issue-18539.rs index eaf8294aa47..66f0dabb73a 100644 --- a/tests/ui/issues/issue-18539.rs +++ b/tests/ui/issues/issue-18539.rs @@ -2,7 +2,6 @@ // Test that coercing bare fn's that return a zero sized type to // a closure doesn't cause an LLVM ERROR -//@ pretty-expanded FIXME #23616 struct Foo; diff --git a/tests/ui/issues/issue-18685.rs b/tests/ui/issues/issue-18685.rs index cea60e6f4f2..3dab341f615 100644 --- a/tests/ui/issues/issue-18685.rs +++ b/tests/ui/issues/issue-18685.rs @@ -2,7 +2,6 @@ // Test that the self param space is not used in a conflicting // manner by unboxed closures within a default method on a trait -//@ pretty-expanded FIXME #23616 trait Tr { fn foo(&self); diff --git a/tests/ui/issues/issue-18711.rs b/tests/ui/issues/issue-18711.rs index c62f83004ae..1d5e3349a6d 100644 --- a/tests/ui/issues/issue-18711.rs +++ b/tests/ui/issues/issue-18711.rs @@ -2,7 +2,6 @@ // Test that we don't panic on a RefCell borrow conflict in certain // code paths involving unboxed closures. -//@ pretty-expanded FIXME #23616 //@ aux-build:issue-18711.rs extern crate issue_18711 as issue; diff --git a/tests/ui/issues/issue-18906.rs b/tests/ui/issues/issue-18906.rs index 95ad8073955..84b0f5a1788 100644 --- a/tests/ui/issues/issue-18906.rs +++ b/tests/ui/issues/issue-18906.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub trait Borrow<Borrowed: ?Sized> { fn borrow(&self) -> &Borrowed; diff --git a/tests/ui/issues/issue-19037.rs b/tests/ui/issues/issue-19037.rs index 961ef69a3b9..7f88a89a657 100644 --- a/tests/ui/issues/issue-19037.rs +++ b/tests/ui/issues/issue-19037.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Str([u8]); diff --git a/tests/ui/issues/issue-19127.rs b/tests/ui/issues/issue-19127.rs index dd0526592e4..2172c631b84 100644 --- a/tests/ui/issues/issue-19127.rs +++ b/tests/ui/issues/issue-19127.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 fn foo<T, F: FnOnce(T) -> T>(f: F) {} fn id<'a>(input: &'a u8) -> &'a u8 { input } diff --git a/tests/ui/issues/issue-19293.rs b/tests/ui/issues/issue-19293.rs index 7a971a59c3d..42effe303d0 100644 --- a/tests/ui/issues/issue-19293.rs +++ b/tests/ui/issues/issue-19293.rs @@ -1,6 +1,5 @@ //@ run-pass //@ aux-build:issue-19293.rs -//@ pretty-expanded FIXME #23616 extern crate issue_19293; use issue_19293::{Foo, MyEnum}; diff --git a/tests/ui/issues/issue-19398.rs b/tests/ui/issues/issue-19398.rs index 751fffb1744..473e43650c2 100644 --- a/tests/ui/issues/issue-19398.rs +++ b/tests/ui/issues/issue-19398.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait T { unsafe extern "Rust" fn foo(&self); diff --git a/tests/ui/issues/issue-19479.rs b/tests/ui/issues/issue-19479.rs index 2818be310be..ed586b76550 100644 --- a/tests/ui/issues/issue-19479.rs +++ b/tests/ui/issues/issue-19479.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Base { fn dummy(&self) { } diff --git a/tests/ui/issues/issue-19499.rs b/tests/ui/issues/issue-19499.rs index 0bd70865211..d2a6862e05c 100644 --- a/tests/ui/issues/issue-19499.rs +++ b/tests/ui/issues/issue-19499.rs @@ -7,7 +7,6 @@ // reasonable examples) let to ambiguity errors about not being able // to infer sufficient type information. -//@ pretty-expanded FIXME #23616 fn main() { let n = 0; diff --git a/tests/ui/issues/issue-19631.rs b/tests/ui/issues/issue-19631.rs index a20df9c9d4c..d13ac216e36 100644 --- a/tests/ui/issues/issue-19631.rs +++ b/tests/ui/issues/issue-19631.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait PoolManager { type C; diff --git a/tests/ui/issues/issue-19632.rs b/tests/ui/issues/issue-19632.rs index 53e25112ecc..a99ab5f5ebe 100644 --- a/tests/ui/issues/issue-19632.rs +++ b/tests/ui/issues/issue-19632.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait PoolManager { type C; diff --git a/tests/ui/issues/issue-19850.rs b/tests/ui/issues/issue-19850.rs index 5e8ba2d4881..485b1a76390 100644 --- a/tests/ui/issues/issue-19850.rs +++ b/tests/ui/issues/issue-19850.rs @@ -3,7 +3,6 @@ // Test that `<Type as Trait>::Output` and `Self::Output` are accepted as type annotations in let // bindings -//@ pretty-expanded FIXME #23616 trait Int { fn one() -> Self; diff --git a/tests/ui/issues/issue-20009.rs b/tests/ui/issues/issue-20009.rs index ed884d12834..4d091f3a962 100644 --- a/tests/ui/issues/issue-20009.rs +++ b/tests/ui/issues/issue-20009.rs @@ -1,7 +1,6 @@ //@ check-pass // Check that associated types are `Sized` -//@ pretty-expanded FIXME #23616 trait Trait { type Output; diff --git a/tests/ui/issues/issue-20313-rpass.rs b/tests/ui/issues/issue-20313-rpass.rs index 66ba97b1074..a9cd0cbd88e 100644 --- a/tests/ui/issues/issue-20313-rpass.rs +++ b/tests/ui/issues/issue-20313-rpass.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![feature(link_llvm_intrinsics)] extern "C" { diff --git a/tests/ui/issues/issue-20389.rs b/tests/ui/issues/issue-20389.rs index 7d3b49ee25f..e201663afc5 100644 --- a/tests/ui/issues/issue-20389.rs +++ b/tests/ui/issues/issue-20389.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] //@ aux-build:issue-20389.rs -//@ pretty-expanded FIXME #23616 extern crate issue_20389; diff --git a/tests/ui/issues/issue-20396.rs b/tests/ui/issues/issue-20396.rs index 46a06bb8e3c..4a7b57903b5 100644 --- a/tests/ui/issues/issue-20396.rs +++ b/tests/ui/issues/issue-20396.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/issues/issue-20414.rs b/tests/ui/issues/issue-20414.rs index ea086c2fbeb..070e0f451a5 100644 --- a/tests/ui/issues/issue-20414.rs +++ b/tests/ui/issues/issue-20414.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait Trait { fn method(self) -> isize; diff --git a/tests/ui/issues/issue-20575.rs b/tests/ui/issues/issue-20575.rs index f8ff8b7d23d..b213b79d37c 100644 --- a/tests/ui/issues/issue-20575.rs +++ b/tests/ui/issues/issue-20575.rs @@ -1,7 +1,6 @@ //@ run-pass // Test that overloaded calls work with zero arity closures -//@ pretty-expanded FIXME #23616 fn main() { let functions: [Box<dyn Fn() -> Option<()>>; 1] = [Box::new(|| None)]; diff --git a/tests/ui/issues/issue-20644.rs b/tests/ui/issues/issue-20644.rs index f71e1a5ba8f..5f7e4054f77 100644 --- a/tests/ui/issues/issue-20644.rs +++ b/tests/ui/issues/issue-20644.rs @@ -6,7 +6,6 @@ // A reduced version of the rustbook ice. The problem this encountered // had to do with codegen ignoring binders. -//@ pretty-expanded FIXME #23616 #![feature(os)] diff --git a/tests/ui/issues/issue-2074.rs b/tests/ui/issues/issue-2074.rs index ebf0de4348c..b6e3fb1fa23 100644 --- a/tests/ui/issues/issue-2074.rs +++ b/tests/ui/issues/issue-2074.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] diff --git a/tests/ui/issues/issue-21033.rs b/tests/ui/issues/issue-21033.rs index 4ddc7a1db58..e6b13eb3f4b 100644 --- a/tests/ui/issues/issue-21033.rs +++ b/tests/ui/issues/issue-21033.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_mut)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 #![feature(box_patterns)] diff --git a/tests/ui/issues/issue-21245.rs b/tests/ui/issues/issue-21245.rs index f25ebf718b1..b7c694763c6 100644 --- a/tests/ui/issues/issue-21245.rs +++ b/tests/ui/issues/issue-21245.rs @@ -5,7 +5,6 @@ // insufficient type propagation caused the type of the iterator to be // incorrectly unified with the `*const` type to which it is coerced. -//@ pretty-expanded FIXME #23616 use std::ptr; diff --git a/tests/ui/issues/issue-21402.rs b/tests/ui/issues/issue-21402.rs index 28d1e1a0d77..fa0ece3ec3b 100644 --- a/tests/ui/issues/issue-21402.rs +++ b/tests/ui/issues/issue-21402.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #[derive(Hash)] struct Foo { diff --git a/tests/ui/issues/issue-2170-exe.rs b/tests/ui/issues/issue-2170-exe.rs index 9e3586afbbc..b66843d48ca 100644 --- a/tests/ui/issues/issue-2170-exe.rs +++ b/tests/ui/issues/issue-2170-exe.rs @@ -1,6 +1,5 @@ //@ run-pass //@ aux-build:issue-2170-lib.rs -//@ pretty-expanded FIXME #23616 extern crate issue_2170_lib; diff --git a/tests/ui/issues/issue-21891.rs b/tests/ui/issues/issue-21891.rs index 1feb0daa2d1..0da6071cdac 100644 --- a/tests/ui/issues/issue-21891.rs +++ b/tests/ui/issues/issue-21891.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_upper_case_globals)] -//@ pretty-expanded FIXME #23616 static foo: [usize; 3] = [1, 2, 3]; diff --git a/tests/ui/issues/issue-2190-1.rs b/tests/ui/issues/issue-2190-1.rs index 5b2890c89fb..8db4a84aac8 100644 --- a/tests/ui/issues/issue-2190-1.rs +++ b/tests/ui/issues/issue-2190-1.rs @@ -2,7 +2,6 @@ #![allow(unused_must_use)] #![allow(non_upper_case_globals)] -//@ pretty-expanded FIXME #23616 //@ ignore-emscripten no threads use std::thread::Builder; diff --git a/tests/ui/issues/issue-21909.rs b/tests/ui/issues/issue-21909.rs index bbf654cb208..ffc75f1f08c 100644 --- a/tests/ui/issues/issue-21909.rs +++ b/tests/ui/issues/issue-21909.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait A<X> { fn dummy(&self, arg: X); diff --git a/tests/ui/issues/issue-21950.rs b/tests/ui/issues/issue-21950.rs index 72a98bd8ddd..7a85ac91bca 100644 --- a/tests/ui/issues/issue-21950.rs +++ b/tests/ui/issues/issue-21950.rs @@ -8,6 +8,5 @@ impl Add for i32 { fn main() { let x = &10 as &dyn Add; - //~^ ERROR E0393 - //~| ERROR E0191 + //~^ ERROR E0191 } diff --git a/tests/ui/issues/issue-21950.stderr b/tests/ui/issues/issue-21950.stderr index 584370c7178..24230cfe17f 100644 --- a/tests/ui/issues/issue-21950.stderr +++ b/tests/ui/issues/issue-21950.stderr @@ -7,22 +7,6 @@ LL | type Output; LL | let x = &10 as &dyn Add; | ^^^ help: specify the associated type: `Add<Output = Type>` -error[E0393]: the type parameter `Rhs` must be explicitly specified - --> $DIR/issue-21950.rs:10:25 - | -LL | trait Add<Rhs=Self> { - | ------------------- type parameter `Rhs` must be specified for this -... -LL | let x = &10 as &dyn Add; - | ^^^ - | - = note: because of the default `Self` reference, type parameters must be specified on object types -help: set the type parameter to the desired type - | -LL | let x = &10 as &dyn Add<Rhs>; - | +++++ - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0191, E0393. -For more information about an error, try `rustc --explain E0191`. +For more information about this error, try `rustc --explain E0191`. diff --git a/tests/ui/issues/issue-22346.rs b/tests/ui/issues/issue-22346.rs index 42280a7ddb6..710dc0acda7 100644 --- a/tests/ui/issues/issue-22346.rs +++ b/tests/ui/issues/issue-22346.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 // This used to cause an ICE because the retslot for the "return" had the wrong type fn testcase<'a>() -> Box<dyn Iterator<Item=usize> + 'a> { diff --git a/tests/ui/issues/issue-22356.rs b/tests/ui/issues/issue-22356.rs index 6b0024ee0ee..b7c5c2a5932 100644 --- a/tests/ui/issues/issue-22356.rs +++ b/tests/ui/issues/issue-22356.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(type_alias_bounds)] -//@ pretty-expanded FIXME #23616 use std::marker::PhantomData; diff --git a/tests/ui/issues/issue-22426.rs b/tests/ui/issues/issue-22426.rs index d5254528a12..0857ac9dfb4 100644 --- a/tests/ui/issues/issue-22426.rs +++ b/tests/ui/issues/issue-22426.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { match 42 { diff --git a/tests/ui/issues/issue-22577.rs b/tests/ui/issues/issue-22577.rs index 09857c95e1b..0fa284cc7c0 100644 --- a/tests/ui/issues/issue-22577.rs +++ b/tests/ui/issues/issue-22577.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 use std::{fs, net}; diff --git a/tests/ui/issues/issue-22629.rs b/tests/ui/issues/issue-22629.rs index 0a75d3dd152..22da414650f 100644 --- a/tests/ui/issues/issue-22629.rs +++ b/tests/ui/issues/issue-22629.rs @@ -3,7 +3,6 @@ // Test transitive analysis for associated types. Collected types // should be normalized and new obligations generated. -//@ pretty-expanded FIXME #23616 use std::borrow::{ToOwned, Cow}; diff --git a/tests/ui/issues/issue-22777.rs b/tests/ui/issues/issue-22777.rs index 56b385a1691..c95bb9cc3bb 100644 --- a/tests/ui/issues/issue-22777.rs +++ b/tests/ui/issues/issue-22777.rs @@ -3,7 +3,6 @@ // can successfully deal with a "deep" structure, which the drop-check // was hitting a recursion limit on at one point. -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] diff --git a/tests/ui/issues/issue-2284.rs b/tests/ui/issues/issue-2284.rs index 281dce913ad..358331ecd9a 100644 --- a/tests/ui/issues/issue-2284.rs +++ b/tests/ui/issues/issue-2284.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait Send { fn f(&self); diff --git a/tests/ui/issues/issue-23024.rs b/tests/ui/issues/issue-23024.rs index 25220dc3e61..1b072dd7b69 100644 --- a/tests/ui/issues/issue-23024.rs +++ b/tests/ui/issues/issue-23024.rs @@ -8,5 +8,4 @@ fn main() println!("{:?}",(vfnfer[0] as dyn Fn)(3)); //~^ ERROR the precise format of `Fn`-family traits' //~| ERROR missing generics for trait `Fn` - //~| ERROR the value of the associated type `Output` in `FnOnce` } diff --git a/tests/ui/issues/issue-23024.stderr b/tests/ui/issues/issue-23024.stderr index 62278a51be6..51db0414f3a 100644 --- a/tests/ui/issues/issue-23024.stderr +++ b/tests/ui/issues/issue-23024.stderr @@ -19,13 +19,7 @@ help: add missing generic argument LL | println!("{:?}",(vfnfer[0] as dyn Fn<Args>)(3)); | ++++++ -error[E0191]: the value of the associated type `Output` in `FnOnce` must be specified - --> $DIR/issue-23024.rs:8:39 - | -LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); - | ^^ help: specify the associated type: `Fn::<Output = Type>` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0107, E0191, E0658. +Some errors have detailed explanations: E0107, E0658. For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/issues/issue-2311.rs b/tests/ui/issues/issue-2311.rs index dc2fb394f83..5388e634c09 100644 --- a/tests/ui/issues/issue-2311.rs +++ b/tests/ui/issues/issue-2311.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 trait clam<A> { fn get(self) -> A; } trait foo<A> { diff --git a/tests/ui/issues/issue-2316-c.rs b/tests/ui/issues/issue-2316-c.rs index 52e2995ec58..f800d4723ff 100644 --- a/tests/ui/issues/issue-2316-c.rs +++ b/tests/ui/issues/issue-2316-c.rs @@ -2,7 +2,6 @@ //@ aux-build:issue-2316-a.rs //@ aux-build:issue-2316-b.rs -//@ pretty-expanded FIXME #23616 extern crate issue_2316_b; use issue_2316_b::cloth; diff --git a/tests/ui/issues/issue-2380-b.rs b/tests/ui/issues/issue-2380-b.rs index 722b463de09..503698f88c6 100644 --- a/tests/ui/issues/issue-2380-b.rs +++ b/tests/ui/issues/issue-2380-b.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-2380.rs -//@ pretty-expanded FIXME #23616 extern crate a; diff --git a/tests/ui/issues/issue-2383.rs b/tests/ui/issues/issue-2383.rs index eecbaa2562e..5d60018ae67 100644 --- a/tests/ui/issues/issue-2383.rs +++ b/tests/ui/issues/issue-2383.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::collections::VecDeque; diff --git a/tests/ui/issues/issue-2414-c.rs b/tests/ui/issues/issue-2414-c.rs index 1437a4199dc..ac75c5c5105 100644 --- a/tests/ui/issues/issue-2414-c.rs +++ b/tests/ui/issues/issue-2414-c.rs @@ -2,7 +2,6 @@ //@ aux-build:issue-2414-a.rs //@ aux-build:issue-2414-b.rs -//@ pretty-expanded FIXME #23616 extern crate b; diff --git a/tests/ui/issues/issue-2445-b.rs b/tests/ui/issues/issue-2445-b.rs index 8f52c0f47a5..3a54c62a771 100644 --- a/tests/ui/issues/issue-2445-b.rs +++ b/tests/ui/issues/issue-2445-b.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct c1<T> { x: T, diff --git a/tests/ui/issues/issue-2445.rs b/tests/ui/issues/issue-2445.rs index da82a489c1e..e6c33a8fd01 100644 --- a/tests/ui/issues/issue-2445.rs +++ b/tests/ui/issues/issue-2445.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct c1<T> { x: T, diff --git a/tests/ui/issues/issue-2463.rs b/tests/ui/issues/issue-2463.rs index 7650da845e3..8fff9763bd9 100644 --- a/tests/ui/issues/issue-2463.rs +++ b/tests/ui/issues/issue-2463.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Pair { f: isize, g: isize } diff --git a/tests/ui/issues/issue-2472.rs b/tests/ui/issues/issue-2472.rs index afebc7b16e5..f8f539ed1d1 100644 --- a/tests/ui/issues/issue-2472.rs +++ b/tests/ui/issues/issue-2472.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-2472-b.rs -//@ pretty-expanded FIXME #23616 extern crate issue_2472_b; diff --git a/tests/ui/issues/issue-2487-a.rs b/tests/ui/issues/issue-2487-a.rs index 6cdb9f2afe2..d38616929fa 100644 --- a/tests/ui/issues/issue-2487-a.rs +++ b/tests/ui/issues/issue-2487-a.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct socket { sock: isize, diff --git a/tests/ui/issues/issue-2502.rs b/tests/ui/issues/issue-2502.rs index d857099e7b9..dfc0995104e 100644 --- a/tests/ui/issues/issue-2502.rs +++ b/tests/ui/issues/issue-2502.rs @@ -3,7 +3,6 @@ #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct font<'a> { fontbuf: &'a Vec<u8> , diff --git a/tests/ui/issues/issue-2526-a.rs b/tests/ui/issues/issue-2526-a.rs index 62e687f7f3f..379146d02b3 100644 --- a/tests/ui/issues/issue-2526-a.rs +++ b/tests/ui/issues/issue-2526-a.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-2526.rs -//@ pretty-expanded FIXME #23616 #![allow(unused_imports)] diff --git a/tests/ui/issues/issue-2550.rs b/tests/ui/issues/issue-2550.rs index 4fc5ba1f7b2..450db9be627 100644 --- a/tests/ui/issues/issue-2550.rs +++ b/tests/ui/issues/issue-2550.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_snake_case)] -//@ pretty-expanded FIXME #23616 struct C { x: usize, diff --git a/tests/ui/issues/issue-25901.rs b/tests/ui/issues/issue-25901.rs index 85e12463a90..eae038c71a0 100644 --- a/tests/ui/issues/issue-25901.rs +++ b/tests/ui/issues/issue-25901.rs @@ -2,7 +2,7 @@ struct A; struct B; static S: &'static B = &A; -//~^ ERROR cannot perform deref coercion +//~^ ERROR cannot call conditionally-const method use std::ops::Deref; diff --git a/tests/ui/issues/issue-25901.stderr b/tests/ui/issues/issue-25901.stderr index bcbc805908f..655a8b78c6a 100644 --- a/tests/ui/issues/issue-25901.stderr +++ b/tests/ui/issues/issue-25901.stderr @@ -1,23 +1,13 @@ -error[E0015]: cannot perform deref coercion on `A` in statics +error[E0658]: cannot call conditionally-const method `<A as Deref>::deref` in statics --> $DIR/issue-25901.rs:4:24 | LL | static S: &'static B = &A; | ^^ | - = note: attempting to deref into `B` -note: deref defined here - --> $DIR/issue-25901.rs:10:5 - | -LL | type Target = B; - | ^^^^^^^^^^^ -note: impl defined here, but it is not `const` - --> $DIR/issue-25901.rs:9:1 - | -LL | impl Deref for A { - | ^^^^^^^^^^^^^^^^ - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` + = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> 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 error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/issues/issue-2642.rs b/tests/ui/issues/issue-2642.rs index d7d97b84799..ad572149509 100644 --- a/tests/ui/issues/issue-2642.rs +++ b/tests/ui/issues/issue-2642.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn f() { let _x: usize = loop { loop { break; } }; diff --git a/tests/ui/issues/issue-2708.rs b/tests/ui/issues/issue-2708.rs index 68ac4bc343c..09d19f87aa6 100644 --- a/tests/ui/issues/issue-2708.rs +++ b/tests/ui/issues/issue-2708.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_snake_case)] -//@ pretty-expanded FIXME #23616 diff --git a/tests/ui/issues/issue-28344.rs b/tests/ui/issues/issue-28344.rs index 1a6a7f46b27..951ea5d69e9 100644 --- a/tests/ui/issues/issue-28344.rs +++ b/tests/ui/issues/issue-28344.rs @@ -3,13 +3,11 @@ use std::ops::BitXor; fn main() { let x: u8 = BitXor::bitor(0 as u8, 0 as u8); //~^ ERROR must be specified - //~| no function or associated item named //~| WARN trait objects without an explicit `dyn` are deprecated //~| WARN this is accepted in the current edition let g = BitXor::bitor; //~^ ERROR must be specified - //~| no function or associated item named //~| WARN trait objects without an explicit `dyn` are deprecated //~| WARN this is accepted in the current edition } diff --git a/tests/ui/issues/issue-28344.stderr b/tests/ui/issues/issue-28344.stderr index 261f8b67b52..d8febe71652 100644 --- a/tests/ui/issues/issue-28344.stderr +++ b/tests/ui/issues/issue-28344.stderr @@ -18,17 +18,8 @@ error[E0191]: the value of the associated type `Output` in `BitXor` must be spec LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); | ^^^^^^ help: specify the associated type: `BitXor::<Output = Type>` -error[E0599]: no function or associated item named `bitor` found for trait object `dyn BitXor<_>` in the current scope - --> $DIR/issue-28344.rs:4:25 - | -LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); - | ^^^^^ function or associated item not found in `dyn BitXor<_>` - | -help: there is a method `bitxor` with a similar name, but with different arguments - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-28344.rs:10:13 + --> $DIR/issue-28344.rs:9:13 | LL | let g = BitXor::bitor; | ^^^^^^ @@ -41,21 +32,11 @@ LL | let g = <dyn BitXor>::bitor; | ++++ + error[E0191]: the value of the associated type `Output` in `BitXor` must be specified - --> $DIR/issue-28344.rs:10:13 + --> $DIR/issue-28344.rs:9:13 | LL | let g = BitXor::bitor; | ^^^^^^ help: specify the associated type: `BitXor::<Output = Type>` -error[E0599]: no function or associated item named `bitor` found for trait object `dyn BitXor<_>` in the current scope - --> $DIR/issue-28344.rs:10:21 - | -LL | let g = BitXor::bitor; - | ^^^^^ function or associated item not found in `dyn BitXor<_>` - | -help: there is a method `bitxor` with a similar name - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - -error: aborting due to 4 previous errors; 2 warnings emitted +error: aborting due to 2 previous errors; 2 warnings emitted -Some errors have detailed explanations: E0191, E0599. -For more information about an error, try `rustc --explain E0191`. +For more information about this error, try `rustc --explain E0191`. diff --git a/tests/ui/issues/issue-3012-2.rs b/tests/ui/issues/issue-3012-2.rs index 913f92fa8e2..fd090d5e7b5 100644 --- a/tests/ui/issues/issue-3012-2.rs +++ b/tests/ui/issues/issue-3012-2.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-3012-1.rs -//@ pretty-expanded FIXME #23616 extern crate socketlib; diff --git a/tests/ui/issues/issue-3026.rs b/tests/ui/issues/issue-3026.rs index 9d1c0f5a341..05dc46c3cc0 100644 --- a/tests/ui/issues/issue-3026.rs +++ b/tests/ui/issues/issue-3026.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::collections::HashMap; diff --git a/tests/ui/issues/issue-3037.rs b/tests/ui/issues/issue-3037.rs index 166f4b91cbc..933b450ac8e 100644 --- a/tests/ui/issues/issue-3037.rs +++ b/tests/ui/issues/issue-3037.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![allow(non_camel_case_types)] enum what { } diff --git a/tests/ui/issues/issue-3052.rs b/tests/ui/issues/issue-3052.rs index 4aa785e797f..ab3519fe714 100644 --- a/tests/ui/issues/issue-3052.rs +++ b/tests/ui/issues/issue-3052.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 type Connection = Box<dyn FnMut(Vec<u8>) + 'static>; diff --git a/tests/ui/issues/issue-3136-b.rs b/tests/ui/issues/issue-3136-b.rs index 2995c96ebb9..bd6ea732643 100644 --- a/tests/ui/issues/issue-3136-b.rs +++ b/tests/ui/issues/issue-3136-b.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-3136-a.rs -//@ pretty-expanded FIXME #23616 extern crate issue_3136_a; diff --git a/tests/ui/issues/issue-3149.rs b/tests/ui/issues/issue-3149.rs index b0abd5996b1..76744213d51 100644 --- a/tests/ui/issues/issue-3149.rs +++ b/tests/ui/issues/issue-3149.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(dead_code)] #![allow(non_snake_case)] -//@ pretty-expanded FIXME #23616 fn Matrix4<T>(m11: T, m12: T, m13: T, m14: T, m21: T, m22: T, m23: T, m24: T, diff --git a/tests/ui/issues/issue-3220.rs b/tests/ui/issues/issue-3220.rs index 62a979b47c7..2f5ca82b2fa 100644 --- a/tests/ui/issues/issue-3220.rs +++ b/tests/ui/issues/issue-3220.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct thing { x: isize, } diff --git a/tests/ui/issues/issue-3429.rs b/tests/ui/issues/issue-3429.rs index 38ea7df1aa0..39d657573db 100644 --- a/tests/ui/issues/issue-3429.rs +++ b/tests/ui/issues/issue-3429.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let x = 1_usize; diff --git a/tests/ui/issues/issue-34373.rs b/tests/ui/issues/issue-34373.rs index dc20c5589b3..707aa8cf338 100644 --- a/tests/ui/issues/issue-34373.rs +++ b/tests/ui/issues/issue-34373.rs @@ -6,7 +6,6 @@ trait Trait<T> { pub struct Foo<T = Box<Trait<DefaultFoo>>>; //~ ERROR cycle detected //~^ ERROR `T` is never used -//~| ERROR `Trait` cannot be made into an object type DefaultFoo = Foo; fn main() { diff --git a/tests/ui/issues/issue-34373.stderr b/tests/ui/issues/issue-34373.stderr index 4e8e7c61fee..06365558217 100644 --- a/tests/ui/issues/issue-34373.stderr +++ b/tests/ui/issues/issue-34373.stderr @@ -5,7 +5,7 @@ LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>; | ^^^^^^^^^^ | note: ...which requires expanding type alias `DefaultFoo`... - --> $DIR/issue-34373.rs:10:19 + --> $DIR/issue-34373.rs:9:19 | LL | type DefaultFoo = Foo; | ^^^ @@ -17,28 +17,6 @@ LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/issue-34373.rs:7:24 - | -LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>; - | ^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-34373.rs:4:8 - | -LL | trait Trait<T> { - | ----- this trait cannot be made into an object... -LL | fn foo(_: T) {} - | ^^^ ...because associated function `foo` has no `self` parameter -help: consider turning `foo` into a method by giving it a `&self` argument - | -LL | fn foo(&self, _: T) {} - | ++++++ -help: alternatively, consider constraining `foo` so it does not apply to trait objects - | -LL | fn foo(_: T) where Self: Sized {} - | +++++++++++++++++ - error[E0392]: type parameter `T` is never used --> $DIR/issue-34373.rs:7:16 | @@ -48,7 +26,7 @@ LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>; = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0038, E0391, E0392. -For more information about an error, try `rustc --explain E0038`. +Some errors have detailed explanations: E0391, E0392. +For more information about an error, try `rustc --explain E0391`. diff --git a/tests/ui/issues/issue-3500.rs b/tests/ui/issues/issue-3500.rs index 038707ef1ec..0860d0f5926 100644 --- a/tests/ui/issues/issue-3500.rs +++ b/tests/ui/issues/issue-3500.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let x = &Some(1); diff --git a/tests/ui/issues/issue-3656.rs b/tests/ui/issues/issue-3656.rs index 975695e497f..15ad3232555 100644 --- a/tests/ui/issues/issue-3656.rs +++ b/tests/ui/issues/issue-3656.rs @@ -5,7 +5,6 @@ // Incorrect struct size computation in the FFI, because of not taking // the alignment of elements into account. -//@ pretty-expanded FIXME #23616 use std::ffi::{c_uint, c_void}; diff --git a/tests/ui/issues/issue-3874.rs b/tests/ui/issues/issue-3874.rs index 737f2c69e1e..251e8e1da6d 100644 --- a/tests/ui/issues/issue-3874.rs +++ b/tests/ui/issues/issue-3874.rs @@ -1,6 +1,5 @@ //@ build-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 enum PureCounter { PureCounterVariant(usize) } diff --git a/tests/ui/issues/issue-3888-2.rs b/tests/ui/issues/issue-3888-2.rs index c06d20961c2..39b7126f069 100644 --- a/tests/ui/issues/issue-3888-2.rs +++ b/tests/ui/issues/issue-3888-2.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] { &v[1..5] diff --git a/tests/ui/issues/issue-39211.rs b/tests/ui/issues/issue-39211.rs index 6f3834d51a1..ab86afc3410 100644 --- a/tests/ui/issues/issue-39211.rs +++ b/tests/ui/issues/issue-39211.rs @@ -8,6 +8,7 @@ trait Mat { fn m<M: Mat>() { let a = [3; M::Row::DIM]; //~^ ERROR constant expression depends on a generic parameter + //~| ERROR constant expression depends on a generic parameter } fn main() { } diff --git a/tests/ui/issues/issue-39211.stderr b/tests/ui/issues/issue-39211.stderr index 15c9a80bb35..2124bc667ff 100644 --- a/tests/ui/issues/issue-39211.stderr +++ b/tests/ui/issues/issue-39211.stderr @@ -6,5 +6,13 @@ LL | let a = [3; M::Row::DIM]; | = note: this may fail depending on what value the parameter takes -error: aborting due to 1 previous error +error: constant expression depends on a generic parameter + --> $DIR/issue-39211.rs:9:13 + | +LL | let a = [3; M::Row::DIM]; + | ^^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-3979-2.rs b/tests/ui/issues/issue-3979-2.rs index 620090bc3ec..98b6e85225d 100644 --- a/tests/ui/issues/issue-3979-2.rs +++ b/tests/ui/issues/issue-3979-2.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait A { fn a_method(&self); diff --git a/tests/ui/issues/issue-3991.rs b/tests/ui/issues/issue-3991.rs index 97bddb9250a..e69c693ed49 100644 --- a/tests/ui/issues/issue-3991.rs +++ b/tests/ui/issues/issue-3991.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct HasNested { nest: Vec<Vec<isize> > , diff --git a/tests/ui/issues/issue-4208.rs b/tests/ui/issues/issue-4208.rs index 1691bec980b..84938bea022 100644 --- a/tests/ui/issues/issue-4208.rs +++ b/tests/ui/issues/issue-4208.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] //@ aux-build:issue-4208-cc.rs -//@ pretty-expanded FIXME #23616 extern crate numeric; use numeric::{sin, Angle}; diff --git a/tests/ui/issues/issue-4228.rs b/tests/ui/issues/issue-4228.rs index 8ae8a84dac9..362d5925c70 100644 --- a/tests/ui/issues/issue-4228.rs +++ b/tests/ui/issues/issue-4228.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct Foo; diff --git a/tests/ui/issues/issue-4333.rs b/tests/ui/issues/issue-4333.rs index 9b45e1665be..dccaa6f68bd 100644 --- a/tests/ui/issues/issue-4333.rs +++ b/tests/ui/issues/issue-4333.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_must_use)] -//@ pretty-expanded FIXME #23616 use std::io; diff --git a/tests/ui/issues/issue-4387.rs b/tests/ui/issues/issue-4387.rs index 1299c4fcc3a..10f607aacbd 100644 --- a/tests/ui/issues/issue-4387.rs +++ b/tests/ui/issues/issue-4387.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let _foo = [0; 2*4]; diff --git a/tests/ui/issues/issue-4464.rs b/tests/ui/issues/issue-4464.rs index a2d6ed718c2..7b3df9af223 100644 --- a/tests/ui/issues/issue-4464.rs +++ b/tests/ui/issues/issue-4464.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn broken(v: &[u8], i: usize, j: usize) -> &[u8] { &v[i..j] } diff --git a/tests/ui/issues/issue-4542.rs b/tests/ui/issues/issue-4542.rs index bd63246fa33..15fd31d92d2 100644 --- a/tests/ui/issues/issue-4542.rs +++ b/tests/ui/issues/issue-4542.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::env; diff --git a/tests/ui/issues/issue-4545.rs b/tests/ui/issues/issue-4545.rs index 6a2f04e4511..dfb89136cbd 100644 --- a/tests/ui/issues/issue-4545.rs +++ b/tests/ui/issues/issue-4545.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-4545.rs -//@ pretty-expanded FIXME #23616 extern crate issue_4545 as somelib; pub fn main() { somelib::mk::<isize>(); } diff --git a/tests/ui/issues/issue-4735.rs b/tests/ui/issues/issue-4735.rs index 1223e15b2d9..1ca145bae42 100644 --- a/tests/ui/issues/issue-4735.rs +++ b/tests/ui/issues/issue-4735.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::mem::transmute; diff --git a/tests/ui/issues/issue-4759.rs b/tests/ui/issues/issue-4759.rs index 49fe5f92759..4b49442b401 100644 --- a/tests/ui/issues/issue-4759.rs +++ b/tests/ui/issues/issue-4759.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_shorthand_field_patterns)] struct T { a: Box<isize> } diff --git a/tests/ui/issues/issue-48006.rs b/tests/ui/issues/issue-48006.rs index e48146d07bc..1adc76f2a26 100644 --- a/tests/ui/issues/issue-48006.rs +++ b/tests/ui/issues/issue-48006.rs @@ -6,10 +6,10 @@ use std::iter::Step; #[cfg(target_pointer_width = "16")] fn main() { - assert!(Step::steps_between(&0u32, &u32::MAX).is_none()); + assert!(Step::steps_between(&0u32, &u32::MAX).1.is_none()); } #[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))] fn main() { - assert!(Step::steps_between(&0u32, &u32::MAX).is_some()); + assert!(Step::steps_between(&0u32, &u32::MAX).1.is_some()); } diff --git a/tests/ui/issues/issue-4830.rs b/tests/ui/issues/issue-4830.rs index 364def61da8..d48c13fd10b 100644 --- a/tests/ui/issues/issue-4830.rs +++ b/tests/ui/issues/issue-4830.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub struct Scheduler { /// The event loop used to drive the scheduler and perform I/O diff --git a/tests/ui/issues/issue-4875.rs b/tests/ui/issues/issue-4875.rs index 3b09331873c..5068399ff0d 100644 --- a/tests/ui/issues/issue-4875.rs +++ b/tests/ui/issues/issue-4875.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // regression test for issue 4875 -//@ pretty-expanded FIXME #23616 pub struct Foo<T> { data: T, diff --git a/tests/ui/issues/issue-50582.rs b/tests/ui/issues/issue-50582.rs index 2d5c9358752..1358e0bde4c 100644 --- a/tests/ui/issues/issue-50582.rs +++ b/tests/ui/issues/issue-50582.rs @@ -1,5 +1,4 @@ fn main() { Vec::<[(); 1 + for x in 0..1 {}]>::new(); //~^ ERROR cannot add - //~| ERROR `for` is not allowed in a `const` } diff --git a/tests/ui/issues/issue-50582.stderr b/tests/ui/issues/issue-50582.stderr index af7a36f62fb..168f5894fb0 100644 --- a/tests/ui/issues/issue-50582.stderr +++ b/tests/ui/issues/issue-50582.stderr @@ -1,13 +1,3 @@ -error[E0658]: `for` is not allowed in a `const` - --> $DIR/issue-50582.rs:2:20 - | -LL | Vec::<[(); 1 + for x in 0..1 {}]>::new(); - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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[E0277]: cannot add `()` to `{integer}` --> $DIR/issue-50582.rs:2:18 | @@ -26,7 +16,6 @@ LL | Vec::<[(); 1 + for x in 0..1 {}]>::new(); `&f64` implements `Add` and 56 others -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0277, E0658. -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/issues/issue-50585.rs b/tests/ui/issues/issue-50585.rs index a2f11c98d5a..ca2ece8d53b 100644 --- a/tests/ui/issues/issue-50585.rs +++ b/tests/ui/issues/issue-50585.rs @@ -1,5 +1,4 @@ fn main() { |y: Vec<[(); for x in 0..2 {}]>| {}; //~^ ERROR mismatched types - //~| ERROR `for` is not allowed in a `const` } diff --git a/tests/ui/issues/issue-50585.stderr b/tests/ui/issues/issue-50585.stderr index e7f13e63475..7e83ea35fbb 100644 --- a/tests/ui/issues/issue-50585.stderr +++ b/tests/ui/issues/issue-50585.stderr @@ -1,13 +1,3 @@ -error[E0658]: `for` is not allowed in a `const` - --> $DIR/issue-50585.rs:2:18 - | -LL | |y: Vec<[(); for x in 0..2 {}]>| {}; - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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[E0308]: mismatched types --> $DIR/issue-50585.rs:2:18 | @@ -20,7 +10,6 @@ help: consider returning a value here LL | |y: Vec<[(); for x in 0..2 {} /* `usize` value */]>| {}; | +++++++++++++++++++ -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0308, E0658. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-5192.rs b/tests/ui/issues/issue-5192.rs index 8911e7a733b..be5d70f09b3 100644 --- a/tests/ui/issues/issue-5192.rs +++ b/tests/ui/issues/issue-5192.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub trait EventLoop { fn dummy(&self) { } diff --git a/tests/ui/issues/issue-5315.rs b/tests/ui/issues/issue-5315.rs index 64a48b9e842..29a6f8f2934 100644 --- a/tests/ui/issues/issue-5315.rs +++ b/tests/ui/issues/issue-5315.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct A(#[allow(dead_code)] bool); diff --git a/tests/ui/issues/issue-5518.rs b/tests/ui/issues/issue-5518.rs index 4e1049f02fb..333185c482f 100644 --- a/tests/ui/issues/issue-5518.rs +++ b/tests/ui/issues/issue-5518.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-5518.rs -//@ pretty-expanded FIXME #23616 extern crate issue_5518 as other; diff --git a/tests/ui/issues/issue-5550.rs b/tests/ui/issues/issue-5550.rs index e967590c650..41de8ee5d32 100644 --- a/tests/ui/issues/issue-5550.rs +++ b/tests/ui/issues/issue-5550.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_assignments)] -//@ pretty-expanded FIXME #23616 pub fn main() { let s: String = "foobar".to_string(); diff --git a/tests/ui/issues/issue-5554.rs b/tests/ui/issues/issue-5554.rs index 532d1b4092e..7d219a0df70 100644 --- a/tests/ui/issues/issue-5554.rs +++ b/tests/ui/issues/issue-5554.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub struct X<T> { diff --git a/tests/ui/issues/issue-55587.stderr b/tests/ui/issues/issue-55587.stderr index eec6426a299..7a5d0e28100 100644 --- a/tests/ui/issues/issue-55587.stderr +++ b/tests/ui/issues/issue-55587.stderr @@ -4,7 +4,7 @@ error[E0164]: expected tuple struct or tuple variant, found associated function LL | let Path::new(); | ^^^^^^^^^^^ `fn` calls are not allowed in patterns | - = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html + = help: for more information, visit https://doc.rust-lang.org/book/ch19-00-patterns.html error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-5572.rs b/tests/ui/issues/issue-5572.rs index 8a4c867f585..f27744ef0ac 100644 --- a/tests/ui/issues/issue-5572.rs +++ b/tests/ui/issues/issue-5572.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn foo<T: ::std::cmp::PartialEq>(_t: T) { } diff --git a/tests/ui/issues/issue-5718.rs b/tests/ui/issues/issue-5718.rs index c30061298d1..234fb2e2222 100644 --- a/tests/ui/issues/issue-5718.rs +++ b/tests/ui/issues/issue-5718.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 struct Element; diff --git a/tests/ui/issues/issue-5741.rs b/tests/ui/issues/issue-5741.rs index dad16dd39e2..af4702ec22c 100644 --- a/tests/ui/issues/issue-5741.rs +++ b/tests/ui/issues/issue-5741.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(while_true)] #![allow(unreachable_code)] diff --git a/tests/ui/issues/issue-5754.rs b/tests/ui/issues/issue-5754.rs index 2b61da02c30..0aa09882959 100644 --- a/tests/ui/issues/issue-5754.rs +++ b/tests/ui/issues/issue-5754.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(improper_ctypes)] -//@ pretty-expanded FIXME #23616 struct TwoDoubles { r: f64, diff --git a/tests/ui/issues/issue-5884.rs b/tests/ui/issues/issue-5884.rs index 17cb4133632..559b897395d 100644 --- a/tests/ui/issues/issue-5884.rs +++ b/tests/ui/issues/issue-5884.rs @@ -1,6 +1,5 @@ //@ build-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub struct Foo { a: isize, diff --git a/tests/ui/issues/issue-5900.rs b/tests/ui/issues/issue-5900.rs index 986a8233ef2..14b7b8f815a 100644 --- a/tests/ui/issues/issue-5900.rs +++ b/tests/ui/issues/issue-5900.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub mod foo { use super::Bar; diff --git a/tests/ui/issues/issue-5950.rs b/tests/ui/issues/issue-5950.rs index a0822459ad1..6015560fcf8 100644 --- a/tests/ui/issues/issue-5950.rs +++ b/tests/ui/issues/issue-5950.rs @@ -1,6 +1,5 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 pub use local as local_alias; diff --git a/tests/ui/issues/issue-5988.rs b/tests/ui/issues/issue-5988.rs index 801a5edca08..b7527d9bea8 100644 --- a/tests/ui/issues/issue-5988.rs +++ b/tests/ui/issues/issue-5988.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 trait B { fn f(&self); diff --git a/tests/ui/issues/issue-6117.rs b/tests/ui/issues/issue-6117.rs index 4fa99d955c9..3ccf67b0319 100644 --- a/tests/ui/issues/issue-6117.rs +++ b/tests/ui/issues/issue-6117.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 enum Either<T, U> { Left(T), Right(U) } diff --git a/tests/ui/issues/issue-6318.rs b/tests/ui/issues/issue-6318.rs index 3b17754ffdc..d3f08285a93 100644 --- a/tests/ui/issues/issue-6318.rs +++ b/tests/ui/issues/issue-6318.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub enum Thing { A(Box<dyn Foo+'static>) diff --git a/tests/ui/issues/issue-6557.rs b/tests/ui/issues/issue-6557.rs index 89ebb0610dd..64a025a294f 100644 --- a/tests/ui/issues/issue-6557.rs +++ b/tests/ui/issues/issue-6557.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![feature(box_patterns)] diff --git a/tests/ui/issues/issue-6898.rs b/tests/ui/issues/issue-6898.rs index cc0fe35fc88..c810acaf61b 100644 --- a/tests/ui/issues/issue-6898.rs +++ b/tests/ui/issues/issue-6898.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 use std::mem; diff --git a/tests/ui/issues/issue-6919.rs b/tests/ui/issues/issue-6919.rs index 3aa66882c19..7fb8a2f33bc 100644 --- a/tests/ui/issues/issue-6919.rs +++ b/tests/ui/issues/issue-6919.rs @@ -2,7 +2,6 @@ #![allow(unused_attributes)] //@ aux-build:iss.rs -//@ pretty-expanded FIXME #23616 extern crate issue6919_3; diff --git a/tests/ui/issues/issue-7178.rs b/tests/ui/issues/issue-7178.rs index 153ce2cf057..408ce0b03eb 100644 --- a/tests/ui/issues/issue-7178.rs +++ b/tests/ui/issues/issue-7178.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-7178.rs -//@ pretty-expanded FIXME #23616 extern crate issue_7178 as cross_crate_self; diff --git a/tests/ui/issues/issue-7268.rs b/tests/ui/issues/issue-7268.rs index 99b780bcf5c..a3bc1bc3446 100644 --- a/tests/ui/issues/issue-7268.rs +++ b/tests/ui/issues/issue-7268.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn foo<T: 'static>(_: T) {} diff --git a/tests/ui/issues/issue-7344.rs b/tests/ui/issues/issue-7344.rs index 9503037723e..406b24634f5 100644 --- a/tests/ui/issues/issue-7344.rs +++ b/tests/ui/issues/issue-7344.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_must_use)] -//@ pretty-expanded FIXME #23616 #![allow(unreachable_code)] diff --git a/tests/ui/issues/issue-7519-match-unit-in-arg.rs b/tests/ui/issues/issue-7519-match-unit-in-arg.rs index 2b5f1b7f169..a7cea577b22 100644 --- a/tests/ui/issues/issue-7519-match-unit-in-arg.rs +++ b/tests/ui/issues/issue-7519-match-unit-in-arg.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 /* #7519 ICE pattern matching unit in function argument diff --git a/tests/ui/issues/issue-7660.rs b/tests/ui/issues/issue-7660.rs index 4b0f7d84b75..104cdad8f7b 100644 --- a/tests/ui/issues/issue-7660.rs +++ b/tests/ui/issues/issue-7660.rs @@ -3,7 +3,6 @@ // Regression test for issue 7660 // rvalue lifetime too short when equivalent `match` works -//@ pretty-expanded FIXME #23616 use std::collections::HashMap; diff --git a/tests/ui/issues/issue-7673-cast-generically-implemented-trait.rs b/tests/ui/issues/issue-7673-cast-generically-implemented-trait.rs index 742152b6c81..edba3284e31 100644 --- a/tests/ui/issues/issue-7673-cast-generically-implemented-trait.rs +++ b/tests/ui/issues/issue-7673-cast-generically-implemented-trait.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 /* diff --git a/tests/ui/issues/issue-7899.rs b/tests/ui/issues/issue-7899.rs index a2aee240da7..4b69f3e3d89 100644 --- a/tests/ui/issues/issue-7899.rs +++ b/tests/ui/issues/issue-7899.rs @@ -2,7 +2,6 @@ #![allow(unused_variables)] //@ aux-build:issue-7899.rs -//@ pretty-expanded FIXME #23616 extern crate issue_7899 as testcrate; diff --git a/tests/ui/issues/issue-8044.rs b/tests/ui/issues/issue-8044.rs index b965e0bbb10..3c10bbca634 100644 --- a/tests/ui/issues/issue-8044.rs +++ b/tests/ui/issues/issue-8044.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-8044.rs -//@ pretty-expanded FIXME #23616 extern crate issue_8044 as minimal; use minimal::{BTree, leaf}; diff --git a/tests/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs b/tests/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs index 88d56185f6b..6a03404cdca 100644 --- a/tests/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs +++ b/tests/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 /* diff --git a/tests/ui/issues/issue-8248.rs b/tests/ui/issues/issue-8248.rs index c34575df368..95f626658cc 100644 --- a/tests/ui/issues/issue-8248.rs +++ b/tests/ui/issues/issue-8248.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 trait A { fn dummy(&self) { } //~ WARN method `dummy` is never used diff --git a/tests/ui/issues/issue-8248.stderr b/tests/ui/issues/issue-8248.stderr index a0098bcb771..8570bfaefad 100644 --- a/tests/ui/issues/issue-8248.stderr +++ b/tests/ui/issues/issue-8248.stderr @@ -1,5 +1,5 @@ warning: method `dummy` is never used - --> $DIR/issue-8248.rs:5:8 + --> $DIR/issue-8248.rs:4:8 | LL | trait A { | - method in this trait diff --git a/tests/ui/issues/issue-8249.rs b/tests/ui/issues/issue-8249.rs index 67a42619316..2364fc14d31 100644 --- a/tests/ui/issues/issue-8249.rs +++ b/tests/ui/issues/issue-8249.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait A { fn dummy(&self) { } diff --git a/tests/ui/issues/issue-8259.rs b/tests/ui/issues/issue-8259.rs index f790e1a2155..e843f7f9c50 100644 --- a/tests/ui/issues/issue-8259.rs +++ b/tests/ui/issues/issue-8259.rs @@ -4,7 +4,6 @@ //@ aux-build:issue-8259.rs -//@ pretty-expanded FIXME #23616 extern crate issue_8259 as other; static a: other::Foo<'static> = other::Foo::A; diff --git a/tests/ui/issues/issue-8398.rs b/tests/ui/issues/issue-8398.rs index 6f91b1dbb28..7d100b855fd 100644 --- a/tests/ui/issues/issue-8398.rs +++ b/tests/ui/issues/issue-8398.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub trait Writer { fn write(&mut self, b: &[u8]) -> Result<(), ()>; diff --git a/tests/ui/issues/issue-8401.rs b/tests/ui/issues/issue-8401.rs index b72616bb28f..1df63516fb0 100644 --- a/tests/ui/issues/issue-8401.rs +++ b/tests/ui/issues/issue-8401.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-8401.rs -//@ pretty-expanded FIXME #23616 extern crate issue_8401; diff --git a/tests/ui/issues/issue-8506.rs b/tests/ui/issues/issue-8506.rs index 48abd7efc7b..30a789a3e27 100644 --- a/tests/ui/issues/issue-8506.rs +++ b/tests/ui/issues/issue-8506.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(non_upper_case_globals)] #![allow(dead_code)] diff --git a/tests/ui/issues/issue-8578.rs b/tests/ui/issues/issue-8578.rs index e081d7a5415..9baa2f70a02 100644 --- a/tests/ui/issues/issue-8578.rs +++ b/tests/ui/issues/issue-8578.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] -//@ pretty-expanded FIXME #23616 pub struct UninterpretedOption_NamePart { name_part: Option<String>, diff --git a/tests/ui/issues/issue-8783.rs b/tests/ui/issues/issue-8783.rs index a7c96b69b18..d0ff79f8ac8 100644 --- a/tests/ui/issues/issue-8783.rs +++ b/tests/ui/issues/issue-8783.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 struct X { pub x: usize } impl Default for X { diff --git a/tests/ui/issues/issue-9110.rs b/tests/ui/issues/issue-9110.rs index 9aeda7d5b1b..47533dc43b5 100644 --- a/tests/ui/issues/issue-9110.rs +++ b/tests/ui/issues/issue-9110.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![allow(non_snake_case)] macro_rules! silly_macro { diff --git a/tests/ui/issues/issue-9123.rs b/tests/ui/issues/issue-9123.rs index e554a8c8ff2..bbf6c13341c 100644 --- a/tests/ui/issues/issue-9123.rs +++ b/tests/ui/issues/issue-9123.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-9123.rs -//@ pretty-expanded FIXME #23616 extern crate issue_9123; diff --git a/tests/ui/issues/issue-9155.rs b/tests/ui/issues/issue-9155.rs index e177c597800..dfd9dea2009 100644 --- a/tests/ui/issues/issue-9155.rs +++ b/tests/ui/issues/issue-9155.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-9155.rs -//@ pretty-expanded FIXME #23616 extern crate issue_9155; diff --git a/tests/ui/issues/issue-9249.rs b/tests/ui/issues/issue-9249.rs index 893d01637de..b98ba050521 100644 --- a/tests/ui/issues/issue-9249.rs +++ b/tests/ui/issues/issue-9249.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 static DATA:&'static [&'static str] = &["my string"]; fn main() { } diff --git a/tests/ui/issues/issue-9382.rs b/tests/ui/issues/issue-9382.rs index 4b37e5b381f..27f9ab57743 100644 --- a/tests/ui/issues/issue-9382.rs +++ b/tests/ui/issues/issue-9382.rs @@ -1,6 +1,3 @@ -//@ pretty-expanded FIXME #23616 - - //@ run-pass #![allow(dead_code)] diff --git a/tests/ui/issues/issue-9719.rs b/tests/ui/issues/issue-9719.rs index e48c020328a..904768c9341 100644 --- a/tests/ui/issues/issue-9719.rs +++ b/tests/ui/issues/issue-9719.rs @@ -1,6 +1,5 @@ //@ build-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 mod a { pub enum Enum<T> { diff --git a/tests/ui/issues/issue-9906.rs b/tests/ui/issues/issue-9906.rs index b425df4975f..50417d3e456 100644 --- a/tests/ui/issues/issue-9906.rs +++ b/tests/ui/issues/issue-9906.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-9906.rs -//@ pretty-expanded FIXME #23616 extern crate issue_9906 as testmod; diff --git a/tests/ui/issues/issue-9942.rs b/tests/ui/issues/issue-9942.rs index 76c90903306..6332d9b3e08 100644 --- a/tests/ui/issues/issue-9942.rs +++ b/tests/ui/issues/issue-9942.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { const S: usize = 23 as usize; [0; S]; () diff --git a/tests/ui/issues/issue-9951.rs b/tests/ui/issues/issue-9951.rs index 42a65c701f7..2cd7cd4f430 100644 --- a/tests/ui/issues/issue-9951.rs +++ b/tests/ui/issues/issue-9951.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/tests/ui/issues/issue-9951.stderr b/tests/ui/issues/issue-9951.stderr index 475f2817914..62ed9f3e0cc 100644 --- a/tests/ui/issues/issue-9951.stderr +++ b/tests/ui/issues/issue-9951.stderr @@ -1,5 +1,5 @@ warning: method `noop` is never used - --> $DIR/issue-9951.rs:7:6 + --> $DIR/issue-9951.rs:6:6 | LL | trait Bar { | --- method in this trait diff --git a/tests/ui/issues/issue-9968.rs b/tests/ui/issues/issue-9968.rs index 5ceea056634..89e60ba5ac7 100644 --- a/tests/ui/issues/issue-9968.rs +++ b/tests/ui/issues/issue-9968.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-9968.rs -//@ pretty-expanded FIXME #23616 extern crate issue_9968 as lib; diff --git a/tests/ui/item-name-overload.rs b/tests/ui/item-name-overload.rs index 54aa470e59e..dd2925aa53f 100644 --- a/tests/ui/item-name-overload.rs +++ b/tests/ui/item-name-overload.rs @@ -4,7 +4,6 @@ -//@ pretty-expanded FIXME #23616 mod foo { pub fn baz() { } diff --git a/tests/ui/iterators/into-iter-on-boxed-slices-2024.rs b/tests/ui/iterators/into-iter-on-boxed-slices-2024.rs index ffd6f022bc6..6e9b38be080 100644 --- a/tests/ui/iterators/into-iter-on-boxed-slices-2024.rs +++ b/tests/ui/iterators/into-iter-on-boxed-slices-2024.rs @@ -1,6 +1,5 @@ //@ check-pass //@ edition:2024 -//@ compile-flags: -Zunstable-options use std::ops::Deref; use std::rc::Rc; diff --git a/tests/ui/iterators/into-iterator-type-inference-shift.rs b/tests/ui/iterators/into-iterator-type-inference-shift.rs index b550dc27f5c..6b07a6bcb0a 100644 --- a/tests/ui/iterators/into-iterator-type-inference-shift.rs +++ b/tests/ui/iterators/into-iterator-type-inference-shift.rs @@ -8,7 +8,6 @@ // propagation yet, and so we just saw a type variable, yielding an // error. -//@ pretty-expanded FIXME #23616 trait IntoIterator { type Iter: Iterator; diff --git a/tests/ui/kinds-in-metadata.rs b/tests/ui/kinds-in-metadata.rs index d557f949c76..58dffba861d 100644 --- a/tests/ui/kinds-in-metadata.rs +++ b/tests/ui/kinds-in-metadata.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:kinds_in_metadata.rs -//@ pretty-expanded FIXME #23616 /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ diff --git a/tests/ui/layout/aggregate-lang/struct-align.rs b/tests/ui/layout/aggregate-lang/struct-align.rs new file mode 100644 index 00000000000..f3b88a6d85d --- /dev/null +++ b/tests/ui/layout/aggregate-lang/struct-align.rs @@ -0,0 +1,29 @@ +//@ run-pass +//@ reference: layout.aggregate.struct-size-align +//@ edition: 2018 + +#[repr(align(64))] +#[derive(Copy, Clone)] +#[allow(dead_code)] +pub struct Overaligned(u8); + +#[allow(dead_code)] +struct ReprRustStruct { + x: i32, + y: [u32; 4], + z: f32, + a: u128, + b: Overaligned, +} + +fn test_alignment_contains_all_fields() { + assert!(core::mem::align_of::<ReprRustStruct>() >= core::mem::align_of::<i32>()); + assert!(core::mem::align_of::<ReprRustStruct>() >= core::mem::align_of::<[u32; 4]>()); + assert!(core::mem::align_of::<ReprRustStruct>() >= core::mem::align_of::<f32>()); + assert!(core::mem::align_of::<ReprRustStruct>() >= core::mem::align_of::<u128>()); + assert!(core::mem::align_of::<ReprRustStruct>() >= core::mem::align_of::<Overaligned>()); +} + +fn main() { + test_alignment_contains_all_fields(); +} diff --git a/tests/ui/layout/aggregate-lang/struct-offsets.rs b/tests/ui/layout/aggregate-lang/struct-offsets.rs new file mode 100644 index 00000000000..ca199bdfeb1 --- /dev/null +++ b/tests/ui/layout/aggregate-lang/struct-offsets.rs @@ -0,0 +1,78 @@ +//@ run-pass +//@ reference: layout.aggregate.struct-offsets +//@ edition: 2018 + +#[repr(align(64))] +#[derive(Copy, Clone)] +#[allow(dead_code)] +pub struct Overaligned(u8); + +#[allow(dead_code)] +struct ReprRustStruct { + x: i32, + y: [u32; 4], + z: f32, + a: u128, + b: Overaligned, +} + +macro_rules! span_of { + ($ty:ty , $field:tt) => {{ + let __field = unsafe { ::core::mem::zeroed::<$ty>() }; + + ( + core::mem::offset_of!($ty, $field), + core::mem::offset_of!($ty, $field) + core::mem::size_of_val(&__field.$field), + ) + }}; +} + +fn test_fields_make_sense(a: &(usize, usize)) { + assert!(a.0 <= a.1); +} + +// order is `begin, end` +fn test_non_overlapping(a: &(usize, usize), b: &(usize, usize)) { + assert!((a.1 <= b.0) || (b.1 <= a.0)); +} + +fn test_fields_non_overlapping() { + let fields = [ + span_of!(ReprRustStruct, x), + span_of!(ReprRustStruct, y), + span_of!(ReprRustStruct, z), + span_of!(ReprRustStruct, a), + span_of!(ReprRustStruct, b), + ]; + + test_fields_make_sense(&fields[0]); + test_fields_make_sense(&fields[1]); + test_fields_make_sense(&fields[2]); + test_fields_make_sense(&fields[3]); + test_fields_make_sense(&fields[4]); + + test_non_overlapping(&fields[0], &fields[1]); + test_non_overlapping(&fields[0], &fields[2]); + test_non_overlapping(&fields[0], &fields[3]); + test_non_overlapping(&fields[0], &fields[4]); + test_non_overlapping(&fields[1], &fields[2]); + test_non_overlapping(&fields[2], &fields[3]); + test_non_overlapping(&fields[2], &fields[4]); + test_non_overlapping(&fields[3], &fields[4]); +} + +fn test_fields_aligned() { + assert_eq!((core::mem::offset_of!(ReprRustStruct, x) % (core::mem::align_of::<i32>())), 0); + assert_eq!((core::mem::offset_of!(ReprRustStruct, y) % (core::mem::align_of::<[u32; 4]>())), 0); + assert_eq!((core::mem::offset_of!(ReprRustStruct, z) % (core::mem::align_of::<f32>())), 0); + assert_eq!((core::mem::offset_of!(ReprRustStruct, a) % (core::mem::align_of::<u128>())), 0); + assert_eq!( + (core::mem::offset_of!(ReprRustStruct, b) % (core::mem::align_of::<Overaligned>())), + 0 + ); +} + +fn main() { + test_fields_non_overlapping(); + test_fields_aligned(); +} diff --git a/tests/ui/layout/aggregate-lang/struct-size.rs b/tests/ui/layout/aggregate-lang/struct-size.rs new file mode 100644 index 00000000000..f9fb605c324 --- /dev/null +++ b/tests/ui/layout/aggregate-lang/struct-size.rs @@ -0,0 +1,50 @@ +//@ run-pass +//@ reference: layout.aggregate.struct-size-align +//@ edition: 2018 + +#[allow(dead_code)] +struct ReprRustStruct { + x: i32, + y: [u32; 4], + z: f32, + a: u128, +} + +fn test_size_contains_all_types() { + assert!( + core::mem::size_of::<ReprRustStruct>() + >= (core::mem::size_of::<i32>() + + core::mem::size_of::<[u32; 4]>() + + core::mem::size_of::<f32>() + + core::mem::size_of::<u128>()) + ); +} + +fn test_size_contains_all_fields() { + assert!( + (core::mem::offset_of!(ReprRustStruct, x) + core::mem::size_of::<i32>()) + <= core::mem::size_of::<ReprRustStruct>() + ); + assert!( + (core::mem::offset_of!(ReprRustStruct, y) + core::mem::size_of::<[u32; 4]>()) + <= core::mem::size_of::<ReprRustStruct>() + ); + assert!( + (core::mem::offset_of!(ReprRustStruct, z) + core::mem::size_of::<f32>()) + <= core::mem::size_of::<ReprRustStruct>() + ); + assert!( + (core::mem::offset_of!(ReprRustStruct, a) + core::mem::size_of::<u128>()) + <= core::mem::size_of::<ReprRustStruct>() + ); +} + +fn test_size_modulo_align() { + assert_eq!(core::mem::size_of::<ReprRustStruct>() % core::mem::align_of::<ReprRustStruct>(), 0); +} + +fn main() { + test_size_contains_all_fields(); + test_size_contains_all_types(); + test_size_modulo_align(); +} diff --git a/tests/ui/layout/aggregate-lang/union-align.rs b/tests/ui/layout/aggregate-lang/union-align.rs new file mode 100644 index 00000000000..03825f1df21 --- /dev/null +++ b/tests/ui/layout/aggregate-lang/union-align.rs @@ -0,0 +1,29 @@ +//@ run-pass +//@ reference: layout.aggregate.struct-size-align +//@ edition: 2018 + +#[repr(align(64))] +#[derive(Copy, Clone)] +#[allow(dead_code)] +pub struct Overaligned(u8); + +#[allow(dead_code)] +union ReprRustUnion { + x: i32, + y: [u32; 4], + z: f32, + a: u128, + b: Overaligned, +} + +fn test_alignment_contains_all_fields() { + assert!(core::mem::align_of::<ReprRustUnion>() >= core::mem::align_of::<i32>()); + assert!(core::mem::align_of::<ReprRustUnion>() >= core::mem::align_of::<[u32; 4]>()); + assert!(core::mem::align_of::<ReprRustUnion>() >= core::mem::align_of::<f32>()); + assert!(core::mem::align_of::<ReprRustUnion>() >= core::mem::align_of::<u128>()); + assert!(core::mem::align_of::<ReprRustUnion>() >= core::mem::align_of::<Overaligned>()); +} + +fn main() { + test_alignment_contains_all_fields(); +} diff --git a/tests/ui/layout/aggregate-lang/union-offsets.rs b/tests/ui/layout/aggregate-lang/union-offsets.rs new file mode 100644 index 00000000000..29ab0a9ce54 --- /dev/null +++ b/tests/ui/layout/aggregate-lang/union-offsets.rs @@ -0,0 +1,32 @@ +//@ run-pass +//@ reference: layout.aggregate.struct-offsets +//@ edition: 2018 + +#[repr(align(64))] +#[derive(Copy, Clone)] +#[allow(dead_code)] +pub struct Overaligned(u8); + +#[allow(dead_code)] +union ReprRustUnion { + x: i32, + y: [u32; 4], + z: f32, + a: u128, + b: Overaligned, +} + +fn test_fields_aligned() { + assert_eq!((core::mem::offset_of!(ReprRustUnion, x) % (core::mem::align_of::<i32>())), 0); + assert_eq!((core::mem::offset_of!(ReprRustUnion, y) % (core::mem::align_of::<[u32; 4]>())), 0); + assert_eq!((core::mem::offset_of!(ReprRustUnion, z) % (core::mem::align_of::<f32>())), 0); + assert_eq!((core::mem::offset_of!(ReprRustUnion, a) % (core::mem::align_of::<u128>())), 0); + assert_eq!( + (core::mem::offset_of!(ReprRustUnion, b) % (core::mem::align_of::<Overaligned>())), + 0 + ); +} + +fn main() { + test_fields_aligned(); +} diff --git a/tests/ui/layout/aggregate-lang/union-size.rs b/tests/ui/layout/aggregate-lang/union-size.rs new file mode 100644 index 00000000000..6d1b51b172d --- /dev/null +++ b/tests/ui/layout/aggregate-lang/union-size.rs @@ -0,0 +1,47 @@ +//@ run-pass +//@ reference: layout.aggregate.struct-size-align +//@ edition: 2018 + +#[allow(dead_code)] +union ReprRustUnion { + x: i32, + y: [u32; 4], + z: f32, + a: u128, +} + +fn test_size_contains_each_type() { + assert!(core::mem::size_of::<i32>() <= core::mem::size_of::<ReprRustUnion>()); + assert!(core::mem::size_of::<[u32; 4]>() <= core::mem::size_of::<ReprRustUnion>()); + assert!(core::mem::size_of::<f32>() <= core::mem::size_of::<ReprRustUnion>()); + assert!(core::mem::size_of::<u128>() <= core::mem::size_of::<ReprRustUnion>()); +} + +fn test_size_contains_all_fields() { + assert!( + (core::mem::offset_of!(ReprRustUnion, x) + core::mem::size_of::<i32>()) + <= core::mem::size_of::<ReprRustUnion>() + ); + assert!( + (core::mem::offset_of!(ReprRustUnion, y) + core::mem::size_of::<[u32; 4]>()) + <= core::mem::size_of::<ReprRustUnion>() + ); + assert!( + (core::mem::offset_of!(ReprRustUnion, z) + core::mem::size_of::<f32>()) + <= core::mem::size_of::<ReprRustUnion>() + ); + assert!( + (core::mem::offset_of!(ReprRustUnion, a) + core::mem::size_of::<u128>()) + <= core::mem::size_of::<ReprRustUnion>() + ); +} + +fn test_size_modulo_align() { + assert_eq!(core::mem::size_of::<ReprRustUnion>() % core::mem::align_of::<ReprRustUnion>(), 0); +} + +fn main() { + test_size_contains_each_type(); + test_size_contains_all_fields(); + test_size_modulo_align(); +} diff --git a/tests/ui/layout/base-layout-is-sized-ice-123078.stderr b/tests/ui/layout/base-layout-is-sized-ice-123078.stderr index 455bd2cbf8b..ee7f5162552 100644 --- a/tests/ui/layout/base-layout-is-sized-ice-123078.stderr +++ b/tests/ui/layout/base-layout-is-sized-ice-123078.stderr @@ -25,6 +25,12 @@ LL | const C: S = unsafe { std::mem::transmute(()) }; = note: source type: `()` (0 bits) = note: target type: `S` (size can vary because of [u8]) +note: erroneous constant encountered + --> $DIR/base-layout-is-sized-ice-123078.rs:13:5 + | +LL | C; + | ^ + error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0512. diff --git a/tests/ui/layout/ice-type-error-in-tail-124031.rs b/tests/ui/layout/ice-type-error-in-tail-124031.rs index 0a2be117403..ecd6f3d56f3 100644 --- a/tests/ui/layout/ice-type-error-in-tail-124031.rs +++ b/tests/ui/layout/ice-type-error-in-tail-124031.rs @@ -1,3 +1,5 @@ +//@ normalize-stderr-test: "\d+ bits" -> "$$BITS bits" + // Regression test for issue #124031 // Checks that we don't ICE when the tail // of an ADT has a type error @@ -16,5 +18,6 @@ struct Other { fn main() { unsafe { std::mem::transmute::<Option<()>, Option<&Other>>(None); + //~^ ERROR cannot transmute between types of different sizes } } diff --git a/tests/ui/layout/ice-type-error-in-tail-124031.stderr b/tests/ui/layout/ice-type-error-in-tail-124031.stderr index 57dc83f92df..a066e8574dc 100644 --- a/tests/ui/layout/ice-type-error-in-tail-124031.stderr +++ b/tests/ui/layout/ice-type-error-in-tail-124031.stderr @@ -1,5 +1,5 @@ error[E0046]: not all trait items implemented, missing: `RefTarget` - --> $DIR/ice-type-error-in-tail-124031.rs:9:1 + --> $DIR/ice-type-error-in-tail-124031.rs:11:1 | LL | type RefTarget; | -------------- `RefTarget` from trait @@ -7,6 +7,16 @@ LL | type RefTarget; LL | impl Trait for () {} | ^^^^^^^^^^^^^^^^^ missing `RefTarget` in implementation -error: aborting due to 1 previous error +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/ice-type-error-in-tail-124031.rs:20:9 + | +LL | std::mem::transmute::<Option<()>, Option<&Other>>(None); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `Option<()>` ($BITS bits) + = note: target type: `Option<&Other>` ($BITS bits) + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0046`. +Some errors have detailed explanations: E0046, E0512. +For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/lazy-type-alias/bad-lazy-type-alias.rs b/tests/ui/lazy-type-alias/bad-lazy-type-alias.rs new file mode 100644 index 00000000000..6ded9118700 --- /dev/null +++ b/tests/ui/lazy-type-alias/bad-lazy-type-alias.rs @@ -0,0 +1,18 @@ +// regression test for #127351 + +#![feature(lazy_type_alias)] +//~^ WARN the feature `lazy_type_alias` is incomplete + +type ExplicitTypeOutlives<T> = T; + +pub struct Warns { + _significant_drop: ExplicitTypeOutlives, + //~^ ERROR missing generics for type alias `ExplicitTypeOutlives` + field: String, +} + +pub fn test(w: Warns) { + let _ = || drop(w.field); +} + +fn main() {} diff --git a/tests/ui/lazy-type-alias/bad-lazy-type-alias.stderr b/tests/ui/lazy-type-alias/bad-lazy-type-alias.stderr new file mode 100644 index 00000000000..3a5ded60241 --- /dev/null +++ b/tests/ui/lazy-type-alias/bad-lazy-type-alias.stderr @@ -0,0 +1,28 @@ +warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/bad-lazy-type-alias.rs:3:12 + | +LL | #![feature(lazy_type_alias)] + | ^^^^^^^^^^^^^^^ + | + = note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information + = note: `#[warn(incomplete_features)]` on by default + +error[E0107]: missing generics for type alias `ExplicitTypeOutlives` + --> $DIR/bad-lazy-type-alias.rs:9:24 + | +LL | _significant_drop: ExplicitTypeOutlives, + | ^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument + | +note: type alias defined here, with 1 generic parameter: `T` + --> $DIR/bad-lazy-type-alias.rs:6:6 + | +LL | type ExplicitTypeOutlives<T> = T; + | ^^^^^^^^^^^^^^^^^^^^ - +help: add missing generic argument + | +LL | _significant_drop: ExplicitTypeOutlives<T>, + | +++ + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/let-else/uninitialized-refutable-let-issue-123844.stderr b/tests/ui/let-else/uninitialized-refutable-let-issue-123844.stderr index 13312306c07..58f9e267db3 100644 --- a/tests/ui/let-else/uninitialized-refutable-let-issue-123844.stderr +++ b/tests/ui/let-else/uninitialized-refutable-let-issue-123844.stderr @@ -5,7 +5,7 @@ LL | let Some(x); | ^^^^^^^ pattern `None` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Option<i32>` error: aborting due to 1 previous error diff --git a/tests/ui/lifetimes/auxiliary/issue-91763-aux.rs b/tests/ui/lifetimes/auxiliary/issue-91763-aux.rs index 35ef6fc019d..4e4b7f61f1e 100644 --- a/tests/ui/lifetimes/auxiliary/issue-91763-aux.rs +++ b/tests/ui/lifetimes/auxiliary/issue-91763-aux.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - //#![feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)] extern crate proc_macro; diff --git a/tests/ui/lifetimes/issue-91763.rs b/tests/ui/lifetimes/issue-91763.rs index 5df69cff3be..6abb64db5fe 100644 --- a/tests/ui/lifetimes/issue-91763.rs +++ b/tests/ui/lifetimes/issue-91763.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-91763-aux.rs +//@ proc-macro: issue-91763-aux.rs #![deny(elided_lifetimes_in_paths)] diff --git a/tests/ui/lifetimes/raw/gen-lt.e2024.stderr b/tests/ui/lifetimes/raw/gen-lt.e2024.stderr index 232453df8ef..0f184853ece 100644 --- a/tests/ui/lifetimes/raw/gen-lt.e2024.stderr +++ b/tests/ui/lifetimes/raw/gen-lt.e2024.stderr @@ -1,5 +1,5 @@ error: lifetimes cannot use keyword names - --> $DIR/gen-lt.rs:11:11 + --> $DIR/gen-lt.rs:10:11 | LL | fn gen_lt<'gen>() {} | ^^^^ diff --git a/tests/ui/lifetimes/raw/gen-lt.rs b/tests/ui/lifetimes/raw/gen-lt.rs index 4f3ede5b4a2..3c33dc285f0 100644 --- a/tests/ui/lifetimes/raw/gen-lt.rs +++ b/tests/ui/lifetimes/raw/gen-lt.rs @@ -2,7 +2,6 @@ //@[e2021] edition:2021 //@[e2024] edition:2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2021] check-pass diff --git a/tests/ui/lifetimes/raw/immediately-followed-by-lt.stderr b/tests/ui/lifetimes/raw/immediately-followed-by-lt.e2021.stderr index 1caeec84b22..e600cc37fc4 100644 --- a/tests/ui/lifetimes/raw/immediately-followed-by-lt.stderr +++ b/tests/ui/lifetimes/raw/immediately-followed-by-lt.e2021.stderr @@ -1,5 +1,5 @@ error: character literal may only contain one codepoint - --> $DIR/immediately-followed-by-lt.rs:11:4 + --> $DIR/immediately-followed-by-lt.rs:15:4 | LL | w!('r#long'id); | ^^^^^^^^ diff --git a/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs b/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs index fe2b6de7bb3..eb161f9c855 100644 --- a/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs +++ b/tests/ui/lifetimes/raw/immediately-followed-by-lt.rs @@ -1,4 +1,8 @@ -//@ edition: 2021 +//@ revisions: e2015 e2021 + +//@[e2021] edition: 2021 +//@[e2015] edition: 2015 +//@[e2015] check-pass // Make sure we reject the case where a raw lifetime is immediately followed by another // lifetime. This reserves a modest amount of space for changing lexing to, for example, @@ -9,6 +13,6 @@ macro_rules! w { } w!('r#long'id); -//~^ ERROR character literal may only contain one codepoint +//[e2021]~^ ERROR character literal may only contain one codepoint fn main() {} diff --git a/tests/ui/lifetimes/refcell-in-tail-expr.edition2021.stderr b/tests/ui/lifetimes/refcell-in-tail-expr.edition2021.stderr index 157a1c5e09b..6d7000a1370 100644 --- a/tests/ui/lifetimes/refcell-in-tail-expr.edition2021.stderr +++ b/tests/ui/lifetimes/refcell-in-tail-expr.edition2021.stderr @@ -1,5 +1,5 @@ error[E0597]: `cell` does not live long enough - --> $DIR/refcell-in-tail-expr.rs:10:27 + --> $DIR/refcell-in-tail-expr.rs:9:27 | LL | let cell = std::cell::RefCell::new(0u8); | ---- binding `cell` declared here diff --git a/tests/ui/lifetimes/refcell-in-tail-expr.rs b/tests/ui/lifetimes/refcell-in-tail-expr.rs index 595e951f373..2cca7acbf5a 100644 --- a/tests/ui/lifetimes/refcell-in-tail-expr.rs +++ b/tests/ui/lifetimes/refcell-in-tail-expr.rs @@ -1,7 +1,6 @@ //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 //@ [edition2024] edition: 2024 -//@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] check-pass fn main() { diff --git a/tests/ui/lifetimes/shorter-tail-expr-lifetime.edition2021.stderr b/tests/ui/lifetimes/shorter-tail-expr-lifetime.edition2021.stderr index 3c074c5c3a2..ac23c67a8e1 100644 --- a/tests/ui/lifetimes/shorter-tail-expr-lifetime.edition2021.stderr +++ b/tests/ui/lifetimes/shorter-tail-expr-lifetime.edition2021.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/shorter-tail-expr-lifetime.rs:8:5 + --> $DIR/shorter-tail-expr-lifetime.rs:7:5 | LL | let c = std::cell::RefCell::new(".."); | - binding `c` declared here diff --git a/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs b/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs index 4195a8b6c32..25c530d4391 100644 --- a/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs +++ b/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs @@ -1,5 +1,4 @@ //@ revisions: edition2021 edition2024 -//@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] edition: 2024 //@ [edition2024] run-pass diff --git a/tests/ui/lifetimes/tail-expr-in-nested-expr.rs b/tests/ui/lifetimes/tail-expr-in-nested-expr.rs index 2ac97aff2b0..741cdacdb1d 100644 --- a/tests/ui/lifetimes/tail-expr-in-nested-expr.rs +++ b/tests/ui/lifetimes/tail-expr-in-nested-expr.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options fn main() { let _ = { String::new().as_str() }.len(); diff --git a/tests/ui/lifetimes/tail-expr-in-nested-expr.stderr b/tests/ui/lifetimes/tail-expr-in-nested-expr.stderr index 96e88eaca92..6770da091ce 100644 --- a/tests/ui/lifetimes/tail-expr-in-nested-expr.stderr +++ b/tests/ui/lifetimes/tail-expr-in-nested-expr.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/tail-expr-in-nested-expr.rs:5:15 + --> $DIR/tail-expr-in-nested-expr.rs:4:15 | LL | let _ = { String::new().as_str() }.len(); | ^^^^^^^^^^^^^--------- diff --git a/tests/ui/lifetimes/tail-expr-lock-poisoning.rs b/tests/ui/lifetimes/tail-expr-lock-poisoning.rs index ec74596a08d..6af6655149b 100644 --- a/tests/ui/lifetimes/tail-expr-lock-poisoning.rs +++ b/tests/ui/lifetimes/tail-expr-lock-poisoning.rs @@ -1,6 +1,5 @@ //@ revisions: edition2021 edition2024 //@ ignore-wasm no panic or subprocess support -//@ [edition2024] compile-flags: -Zunstable-options //@ [edition2024] edition: 2024 //@ run-pass //@ needs-unwind diff --git a/tests/ui/lifetimes/temporary-lifetime-extension.rs b/tests/ui/lifetimes/temporary-lifetime-extension.rs index d03027cf4a3..86c478af317 100644 --- a/tests/ui/lifetimes/temporary-lifetime-extension.rs +++ b/tests/ui/lifetimes/temporary-lifetime-extension.rs @@ -15,7 +15,6 @@ //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 //@ [edition2024] edition: 2024 -//@ [edition2024] compile-flags: -Z unstable-options fn temp() -> (String, i32) { (String::from("Hello"), 1) diff --git a/tests/ui/limits/issue-55878.stderr b/tests/ui/limits/issue-55878.stderr index 0a5f17be804..51c4837f458 100644 --- a/tests/ui/limits/issue-55878.stderr +++ b/tests/ui/limits/issue-55878.stderr @@ -11,23 +11,6 @@ note: inside `main` LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: erroneous constant encountered - --> $DIR/issue-55878.rs:7:26 - | -LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) - -note: erroneous constant encountered - --> $DIR/issue-55878.rs:7:26 - | -LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (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/linkage-attr/common-linkage-non-zero-init.rs b/tests/ui/linkage-attr/common-linkage-non-zero-init.rs index a1fdd5a014c..e5de08a7a28 100644 --- a/tests/ui/linkage-attr/common-linkage-non-zero-init.rs +++ b/tests/ui/linkage-attr/common-linkage-non-zero-init.rs @@ -2,6 +2,7 @@ //@ failure-status: 101 //@ known-bug: #109681 //@ ignore-wasm32 this appears to SIGABRT on wasm, not fail cleanly +//@ compile-flags: -Z verify-llvm-ir // This test verifies that we continue to hit the LLVM error for common linkage with non-zero // initializers, since it generates invalid LLVM IR. diff --git a/tests/ui/linkage-attr/issue-12133-1.rs b/tests/ui/linkage-attr/issue-12133-1.rs index dc3f7f33da1..f545db67e92 100644 --- a/tests/ui/linkage-attr/issue-12133-1.rs +++ b/tests/ui/linkage-attr/issue-12133-1.rs @@ -2,7 +2,6 @@ //@ aux-build:issue-12133-rlib.rs //@ aux-build:issue-12133-dylib.rs -//@ pretty-expanded FIXME #23616 extern crate issue_12133_rlib as a; extern crate issue_12133_dylib as b; diff --git a/tests/ui/linkage-attr/issue-12133-2.rs b/tests/ui/linkage-attr/issue-12133-2.rs index 55742a1b383..bc2dd84e0f7 100644 --- a/tests/ui/linkage-attr/issue-12133-2.rs +++ b/tests/ui/linkage-attr/issue-12133-2.rs @@ -3,7 +3,6 @@ //@ aux-build:issue-12133-dylib.rs //@ no-prefer-dynamic -//@ pretty-expanded FIXME #23616 extern crate issue_12133_rlib as a; extern crate issue_12133_dylib as b; diff --git a/tests/ui/linkage-attr/issue-12133-3.rs b/tests/ui/linkage-attr/issue-12133-3.rs index a34c075d64d..473d5774c16 100644 --- a/tests/ui/linkage-attr/issue-12133-3.rs +++ b/tests/ui/linkage-attr/issue-12133-3.rs @@ -6,7 +6,6 @@ //@ ignore-musl //@ needs-dynamic-linking -//@ pretty-expanded FIXME #23616 extern crate issue_12133_dylib2 as other; diff --git a/tests/ui/lint/auxiliary/add-impl.rs b/tests/ui/lint/auxiliary/add-impl.rs index 7ee4a4e4fde..d0f2baf94bf 100644 --- a/tests/ui/lint/auxiliary/add-impl.rs +++ b/tests/ui/lint/auxiliary/add-impl.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/lint/dead-code/leading-underscore.rs b/tests/ui/lint/dead-code/leading-underscore.rs index 0ef123efc24..0c5fecb27a8 100644 --- a/tests/ui/lint/dead-code/leading-underscore.rs +++ b/tests/ui/lint/dead-code/leading-underscore.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![deny(dead_code)] diff --git a/tests/ui/lint/group-forbid-always-trumps-cli.stderr b/tests/ui/lint/forbid-always-trumps-cli.allow-first-group.stderr index ed1242eacfc..07773ee4ddf 100644 --- a/tests/ui/lint/group-forbid-always-trumps-cli.stderr +++ b/tests/ui/lint/forbid-always-trumps-cli.allow-first-group.stderr @@ -1,5 +1,5 @@ error: unused variable: `x` - --> $DIR/group-forbid-always-trumps-cli.rs:4:9 + --> $DIR/forbid-always-trumps-cli.rs:15:9 | LL | let x = 1; | ^ help: if this is intentional, prefix it with an underscore: `_x` diff --git a/tests/ui/lint/forbid-always-trumps-cli.allow-first-lint.stderr b/tests/ui/lint/forbid-always-trumps-cli.allow-first-lint.stderr new file mode 100644 index 00000000000..cf357ef8ca8 --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.allow-first-lint.stderr @@ -0,0 +1,10 @@ +error: unused variable: `x` + --> $DIR/forbid-always-trumps-cli.rs:15:9 + | +LL | let x = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_x` + | + = note: requested on the command line with `-F unused-variables` + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/forbid-always-trumps-cli.allow-first-mix1.stderr b/tests/ui/lint/forbid-always-trumps-cli.allow-first-mix1.stderr new file mode 100644 index 00000000000..07773ee4ddf --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.allow-first-mix1.stderr @@ -0,0 +1,10 @@ +error: unused variable: `x` + --> $DIR/forbid-always-trumps-cli.rs:15:9 + | +LL | let x = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_x` + | + = note: `-F unused-variables` implied by `-F unused` + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/forbid-always-trumps-cli.allow-first-mix2.stderr b/tests/ui/lint/forbid-always-trumps-cli.allow-first-mix2.stderr new file mode 100644 index 00000000000..cf357ef8ca8 --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.allow-first-mix2.stderr @@ -0,0 +1,10 @@ +error: unused variable: `x` + --> $DIR/forbid-always-trumps-cli.rs:15:9 + | +LL | let x = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_x` + | + = note: requested on the command line with `-F unused-variables` + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/forbid-always-trumps-cli.forbid-first-group.stderr b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-group.stderr new file mode 100644 index 00000000000..07773ee4ddf --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-group.stderr @@ -0,0 +1,10 @@ +error: unused variable: `x` + --> $DIR/forbid-always-trumps-cli.rs:15:9 + | +LL | let x = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_x` + | + = note: `-F unused-variables` implied by `-F unused` + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/forbid-always-trumps-cli.forbid-first-lint.stderr b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-lint.stderr new file mode 100644 index 00000000000..cf357ef8ca8 --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-lint.stderr @@ -0,0 +1,10 @@ +error: unused variable: `x` + --> $DIR/forbid-always-trumps-cli.rs:15:9 + | +LL | let x = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_x` + | + = note: requested on the command line with `-F unused-variables` + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix1.stderr b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix1.stderr new file mode 100644 index 00000000000..07773ee4ddf --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix1.stderr @@ -0,0 +1,10 @@ +error: unused variable: `x` + --> $DIR/forbid-always-trumps-cli.rs:15:9 + | +LL | let x = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_x` + | + = note: `-F unused-variables` implied by `-F unused` + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix2.stderr b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix2.stderr new file mode 100644 index 00000000000..cf357ef8ca8 --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.forbid-first-mix2.stderr @@ -0,0 +1,10 @@ +error: unused variable: `x` + --> $DIR/forbid-always-trumps-cli.rs:15:9 + | +LL | let x = 1; + | ^ help: if this is intentional, prefix it with an underscore: `_x` + | + = note: requested on the command line with `-F unused-variables` + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/forbid-always-trumps-cli.rs b/tests/ui/lint/forbid-always-trumps-cli.rs new file mode 100644 index 00000000000..d94cc2e8efe --- /dev/null +++ b/tests/ui/lint/forbid-always-trumps-cli.rs @@ -0,0 +1,17 @@ +//! Ensure that "forbid" always trumps" allow" in CLI arguments, no matter the order +//! and no matter whether it is used with a lint group vs an individual lint. +// ignore-tidy-linelength +//@ revisions: forbid-first-group allow-first-group forbid-first-lint allow-first-lint forbid-first-mix1 allow-first-mix1 forbid-first-mix2 allow-first-mix2 +//@[forbid-first-group] compile-flags: -F unused -A unused +//@[allow-first-group] compile-flags: -A unused -F unused +//@[forbid-first-lint] compile-flags: -F unused_variables -A unused_variables +//@[allow-first-lint] compile-flags: -A unused_variables -F unused_variables +//@[forbid-first-mix1] compile-flags: -F unused -A unused_variables +//@[allow-first-mix1] compile-flags: -A unused_variables -F unused +//@[forbid-first-mix2] compile-flags: -F unused_variables -A unused +//@[allow-first-mix2] compile-flags: -A unused -F unused_variables + +fn main() { + let x = 1; + //~^ ERROR unused variable: `x` +} diff --git a/tests/ui/lint/forbid-group-group-2.stderr b/tests/ui/lint/forbid-group-group-2.stderr index 80e2f566eb8..b075a521cc9 100644 --- a/tests/ui/lint/forbid-group-group-2.stderr +++ b/tests/ui/lint/forbid-group-group-2.stderr @@ -43,3 +43,57 @@ LL | #[allow(nonstandard_style)] error: aborting due to 3 previous errors +Future incompatibility report: Future breakage diagnostic: +error: allow(nonstandard_style) incompatible with previous forbid + --> $DIR/forbid-group-group-2.rs:7:9 + | +LL | #![forbid(warnings)] + | -------- `forbid` level set here +... +LL | #[allow(nonstandard_style)] + | ^^^^^^^^^^^^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/forbid-group-group-2.rs:5:9 + | +LL | #![deny(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(nonstandard_style) incompatible with previous forbid + --> $DIR/forbid-group-group-2.rs:7:9 + | +LL | #![forbid(warnings)] + | -------- `forbid` level set here +... +LL | #[allow(nonstandard_style)] + | ^^^^^^^^^^^^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/forbid-group-group-2.rs:5:9 + | +LL | #![deny(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(nonstandard_style) incompatible with previous forbid + --> $DIR/forbid-group-group-2.rs:7:9 + | +LL | #![forbid(warnings)] + | -------- `forbid` level set here +... +LL | #[allow(nonstandard_style)] + | ^^^^^^^^^^^^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/forbid-group-group-2.rs:5:9 + | +LL | #![deny(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/lint/forbid-group-member.stderr b/tests/ui/lint/forbid-group-member.stderr index 8794591bd31..2e0147693f3 100644 --- a/tests/ui/lint/forbid-group-member.stderr +++ b/tests/ui/lint/forbid-group-member.stderr @@ -13,3 +13,17 @@ LL | #[allow(unused_variables)] warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: allow(unused_variables) incompatible with previous forbid + --> $DIR/forbid-group-member.rs:8:9 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | +LL | #[allow(unused_variables)] + | ^^^^^^^^^^^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> + = note: `#[warn(forbidden_lint_groups)]` on by default + diff --git a/tests/ui/lint/group-forbid-always-trumps-cli.rs b/tests/ui/lint/group-forbid-always-trumps-cli.rs deleted file mode 100644 index 4b63452bf5d..00000000000 --- a/tests/ui/lint/group-forbid-always-trumps-cli.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ compile-flags: -F unused -A unused - -fn main() { - let x = 1; - //~^ ERROR unused variable: `x` -} diff --git a/tests/ui/lint/issue-14837.rs b/tests/ui/lint/issue-14837.rs index 73c63cde2ba..829df15ae51 100644 --- a/tests/ui/lint/issue-14837.rs +++ b/tests/ui/lint/issue-14837.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 #[deny(dead_code)] pub enum Foo { diff --git a/tests/ui/lint/issue-1866.rs b/tests/ui/lint/issue-1866.rs index 386aeeb6ad0..4a571fbeb02 100644 --- a/tests/ui/lint/issue-1866.rs +++ b/tests/ui/lint/issue-1866.rs @@ -3,7 +3,6 @@ #![allow(non_camel_case_types)] #![warn(clashing_extern_declarations)] -//@ pretty-expanded FIXME #23616 mod a { pub type rust_task = usize; diff --git a/tests/ui/lint/issue-1866.stderr b/tests/ui/lint/issue-1866.stderr index d19a1349668..3ea9d209658 100644 --- a/tests/ui/lint/issue-1866.stderr +++ b/tests/ui/lint/issue-1866.stderr @@ -1,5 +1,5 @@ warning: `rust_task_is_unwinding` redeclared with a different signature - --> $DIR/issue-1866.rs:23:13 + --> $DIR/issue-1866.rs:22:13 | LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool; | ------------------------------------------------------------ `rust_task_is_unwinding` previously declared here diff --git a/tests/ui/lint/issue-20343.rs b/tests/ui/lint/issue-20343.rs index 24e8062b1f3..da353c985c9 100644 --- a/tests/ui/lint/issue-20343.rs +++ b/tests/ui/lint/issue-20343.rs @@ -2,7 +2,6 @@ #![allow(unused_variables)] // Regression test for Issue #20343. -//@ pretty-expanded FIXME #23616 #![deny(dead_code)] diff --git a/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr b/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr index 407eaf1c60a..77c8d1eab58 100644 --- a/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr +++ b/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr @@ -17,3 +17,399 @@ LL | #![forbid(forbidden_lint_groups)] error: aborting due to 1 previous error +Future incompatibility report: Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: warn(unused) incompatible with previous forbid + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:22:13 + | +LL | #![forbid(unused)] + | ------ `forbid` level set here +LL | #![deny(unused)] +LL | #![warn(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/lint/issue-79546-fuel-ice.rs b/tests/ui/lint/issue-79546-fuel-ice.rs deleted file mode 100644 index dbee924d26e..00000000000 --- a/tests/ui/lint/issue-79546-fuel-ice.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Regression test for the ICE described in #79546. - -//@ compile-flags: --cap-lints=allow -Zfuel=issue79546=0 -//@ check-pass -#![crate_name="issue79546"] - -struct S; -fn main() {} diff --git a/tests/ui/lint/lint-non-camel-case-with-trailing-underscores.rs b/tests/ui/lint/lint-non-camel-case-with-trailing-underscores.rs index 30091253f4d..178ee0e6663 100644 --- a/tests/ui/lint/lint-non-camel-case-with-trailing-underscores.rs +++ b/tests/ui/lint/lint-non-camel-case-with-trailing-underscores.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] // This is ok because we often use the trailing underscore to mean 'prime' -//@ pretty-expanded FIXME #23616 #[forbid(non_camel_case_types)] type Foo_ = isize; diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-no-lowercase-equivalent.rs b/tests/ui/lint/non-snake-case/lint-non-snake-case-no-lowercase-equivalent.rs index a43d2974ff3..7622f8b0454 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-no-lowercase-equivalent.rs +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-no-lowercase-equivalent.rs @@ -1,7 +1,6 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![deny(non_snake_case)] diff --git a/tests/ui/lint/outer-forbid.stderr b/tests/ui/lint/outer-forbid.stderr index a47877980a0..64a1077462a 100644 --- a/tests/ui/lint/outer-forbid.stderr +++ b/tests/ui/lint/outer-forbid.stderr @@ -39,3 +39,417 @@ LL | #[allow(nonstandard_style)] error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0453`. +Future incompatibility report: Future breakage diagnostic: +error: allow(unused_variables) incompatible with previous forbid + --> $DIR/outer-forbid.rs:20:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused_variables)] + | ^^^^^^^^^^^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: allow(unused) incompatible with previous forbid + --> $DIR/outer-forbid.rs:25:9 + | +LL | #![forbid(unused, non_snake_case)] + | ------ `forbid` level set here +... +LL | #[allow(unused)] + | ^^^^^^ overruled by previous forbid + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670> +note: the lint level is defined here + --> $DIR/outer-forbid.rs:18:11 + | +LL | #![forbid(forbidden_lint_groups)] + | ^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/lint/redundant-semicolon/auxiliary/redundant-semi-proc-macro-def.rs b/tests/ui/lint/redundant-semicolon/auxiliary/redundant-semi-proc-macro-def.rs index 2a58af0fedc..72303f12b7e 100644 --- a/tests/ui/lint/redundant-semicolon/auxiliary/redundant-semi-proc-macro-def.rs +++ b/tests/ui/lint/redundant-semicolon/auxiliary/redundant-semi-proc-macro-def.rs @@ -1,6 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type="proc-macro"] #![crate_name="redundant_semi_proc_macro"] extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.rs b/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.rs index 33c7e26ba47..3469614aab0 100644 --- a/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.rs +++ b/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.rs @@ -1,4 +1,4 @@ -//@ aux-build:redundant-semi-proc-macro-def.rs +//@ proc-macro: redundant-semi-proc-macro-def.rs #![deny(redundant_semicolons)] extern crate redundant_semi_proc_macro; diff --git a/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr b/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr index d42aa1d613f..1ec440b4e45 100644 --- a/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr +++ b/tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr @@ -1,4 +1,4 @@ -TokenStream [Ident { ident: "fn", span: #0 bytes(199..201) }, Ident { ident: "span_preservation", span: #0 bytes(202..219) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(219..221) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(229..232) }, Ident { ident: "tst", span: #0 bytes(233..236) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(237..238) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(239..242) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(242..243) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(243..244) }, Ident { ident: "match", span: #0 bytes(290..295) }, Ident { ident: "tst", span: #0 bytes(296..299) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(484..487) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(488..489) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(489..490) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(491..493) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(493..494) }, Ident { ident: "_", span: #0 bytes(503..504) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(505..506) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(506..507) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(508..510) }], span: #0 bytes(300..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(517..518) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(518..519) }], span: #0 bytes(223..563) }] +TokenStream [Ident { ident: "fn", span: #0 bytes(201..203) }, Ident { ident: "span_preservation", span: #0 bytes(204..221) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(221..223) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(231..234) }, Ident { ident: "tst", span: #0 bytes(235..238) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(239..240) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(241..244) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(244..245) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(245..246) }, Ident { ident: "match", span: #0 bytes(292..297) }, Ident { ident: "tst", span: #0 bytes(298..301) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(486..489) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(490..491) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(491..492) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(493..495) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(495..496) }, Ident { ident: "_", span: #0 bytes(505..506) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(507..508) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(508..509) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(510..512) }], span: #0 bytes(302..518) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(518..519) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(519..520) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(520..521) }], span: #0 bytes(225..565) }] error: unnecessary trailing semicolon --> $DIR/redundant-semi-proc-macro.rs:9:19 | diff --git a/tests/ui/lint/reference_casting.stderr b/tests/ui/lint/reference_casting.stderr index 26af60b6bc5..4205d406b51 100644 --- a/tests/ui/lint/reference_casting.stderr +++ b/tests/ui/lint/reference_casting.stderr @@ -103,7 +103,7 @@ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is --> $DIR/reference_casting.rs:45:16 | LL | let deferred = num as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here LL | let _num = &mut *deferred; | ^^^^^^^^^^^^^^ | @@ -113,7 +113,7 @@ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is --> $DIR/reference_casting.rs:48:16 | LL | let deferred = (std::ptr::from_ref(num) as *const i32 as *const i32).cast_mut() as *mut i32; - | ---------------------------------------------------------------------------- casting happend here + | ---------------------------------------------------------------------------- casting happened here LL | let _num = &mut *deferred; | ^^^^^^^^^^^^^^ | @@ -123,7 +123,7 @@ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is --> $DIR/reference_casting.rs:51:16 | LL | let deferred = (std::ptr::from_ref(num) as *const i32 as *const i32).cast_mut() as *mut i32; - | ---------------------------------------------------------------------------- casting happend here + | ---------------------------------------------------------------------------- casting happened here ... LL | let _num = &mut *deferred_rebind; | ^^^^^^^^^^^^^^^^^^^^^ @@ -150,7 +150,7 @@ error: casting `&T` to `&mut T` is undefined behavior, even if the reference is --> $DIR/reference_casting.rs:62:16 | LL | let num = NUM as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here ... LL | let _num = &mut *num; | ^^^^^^^^^ @@ -279,7 +279,7 @@ error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell` --> $DIR/reference_casting.rs:115:5 | LL | let value = num as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here LL | *value = 1; | ^^^^^^^^^^ | @@ -289,7 +289,7 @@ error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell` --> $DIR/reference_casting.rs:119:5 | LL | let value = value as *mut i32; - | ----------------- casting happend here + | ----------------- casting happened here LL | *value = 1; | ^^^^^^^^^^ | @@ -299,7 +299,7 @@ error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell` --> $DIR/reference_casting.rs:122:5 | LL | let value = num as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here LL | *value = 1; | ^^^^^^^^^^ | @@ -309,7 +309,7 @@ error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell` --> $DIR/reference_casting.rs:125:5 | LL | let value = num as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here ... LL | *value_rebind = 1; | ^^^^^^^^^^^^^^^^^ @@ -336,7 +336,7 @@ error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell` --> $DIR/reference_casting.rs:131:5 | LL | let value = num as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here ... LL | std::ptr::write(value, 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -347,7 +347,7 @@ error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell` --> $DIR/reference_casting.rs:133:5 | LL | let value = num as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here ... LL | std::ptr::write_unaligned(value, 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -358,7 +358,7 @@ error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell` --> $DIR/reference_casting.rs:135:5 | LL | let value = num as *const i32 as *mut i32; - | ----------------------------- casting happend here + | ----------------------------- casting happened here ... LL | std::ptr::write_volatile(value, 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -496,7 +496,7 @@ LL | let w: *mut [u16; 2] = &mut l as *mut [u8; 2] as *mut _; | -------------------------------- | | | | | backing allocation comes from here - | casting happend here + | casting happened here LL | let w: *mut [u16] = unsafe {&mut *w}; | ^^^^^^^ | diff --git a/tests/ui/lint/static-mut-refs.e2021.stderr b/tests/ui/lint/static-mut-refs.e2021.stderr index 09f560652e7..5a4e712b3c0 100644 --- a/tests/ui/lint/static-mut-refs.e2021.stderr +++ b/tests/ui/lint/static-mut-refs.e2021.stderr @@ -1,5 +1,5 @@ warning: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:39:18 + --> $DIR/static-mut-refs.rs:38:18 | LL | let _y = &X; | ^^ shared reference to mutable static @@ -13,7 +13,7 @@ LL | let _y = &raw const X; | ~~~~~~~~~~ warning: creating a mutable reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:43:18 + --> $DIR/static-mut-refs.rs:42:18 | LL | let _y = &mut X; | ^^^^^^ mutable reference to mutable static @@ -26,7 +26,7 @@ LL | let _y = &raw mut X; | ~~~~~~~~ warning: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:51:22 + --> $DIR/static-mut-refs.rs:50:22 | LL | let ref _a = X; | ^ shared reference to mutable static @@ -35,7 +35,7 @@ LL | let ref _a = X; = 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 is discouraged - --> $DIR/static-mut-refs.rs:55:25 + --> $DIR/static-mut-refs.rs:54:25 | LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static @@ -48,7 +48,7 @@ LL | let (_b, _c) = (&raw const X, &Y); | ~~~~~~~~~~ warning: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:55:29 + --> $DIR/static-mut-refs.rs:54:29 | LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static @@ -61,7 +61,7 @@ LL | let (_b, _c) = (&X, &raw const Y); | ~~~~~~~~~~ warning: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:61:13 + --> $DIR/static-mut-refs.rs:60:13 | LL | foo(&X); | ^^ shared reference to mutable static @@ -74,7 +74,7 @@ LL | foo(&raw const X); | ~~~~~~~~~~ warning: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:67:17 + --> $DIR/static-mut-refs.rs:66:17 | LL | let _ = Z.len(); | ^^^^^^^ shared reference to mutable static @@ -83,7 +83,7 @@ LL | let _ = Z.len(); = 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 is discouraged - --> $DIR/static-mut-refs.rs:73:33 + --> $DIR/static-mut-refs.rs:72:33 | LL | let _ = format!("{:?}", Z); | ^ shared reference to mutable static @@ -92,7 +92,7 @@ LL | let _ = format!("{:?}", Z); = 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 is discouraged - --> $DIR/static-mut-refs.rs:77:18 + --> $DIR/static-mut-refs.rs:76:18 | LL | let _v = &A.value; | ^^^^^^^^ shared reference to mutable static @@ -105,7 +105,7 @@ LL | let _v = &raw const A.value; | ~~~~~~~~~~ warning: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:81:18 + --> $DIR/static-mut-refs.rs:80:18 | LL | let _s = &A.s.value; | ^^^^^^^^^^ shared reference to mutable static @@ -118,7 +118,7 @@ LL | let _s = &raw const A.s.value; | ~~~~~~~~~~ warning: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:85:22 + --> $DIR/static-mut-refs.rs:84:22 | LL | let ref _v = A.value; | ^^^^^^^ shared reference to mutable static @@ -127,7 +127,7 @@ LL | let ref _v = A.value; = 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 is discouraged - --> $DIR/static-mut-refs.rs:15:14 + --> $DIR/static-mut-refs.rs:14:14 | LL | &mut ($x.0) | ^^^^^^ mutable reference to mutable static diff --git a/tests/ui/lint/static-mut-refs.e2024.stderr b/tests/ui/lint/static-mut-refs.e2024.stderr index 2d2a4f7afe0..1b549272bd5 100644 --- a/tests/ui/lint/static-mut-refs.e2024.stderr +++ b/tests/ui/lint/static-mut-refs.e2024.stderr @@ -1,5 +1,5 @@ error: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:39:18 + --> $DIR/static-mut-refs.rs:38:18 | LL | let _y = &X; | ^^ shared reference to mutable static @@ -13,7 +13,7 @@ LL | let _y = &raw const X; | ~~~~~~~~~~ error: creating a mutable reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:43:18 + --> $DIR/static-mut-refs.rs:42:18 | LL | let _y = &mut X; | ^^^^^^ mutable reference to mutable static @@ -26,7 +26,7 @@ LL | let _y = &raw mut X; | ~~~~~~~~ error: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:51:22 + --> $DIR/static-mut-refs.rs:50:22 | LL | let ref _a = X; | ^ shared reference to mutable static @@ -35,7 +35,7 @@ LL | let ref _a = X; = 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 is discouraged - --> $DIR/static-mut-refs.rs:55:25 + --> $DIR/static-mut-refs.rs:54:25 | LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static @@ -48,7 +48,7 @@ LL | let (_b, _c) = (&raw const X, &Y); | ~~~~~~~~~~ error: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:55:29 + --> $DIR/static-mut-refs.rs:54:29 | LL | let (_b, _c) = (&X, &Y); | ^^ shared reference to mutable static @@ -61,7 +61,7 @@ LL | let (_b, _c) = (&X, &raw const Y); | ~~~~~~~~~~ error: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:61:13 + --> $DIR/static-mut-refs.rs:60:13 | LL | foo(&X); | ^^ shared reference to mutable static @@ -74,7 +74,7 @@ LL | foo(&raw const X); | ~~~~~~~~~~ error: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:67:17 + --> $DIR/static-mut-refs.rs:66:17 | LL | let _ = Z.len(); | ^^^^^^^ shared reference to mutable static @@ -83,7 +83,7 @@ LL | let _ = Z.len(); = 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 is discouraged - --> $DIR/static-mut-refs.rs:73:33 + --> $DIR/static-mut-refs.rs:72:33 | LL | let _ = format!("{:?}", Z); | ^ shared reference to mutable static @@ -92,7 +92,7 @@ LL | let _ = format!("{:?}", Z); = 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 is discouraged - --> $DIR/static-mut-refs.rs:77:18 + --> $DIR/static-mut-refs.rs:76:18 | LL | let _v = &A.value; | ^^^^^^^^ shared reference to mutable static @@ -105,7 +105,7 @@ LL | let _v = &raw const A.value; | ~~~~~~~~~~ error: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:81:18 + --> $DIR/static-mut-refs.rs:80:18 | LL | let _s = &A.s.value; | ^^^^^^^^^^ shared reference to mutable static @@ -118,7 +118,7 @@ LL | let _s = &raw const A.s.value; | ~~~~~~~~~~ error: creating a shared reference to mutable static is discouraged - --> $DIR/static-mut-refs.rs:85:22 + --> $DIR/static-mut-refs.rs:84:22 | LL | let ref _v = A.value; | ^^^^^^^ shared reference to mutable static @@ -127,7 +127,7 @@ LL | let ref _v = A.value; = 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 is discouraged - --> $DIR/static-mut-refs.rs:15:14 + --> $DIR/static-mut-refs.rs:14:14 | LL | &mut ($x.0) | ^^^^^^ mutable reference to mutable static diff --git a/tests/ui/lint/static-mut-refs.rs b/tests/ui/lint/static-mut-refs.rs index 3d84d7dbf40..1040dfcae7a 100644 --- a/tests/ui/lint/static-mut-refs.rs +++ b/tests/ui/lint/static-mut-refs.rs @@ -6,7 +6,6 @@ //@ [e2021] run-pass //@ [e2024] edition:2024 -//@ [e2024] compile-flags: -Zunstable-options static mut FOO: (u32, u32) = (1, 2); diff --git a/tests/ui/lint/unsafe_code/auxiliary/forge_unsafe_block.rs b/tests/ui/lint/unsafe_code/auxiliary/forge_unsafe_block.rs index 6849e9170c1..b00f5838749 100644 --- a/tests/ui/lint/unsafe_code/auxiliary/forge_unsafe_block.rs +++ b/tests/ui/lint/unsafe_code/auxiliary/forge_unsafe_block.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{Delimiter, Group, Ident, Span, TokenStream, TokenTree}; diff --git a/tests/ui/lint/unsafe_code/forge_unsafe_block.rs b/tests/ui/lint/unsafe_code/forge_unsafe_block.rs index 6392849f915..93b2b60647d 100644 --- a/tests/ui/lint/unsafe_code/forge_unsafe_block.rs +++ b/tests/ui/lint/unsafe_code/forge_unsafe_block.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:forge_unsafe_block.rs +//@ proc-macro: forge_unsafe_block.rs #[macro_use] extern crate forge_unsafe_block; diff --git a/tests/ui/lint/unused-qualification-in-derive-expansion.rs b/tests/ui/lint/unused-qualification-in-derive-expansion.rs index 5cea9086d12..b2067e22c44 100644 --- a/tests/ui/lint/unused-qualification-in-derive-expansion.rs +++ b/tests/ui/lint/unused-qualification-in-derive-expansion.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:add-impl.rs +//@ proc-macro: add-impl.rs #![forbid(unused_qualifications)] diff --git a/tests/ui/lint/warn-ctypes-inhibit.rs b/tests/ui/lint/warn-ctypes-inhibit.rs index e3952dd0049..0f401150adf 100644 --- a/tests/ui/lint/warn-ctypes-inhibit.rs +++ b/tests/ui/lint/warn-ctypes-inhibit.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] //@ compile-flags:-D improper-ctypes -//@ pretty-expanded FIXME #23616 #![allow(improper_ctypes)] mod libc { diff --git a/tests/ui/list.rs b/tests/ui/list.rs index 7e5c2d8548b..443c4c9f28f 100644 --- a/tests/ui/list.rs +++ b/tests/ui/list.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum list { #[allow(dead_code)] cons(isize, Box<list>), nil, } diff --git a/tests/ui/liveness/liveness-assign-imm-local-after-ret.rs b/tests/ui/liveness/liveness-assign-imm-local-after-ret.rs index 298181e5529..ebdb5658537 100644 --- a/tests/ui/liveness/liveness-assign-imm-local-after-ret.rs +++ b/tests/ui/liveness/liveness-assign-imm-local-after-ret.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unreachable_code)] -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/loops/issue-1974.rs b/tests/ui/loops/issue-1974.rs index ea67b2541de..9416f09c6e3 100644 --- a/tests/ui/loops/issue-1974.rs +++ b/tests/ui/loops/issue-1974.rs @@ -1,7 +1,6 @@ //@ run-pass // Issue 1974 // Don't double free the condition allocation -//@ pretty-expanded FIXME #23616 pub fn main() { let s = "hej".to_string(); diff --git a/tests/ui/loops/loop-else-break-with-value.stderr b/tests/ui/loops/loop-else-break-with-value.stderr index ca18f0fdd7f..da3276c8cd3 100644 --- a/tests/ui/loops/loop-else-break-with-value.stderr +++ b/tests/ui/loops/loop-else-break-with-value.stderr @@ -21,7 +21,7 @@ LL | let Some(1) = loop { | ^^^^^^^ pattern `None` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Option<i32>` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/tests/ui/macros/auxiliary/hello_macro.rs b/tests/ui/macros/auxiliary/hello_macro.rs index 10f474bd1b3..79125a1f86e 100644 --- a/tests/ui/macros/auxiliary/hello_macro.rs +++ b/tests/ui/macros/auxiliary/hello_macro.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/macros/auxiliary/issue-100199.rs b/tests/ui/macros/auxiliary/issue-100199.rs index 9ee9a2f5039..f05c4f0722c 100644 --- a/tests/ui/macros/auxiliary/issue-100199.rs +++ b/tests/ui/macros/auxiliary/issue-100199.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/macros/auxiliary/proc_macro_def.rs b/tests/ui/macros/auxiliary/proc_macro_def.rs index 6574bf184fb..38a1f6fa3c1 100644 --- a/tests/ui/macros/auxiliary/proc_macro_def.rs +++ b/tests/ui/macros/auxiliary/proc_macro_def.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/macros/auxiliary/proc_macro_sequence.rs b/tests/ui/macros/auxiliary/proc_macro_sequence.rs index de2efdfecf1..0f543540171 100644 --- a/tests/ui/macros/auxiliary/proc_macro_sequence.rs +++ b/tests/ui/macros/auxiliary/proc_macro_sequence.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_span, proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/macros/defined-later-issue-121061-2.stderr b/tests/ui/macros/defined-later-issue-121061-2.stderr index aa6ef338531..2ec590d46ed 100644 --- a/tests/ui/macros/defined-later-issue-121061-2.stderr +++ b/tests/ui/macros/defined-later-issue-121061-2.stderr @@ -4,7 +4,7 @@ error: cannot find macro `something_later` in this scope LL | something_later!(); | ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call | -note: a macro with the same name exists, but it appears later at here +note: a macro with the same name exists, but it appears later --> $DIR/defined-later-issue-121061-2.rs:6:18 | LL | macro_rules! something_later { diff --git a/tests/ui/macros/defined-later-issue-121061.stderr b/tests/ui/macros/defined-later-issue-121061.stderr index 65cb53432a9..7b3496991af 100644 --- a/tests/ui/macros/defined-later-issue-121061.stderr +++ b/tests/ui/macros/defined-later-issue-121061.stderr @@ -4,7 +4,7 @@ error: cannot find macro `something_later` in this scope LL | something_later!(); | ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call | -note: a macro with the same name exists, but it appears later at here +note: a macro with the same name exists, but it appears later --> $DIR/defined-later-issue-121061.rs:5:14 | LL | macro_rules! something_later { diff --git a/tests/ui/macros/expr_2021_implicit_in_2024.rs b/tests/ui/macros/expr_2021_implicit_in_2024.rs index b3f7a31a802..f2eee1aa272 100644 --- a/tests/ui/macros/expr_2021_implicit_in_2024.rs +++ b/tests/ui/macros/expr_2021_implicit_in_2024.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2024 -Zunstable-options +//@ edition: 2024 //@ aux-build:expr_2021_implicit.rs //@ check-pass diff --git a/tests/ui/macros/expr_2021_inline_const.rs b/tests/ui/macros/expr_2021_inline_const.rs index 312256f1879..257f5b2f8cf 100644 --- a/tests/ui/macros/expr_2021_inline_const.rs +++ b/tests/ui/macros/expr_2021_inline_const.rs @@ -1,6 +1,6 @@ //@ revisions: edi2021 edi2024 -//@[edi2024]compile-flags: --edition=2024 -Z unstable-options -//@[edi2021]compile-flags: --edition=2021 +//@[edi2024] edition: 2024 +//@[edi2021] edition: 2021 // This test ensures that the inline const match only on edition 2024 macro_rules! m2021 { diff --git a/tests/ui/macros/expr_2024_underscore_expr.rs b/tests/ui/macros/expr_2024_underscore_expr.rs index 6f8ec139109..1d45d60c136 100644 --- a/tests/ui/macros/expr_2024_underscore_expr.rs +++ b/tests/ui/macros/expr_2024_underscore_expr.rs @@ -1,6 +1,6 @@ //@ revisions: edi2021 edi2024 -//@[edi2024]compile-flags: --edition=2024 -Z unstable-options -//@[edi2021]compile-flags: --edition=2021 +//@[edi2024] edition: 2024 +//@[edi2021] edition: 2021 // This test ensures that the `_` tok is considered an // expression on edition 2024. macro_rules! m2021 { diff --git a/tests/ui/macros/issue-100199.rs b/tests/ui/macros/issue-100199.rs index b1bcc535d74..78a6ff149e2 100644 --- a/tests/ui/macros/issue-100199.rs +++ b/tests/ui/macros/issue-100199.rs @@ -5,7 +5,7 @@ struct Foo {} // an unexpected dummy span (lo == 0 == hi) while attempting to print a // suggestion. -//@ aux-build: issue-100199.rs +//@ proc-macro: issue-100199.rs extern crate issue_100199; diff --git a/tests/ui/macros/issue-8851.rs b/tests/ui/macros/issue-8851.rs index 4a398d15997..0198f3f358e 100644 --- a/tests/ui/macros/issue-8851.rs +++ b/tests/ui/macros/issue-8851.rs @@ -5,7 +5,6 @@ // doesn't cause capture. Making this macro hygienic (as I've done) // could very well make this test case completely pointless.... -//@ pretty-expanded FIXME #23616 enum T { A(isize), diff --git a/tests/ui/macros/log_syntax-trace_macros-macro-locations.rs b/tests/ui/macros/log_syntax-trace_macros-macro-locations.rs index 85a65300eaf..adf5448ffc0 100644 --- a/tests/ui/macros/log_syntax-trace_macros-macro-locations.rs +++ b/tests/ui/macros/log_syntax-trace_macros-macro-locations.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![feature(trace_macros, log_syntax)] diff --git a/tests/ui/macros/macro-invocation-in-count-expr-fixed-array-type.rs b/tests/ui/macros/macro-invocation-in-count-expr-fixed-array-type.rs index 08fe2c92830..e80c712b03d 100644 --- a/tests/ui/macros/macro-invocation-in-count-expr-fixed-array-type.rs +++ b/tests/ui/macros/macro-invocation-in-count-expr-fixed-array-type.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 macro_rules! four { () => (4) diff --git a/tests/ui/macros/macro-missing-fragment.e2015.stderr b/tests/ui/macros/macro-missing-fragment.e2015.stderr index a068dc5c054..3d32f203d4a 100644 --- a/tests/ui/macros/macro-missing-fragment.e2015.stderr +++ b/tests/ui/macros/macro-missing-fragment.e2015.stderr @@ -1,11 +1,11 @@ error: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:9:20 + --> $DIR/macro-missing-fragment.rs:8:20 | LL | ( $( any_token $field_rust_type )* ) => {}; | ^^^^^^^^^^^^^^^^ warning: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:9:20 + --> $DIR/macro-missing-fragment.rs:8:20 | LL | ( $( any_token $field_rust_type )* ) => {}; | ^^^^^^^^^^^^^^^^ @@ -13,13 +13,13 @@ LL | ( $( any_token $field_rust_type )* ) => {}; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107> note: the lint level is defined here - --> $DIR/macro-missing-fragment.rs:6:9 + --> $DIR/macro-missing-fragment.rs:5:9 | LL | #![warn(missing_fragment_specifier)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:19:7 + --> $DIR/macro-missing-fragment.rs:18:7 | LL | ( $name ) => {}; | ^^^^^ @@ -28,7 +28,7 @@ LL | ( $name ) => {}; = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107> warning: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:26:7 + --> $DIR/macro-missing-fragment.rs:25:7 | LL | ( $name ) => {}; | ^^^^^ @@ -40,7 +40,7 @@ error: aborting due to 1 previous error; 3 warnings emitted Future incompatibility report: Future breakage diagnostic: warning: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:9:20 + --> $DIR/macro-missing-fragment.rs:8:20 | LL | ( $( any_token $field_rust_type )* ) => {}; | ^^^^^^^^^^^^^^^^ @@ -48,14 +48,14 @@ LL | ( $( any_token $field_rust_type )* ) => {}; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107> note: the lint level is defined here - --> $DIR/macro-missing-fragment.rs:6:9 + --> $DIR/macro-missing-fragment.rs:5:9 | LL | #![warn(missing_fragment_specifier)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Future breakage diagnostic: warning: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:19:7 + --> $DIR/macro-missing-fragment.rs:18:7 | LL | ( $name ) => {}; | ^^^^^ @@ -63,14 +63,14 @@ LL | ( $name ) => {}; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107> note: the lint level is defined here - --> $DIR/macro-missing-fragment.rs:6:9 + --> $DIR/macro-missing-fragment.rs:5:9 | LL | #![warn(missing_fragment_specifier)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Future breakage diagnostic: warning: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:26:7 + --> $DIR/macro-missing-fragment.rs:25:7 | LL | ( $name ) => {}; | ^^^^^ @@ -78,7 +78,7 @@ LL | ( $name ) => {}; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107> note: the lint level is defined here - --> $DIR/macro-missing-fragment.rs:6:9 + --> $DIR/macro-missing-fragment.rs:5:9 | LL | #![warn(missing_fragment_specifier)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/macros/macro-missing-fragment.e2024.stderr b/tests/ui/macros/macro-missing-fragment.e2024.stderr index 0dc48e0c7b2..a9195063a5b 100644 --- a/tests/ui/macros/macro-missing-fragment.e2024.stderr +++ b/tests/ui/macros/macro-missing-fragment.e2024.stderr @@ -1,5 +1,5 @@ error: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:9:20 + --> $DIR/macro-missing-fragment.rs:8:20 | LL | ( $( any_token $field_rust_type )* ) => {}; | ^^^^^^^^^^^^^^^^ @@ -12,7 +12,7 @@ LL | ( $( any_token $field_rust_type:spec )* ) => {}; | +++++ error: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:19:7 + --> $DIR/macro-missing-fragment.rs:18:7 | LL | ( $name ) => {}; | ^^^^^ @@ -25,7 +25,7 @@ LL | ( $name:spec ) => {}; | +++++ error: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:26:7 + --> $DIR/macro-missing-fragment.rs:25:7 | LL | ( $name ) => {}; | ^^^^^ @@ -38,7 +38,7 @@ LL | ( $name:spec ) => {}; | +++++ error: missing fragment specifier - --> $DIR/macro-missing-fragment.rs:9:20 + --> $DIR/macro-missing-fragment.rs:8:20 | LL | ( $( any_token $field_rust_type )* ) => {}; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/macros/macro-missing-fragment.rs b/tests/ui/macros/macro-missing-fragment.rs index b7da87ae610..42387e8dbbf 100644 --- a/tests/ui/macros/macro-missing-fragment.rs +++ b/tests/ui/macros/macro-missing-fragment.rs @@ -1,7 +1,6 @@ //@ revisions: e2015 e2024 //@[e2015] edition:2015 //@[e2024] edition:2024 -//@[e2024] compile-flags: -Zunstable-options #![warn(missing_fragment_specifier)] diff --git a/tests/ui/macros/macro-nt-list.rs b/tests/ui/macros/macro-nt-list.rs index 7a6bc6a8d73..b7b260c5398 100644 --- a/tests/ui/macros/macro-nt-list.rs +++ b/tests/ui/macros/macro-nt-list.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 macro_rules! list { ( ($($id:ident),*) ) => (()); diff --git a/tests/ui/macros/macro-quote-test.rs b/tests/ui/macros/macro-quote-test.rs index dd7b10f6322..a4b667b4af6 100644 --- a/tests/ui/macros/macro-quote-test.rs +++ b/tests/ui/macros/macro-quote-test.rs @@ -1,7 +1,7 @@ // Test that a macro can emit delimiters with nothing inside - `()`, `{}` //@ run-pass -//@ aux-build:hello_macro.rs +//@ proc-macro: hello_macro.rs extern crate hello_macro; diff --git a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs new file mode 100644 index 00000000000..a2e1398c61e --- /dev/null +++ b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs @@ -0,0 +1,9 @@ +#![crate_type = "lib"] + +macro_rules! sample { () => {} } + +#[sample] //~ ERROR cannot find attribute `sample` in this scope +#[derive(sample)] //~ ERROR cannot find derive macro `sample` in this scope + //~| ERROR cannot find derive macro `sample` in this scope + //~| ERROR cannot find derive macro `sample` in this scope +pub struct S {} diff --git a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr new file mode 100644 index 00000000000..e5b913b208d --- /dev/null +++ b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr @@ -0,0 +1,42 @@ +error: cannot find derive macro `sample` in this scope + --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10 + | +LL | macro_rules! sample { () => {} } + | ------ `sample` exists, but a declarative macro cannot be used as a derive macro +... +LL | #[derive(sample)] + | ^^^^^^ + +error: cannot find attribute `sample` in this scope + --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:5:3 + | +LL | macro_rules! sample { () => {} } + | ------ `sample` exists, but a declarative macro cannot be used as an attribute macro +LL | +LL | #[sample] + | ^^^^^^ + +error: cannot find derive macro `sample` in this scope + --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10 + | +LL | macro_rules! sample { () => {} } + | ------ `sample` exists, but a declarative macro cannot be used as a derive macro +... +LL | #[derive(sample)] + | ^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: cannot find derive macro `sample` in this scope + --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10 + | +LL | macro_rules! sample { () => {} } + | ------ `sample` exists, but a declarative macro cannot be used as a derive macro +... +LL | #[derive(sample)] + | ^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 4 previous errors + diff --git a/tests/ui/macros/macro_with_super_2.rs b/tests/ui/macros/macro_with_super_2.rs index 5353405ca57..5e7ec251549 100644 --- a/tests/ui/macros/macro_with_super_2.rs +++ b/tests/ui/macros/macro_with_super_2.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:macro_with_super_1.rs -//@ pretty-expanded FIXME #23616 #[macro_use] extern crate macro_with_super_1; diff --git a/tests/ui/macros/metavar_cross_edition_recursive_macros.rs b/tests/ui/macros/metavar_cross_edition_recursive_macros.rs index 9a5b92f5032..ae1bc00236f 100644 --- a/tests/ui/macros/metavar_cross_edition_recursive_macros.rs +++ b/tests/ui/macros/metavar_cross_edition_recursive_macros.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2024 -Z unstable-options +//@ edition: 2024 //@ aux-build: metavar_2018.rs //@ known-bug: #130484 //@ run-pass diff --git a/tests/ui/macros/parse-complex-macro-invoc-op.rs b/tests/ui/macros/parse-complex-macro-invoc-op.rs index bbb9b0270f2..27ead36f69d 100644 --- a/tests/ui/macros/parse-complex-macro-invoc-op.rs +++ b/tests/ui/macros/parse-complex-macro-invoc-op.rs @@ -8,7 +8,6 @@ // Test parsing binary operators after macro invocations. -//@ pretty-expanded FIXME #23616 #![feature(macro_rules)] diff --git a/tests/ui/macros/proc_macro.rs b/tests/ui/macros/proc_macro.rs index 8fea4ca282c..b73f3112536 100644 --- a/tests/ui/macros/proc_macro.rs +++ b/tests/ui/macros/proc_macro.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:proc_macro_def.rs +//@ proc-macro: proc_macro_def.rs extern crate proc_macro_def; diff --git a/tests/ui/macros/pub-item-inside-macro.rs b/tests/ui/macros/pub-item-inside-macro.rs index b05d8539d58..c37945a2d67 100644 --- a/tests/ui/macros/pub-item-inside-macro.rs +++ b/tests/ui/macros/pub-item-inside-macro.rs @@ -1,7 +1,6 @@ //@ run-pass // Issue #14660 -//@ pretty-expanded FIXME #23616 mod bleh { macro_rules! foo { diff --git a/tests/ui/macros/pub-method-inside-macro.rs b/tests/ui/macros/pub-method-inside-macro.rs index c4f9acc637d..dd4e6fda8be 100644 --- a/tests/ui/macros/pub-method-inside-macro.rs +++ b/tests/ui/macros/pub-method-inside-macro.rs @@ -1,7 +1,6 @@ //@ run-pass // Issue #17436 -//@ pretty-expanded FIXME #23616 mod bleh { macro_rules! foo { diff --git a/tests/ui/macros/same-sequence-span.rs b/tests/ui/macros/same-sequence-span.rs index 67f6b6ad1cd..dfaf669a769 100644 --- a/tests/ui/macros/same-sequence-span.rs +++ b/tests/ui/macros/same-sequence-span.rs @@ -1,4 +1,4 @@ -//@ aux-build:proc_macro_sequence.rs +//@ proc-macro: proc_macro_sequence.rs // Regression test for issue #62831: Check that multiple sequences with the same span in the // left-hand side of a macro definition behave as if they had unique spans, and in particular that diff --git a/tests/ui/macros/same-sequence-span.stderr b/tests/ui/macros/same-sequence-span.stderr index 3242a32e2f4..ff32ef94386 100644 --- a/tests/ui/macros/same-sequence-span.stderr +++ b/tests/ui/macros/same-sequence-span.stderr @@ -17,9 +17,9 @@ LL | $(= $z:tt)* error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments --> $DIR/same-sequence-span.rs:19:1 | -LL | | } +LL | | macro_rules! manual_foo { | |_________________________________^ not allowed after `expr` fragments -LL | +... LL | proc_macro_sequence::make_foo!(); | ^------------------------------- | | diff --git a/tests/ui/match/match-fn-call.stderr b/tests/ui/match/match-fn-call.stderr index 297aa4cd95d..a3d61947080 100644 --- a/tests/ui/match/match-fn-call.stderr +++ b/tests/ui/match/match-fn-call.stderr @@ -4,7 +4,7 @@ error[E0164]: expected tuple struct or tuple variant, found associated function LL | Path::new("foo") => println!("foo"), | ^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns | - = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html + = help: for more information, visit https://doc.rust-lang.org/book/ch19-00-patterns.html error[E0164]: expected tuple struct or tuple variant, found associated function `Path::new` --> $DIR/match-fn-call.rs:8:9 @@ -12,7 +12,7 @@ error[E0164]: expected tuple struct or tuple variant, found associated function LL | Path::new("bar") => println!("bar"), | ^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns | - = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html + = help: for more information, visit https://doc.rust-lang.org/book/ch19-00-patterns.html error: aborting due to 2 previous errors diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.rs b/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.rs index 7cbe8e0943a..bc12d69b105 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.rs +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options // gate-test-ref_pat_eat_one_layer_2024_structural pub fn main() { diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr index b3ea60252ac..132fe421a18 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:6:22 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:5:22 | LL | if let Some(Some(&x)) = &Some(&Some(0)) { | ^^ --------------- this expression has type `&Option<&Option<{integer}>>` @@ -14,7 +14,7 @@ LL | if let Some(Some(x)) = &Some(&Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:11:23 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:10:23 | LL | let _: &u32 = x; | ---- ^ expected `&u32`, found integer @@ -27,7 +27,7 @@ LL | let _: &u32 = &x; | + error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:14:23 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:13:23 | LL | if let Some(Some(&&x)) = &Some(Some(&0)) { | ^^ --------------- this expression has type `&Option<Option<&{integer}>>` @@ -43,7 +43,7 @@ LL + if let Some(Some(&x)) = &Some(Some(&0)) { | error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:18:17 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:17:17 | LL | if let Some(&Some(x)) = &Some(Some(0)) { | ^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>` @@ -54,7 +54,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) { found reference `&_` error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:22:22 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:21:22 | LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { | ^^^^^^ ----------------------- this expression has type `&mut Option<&mut Option<{integer}>>` @@ -64,7 +64,7 @@ LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { = note: expected type `{integer}` found mutable reference `&mut _` note: to declare a mutable binding use: `mut x` - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:22:22 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:21:22 | LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { | ^^^^^^ @@ -74,7 +74,7 @@ LL | if let Some(Some(x)) = &mut Some(&mut Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:26:22 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:25:22 | LL | if let Some(Some(&x)) = &Some(&Some(0)) { | ^^ --------------- this expression has type `&Option<&Option<{integer}>>` @@ -89,7 +89,7 @@ LL | if let Some(Some(x)) = &Some(&Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:30:27 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:29:27 | LL | if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { | ^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>` @@ -104,7 +104,7 @@ LL | if let Some(&mut Some(x)) = &Some(&mut Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:34:23 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:33:23 | LL | if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { | ^^^^^^ ------------------- this expression has type `&mut Option<&Option<{integer}>>` @@ -114,7 +114,7 @@ LL | if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { = note: expected type `{integer}` found mutable reference `&mut _` note: to declare a mutable binding use: `mut x` - --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:34:23 + --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:33:23 | LL | if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { | ^^^^^^ diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024.rs b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024.rs index c6a699d2ff8..b145446de0a 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024.rs +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024.rs @@ -1,6 +1,5 @@ //@ run-pass //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ revisions: classic structural both #![allow(incomplete_features)] #![cfg_attr(any(classic, both), feature(ref_pat_eat_one_layer_2024))] diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.both.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.both.stderr index 0215df98ea1..f8672d755b9 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.both.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.both.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:9:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:8:17 | LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) { | ^^^^^^^^^^^^^ --------------- this expression has type `&Option<&Option<{integer}>>` @@ -10,7 +10,7 @@ LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:12:23 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:11:23 | LL | if let Some(&Some(&mut _)) = &Some(&mut Some(0)) { | ^^^^^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>` @@ -21,7 +21,7 @@ LL | if let Some(&Some(&mut _)) = &Some(&mut Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:16:27 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:15:27 | LL | let _: &mut u32 = x; | -------- ^ types differ in mutability @@ -32,7 +32,7 @@ LL | let _: &mut u32 = x; found reference `&{integer}` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:19:23 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:18:23 | LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { | ^^^^^^ ------------------- this expression has type `&mut Option<&Option<{integer}>>` @@ -43,7 +43,7 @@ LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:22:29 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:21:29 | LL | if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { | ^^^^^^ ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>` @@ -54,7 +54,7 @@ LL | if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:25:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:24:17 | LL | if let Some(&mut Some(x)) = &Some(Some(0)) { | ^^^^^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>` @@ -65,7 +65,7 @@ LL | if let Some(&mut Some(x)) = &Some(Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:28:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:27:17 | LL | if let Some(&mut Some(x)) = &Some(Some(0)) { | ^^^^^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>` @@ -76,7 +76,7 @@ LL | if let Some(&mut Some(x)) = &Some(Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:32:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:31:9 | LL | let &mut _ = &&0; | ^^^^^^ --- this expression has type `&&{integer}` @@ -87,7 +87,7 @@ LL | let &mut _ = &&0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:35:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:34:9 | LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&0; | ^^^^^^ ----------------------------- this expression has type `&&&&&&&&&&&&&&&&&&&&&&&&&&&&{integer}` @@ -98,7 +98,7 @@ LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:46:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:45:9 | LL | let &mut _ = &&mut 0; | ^^^^^^ ------- this expression has type `&&mut {integer}` @@ -109,7 +109,7 @@ LL | let &mut _ = &&mut 0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:49:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:48:9 | LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0; | ^^^^^^ --------------------------------- this expression has type `&&&&&&&&&&&&&&&&&&&&&&&&&&&&mut {integer}` @@ -120,7 +120,7 @@ LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:52:14 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:51:14 | LL | let &mut &mut &mut &mut _ = &mut &&&&mut &&&mut &mut 0; | ^^^^^^^^^^^^^^^^ -------------------------- this expression has type `&mut &&&&mut &&&mut &mut {integer}` @@ -131,7 +131,7 @@ LL | let &mut &mut &mut &mut _ = &mut &&&&mut &&&mut &mut 0; found mutable reference `&mut _` error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:61:13 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:60:13 | LL | let Foo(mut a) = &Foo(0); | ^^^^ @@ -141,7 +141,7 @@ LL | let Foo(mut a) = &Foo(0); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:65:13 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:64:13 | LL | let Foo(mut a) = &mut Foo(0); | ^^^^ @@ -151,14 +151,14 @@ LL | let Foo(mut a) = &mut Foo(0); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0277]: the trait bound `&_: main::Ref` is not satisfied - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:83:14 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:82:14 | LL | let &_ = generic(); | ^^^^^^^^^ the trait `main::Ref` is not implemented for `&_` | = help: the trait `main::Ref` is implemented for `&'static mut [(); 0]` note: required by a bound in `generic` - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:69:19 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:68:19 | LL | fn generic<R: Ref>() -> R { | ^^^ required by this bound in `generic` diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr index 9428b32c4af..a37316b3097 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:9:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:8:17 | LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) { | ^^^^^ @@ -11,7 +11,7 @@ LL | if let Some(&Some(&_)) = &Some(&Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:12:23 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:11:23 | LL | if let Some(&Some(&mut _)) = &Some(&mut Some(0)) { | ^^^^^ @@ -23,7 +23,7 @@ LL | if let Some(&Some(&_)) = &Some(&mut Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:16:27 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:15:27 | LL | let _: &mut u32 = x; | -------- ^ types differ in mutability @@ -34,7 +34,7 @@ LL | let _: &mut u32 = x; found reference `&{integer}` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:19:23 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:18:23 | LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { | ^^^^^ @@ -46,7 +46,7 @@ LL | if let Some(&Some(&_)) = &mut Some(&Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:22:29 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:21:29 | LL | if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { | ^^^^^ @@ -58,7 +58,7 @@ LL | if let Some(&Some(Some((&_)))) = &Some(Some(&mut Some(0))) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:25:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:24:17 | LL | if let Some(&mut Some(x)) = &Some(Some(0)) { | ^^^^^ @@ -70,7 +70,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:28:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:27:17 | LL | if let Some(&mut Some(x)) = &Some(Some(0)) { | ^^^^^ @@ -82,7 +82,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:32:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:31:9 | LL | let &mut _ = &&0; | ^^^^^^ --- this expression has type `&&{integer}` @@ -93,7 +93,7 @@ LL | let &mut _ = &&0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:35:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:34:9 | LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&0; | ^^^^^^ ----------------------------- this expression has type `&&&&&&&&&&&&&&&&&&&&&&&&&&&&{integer}` @@ -104,7 +104,7 @@ LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:38:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:37:17 | LL | if let Some(&mut Some(&_)) = &Some(&mut Some(0)) { | ^^^^^ @@ -116,7 +116,7 @@ LL | if let Some(&Some(&_)) = &Some(&mut Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:42:22 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:41:22 | LL | if let Some(Some(&mut x)) = &Some(Some(&mut 0)) { | ^^^^^ @@ -128,7 +128,7 @@ LL | if let Some(Some(&x)) = &Some(Some(&mut 0)) { | ~ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:46:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:45:9 | LL | let &mut _ = &&mut 0; | ^^^^^^ ------- this expression has type `&&mut {integer}` @@ -139,7 +139,7 @@ LL | let &mut _ = &&mut 0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:49:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:48:9 | LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0; | ^^^^^^ --------------------------------- this expression has type `&&&&&&&&&&&&&&&&&&&&&&&&&&&&mut {integer}` @@ -150,7 +150,7 @@ LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:52:14 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:51:14 | LL | let &mut &mut &mut &mut _ = &mut &&&&mut &&&mut &mut 0; | ^^^^^^^^^^^^^^^^ -------------------------- this expression has type `&mut &&&&mut &&&mut &mut {integer}` @@ -161,7 +161,7 @@ LL | let &mut &mut &mut &mut _ = &mut &&&&mut &&&mut &mut 0; found mutable reference `&mut _` error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:61:13 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:60:13 | LL | let Foo(mut a) = &Foo(0); | ^^^^ @@ -171,7 +171,7 @@ LL | let Foo(mut a) = &Foo(0); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:65:13 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:64:13 | LL | let Foo(mut a) = &mut Foo(0); | ^^^^ @@ -181,14 +181,14 @@ LL | let Foo(mut a) = &mut Foo(0); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0277]: the trait bound `&_: main::Ref` is not satisfied - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:83:14 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:82:14 | LL | let &_ = generic(); | ^^^^^^^^^ the trait `main::Ref` is not implemented for `&_` | = help: the trait `main::Ref` is implemented for `&'static mut [(); 0]` note: required by a bound in `generic` - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:69:19 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:68:19 | LL | fn generic<R: Ref>() -> R { | ^^^ required by this bound in `generic` diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.rs b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.rs index d23e9c8083d..fd616807b28 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.rs +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ revisions: classic structural both #![allow(incomplete_features)] #![cfg_attr(any(classic, both), feature(ref_pat_eat_one_layer_2024))] diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.structural.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.structural.stderr index 56dad605030..2f62e9974fa 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.structural.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.structural.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:9:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:8:17 | LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) { | ^^^^^^^^^^^^^ --------------- this expression has type `&Option<&Option<{integer}>>` @@ -10,7 +10,7 @@ LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:12:23 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:11:23 | LL | if let Some(&Some(&mut _)) = &Some(&mut Some(0)) { | ^^^^^^ ------------------- this expression has type `&Option<&mut Option<{integer}>>` @@ -21,7 +21,7 @@ LL | if let Some(&Some(&mut _)) = &Some(&mut Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:16:27 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:15:27 | LL | let _: &mut u32 = x; | -------- ^ types differ in mutability @@ -32,7 +32,7 @@ LL | let _: &mut u32 = x; found reference `&{integer}` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:19:23 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:18:23 | LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { | ^^^^^^ ------------------- this expression has type `&mut Option<&Option<{integer}>>` @@ -43,7 +43,7 @@ LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:22:29 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:21:29 | LL | if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { | ^^^^^^ ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>` @@ -54,7 +54,7 @@ LL | if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:25:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:24:17 | LL | if let Some(&mut Some(x)) = &Some(Some(0)) { | ^^^^^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>` @@ -65,7 +65,7 @@ LL | if let Some(&mut Some(x)) = &Some(Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:28:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:27:17 | LL | if let Some(&mut Some(x)) = &Some(Some(0)) { | ^^^^^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>` @@ -76,7 +76,7 @@ LL | if let Some(&mut Some(x)) = &Some(Some(0)) { found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:32:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:31:9 | LL | let &mut _ = &&0; | ^^^^^^ --- this expression has type `&&{integer}` @@ -87,7 +87,7 @@ LL | let &mut _ = &&0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:35:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:34:9 | LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&0; | ^^^^^^ ----------------------------- this expression has type `&&&&&&&&&&&&&&&&&&&&&&&&&&&&{integer}` @@ -98,7 +98,7 @@ LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:46:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:45:9 | LL | let &mut _ = &&mut 0; | ^^^^^^ ------- this expression has type `&&mut {integer}` @@ -109,7 +109,7 @@ LL | let &mut _ = &&mut 0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:49:9 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:48:9 | LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0; | ^^^^^^ --------------------------------- this expression has type `&&&&&&&&&&&&&&&&&&&&&&&&&&&&mut {integer}` @@ -120,7 +120,7 @@ LL | let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:52:14 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:51:14 | LL | let &mut &mut &mut &mut _ = &mut &&&&mut &&&mut &mut 0; | ^^^^^^^^^^^^^^^^ -------------------------- this expression has type `&mut &&&&mut &&&mut &mut {integer}` @@ -131,7 +131,7 @@ LL | let &mut &mut &mut &mut _ = &mut &&&&mut &&&mut &mut 0; found mutable reference `&mut _` error[E0308]: mismatched types - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:55:17 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:54:17 | LL | if let Some(&mut _) = &mut Some(&0) { | ^^^^^^ ------------- this expression has type `&mut Option<&{integer}>` @@ -142,7 +142,7 @@ LL | if let Some(&mut _) = &mut Some(&0) { found mutable reference `&mut _` error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:61:13 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:60:13 | LL | let Foo(mut a) = &Foo(0); | ^^^^ @@ -152,7 +152,7 @@ LL | let Foo(mut a) = &Foo(0); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:65:13 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:64:13 | LL | let Foo(mut a) = &mut Foo(0); | ^^^^ @@ -162,14 +162,14 @@ LL | let Foo(mut a) = &mut Foo(0); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0277]: the trait bound `&_: main::Ref` is not satisfied - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:83:14 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:82:14 | LL | let &_ = generic(); | ^^^^^^^^^ the trait `main::Ref` is not implemented for `&_` | = help: the trait `main::Ref` is implemented for `&'static mut [(); 0]` note: required by a bound in `generic` - --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:69:19 + --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:68:19 | LL | fn generic<R: Ref>() -> R { | ^^^ required by this bound in `generic` diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.rs b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.rs index 3cdf47c1dbf..79403b19365 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.rs +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options #![allow(incomplete_features)] #![feature(ref_pat_eat_one_layer_2024)] diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr index 8b86fa65c4d..52f4c09e5c0 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail2.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of a shared reference - --> $DIR/ref_pat_eat_one_layer_2024_fail2.rs:7:29 + --> $DIR/ref_pat_eat_one_layer_2024_fail2.rs:6:29 | LL | if let Some(&Some(x)) = Some(&Some(&mut 0)) { | - ^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | if let Some(&Some(ref x)) = Some(&Some(&mut 0)) { | +++ error[E0596]: cannot borrow data in a `&` reference as mutable - --> $DIR/ref_pat_eat_one_layer_2024_fail2.rs:12:10 + --> $DIR/ref_pat_eat_one_layer_2024_fail2.rs:11:10 | LL | let &ref mut x = &0; | ^^^^^^^^^ cannot borrow as mutable diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.fixed b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.fixed index bc7a58a382d..e69d169966b 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.fixed +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.fixed @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ run-rustfix #![allow(incomplete_features)] #![feature(ref_pat_eat_one_layer_2024)] diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs index c6d72b0a9d7..a300cbcd4df 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ run-rustfix #![allow(incomplete_features)] #![feature(ref_pat_eat_one_layer_2024)] diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr index 964e9f36596..8e135b65253 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow as mutable inside an `&` pattern - --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:8:31 + --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:7:31 | LL | if let Some(&Some(ref mut x)) = &mut Some(Some(0)) { | - ^ @@ -7,7 +7,7 @@ LL | if let Some(&Some(ref mut x)) = &mut Some(Some(0)) { | help: replace this `&` with `&mut`: `&mut` error[E0596]: cannot borrow as mutable inside an `&` pattern - --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:13:31 + --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:12:31 | LL | if let &Some(Some(ref mut x)) = &mut Some(Some(0)) { | - ^ @@ -15,7 +15,7 @@ LL | if let &Some(Some(ref mut x)) = &mut Some(Some(0)) { | help: replace this `&` with `&mut`: `&mut` error[E0596]: cannot borrow as mutable inside an `&` pattern - --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:21:15 + --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:20:15 | LL | let &pat!(x) = &mut 0; | - ^ @@ -23,7 +23,7 @@ LL | let &pat!(x) = &mut 0; | help: replace this `&` with `&mut`: `&mut` error[E0596]: cannot borrow as mutable inside an `&` pattern - --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:25:19 + --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:24:19 | LL | let &(ref mut a, ref mut b) = &mut (true, false); | - ^ @@ -31,7 +31,7 @@ LL | let &(ref mut a, ref mut b) = &mut (true, false); | help: replace this `&` with `&mut`: `&mut` error[E0596]: cannot borrow as mutable inside an `&` pattern - --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:25:30 + --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:24:30 | LL | let &(ref mut a, ref mut b) = &mut (true, false); | - ^ diff --git a/tests/ui/methods/method-early-bound-lifetimes-on-self.rs b/tests/ui/methods/method-early-bound-lifetimes-on-self.rs index 8721dd85ac7..ec7abe1280d 100644 --- a/tests/ui/methods/method-early-bound-lifetimes-on-self.rs +++ b/tests/ui/methods/method-early-bound-lifetimes-on-self.rs @@ -2,7 +2,6 @@ // Check that we successfully handle methods where the `self` type has // an early-bound lifetime. Issue #18208. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/methods/method-normalize-bounds-issue-20604.rs b/tests/ui/methods/method-normalize-bounds-issue-20604.rs index b3979e75b61..ea18fe14d15 100644 --- a/tests/ui/methods/method-normalize-bounds-issue-20604.rs +++ b/tests/ui/methods/method-normalize-bounds-issue-20604.rs @@ -9,7 +9,6 @@ // winnowing stage of method resolution failed to handle an associated // type projection. -//@ pretty-expanded FIXME #23616 #![feature(associated_types)] diff --git a/tests/ui/methods/method-recursive-blanket-impl.rs b/tests/ui/methods/method-recursive-blanket-impl.rs index 09bbfffcd55..547e57885e0 100644 --- a/tests/ui/methods/method-recursive-blanket-impl.rs +++ b/tests/ui/methods/method-recursive-blanket-impl.rs @@ -6,7 +6,6 @@ // know not to stop at the blanket, we have to recursively evaluate // the `T:Foo` bound. -//@ pretty-expanded FIXME #23616 use std::marker::Sized; diff --git a/tests/ui/methods/method-recursive-blanket-impl.stderr b/tests/ui/methods/method-recursive-blanket-impl.stderr index 9797a8f6c83..e358f80d3ff 100644 --- a/tests/ui/methods/method-recursive-blanket-impl.stderr +++ b/tests/ui/methods/method-recursive-blanket-impl.stderr @@ -1,5 +1,5 @@ warning: trait `Foo` is never used - --> $DIR/method-recursive-blanket-impl.rs:14:7 + --> $DIR/method-recursive-blanket-impl.rs:13:7 | LL | trait Foo<A> { | ^^^ diff --git a/tests/ui/methods/method-two-traits-distinguished-via-where-clause.rs b/tests/ui/methods/method-two-traits-distinguished-via-where-clause.rs index 373439d2559..2ef2848c216 100644 --- a/tests/ui/methods/method-two-traits-distinguished-via-where-clause.rs +++ b/tests/ui/methods/method-two-traits-distinguished-via-where-clause.rs @@ -2,7 +2,6 @@ // Test that we select between traits A and B. To do that, we must // consider the `Sized` bound. -//@ pretty-expanded FIXME #23616 trait A { //~ WARN trait `A` is never used fn foo(self); diff --git a/tests/ui/methods/method-two-traits-distinguished-via-where-clause.stderr b/tests/ui/methods/method-two-traits-distinguished-via-where-clause.stderr index 0a60c6242bb..fa87ce5cc49 100644 --- a/tests/ui/methods/method-two-traits-distinguished-via-where-clause.stderr +++ b/tests/ui/methods/method-two-traits-distinguished-via-where-clause.stderr @@ -1,5 +1,5 @@ warning: trait `A` is never used - --> $DIR/method-two-traits-distinguished-via-where-clause.rs:7:7 + --> $DIR/method-two-traits-distinguished-via-where-clause.rs:6:7 | LL | trait A { | ^ diff --git a/tests/ui/mir-dataflow/def-inits-1.rs b/tests/ui/mir-dataflow/def-inits-1.rs deleted file mode 100644 index 30460824a16..00000000000 --- a/tests/ui/mir-dataflow/def-inits-1.rs +++ /dev/null @@ -1,51 +0,0 @@ -// General test of maybe_uninits state computed by MIR dataflow. - -#![feature(core_intrinsics, rustc_attrs)] - -use std::intrinsics::rustc_peek; -use std::mem::{drop, replace}; - -struct S(i32); - -#[rustc_mir(rustc_peek_definite_init,stop_after_dataflow)] -fn foo(test: bool, x: &mut S, y: S, mut z: S) -> S { - let ret; - // `ret` starts off uninitialized - rustc_peek(&ret); //~ ERROR rustc_peek: bit not set - - // All function formal parameters start off initialized. - - rustc_peek(&x); - rustc_peek(&y); - rustc_peek(&z); - - ret = if test { - ::std::mem::replace(x, y) - } else { - z = y; - z - }; - - // `z` may be uninitialized here. - rustc_peek(&z); //~ ERROR rustc_peek: bit not set - - // `y` is definitely uninitialized here. - rustc_peek(&y); //~ ERROR rustc_peek: bit not set - - // `x` is still (definitely) initialized (replace above is a reborrow). - rustc_peek(&x); - - ::std::mem::drop(x); - - // `x` is *definitely* uninitialized here - rustc_peek(&x); //~ ERROR rustc_peek: bit not set - - // `ret` is now definitely initialized (via `if` above). - rustc_peek(&ret); - - ret -} -fn main() { - foo(true, &mut S(13), S(14), S(15)); - foo(false, &mut S(13), S(14), S(15)); -} diff --git a/tests/ui/mir-dataflow/def-inits-1.stderr b/tests/ui/mir-dataflow/def-inits-1.stderr deleted file mode 100644 index e2bddb54d9b..00000000000 --- a/tests/ui/mir-dataflow/def-inits-1.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:14:5 - | -LL | rustc_peek(&ret); - | ^^^^^^^^^^^^^^^^ - -error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:30:5 - | -LL | rustc_peek(&z); - | ^^^^^^^^^^^^^^ - -error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:33:5 - | -LL | rustc_peek(&y); - | ^^^^^^^^^^^^^^ - -error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:41:5 - | -LL | rustc_peek(&x); - | ^^^^^^^^^^^^^^ - -error: stop_after_dataflow ended compilation - -error: aborting due to 5 previous errors - diff --git a/tests/ui/mir/issue-112269.stderr b/tests/ui/mir/issue-112269.stderr index adb662c98a7..80f329e2ce0 100644 --- a/tests/ui/mir/issue-112269.stderr +++ b/tests/ui/mir/issue-112269.stderr @@ -7,7 +7,7 @@ LL | let x: i32 = 3; | ^ patterns `i32::MIN..=3_i32` and `5_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: introduce a variable instead | @@ -23,7 +23,7 @@ LL | let y = 4; | ^ patterns `i32::MIN..=2_i32` and `4_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: introduce a variable instead | diff --git a/tests/ui/mir/mir_let_chains_drop_order.rs b/tests/ui/mir/mir_let_chains_drop_order.rs index 92199625207..8991c6db7b9 100644 --- a/tests/ui/mir/mir_let_chains_drop_order.rs +++ b/tests/ui/mir/mir_let_chains_drop_order.rs @@ -2,7 +2,6 @@ //@ needs-unwind //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 -//@ [edition2024] compile-flags: -Z unstable-options //@ [edition2024] edition: 2024 // See `mir_drop_order.rs` for more information diff --git a/tests/ui/mir/validate/needs-reveal-all.rs b/tests/ui/mir/validate/needs-reveal-all.rs index be2f5dd322f..7d793ebbba6 100644 --- a/tests/ui/mir/validate/needs-reveal-all.rs +++ b/tests/ui/mir/validate/needs-reveal-all.rs @@ -1,8 +1,8 @@ -// Regression test for #105009. the issue here was that even after the `RevealAll` pass, +// Regression test for #105009. the issue here was that even after the `PostAnalysisNormalize` pass, // `validate` still used `Reveal::UserFacing`. This meant that it now ends up comparing // opaque types with their revealed version, resulting in an ICE. // -// We're using these flags to run the `RevealAll` pass while making it less likely to +// We're using these flags to run the `PostAnalysisNormalize` pass while making it less likely to // accidentally removing the assignment from `Foo<fn_ptr>` to `Foo<fn_def>`. //@ compile-flags: -Zinline_mir=yes -Zmir-opt-level=0 -Zvalidate-mir diff --git a/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr b/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr index a845dfabe93..0a86f884e70 100644 --- a/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr +++ b/tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr @@ -14,7 +14,7 @@ LL | fn foo<T>(a: T, b: T) {} | ^^^ - ---- ---- this parameter needs to match the integer type of `a` | | | | | `b` needs to match the integer type of this parameter - | `a` and `b` all reference this parameter T + | `a` and `b` both reference this parameter `T` error[E0308]: arguments to this function are incorrect --> $DIR/generic-mismatch-reporting-issue-116615.rs:8:5 @@ -38,7 +38,7 @@ LL | fn foo_multi_same<T>(a: T, b: T, c: T, d: T, e: T, f: i32) {} | | | | this parameter needs to match the `&str` type of `a` and `b` | | | `c`, `d` and `e` need to match the `&str` type of this parameter | | `c`, `d` and `e` need to match the `&str` type of this parameter - | `a`, `b`, `c`, `d` and `e` all reference this parameter T + | `a`, `b`, `c`, `d` and `e` all reference this parameter `T` error[E0308]: arguments to this function are incorrect --> $DIR/generic-mismatch-reporting-issue-116615.rs:10:5 @@ -65,8 +65,8 @@ LL | fn foo_multi_generics<S, T>(a: T, b: T, c: T, d: T, e: T, f: S, g: S) {} | | | | | `d` and `e` need to match the `&str` type of this parameter | | | | `d` and `e` need to match the `&str` type of this parameter | | | `d` and `e` need to match the `&str` type of this parameter - | | `a`, `b`, `c`, `d` and `e` all reference this parameter T - | `f` and `g` all reference this parameter S + | | `a`, `b`, `c`, `d` and `e` all reference this parameter `T` + | `f` and `g` both reference this parameter `S` error[E0308]: arguments to this function are incorrect --> $DIR/generic-mismatch-reporting-issue-116615.rs:12:5 @@ -90,7 +90,7 @@ LL | fn foo_multi_same<T>(a: T, b: T, c: T, d: T, e: T, f: i32) {} | | | | this parameter needs to match the `&str` type of `a`, `d` and `e` | | | this parameter needs to match the `&str` type of `a`, `d` and `e` | | `b` and `c` need to match the `&str` type of this parameter - | `a`, `b`, `c`, `d` and `e` all reference this parameter T + | `a`, `b`, `c`, `d` and `e` all reference this parameter `T` error: aborting due to 4 previous errors diff --git a/tests/ui/modules/issue-13872.rs b/tests/ui/modules/issue-13872.rs index 5589d2d4f68..a29f378c844 100644 --- a/tests/ui/modules/issue-13872.rs +++ b/tests/ui/modules/issue-13872.rs @@ -3,7 +3,6 @@ //@ aux-build:issue-13872-2.rs //@ aux-build:issue-13872-3.rs -//@ pretty-expanded FIXME #23616 extern crate issue_13872_3 as other; diff --git a/tests/ui/modules/mod-view-items.rs b/tests/ui/modules/mod-view-items.rs index 462071b7b12..2d25c83f362 100644 --- a/tests/ui/modules/mod-view-items.rs +++ b/tests/ui/modules/mod-view-items.rs @@ -5,7 +5,6 @@ // pretty-print such view items. If that happens again, this should // begin failing. -//@ pretty-expanded FIXME #23616 mod m { pub fn f() -> Vec<isize> { Vec::new() } diff --git a/tests/ui/moves/move-nullary-fn.rs b/tests/ui/moves/move-nullary-fn.rs index 8c7bcf395e7..0480d2b1045 100644 --- a/tests/ui/moves/move-nullary-fn.rs +++ b/tests/ui/moves/move-nullary-fn.rs @@ -1,6 +1,5 @@ //@ run-pass // Issue #922 -//@ pretty-expanded FIXME #23616 fn f2<F>(_thing: F) where F: FnOnce() { } diff --git a/tests/ui/multiline-comment.rs b/tests/ui/multiline-comment.rs index bf86250c1f8..98174882032 100644 --- a/tests/ui/multiline-comment.rs +++ b/tests/ui/multiline-comment.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 /* * This is a multi-line oldcomment. diff --git a/tests/ui/mutual-recursion-group.rs b/tests/ui/mutual-recursion-group.rs index dc6d216f8d9..f83150af7dc 100644 --- a/tests/ui/mutual-recursion-group.rs +++ b/tests/ui/mutual-recursion-group.rs @@ -3,7 +3,6 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 enum colour { red, green, blue, } diff --git a/tests/ui/nested-block-comment.rs b/tests/ui/nested-block-comment.rs index 07414345c38..008df27e0e2 100644 --- a/tests/ui/nested-block-comment.rs +++ b/tests/ui/nested-block-comment.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 /* This test checks that nested comments are supported diff --git a/tests/ui/never_type/exhaustive_patterns.stderr b/tests/ui/never_type/exhaustive_patterns.stderr index 1314cbc52f8..1f22b9e6198 100644 --- a/tests/ui/never_type/exhaustive_patterns.stderr +++ b/tests/ui/never_type/exhaustive_patterns.stderr @@ -5,7 +5,7 @@ LL | let Either::A(()) = foo(); | ^^^^^^^^^^^^^ pattern `Either::B(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Either<(), !>` defined here --> $DIR/exhaustive_patterns.rs:9:6 | diff --git a/tests/ui/never_type/expr-empty-ret.rs b/tests/ui/never_type/expr-empty-ret.rs index 5d315934e00..e6af5bd3153 100644 --- a/tests/ui/never_type/expr-empty-ret.rs +++ b/tests/ui/never_type/expr-empty-ret.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] // Issue #521 -//@ pretty-expanded FIXME #23616 fn f() { let _x = match true { diff --git a/tests/ui/never_type/issue-52443.rs b/tests/ui/never_type/issue-52443.rs index dcda2b9536a..b112842030e 100644 --- a/tests/ui/never_type/issue-52443.rs +++ b/tests/ui/never_type/issue-52443.rs @@ -7,7 +7,6 @@ fn main() { //~^ WARN denote infinite loops with [(); { for _ in 0usize.. {}; 0}]; - //~^ ERROR `for` is not allowed in a `const` - //~| ERROR cannot convert - //~| ERROR cannot call + //~^ ERROR cannot use `for` + //~| ERROR cannot use `for` } diff --git a/tests/ui/never_type/issue-52443.stderr b/tests/ui/never_type/issue-52443.stderr index 2207ceb5033..1c5a0d65142 100644 --- a/tests/ui/never_type/issue-52443.stderr +++ b/tests/ui/never_type/issue-52443.stderr @@ -6,16 +6,6 @@ LL | [(); {while true {break}; 0}]; | = note: `#[warn(while_true)]` on by default -error[E0658]: `for` is not allowed in a `const` - --> $DIR/issue-52443.rs:9:12 - | -LL | [(); { for _ in 0usize.. {}; 0}]; - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information - = help: add `#![feature(const_for)]` 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[E0308]: mismatched types --> $DIR/issue-52443.rs:2:10 | @@ -41,25 +31,24 @@ help: give the `break` a value of the expected type LL | [(); loop { break 42 }]; | ++ -error[E0015]: cannot convert `RangeFrom<usize>` into an iterator in constants +error[E0015]: cannot use `for` loop on `RangeFrom<usize>` in constants --> $DIR/issue-52443.rs:9:21 | LL | [(); { for _ in 0usize.. {}; 0}]; | ^^^^^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants -error[E0015]: cannot call non-const fn `<RangeFrom<usize> as Iterator>::next` in constants +error[E0015]: cannot use `for` loop on `RangeFrom<usize>` in constants --> $DIR/issue-52443.rs:9:21 | LL | [(); { for _ in 0usize.. {}; 0}]; | ^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 5 previous errors; 1 warning emitted +error: aborting due to 4 previous errors; 1 warning emitted -Some errors have detailed explanations: E0015, E0308, E0658. +Some errors have detailed explanations: E0015, E0308. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed b/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed new file mode 100644 index 00000000000..f9f2b59a8c2 --- /dev/null +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed @@ -0,0 +1,17 @@ +//@ run-rustfix + +#![allow(unused)] +#![deny(dependency_on_unit_never_type_fallback)] + +fn foo<T: Default>() -> Result<T, ()> { + Err(()) +} + +fn test() -> Result<(), ()> { + //~^ ERROR this function depends on never type fallback being `()` + //~| WARN this was previously accepted by the compiler but is being phased out + _ = foo::<()>()?; + Ok(()) +} + +fn main() {} diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs b/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs new file mode 100644 index 00000000000..8a2f3d311ab --- /dev/null +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs @@ -0,0 +1,17 @@ +//@ run-rustfix + +#![allow(unused)] +#![deny(dependency_on_unit_never_type_fallback)] + +fn foo<T: Default>() -> Result<T, ()> { + Err(()) +} + +fn test() -> Result<(), ()> { + //~^ ERROR this function depends on never type fallback being `()` + //~| WARN this was previously accepted by the compiler but is being phased out + _ = foo()?; + Ok(()) +} + +fn main() {} diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr new file mode 100644 index 00000000000..dc4ffa0d6f4 --- /dev/null +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr @@ -0,0 +1,26 @@ +error: this function depends on never type fallback being `()` + --> $DIR/lint-breaking-2024-assign-underscore.rs:10:1 + | +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 issue #123748 <https://github.com/rust-lang/rust/issues/123748> + = help: specify the types explicitly +note: in edition 2024, the requirement `!: Default` will fail + --> $DIR/lint-breaking-2024-assign-underscore.rs:13:9 + | +LL | _ = foo()?; + | ^^^^^ +note: the lint level is defined here + --> $DIR/lint-breaking-2024-assign-underscore.rs:4:9 + | +LL | #![deny(dependency_on_unit_never_type_fallback)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use `()` annotations to avoid fallback changes + | +LL | _ = foo::<()>()?; + | ++++++ + +error: aborting due to 1 previous error + 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 03bb0ca5f3a..ec1483b0aae 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 @@ -1,5 +1,5 @@ warning: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:13:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:12:18 | LL | unsafe { mem::zeroed() } | ^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | unsafe { mem::zeroed::<()>() } | ++++++ warning: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:30:13 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:29:13 | LL | core::mem::transmute(Zst) | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -28,7 +28,7 @@ LL | core::mem::transmute::<_, ()>(Zst) | +++++++++ warning: never type fallback affects this union access - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:47:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:46:18 | LL | unsafe { Union { a: () }.b } | ^^^^^^^^^^^^^^^^^ @@ -38,7 +38,7 @@ LL | unsafe { Union { a: () }.b } = help: specify the type explicitly warning: never type fallback affects this raw pointer dereference - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:58:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:57:18 | LL | unsafe { *ptr::from_ref(&()).cast() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -52,7 +52,7 @@ LL | unsafe { *ptr::from_ref(&()).cast::<()>() } | ++++++ warning: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:79:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:78:18 | LL | unsafe { internally_create(x) } | ^^^^^^^^^^^^^^^^^^^^ @@ -66,7 +66,7 @@ LL | unsafe { internally_create::<()>(x) } | ++++++ warning: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:97:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:96:18 | LL | unsafe { zeroed() } | ^^^^^^^^ @@ -80,7 +80,7 @@ LL | let zeroed = mem::zeroed::<()>; | ++++++ warning: never type fallback affects this `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:92:22 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:91:22 | LL | let zeroed = mem::zeroed; | ^^^^^^^^^^^ @@ -94,7 +94,7 @@ LL | let zeroed = mem::zeroed::<()>; | ++++++ warning: never type fallback affects this `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:115:17 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:114:17 | LL | let f = internally_create; | ^^^^^^^^^^^^^^^^^ @@ -108,7 +108,7 @@ LL | let f = internally_create::<()>; | ++++++ warning: never type fallback affects this call to an `unsafe` method - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:140:13 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:139:13 | LL | S(marker::PhantomData).create_out_of_thin_air() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -118,7 +118,7 @@ LL | S(marker::PhantomData).create_out_of_thin_air() = help: specify the type explicitly warning: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:158:19 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:157:19 | LL | match send_message::<_ /* ?0 */>() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 cf12d699f2e..790facee09e 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 @@ -1,5 +1,5 @@ error: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:13:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:12:18 | LL | unsafe { mem::zeroed() } | ^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | unsafe { mem::zeroed::<()>() } | ++++++ error: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:30:13 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:29:13 | LL | core::mem::transmute(Zst) | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -28,7 +28,7 @@ LL | core::mem::transmute::<_, ()>(Zst) | +++++++++ error: never type fallback affects this union access - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:47:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:46:18 | LL | unsafe { Union { a: () }.b } | ^^^^^^^^^^^^^^^^^ @@ -38,7 +38,7 @@ LL | unsafe { Union { a: () }.b } = help: specify the type explicitly error: never type fallback affects this raw pointer dereference - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:58:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:57:18 | LL | unsafe { *ptr::from_ref(&()).cast() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -52,7 +52,7 @@ LL | unsafe { *ptr::from_ref(&()).cast::<()>() } | ++++++ error: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:79:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:78:18 | LL | unsafe { internally_create(x) } | ^^^^^^^^^^^^^^^^^^^^ @@ -66,7 +66,7 @@ LL | unsafe { internally_create::<()>(x) } | ++++++ error: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:97:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:96:18 | LL | unsafe { zeroed() } | ^^^^^^^^ @@ -80,7 +80,7 @@ LL | let zeroed = mem::zeroed::<()>; | ++++++ error: never type fallback affects this `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:92:22 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:91:22 | LL | let zeroed = mem::zeroed; | ^^^^^^^^^^^ @@ -94,7 +94,7 @@ LL | let zeroed = mem::zeroed::<()>; | ++++++ error: never type fallback affects this `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:115:17 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:114:17 | LL | let f = internally_create; | ^^^^^^^^^^^^^^^^^ @@ -108,7 +108,7 @@ LL | let f = internally_create::<()>; | ++++++ error: never type fallback affects this call to an `unsafe` method - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:140:13 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:139:13 | LL | S(marker::PhantomData).create_out_of_thin_air() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -118,7 +118,7 @@ LL | S(marker::PhantomData).create_out_of_thin_air() = help: specify the type explicitly error: never type fallback affects this call to an `unsafe` function - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:158:19 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:157:19 | LL | match send_message::<_ /* ?0 */>() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -136,7 +136,7 @@ LL | match send_message::<() /* ?0 */>() { | ~~ warning: the type `!` does not permit zero-initialization - --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:13:18 + --> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:12:18 | LL | unsafe { mem::zeroed() } | ^^^^^^^^^^^^^ this code causes undefined behavior when executed diff --git a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs index 19b51eea2f5..97e7a2f56bd 100644 --- a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs +++ b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs @@ -2,7 +2,6 @@ //@[e2015] check-pass //@[e2024] check-fail //@[e2024] edition:2024 -//@[e2024] compile-flags: -Zunstable-options use std::{marker, mem, ptr}; diff --git a/tests/ui/nll/issue-54556-niconii.edition2021.stderr b/tests/ui/nll/issue-54556-niconii.edition2021.stderr index abee09ed950..8bd559034b0 100644 --- a/tests/ui/nll/issue-54556-niconii.edition2021.stderr +++ b/tests/ui/nll/issue-54556-niconii.edition2021.stderr @@ -1,5 +1,5 @@ error[E0597]: `counter` does not live long enough - --> $DIR/issue-54556-niconii.rs:28:20 + --> $DIR/issue-54556-niconii.rs:27:20 | LL | let counter = Mutex; | ------- binding `counter` declared here diff --git a/tests/ui/nll/issue-54556-niconii.rs b/tests/ui/nll/issue-54556-niconii.rs index f01e0523cbf..9d37adede6a 100644 --- a/tests/ui/nll/issue-54556-niconii.rs +++ b/tests/ui/nll/issue-54556-niconii.rs @@ -9,7 +9,6 @@ //@ revisions: edition2021 edition2024 //@ [edition2021] edition: 2021 //@ [edition2024] edition: 2024 -//@ [edition2024] compile-flags: -Z unstable-options //@ [edition2024] check-pass struct Mutex; diff --git a/tests/ui/nll/user-annotations/region-error-ice-109072.rs b/tests/ui/nll/user-annotations/region-error-ice-109072.rs index bcdc6651cf5..3f2ad3ccbf5 100644 --- a/tests/ui/nll/user-annotations/region-error-ice-109072.rs +++ b/tests/ui/nll/user-annotations/region-error-ice-109072.rs @@ -11,5 +11,4 @@ impl Lt<'missing> for () { //~ ERROR undeclared lifetime fn main() { let _: <() as Lt<'_>>::T = &(); - //~^ ERROR the trait bound `(): Lt<'_>` is not satisfied } diff --git a/tests/ui/nll/user-annotations/region-error-ice-109072.stderr b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr index c187c17d98c..d90971bed25 100644 --- a/tests/ui/nll/user-annotations/region-error-ice-109072.stderr +++ b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr @@ -21,13 +21,6 @@ help: consider introducing lifetime `'missing` here LL | impl<'missing> Lt<'missing> for () { | ++++++++++ -error[E0277]: the trait bound `(): Lt<'_>` is not satisfied - --> $DIR/region-error-ice-109072.rs:13:13 - | -LL | let _: <() as Lt<'_>>::T = &(); - | ^^ the trait `Lt<'_>` is not implemented for `()` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0261, E0277. -For more information about an error, try `rustc --explain E0261`. +For more information about this error, try `rustc --explain E0261`. diff --git a/tests/ui/numbers-arithmetic/int.rs b/tests/ui/numbers-arithmetic/int.rs index edc7f729444..42f8e50d6ef 100644 --- a/tests/ui/numbers-arithmetic/int.rs +++ b/tests/ui/numbers-arithmetic/int.rs @@ -2,6 +2,5 @@ -//@ pretty-expanded FIXME #23616 pub fn main() { let _x: isize = 10; } diff --git a/tests/ui/numbers-arithmetic/integer-literal-suffix-inference-2.rs b/tests/ui/numbers-arithmetic/integer-literal-suffix-inference-2.rs index 406ed470458..2cbbdfc6479 100644 --- a/tests/ui/numbers-arithmetic/integer-literal-suffix-inference-2.rs +++ b/tests/ui/numbers-arithmetic/integer-literal-suffix-inference-2.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn foo(_: *const ()) {} diff --git a/tests/ui/numbers-arithmetic/integer-literal-suffix-inference.rs b/tests/ui/numbers-arithmetic/integer-literal-suffix-inference.rs index 97c10bc3c56..ed59bba1196 100644 --- a/tests/ui/numbers-arithmetic/integer-literal-suffix-inference.rs +++ b/tests/ui/numbers-arithmetic/integer-literal-suffix-inference.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { fn id_i8(n: i8) -> i8 { n } diff --git a/tests/ui/numbers-arithmetic/uint.rs b/tests/ui/numbers-arithmetic/uint.rs index c64361c2726..c2087b5a06c 100644 --- a/tests/ui/numbers-arithmetic/uint.rs +++ b/tests/ui/numbers-arithmetic/uint.rs @@ -2,6 +2,5 @@ -//@ pretty-expanded FIXME #23616 pub fn main() { let _x: usize = 10 as usize; } diff --git a/tests/ui/object-lifetime/object-lifetime-default-default-to-static.rs b/tests/ui/object-lifetime/object-lifetime-default-default-to-static.rs index edbd9f35d4d..23e58523356 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-default-to-static.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-default-to-static.rs @@ -2,7 +2,6 @@ // Test that `Box<Test>` is equivalent to `Box<Test+'static>`, both in // fields and fn arguments. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/object-lifetime/object-lifetime-default-from-ref-struct.rs b/tests/ui/object-lifetime/object-lifetime-default-from-ref-struct.rs index 986fc836799..040ac1f8913 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-from-ref-struct.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-from-ref-struct.rs @@ -2,7 +2,6 @@ // Test that the lifetime of the enclosing `&` is used for the object // lifetime bound. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/object-lifetime/object-lifetime-default-from-rptr-box.rs b/tests/ui/object-lifetime/object-lifetime-default-from-rptr-box.rs index 3c88f2b9f37..c3f3101155c 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-from-rptr-box.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-from-rptr-box.rs @@ -2,7 +2,6 @@ // Test that the lifetime from the enclosing `&` is "inherited" // through the `Box` struct. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/object-lifetime/object-lifetime-default-from-rptr-mut.rs b/tests/ui/object-lifetime/object-lifetime-default-from-rptr-mut.rs index 412695f7086..db4f9a40235 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-from-rptr-mut.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-from-rptr-mut.rs @@ -2,7 +2,6 @@ // Test that the lifetime of the enclosing `&` is used for the object // lifetime bound. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/object-lifetime/object-lifetime-default-from-rptr-struct.rs b/tests/ui/object-lifetime/object-lifetime-default-from-rptr-struct.rs index 591f843a284..5163ff1c245 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-from-rptr-struct.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-from-rptr-struct.rs @@ -2,7 +2,6 @@ // Test that the lifetime from the enclosing `&` is "inherited" // through the `MyBox` struct. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/object-lifetime/object-lifetime-default-from-rptr.rs b/tests/ui/object-lifetime/object-lifetime-default-from-rptr.rs index bc47b8d46a1..556bde78415 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-from-rptr.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-from-rptr.rs @@ -2,7 +2,6 @@ // Test that the lifetime of the enclosing `&` is used for the object // lifetime bound. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/object-lifetime/object-lifetime-default-inferred.rs b/tests/ui/object-lifetime/object-lifetime-default-inferred.rs index 53b9c488645..5abe09e2729 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-inferred.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-inferred.rs @@ -2,7 +2,6 @@ // Test that even with prior inferred parameters, object lifetimes of objects after are still // valid. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] #![feature(generic_arg_infer)] diff --git a/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr b/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr index fdb1a9bb4b7..7044b8e035a 100644 --- a/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr +++ b/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr @@ -5,7 +5,7 @@ LL | let (0 | (1 | 2)) = 0; | ^^^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | diff --git a/tests/ui/output-slot-variants.rs b/tests/ui/output-slot-variants.rs index c545b2504cb..97757e74fc4 100644 --- a/tests/ui/output-slot-variants.rs +++ b/tests/ui/output-slot-variants.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] #![allow(unused_assignments)] #![allow(unknown_lints)] -//@ pretty-expanded FIXME #23616 #![allow(dead_assignment)] #![allow(unused_variables)] diff --git a/tests/ui/overloaded/fixup-deref-mut.rs b/tests/ui/overloaded/fixup-deref-mut.rs index 2879554bb94..f8d3e678f0c 100644 --- a/tests/ui/overloaded/fixup-deref-mut.rs +++ b/tests/ui/overloaded/fixup-deref-mut.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 use std::ops::{Deref, DerefMut}; diff --git a/tests/ui/overloaded/issue-14958.rs b/tests/ui/overloaded/issue-14958.rs index 3df4732d9ad..a4e5c8e3562 100644 --- a/tests/ui/overloaded/issue-14958.rs +++ b/tests/ui/overloaded/issue-14958.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![feature(fn_traits, unboxed_closures)] diff --git a/tests/ui/overloaded/issue-14958.stderr b/tests/ui/overloaded/issue-14958.stderr index cc97730239c..e4f527319e7 100644 --- a/tests/ui/overloaded/issue-14958.stderr +++ b/tests/ui/overloaded/issue-14958.stderr @@ -1,5 +1,5 @@ warning: method `dummy` is never used - --> $DIR/issue-14958.rs:6:16 + --> $DIR/issue-14958.rs:5:16 | LL | trait Foo { fn dummy(&self) { }} | --- ^^^^^ diff --git a/tests/ui/overloaded/overloaded-calls-param-vtables.rs b/tests/ui/overloaded/overloaded-calls-param-vtables.rs index 7b89b45eb9b..b82e2ab05be 100644 --- a/tests/ui/overloaded/overloaded-calls-param-vtables.rs +++ b/tests/ui/overloaded/overloaded-calls-param-vtables.rs @@ -1,7 +1,6 @@ //@ run-pass // Tests that nested vtables work with overloaded calls. -//@ pretty-expanded FIXME #23616 #![feature(unboxed_closures, fn_traits)] diff --git a/tests/ui/panic-handler/weak-lang-item-2.rs b/tests/ui/panic-handler/weak-lang-item-2.rs index 2acaff3ab71..5291f3c4403 100644 --- a/tests/ui/panic-handler/weak-lang-item-2.rs +++ b/tests/ui/panic-handler/weak-lang-item-2.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:weak-lang-items.rs -//@ pretty-expanded FIXME #23616 extern crate weak_lang_items as other; diff --git a/tests/ui/panics/issue-47429-short-backtraces.rs b/tests/ui/panics/issue-47429-short-backtraces.rs index 97d2e22574a..0d216fdd653 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.rs +++ b/tests/ui/panics/issue-47429-short-backtraces.rs @@ -6,6 +6,12 @@ //@ check-run-results //@ exec-env:RUST_BACKTRACE=1 +// This is needed to avoid test output differences across std being built with v0 symbols vs legacy +// symbols. +//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic" +// And this is for differences between std with and without debuginfo. +//@ normalize-stderr-test: "\n +at [^\n]+" -> "" + //@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test //@ ignore-android FIXME #17520 //@ ignore-openbsd no support for libbacktrace without filename @@ -14,11 +20,6 @@ //@ ignore-sgx no subprocess support //@ ignore-fuchsia Backtraces not symbolized -// NOTE(eddyb) output differs between symbol mangling schemes -//@ revisions: legacy v0 -//@ [legacy] compile-flags: -Zunstable-options -Csymbol-mangling-version=legacy -//@ [v0] compile-flags: -Csymbol-mangling-version=v0 - fn main() { panic!() } diff --git a/tests/ui/panics/issue-47429-short-backtraces.legacy.run.stderr b/tests/ui/panics/issue-47429-short-backtraces.run.stderr index dce91ce59e3..1078a2fbc90 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.legacy.run.stderr +++ b/tests/ui/panics/issue-47429-short-backtraces.run.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:23:5: +thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:24:5: explicit panic stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/panics/issue-47429-short-backtraces.v0.run.stderr b/tests/ui/panics/issue-47429-short-backtraces.v0.run.stderr deleted file mode 100644 index f458c7acb39..00000000000 --- a/tests/ui/panics/issue-47429-short-backtraces.v0.run.stderr +++ /dev/null @@ -1,6 +0,0 @@ -thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:23:5: -explicit panic -stack backtrace: - 0: std::panicking::begin_panic::<&str> - 1: issue_47429_short_backtraces::main -note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. diff --git a/tests/ui/panics/panic-in-cleanup.run.stderr b/tests/ui/panics/panic-in-cleanup.run.stderr index 3417d4bf1a3..e7def11b0e9 100644 --- a/tests/ui/panics/panic-in-cleanup.run.stderr +++ b/tests/ui/panics/panic-in-cleanup.run.stderr @@ -4,6 +4,6 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'main' panicked at $DIR/panic-in-cleanup.rs:16:9: BOOM stack backtrace: -thread 'main' panicked at core/src/panicking.rs:$LINE:$COL: +thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: panic in a destructor during cleanup thread caused non-unwinding panic. aborting. diff --git a/tests/ui/panics/panic-in-ffi.run.stderr b/tests/ui/panics/panic-in-ffi.run.stderr index 58f5187f0da..fe8c2b04b91 100644 --- a/tests/ui/panics/panic-in-ffi.run.stderr +++ b/tests/ui/panics/panic-in-ffi.run.stderr @@ -2,7 +2,7 @@ thread 'main' panicked at $DIR/panic-in-ffi.rs:21:5: Test note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Noisy Drop -thread 'main' panicked at core/src/panicking.rs:$LINE:$COL: +thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. diff --git a/tests/ui/panics/runtime-switch.rs b/tests/ui/panics/runtime-switch.rs index a4ef0dcd8a2..10dce250909 100644 --- a/tests/ui/panics/runtime-switch.rs +++ b/tests/ui/panics/runtime-switch.rs @@ -6,6 +6,12 @@ //@ check-run-results //@ exec-env:RUST_BACKTRACE=0 +// This is needed to avoid test output differences across std being built with v0 symbols vs legacy +// symbols. +//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic" +// And this is for differences between std with and without debuginfo. +//@ normalize-stderr-test: "\n +at [^\n]+" -> "" + //@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test //@ ignore-android FIXME #17520 //@ ignore-openbsd no support for libbacktrace without filename @@ -14,11 +20,6 @@ //@ ignore-sgx no subprocess support //@ ignore-fuchsia Backtrace not symbolized -// NOTE(eddyb) output differs between symbol mangling schemes -//@ revisions: legacy v0 -//@ [legacy] compile-flags: -Zunstable-options -Csymbol-mangling-version=legacy -//@ [v0] compile-flags: -Csymbol-mangling-version=v0 - #![feature(panic_backtrace_config)] fn main() { diff --git a/tests/ui/panics/runtime-switch.legacy.run.stderr b/tests/ui/panics/runtime-switch.run.stderr index bd05b6cc00f..abbb91eba60 100644 --- a/tests/ui/panics/runtime-switch.legacy.run.stderr +++ b/tests/ui/panics/runtime-switch.run.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/runtime-switch.rs:26:5: +thread 'main' panicked at $DIR/runtime-switch.rs:27:5: explicit panic stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/panics/runtime-switch.v0.run.stderr b/tests/ui/panics/runtime-switch.v0.run.stderr deleted file mode 100644 index 2078c356d5c..00000000000 --- a/tests/ui/panics/runtime-switch.v0.run.stderr +++ /dev/null @@ -1,6 +0,0 @@ -thread 'main' panicked at $DIR/runtime-switch.rs:26:5: -explicit panic -stack backtrace: - 0: std::panicking::begin_panic::<&str> - 1: runtime_switch::main -note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.rs b/tests/ui/panics/short-ice-remove-middle-frames-2.rs index 6caad2212d4..c2f04cd122c 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.rs +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.rs @@ -9,6 +9,11 @@ //@ ignore-sgx Backtraces not symbolized //@ ignore-fuchsia Backtraces not symbolized //@ ignore-msvc the `__rust_{begin,end}_short_backtrace` symbols aren't reliable. +// This is needed to avoid test output differences across std being built with v0 symbols vs legacy +// symbols. +//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic" +// And this is for differences between std with and without debuginfo. +//@ normalize-stderr-test: "\n +at [^\n]+" -> "" /// This test case make sure that we can have multiple pairs of `__rust_{begin,end}_short_backtrace` diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr index 2b648a0cad2..67577f3568e 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:56:5: +thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:61:5: debug!!! stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/panics/short-ice-remove-middle-frames.rs b/tests/ui/panics/short-ice-remove-middle-frames.rs index 5f275d13cc4..c035e7e69bc 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.rs +++ b/tests/ui/panics/short-ice-remove-middle-frames.rs @@ -10,6 +10,11 @@ //@ ignore-fuchsia Backtraces not symbolized //@ ignore-msvc the `__rust_{begin,end}_short_backtrace` symbols aren't reliable. +// This is needed to avoid test output differences across std being built with v0 symbols vs legacy +// symbols. +//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic" +// And this is for differences between std with and without debuginfo. +//@ normalize-stderr-test: "\n +at [^\n]+" -> "" #[inline(never)] fn __rust_begin_short_backtrace<T, F: FnOnce() -> T>(f: F) -> T { diff --git a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr index 5b372684096..63fa466ab24 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:52:5: +thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:57:5: debug!!! stack backtrace: 0: std::panicking::begin_panic diff --git a/tests/ui/parser/assoc/assoc-oddities-1.rs b/tests/ui/parser/assoc/assoc-oddities-1.rs index 246546ac034..c1b305a4eeb 100644 --- a/tests/ui/parser/assoc/assoc-oddities-1.rs +++ b/tests/ui/parser/assoc/assoc-oddities-1.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only fn main() { // following lines below parse and must not fail diff --git a/tests/ui/parser/assoc/assoc-oddities-2.rs b/tests/ui/parser/assoc/assoc-oddities-2.rs index aee2af41d62..82cf7d79c0d 100644 --- a/tests/ui/parser/assoc/assoc-oddities-2.rs +++ b/tests/ui/parser/assoc/assoc-oddities-2.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only fn main() { // see assoc-oddities-1 for explanation diff --git a/tests/ui/parser/bad-name.stderr b/tests/ui/parser/bad-name.stderr index 5ca248380ee..a336923f4fd 100644 --- a/tests/ui/parser/bad-name.stderr +++ b/tests/ui/parser/bad-name.stderr @@ -10,7 +10,7 @@ error: expected a pattern, found an expression LL | let x.y::<isize>.z foo; | ^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected one of `(`, `.`, `::`, `:`, `;`, `=`, `?`, `|`, or an operator, found `foo` --> $DIR/bad-name.rs:2:22 diff --git a/tests/ui/parser/bad-recover-kw-after-impl.rs b/tests/ui/parser/bad-recover-kw-after-impl.rs index 15c0b377c8a..964d32c55bc 100644 --- a/tests/ui/parser/bad-recover-kw-after-impl.rs +++ b/tests/ui/parser/bad-recover-kw-after-impl.rs @@ -12,6 +12,6 @@ macro_rules! impl_primitive { impl_primitive!(impl async); //~^ ERROR expected identifier, found `<eof>` -//~| ERROR async closures are unstable +//~| ERROR `async` trait bounds are unstable fn main() {} diff --git a/tests/ui/parser/bad-recover-kw-after-impl.stderr b/tests/ui/parser/bad-recover-kw-after-impl.stderr index f617cf65498..7a8979db165 100644 --- a/tests/ui/parser/bad-recover-kw-after-impl.stderr +++ b/tests/ui/parser/bad-recover-kw-after-impl.stderr @@ -7,16 +7,16 @@ LL | ($ty:ty) => { LL | impl_primitive!(impl async); | ^^^^^ expected identifier -error[E0658]: async closures are unstable +error[E0658]: `async` trait bounds are unstable --> $DIR/bad-recover-kw-after-impl.rs:13:22 | LL | impl_primitive!(impl async); | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable + = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` + = help: use the desugared name of the async trait, such as `AsyncFn` error: aborting due to 2 previous errors diff --git a/tests/ui/parser/bounds-type.rs b/tests/ui/parser/bounds-type.rs index 7cee6def32f..ec0e83c314e 100644 --- a/tests/ui/parser/bounds-type.rs +++ b/tests/ui/parser/bounds-type.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only //@ edition: 2021 struct S< diff --git a/tests/ui/parser/help-set-edition-ice-122130.stderr b/tests/ui/parser/help-set-edition-ice-122130.stderr index fe4d212f2db..700b1ec911b 100644 --- a/tests/ui/parser/help-set-edition-ice-122130.stderr +++ b/tests/ui/parser/help-set-edition-ice-122130.stderr @@ -6,7 +6,7 @@ LL | s#[c"owned_box"] | = note: you may be trying to write a c-string literal = note: c-string literals require Rust 2021 or later - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: expected item, found `"owned_box"` diff --git a/tests/ui/parser/impl-qpath.rs b/tests/ui/parser/impl-qpath.rs index d7c4989b6e4..fed026792c9 100644 --- a/tests/ui/parser/impl-qpath.rs +++ b/tests/ui/parser/impl-qpath.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only impl <*const u8>::AssocTy {} // OK impl <Type as Trait>::AssocTy {} // OK diff --git a/tests/ui/parser/issues/auxiliary/issue-89971-outer-attr-following-inner-attr-ice.rs b/tests/ui/parser/issues/auxiliary/issue-89971-outer-attr-following-inner-attr-ice.rs index 44697afcfed..2df0b3a17dc 100644 --- a/tests/ui/parser/issues/auxiliary/issue-89971-outer-attr-following-inner-attr-ice.rs +++ b/tests/ui/parser/issues/auxiliary/issue-89971-outer-attr-following-inner-attr-ice.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/parser/issues/issue-17904.rs b/tests/ui/parser/issues/issue-17904.rs index 6f77d4bb086..99a3b139898 100644 --- a/tests/ui/parser/issues/issue-17904.rs +++ b/tests/ui/parser/issues/issue-17904.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Zparse-only +//@ compile-flags: -Zparse-crate-root-only struct Baz<U> where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax. struct Baz<U> where U: Eq(U) -> R; // Notice this parses as well. diff --git a/tests/ui/parser/issues/issue-21475.rs b/tests/ui/parser/issues/issue-21475.rs index 27248179ef4..43dc7c53a70 100644 --- a/tests/ui/parser/issues/issue-21475.rs +++ b/tests/ui/parser/issues/issue-21475.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_imports, overlapping_range_endpoints)] -//@ pretty-expanded FIXME #23616 use m::{START, END}; diff --git a/tests/ui/parser/issues/issue-24197.stderr b/tests/ui/parser/issues/issue-24197.stderr index c92e165b23b..4eadc897d88 100644 --- a/tests/ui/parser/issues/issue-24197.stderr +++ b/tests/ui/parser/issues/issue-24197.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | let buf[0] = 0; | ^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-24375.stderr b/tests/ui/parser/issues/issue-24375.stderr index fef3fcde7b7..03cd33f1875 100644 --- a/tests/ui/parser/issues/issue-24375.stderr +++ b/tests/ui/parser/issues/issue-24375.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | tmp[0] => {} | ^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == tmp[0] => {} diff --git a/tests/ui/parser/issues/issue-7222.rs b/tests/ui/parser/issues/issue-7222.rs index 6f6b34f4f48..d601731dc77 100644 --- a/tests/ui/parser/issues/issue-7222.rs +++ b/tests/ui/parser/issues/issue-7222.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { const FOO: f64 = 10.0; diff --git a/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs b/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs index 51bb04dba19..461890e63e3 100644 --- a/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs +++ b/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-89971-outer-attr-following-inner-attr-ice.rs +//@ proc-macro: issue-89971-outer-attr-following-inner-attr-ice.rs #[macro_use] extern crate issue_89971_outer_attr_following_inner_attr_ice; diff --git a/tests/ui/parser/mut-patterns.rs b/tests/ui/parser/mut-patterns.rs index b8610c4e190..45968a516e3 100644 --- a/tests/ui/parser/mut-patterns.rs +++ b/tests/ui/parser/mut-patterns.rs @@ -15,6 +15,10 @@ pub fn main() { //~^ ERROR `mut` on a binding may not be repeated //~| remove the additional `mut`s + let mut mut mut mut mut x = 0; + //~^ ERROR `mut` on a binding may not be repeated + //~| remove the additional `mut`s + struct Foo { x: isize } let mut Foo { x: x } = Foo { x: 3 }; //~^ ERROR `mut` must be attached to each individual binding diff --git a/tests/ui/parser/mut-patterns.stderr b/tests/ui/parser/mut-patterns.stderr index f4f11b88d36..ad19a60af34 100644 --- a/tests/ui/parser/mut-patterns.stderr +++ b/tests/ui/parser/mut-patterns.stderr @@ -45,11 +45,23 @@ LL | let mut mut x = 0; help: remove the additional `mut`s | LL - let mut mut x = 0; -LL + let mut x = 0; +LL + let mut x = 0; + | + +error: `mut` on a binding may not be repeated + --> $DIR/mut-patterns.rs:18:13 + | +LL | let mut mut mut mut mut x = 0; + | ^^^^^^^^^^^^^^^ + | +help: remove the additional `mut`s + | +LL - let mut mut mut mut mut x = 0; +LL + let mut x = 0; | error: `mut` must be attached to each individual binding - --> $DIR/mut-patterns.rs:19:9 + --> $DIR/mut-patterns.rs:23:9 | LL | let mut Foo { x: x } = Foo { x: 3 }; | ^^^^^^^^^^^^^^^^ @@ -61,7 +73,7 @@ LL | let Foo { x: mut x } = Foo { x: 3 }; | ~~~~~~~~~~~~~~~~ error: `mut` must be attached to each individual binding - --> $DIR/mut-patterns.rs:23:9 + --> $DIR/mut-patterns.rs:27:9 | LL | let mut Foo { x } = Foo { x: 3 }; | ^^^^^^^^^^^^^ @@ -73,7 +85,7 @@ LL | let Foo { mut x } = Foo { x: 3 }; | ~~~~~~~~~~~~~ error: `mut` on a binding may not be repeated - --> $DIR/mut-patterns.rs:28:13 + --> $DIR/mut-patterns.rs:32:13 | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^ @@ -81,11 +93,11 @@ LL | let mut mut yield(become, await) = r#yield(0, 0); help: remove the additional `mut`s | LL - let mut mut yield(become, await) = r#yield(0, 0); -LL + let mut yield(become, await) = r#yield(0, 0); +LL + let mut yield(become, await) = r#yield(0, 0); | error: expected identifier, found reserved keyword `yield` - --> $DIR/mut-patterns.rs:28:17 + --> $DIR/mut-patterns.rs:32:17 | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^^^ expected identifier, found reserved keyword @@ -96,7 +108,7 @@ LL | let mut mut r#yield(become, await) = r#yield(0, 0); | ++ error: expected identifier, found reserved keyword `become` - --> $DIR/mut-patterns.rs:28:23 + --> $DIR/mut-patterns.rs:32:23 | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^^^^ expected identifier, found reserved keyword @@ -107,7 +119,7 @@ LL | let mut mut yield(r#become, await) = r#yield(0, 0); | ++ error: expected identifier, found keyword `await` - --> $DIR/mut-patterns.rs:28:31 + --> $DIR/mut-patterns.rs:32:31 | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^^^ expected identifier, found keyword @@ -118,7 +130,7 @@ LL | let mut mut yield(become, r#await) = r#yield(0, 0); | ++ error: `mut` must be followed by a named binding - --> $DIR/mut-patterns.rs:28:9 + --> $DIR/mut-patterns.rs:32:9 | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^^^^^^ @@ -131,7 +143,7 @@ LL + let yield(become, await) = r#yield(0, 0); | error: `mut` must be attached to each individual binding - --> $DIR/mut-patterns.rs:37:9 + --> $DIR/mut-patterns.rs:41:9 | LL | let mut W(mut a, W(b, W(ref c, W(d, B { box f })))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -143,7 +155,7 @@ LL | let W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f })))) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: expected identifier, found `x` - --> $DIR/mut-patterns.rs:44:21 + --> $DIR/mut-patterns.rs:48:21 | LL | let mut $p = 0; | ^^ expected identifier @@ -153,5 +165,5 @@ LL | foo!(x); | = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 13 previous errors +error: aborting due to 14 previous errors diff --git a/tests/ui/parser/parse-assoc-type-lt.rs b/tests/ui/parser/parse-assoc-type-lt.rs index f1823ce96b9..48e1423023e 100644 --- a/tests/ui/parser/parse-assoc-type-lt.rs +++ b/tests/ui/parser/parse-assoc-type-lt.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Foo { type T; diff --git a/tests/ui/parser/pat-lt-bracket-5.stderr b/tests/ui/parser/pat-lt-bracket-5.stderr index a2a972652d1..c68aefa0546 100644 --- a/tests/ui/parser/pat-lt-bracket-5.stderr +++ b/tests/ui/parser/pat-lt-bracket-5.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | let v[0] = v[1]; | ^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error[E0425]: cannot find value `v` in this scope --> $DIR/pat-lt-bracket-5.rs:2:16 diff --git a/tests/ui/parser/pat-lt-bracket-6.stderr b/tests/ui/parser/pat-lt-bracket-6.stderr index 14ae602fedf..0274809f800 100644 --- a/tests/ui/parser/pat-lt-bracket-6.stderr +++ b/tests/ui/parser/pat-lt-bracket-6.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | let Test(&desc[..]) = x; | ^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error[E0308]: mismatched types --> $DIR/pat-lt-bracket-6.rs:10:30 diff --git a/tests/ui/parser/pat-ranges-3.stderr b/tests/ui/parser/pat-ranges-3.stderr index ef080368e19..fcda924d98c 100644 --- a/tests/ui/parser/pat-ranges-3.stderr +++ b/tests/ui/parser/pat-ranges-3.stderr @@ -4,7 +4,7 @@ error: expected a pattern range bound, found an expression LL | let 10 ..= 10 + 3 = 12; | ^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected a pattern range bound, found an expression --> $DIR/pat-ranges-3.rs:7:9 @@ -12,7 +12,7 @@ error: expected a pattern range bound, found an expression LL | let 10 - 3 ..= 10 = 8; | ^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: aborting due to 2 previous errors diff --git a/tests/ui/parser/recover/recover-pat-exprs.stderr b/tests/ui/parser/recover/recover-pat-exprs.stderr index 6cb3753de8d..041dfd647ad 100644 --- a/tests/ui/parser/recover/recover-pat-exprs.stderr +++ b/tests/ui/parser/recover/recover-pat-exprs.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | x.y => (), | ^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x.y => (), @@ -27,7 +27,7 @@ error: expected a pattern, found an expression LL | x.0 => (), | ^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x.0 => (), @@ -51,7 +51,7 @@ error: expected a pattern, found an expression LL | x._0 => (), | ^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x._0 => (), @@ -76,7 +76,7 @@ error: expected a pattern, found an expression LL | x.0.1 => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x.0.1 => (), @@ -101,7 +101,7 @@ error: expected a pattern, found an expression LL | x.4.y.17.__z => (), | ^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x.4.y.17.__z => (), @@ -156,7 +156,7 @@ error: expected a pattern, found an expression LL | x[0] => (), | ^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x[0] => (), @@ -178,7 +178,7 @@ error: expected a pattern, found an expression LL | x[..] => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x[..] => (), @@ -228,7 +228,7 @@ error: expected a pattern, found an expression LL | x.f() => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x.f() => (), @@ -250,7 +250,7 @@ error: expected a pattern, found an expression LL | x._f() => (), | ^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x._f() => (), @@ -273,7 +273,7 @@ error: expected a pattern, found an expression LL | x? => (), | ^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x? => (), @@ -297,7 +297,7 @@ error: expected a pattern, found an expression LL | ().f() => (), | ^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == ().f() => (), @@ -322,7 +322,7 @@ error: expected a pattern, found an expression LL | (0, x)?.f() => (), | ^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == (0, x)?.f() => (), @@ -347,7 +347,7 @@ error: expected a pattern, found an expression LL | x.f().g() => (), | ^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x.f().g() => (), @@ -372,7 +372,7 @@ error: expected a pattern, found an expression LL | 0.f()?.g()?? => (), | ^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == 0.f()?.g()?? => (), @@ -397,7 +397,7 @@ error: expected a pattern, found an expression LL | x as usize => (), | ^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x as usize => (), @@ -419,7 +419,7 @@ error: expected a pattern, found an expression LL | 0 as usize => (), | ^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == 0 as usize => (), @@ -442,7 +442,7 @@ error: expected a pattern, found an expression LL | x.f().0.4 as f32 => (), | ^^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == x.f().0.4 as f32 => (), @@ -466,7 +466,7 @@ error: expected a pattern, found an expression LL | 1 + 1 => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == 1 + 1 => (), @@ -488,7 +488,7 @@ error: expected a pattern, found an expression LL | (1 + 2) * 3 => (), | ^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == (1 + 2) * 3 => (), @@ -511,7 +511,7 @@ error: expected a pattern, found an expression LL | x.0 > 2 => (), | ^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == (x.0 > 2) => (), @@ -536,7 +536,7 @@ error: expected a pattern, found an expression LL | x.0 == 2 => (), | ^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == (x.0 == 2) => (), @@ -561,7 +561,7 @@ error: expected a pattern, found an expression LL | (x, y.0 > 2) if x != 0 => (), | ^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to the match arm guard | LL | (x, val) if x != 0 && val == (y.0 > 2) => (), @@ -583,7 +583,7 @@ error: expected a pattern, found an expression LL | (x, y.0 > 2) if x != 0 || x != 1 => (), | ^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to the match arm guard | LL | (x, val) if (x != 0 || x != 1) && val == (y.0 > 2) => (), @@ -623,7 +623,7 @@ error: expected a pattern, found an expression LL | u8::MAX.abs() => (), | ^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == u8::MAX.abs() => (), @@ -645,7 +645,7 @@ error: expected a pattern, found an expression LL | z @ w @ v.u() => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | z @ w @ val if val == v.u() => (), @@ -670,7 +670,7 @@ error: expected a pattern, found an expression LL | y.ilog(3) => (), | ^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == y.ilog(3) => (), @@ -695,7 +695,7 @@ error: expected a pattern, found an expression LL | n + 1 => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == n + 1 => (), @@ -720,7 +720,7 @@ error: expected a pattern, found an expression LL | ("".f() + 14 * 8) => (), | ^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | (val) if val == "".f() + 14 * 8 => (), @@ -745,7 +745,7 @@ error: expected a pattern, found an expression LL | f?() => (), | ^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | val if val == f?() => (), @@ -770,7 +770,7 @@ error: expected a pattern, found an expression LL | let 1 + 1 = 2; | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected one of `)`, `,`, `@`, or `|`, found `*` --> $DIR/recover-pat-exprs.rs:104:28 @@ -787,7 +787,7 @@ error: expected a pattern, found an expression LL | (1 + 2) * 3 => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected a pattern, found an expression --> $DIR/recover-pat-exprs.rs:75:5 @@ -795,7 +795,7 @@ error: expected a pattern, found an expression LL | 1 + 2 * PI.cos() => 2, | ^^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected a pattern, found an expression --> $DIR/recover-pat-exprs.rs:83:9 @@ -803,7 +803,7 @@ error: expected a pattern, found an expression LL | x.sqrt() @ .. => (), | ^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: aborting due to 45 previous errors diff --git a/tests/ui/parser/recover/recover-pat-issues.stderr b/tests/ui/parser/recover/recover-pat-issues.stderr index 17cb7b4aead..bdd0b2b260e 100644 --- a/tests/ui/parser/recover/recover-pat-issues.stderr +++ b/tests/ui/parser/recover/recover-pat-issues.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | Foo("hi".to_owned()) => true, | ^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | Foo(val) if val == "hi".to_owned() => true, @@ -26,7 +26,7 @@ error: expected a pattern, found an expression LL | Bar { baz: "hi".to_owned() } => true, | ^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | Bar { baz } if baz == "hi".to_owned() => true, @@ -48,7 +48,7 @@ error: expected a pattern, found an expression LL | &["foo".to_string()] => {} | ^^^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider moving the expression to a match arm guard | LL | &[val] if val == "foo".to_string() => {} @@ -70,7 +70,7 @@ error: expected a pattern, found an expression LL | if let Some(MAGIC.0 as usize) = None::<usize> {} | ^^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = MAGIC.0 as usize; @@ -87,7 +87,7 @@ error: expected a pattern, found an expression LL | if let (-1.some(4)) = (0, Some(4)) {} | ^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = -1.some(4); @@ -104,7 +104,7 @@ error: expected a pattern, found an expression LL | if let (-1.Some(4)) = (0, Some(4)) {} | ^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = -1.Some(4); diff --git a/tests/ui/parser/recover/recover-pat-lets.stderr b/tests/ui/parser/recover/recover-pat-lets.stderr index b481813b246..55252729d7b 100644 --- a/tests/ui/parser/recover/recover-pat-lets.stderr +++ b/tests/ui/parser/recover/recover-pat-lets.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | let x.expect("foo"); | ^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected a pattern, found an expression --> $DIR/recover-pat-lets.rs:7:9 @@ -12,7 +12,7 @@ error: expected a pattern, found an expression LL | let x.unwrap(): u32; | ^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected a pattern, found an expression --> $DIR/recover-pat-lets.rs:10:9 @@ -20,7 +20,7 @@ error: expected a pattern, found an expression LL | let x[0] = 1; | ^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: expected a pattern, found an expression --> $DIR/recover-pat-lets.rs:13:14 @@ -28,7 +28,7 @@ error: expected a pattern, found an expression LL | let Some(1 + 1) = x else { | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 1 + 1; @@ -45,7 +45,7 @@ error: expected a pattern, found an expression LL | if let Some(1 + 1) = x { | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 1 + 1; diff --git a/tests/ui/parser/recover/recover-pat-ranges.stderr b/tests/ui/parser/recover/recover-pat-ranges.stderr index 0a9b5447468..e8f323596d0 100644 --- a/tests/ui/parser/recover/recover-pat-ranges.stderr +++ b/tests/ui/parser/recover/recover-pat-ranges.stderr @@ -88,7 +88,7 @@ error: expected a pattern range bound, found an expression LL | ..=1 + 2 => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 1 + 2; @@ -109,7 +109,7 @@ error: expected a pattern range bound, found an expression LL | (-4 + 0).. => (), | ^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = -4 + 0; @@ -130,7 +130,7 @@ error: expected a pattern range bound, found an expression LL | (1 + 4)...1 * 2 => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 1 + 4; @@ -151,7 +151,7 @@ error: expected a pattern range bound, found an expression LL | (1 + 4)...1 * 2 => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 1 * 2; @@ -172,7 +172,7 @@ error: expected a pattern range bound, found an expression LL | 0.x()..="y".z() => (), | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 0.x(); @@ -193,7 +193,7 @@ error: expected a pattern range bound, found an expression LL | 0.x()..="y".z() => (), | ^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = "y".z(); diff --git a/tests/ui/parser/recover/recover-pat-wildcards.stderr b/tests/ui/parser/recover/recover-pat-wildcards.stderr index 8d4212ed389..81a9920f6a2 100644 --- a/tests/ui/parser/recover/recover-pat-wildcards.stderr +++ b/tests/ui/parser/recover/recover-pat-wildcards.stderr @@ -77,7 +77,7 @@ error: expected a pattern range bound, found an expression LL | 4..=(2 + _) => () | ^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> help: consider extracting the expression into a `const` | LL + const VAL: /* Type */ = 2 + _; diff --git a/tests/ui/parser/recover/recover-range-pats.stderr b/tests/ui/parser/recover/recover-range-pats.stderr index b8e91c2344a..5c134bd4a82 100644 --- a/tests/ui/parser/recover/recover-range-pats.stderr +++ b/tests/ui/parser/recover/recover-range-pats.stderr @@ -613,7 +613,7 @@ LL | mac2!(0, 1); | ----------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -627,7 +627,7 @@ LL | mac2!(0, 1); | ----------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -641,7 +641,7 @@ LL | mac2!(0, 1); | ----------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -655,7 +655,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -669,7 +669,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -683,7 +683,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -697,7 +697,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -711,7 +711,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -725,7 +725,7 @@ LL | mac!(0); | ------- in this macro invocation | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/path.rs b/tests/ui/path.rs index cd6962ac3e0..bd7b99ac01a 100644 --- a/tests/ui/path.rs +++ b/tests/ui/path.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 mod foo { pub fn bar(_offset: usize) { } diff --git a/tests/ui/pattern/fn-in-pat.stderr b/tests/ui/pattern/fn-in-pat.stderr index 41ea4df72a2..90b1dff32ce 100644 --- a/tests/ui/pattern/fn-in-pat.stderr +++ b/tests/ui/pattern/fn-in-pat.stderr @@ -4,7 +4,7 @@ error[E0164]: expected tuple struct or tuple variant, found associated function LL | A::new() => (), | ^^^^^^^^ `fn` calls are not allowed in patterns | - = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html + = help: for more information, visit https://doc.rust-lang.org/book/ch19-00-patterns.html error: aborting due to 1 previous error diff --git a/tests/ui/pattern/issue-106552.stderr b/tests/ui/pattern/issue-106552.stderr index 96f3d68458f..6d9a989f182 100644 --- a/tests/ui/pattern/issue-106552.stderr +++ b/tests/ui/pattern/issue-106552.stderr @@ -5,7 +5,7 @@ LL | let 5 = 6; | ^ patterns `i32::MIN..=4_i32` and `6_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `if let` to ignore the variants that aren't matched | @@ -23,7 +23,7 @@ LL | let x @ 5 = 6; | ^ patterns `i32::MIN..=4_i32` and `6_i32..=i32::MAX` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: you might want to use `let else` to handle the variants that aren't matched | diff --git a/tests/ui/pattern/mut_preserve_binding_mode_2024.rs b/tests/ui/pattern/mut_preserve_binding_mode_2024.rs index 19aa73573b4..a4afcb2e511 100644 --- a/tests/ui/pattern/mut_preserve_binding_mode_2024.rs +++ b/tests/ui/pattern/mut_preserve_binding_mode_2024.rs @@ -1,6 +1,5 @@ //@ run-pass //@ edition: 2024 -//@ compile-flags: -Zunstable-options #![feature(mut_ref, ref_pat_eat_one_layer_2024)] #![allow(incomplete_features, unused)] diff --git a/tests/ui/pattern/pattern-binding-disambiguation.stderr b/tests/ui/pattern/pattern-binding-disambiguation.stderr index 61c32b6a17b..3ba63b4d253 100644 --- a/tests/ui/pattern/pattern-binding-disambiguation.stderr +++ b/tests/ui/pattern/pattern-binding-disambiguation.stderr @@ -87,7 +87,7 @@ LL | let UnitVariant = UnitVariant; | ^^^^^^^^^^^ patterns `E::TupleVariant` and `E::BracedVariant { }` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `E` defined here --> $DIR/pattern-binding-disambiguation.rs:5:6 | diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/auxiliary/migration_lint_macros.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/auxiliary/migration_lint_macros.rs index 0b70e4404ab..daa9b7368fd 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/auxiliary/migration_lint_macros.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/auxiliary/migration_lint_macros.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Z unstable-options // This contains a binding in edition 2024, so if matched with a reference binding mode it will end // up with a `mut ref mut` binding mode. We use this to test the migration lint on patterns with diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.rs index a822c90ab6e..50b716a1111 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.rs @@ -1,6 +1,5 @@ //@ check-fail //@ edition: 2024 -//@ compile-flags: -Zunstable-options #![deny(rust_2024_incompatible_pat)] fn main() {} diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr index 33e4f0021b7..92058095f84 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/min_match_ergonomics_fail.rs:24:20 + --> $DIR/min_match_ergonomics_fail.rs:23:20 | LL | test_pat_on_type![(&x,): &(T,)]; | ^^ ----- expected due to this @@ -15,7 +15,7 @@ LL + test_pat_on_type![(x,): &(T,)]; | error[E0308]: mismatched types - --> $DIR/min_match_ergonomics_fail.rs:26:20 + --> $DIR/min_match_ergonomics_fail.rs:25:20 | LL | test_pat_on_type![(&x,): &(&mut T,)]; | ^^ ---------- expected due to this @@ -31,7 +31,7 @@ LL + test_pat_on_type![(x,): &(&mut T,)]; | error[E0308]: mismatched types - --> $DIR/min_match_ergonomics_fail.rs:27:20 + --> $DIR/min_match_ergonomics_fail.rs:26:20 | LL | test_pat_on_type![(&mut x,): &(&T,)]; | ^^^^^^ ------ expected due to this @@ -41,7 +41,7 @@ LL | test_pat_on_type![(&mut x,): &(&T,)]; = note: expected reference `&T` found mutable reference `&mut _` note: to declare a mutable binding use: `mut x` - --> $DIR/min_match_ergonomics_fail.rs:27:20 + --> $DIR/min_match_ergonomics_fail.rs:26:20 | LL | test_pat_on_type![(&mut x,): &(&T,)]; | ^^^^^^ @@ -52,7 +52,7 @@ LL + test_pat_on_type![(x,): &(&T,)]; | error[E0308]: mismatched types - --> $DIR/min_match_ergonomics_fail.rs:29:20 + --> $DIR/min_match_ergonomics_fail.rs:28:20 | LL | test_pat_on_type![(&x,): &&mut &(T,)]; | ^^ ----------- expected due to this @@ -68,7 +68,7 @@ LL + test_pat_on_type![(x,): &&mut &(T,)]; | error[E0308]: mismatched types - --> $DIR/min_match_ergonomics_fail.rs:30:29 + --> $DIR/min_match_ergonomics_fail.rs:29:29 | LL | test_pat_on_type![Foo { f: (&x,) }: Foo]; | ^^ --- expected due to this @@ -84,7 +84,7 @@ LL + test_pat_on_type![Foo { f: (x,) }: Foo]; | error[E0308]: mismatched types - --> $DIR/min_match_ergonomics_fail.rs:31:29 + --> $DIR/min_match_ergonomics_fail.rs:30:29 | LL | test_pat_on_type![Foo { f: (&x,) }: &mut Foo]; | ^^ -------- expected due to this @@ -100,7 +100,7 @@ LL + test_pat_on_type![Foo { f: (x,) }: &mut Foo]; | error: patterns are not allowed to reset the default binding mode in edition 2024 - --> $DIR/min_match_ergonomics_fail.rs:25:19 + --> $DIR/min_match_ergonomics_fail.rs:24:19 | LL | test_pat_on_type![(&x,): &(&T,)]; | -^^^^ @@ -108,7 +108,7 @@ LL | test_pat_on_type![(&x,): &(&T,)]; | help: desugar the match ergonomics: `&` error: patterns are not allowed to reset the default binding mode in edition 2024 - --> $DIR/min_match_ergonomics_fail.rs:28:19 + --> $DIR/min_match_ergonomics_fail.rs:27:19 | LL | test_pat_on_type![(&mut x,): &(&mut T,)]; | -^^^^^^^^ @@ -116,7 +116,7 @@ LL | test_pat_on_type![(&mut x,): &(&mut T,)]; | help: desugar the match ergonomics: `&` error: patterns are not allowed to reset the default binding mode in edition 2024 - --> $DIR/min_match_ergonomics_fail.rs:32:19 + --> $DIR/min_match_ergonomics_fail.rs:31:19 | LL | test_pat_on_type![Foo { f: &(x,) }: &Foo]; | -^^^^^^^^^^^^^^^ @@ -124,7 +124,7 @@ LL | test_pat_on_type![Foo { f: &(x,) }: &Foo]; | help: desugar the match ergonomics: `&` error: patterns are not allowed to reset the default binding mode in edition 2024 - --> $DIR/min_match_ergonomics_fail.rs:33:19 + --> $DIR/min_match_ergonomics_fail.rs:32:19 | LL | test_pat_on_type![(mut x,): &(T,)]; | -^^^^^^^ @@ -132,7 +132,7 @@ LL | test_pat_on_type![(mut x,): &(T,)]; | help: desugar the match ergonomics: `&` error: patterns are not allowed to reset the default binding mode in edition 2024 - --> $DIR/min_match_ergonomics_fail.rs:34:19 + --> $DIR/min_match_ergonomics_fail.rs:33:19 | LL | test_pat_on_type![(ref x,): &(T,)]; | -^^^^^^^ @@ -140,7 +140,7 @@ LL | test_pat_on_type![(ref x,): &(T,)]; | help: desugar the match ergonomics: `&` error: patterns are not allowed to reset the default binding mode in edition 2024 - --> $DIR/min_match_ergonomics_fail.rs:35:19 + --> $DIR/min_match_ergonomics_fail.rs:34:19 | LL | test_pat_on_type![(ref mut x,): &mut (T,)]; | -^^^^^^^^^^^ @@ -148,7 +148,7 @@ LL | test_pat_on_type![(ref mut x,): &mut (T,)]; | help: desugar the match ergonomics: `&mut` error: patterns are not allowed to reset the default binding mode in edition 2024 - --> $DIR/min_match_ergonomics_fail.rs:44:9 + --> $DIR/min_match_ergonomics_fail.rs:43:9 | LL | (&x,) => x, | -^^^^ diff --git a/tests/ui/pattern/self-ctor-133272.rs b/tests/ui/pattern/self-ctor-133272.rs new file mode 100644 index 00000000000..ad64d6b88cd --- /dev/null +++ b/tests/ui/pattern/self-ctor-133272.rs @@ -0,0 +1,21 @@ +//! Regression test for <https://github.com/rust-lang/rust/issues/133272>, where a `ref Self` ctor +//! makes it possible to hit a `delayed_bug` that was converted into a `span_bug` in +//! <https://github.com/rust-lang/rust/pull/121208>, and hitting this reveals that we did not have +//! test coverage for this specific code pattern (heh) previously. +//! +//! # References +//! +//! - ICE bug report: <https://github.com/rust-lang/rust/issues/133272>. +//! - Previous PR to change `delayed_bug` -> `span_bug`: +//! <https://github.com/rust-lang/rust/pull/121208> +#![crate_type = "lib"] + +struct Foo; + +impl Foo { + fn fun() { + let S { ref Self } = todo!(); + //~^ ERROR expected identifier, found keyword `Self` + //~| ERROR cannot find struct, variant or union type `S` in this scope + } +} diff --git a/tests/ui/pattern/self-ctor-133272.stderr b/tests/ui/pattern/self-ctor-133272.stderr new file mode 100644 index 00000000000..bca55a43d9c --- /dev/null +++ b/tests/ui/pattern/self-ctor-133272.stderr @@ -0,0 +1,15 @@ +error: expected identifier, found keyword `Self` + --> $DIR/self-ctor-133272.rs:17:21 + | +LL | let S { ref Self } = todo!(); + | ^^^^ expected identifier, found keyword + +error[E0422]: cannot find struct, variant or union type `S` in this scope + --> $DIR/self-ctor-133272.rs:17:13 + | +LL | let S { ref Self } = todo!(); + | ^ not found in this scope + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0422`. diff --git a/tests/ui/pattern/skipped-ref-pats-issue-125058.rs b/tests/ui/pattern/skipped-ref-pats-issue-125058.rs index b733e5fda0a..2b587ecb91f 100644 --- a/tests/ui/pattern/skipped-ref-pats-issue-125058.rs +++ b/tests/ui/pattern/skipped-ref-pats-issue-125058.rs @@ -1,6 +1,5 @@ //@ run-pass //@ edition: 2024 -//@ compile-flags: -Zunstable-options #![allow(incomplete_features)] #![feature(ref_pat_eat_one_layer_2024)] diff --git a/tests/ui/pattern/skipped-ref-pats-issue-125058.stderr b/tests/ui/pattern/skipped-ref-pats-issue-125058.stderr index cee1cc673c7..f7fd4a4cc29 100644 --- a/tests/ui/pattern/skipped-ref-pats-issue-125058.stderr +++ b/tests/ui/pattern/skipped-ref-pats-issue-125058.stderr @@ -1,5 +1,5 @@ warning: struct `Foo` is never constructed - --> $DIR/skipped-ref-pats-issue-125058.rs:8:8 + --> $DIR/skipped-ref-pats-issue-125058.rs:7:8 | LL | struct Foo; | ^^^ @@ -7,7 +7,7 @@ LL | struct Foo; = note: `#[warn(dead_code)]` on by default warning: unused closure that must be used - --> $DIR/skipped-ref-pats-issue-125058.rs:12:5 + --> $DIR/skipped-ref-pats-issue-125058.rs:11:5 | LL | / || { LL | | diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr index ec08e22e2ca..4a435bcc8ba 100644 --- a/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr @@ -54,7 +54,7 @@ LL | let None = *x; | ^^^^ pattern `Some(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: pattern `Some(_)` is currently uninhabited, but this variant contains private fields which may become inhabited in the future = note: the matched value is of type `Option<SecretlyUninhabitedForeignStruct>` help: you might want to use `if let` to ignore the variant that isn't matched diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr b/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr index ec08e22e2ca..4a435bcc8ba 100644 --- a/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr +++ b/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr @@ -54,7 +54,7 @@ LL | let None = *x; | ^^^^ pattern `Some(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: pattern `Some(_)` is currently uninhabited, but this variant contains private fields which may become inhabited in the future = note: the matched value is of type `Option<SecretlyUninhabitedForeignStruct>` help: you might want to use `if let` to ignore the variant that isn't matched diff --git a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr index c6e41c1875f..23821decd6e 100644 --- a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr @@ -150,7 +150,7 @@ LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Result<&u32, &!>` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr b/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr index 2e5511527d5..cf37bf67e86 100644 --- a/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr +++ b/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr @@ -126,7 +126,7 @@ LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Result<&u32, &!>` help: you might want to use `let else` to handle the variant that isn't matched | @@ -140,7 +140,7 @@ LL | let Ok(_x) = &res_u32_never; | ^^^^^^ pattern `&Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `&Result<u32, !>` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr index 3f312d46c7e..84aefe7d963 100644 --- a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr +++ b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr @@ -104,7 +104,7 @@ LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Result<&u32, &!>` help: you might want to use `let else` to handle the variant that isn't matched | @@ -118,7 +118,7 @@ LL | let Ok(_x) = &res_u32_never; | ^^^^^^ pattern `&Err(!)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `&Result<u32, !>` help: you might want to use `let else` to handle the variant that isn't matched | @@ -239,7 +239,7 @@ LL | let Ok(_) = *ptr_result_never_err; | ^^^^^ pattern `Err(!)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Result<u8, !>` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/tests/ui/pattern/usefulness/empty-types.normal.stderr b/tests/ui/pattern/usefulness/empty-types.normal.stderr index bba50dab27b..f3af74c16c3 100644 --- a/tests/ui/pattern/usefulness/empty-types.normal.stderr +++ b/tests/ui/pattern/usefulness/empty-types.normal.stderr @@ -95,7 +95,7 @@ LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Result<&u32, &!>` help: you might want to use `let else` to handle the variant that isn't matched | @@ -109,7 +109,7 @@ LL | let Ok(_x) = &res_u32_never; | ^^^^^^ pattern `&Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `&Result<u32, !>` help: you might want to use `let else` to handle the variant that isn't matched | @@ -230,7 +230,7 @@ LL | let Ok(_) = *ptr_result_never_err; | ^^^^^ pattern `Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Result<u8, !>` help: you might want to use `if let` to ignore the variant that isn't matched | diff --git a/tests/ui/pattern/usefulness/irrefutable-unit.rs b/tests/ui/pattern/usefulness/irrefutable-unit.rs index b4e72c0aa2a..9a48b1a8679 100644 --- a/tests/ui/pattern/usefulness/irrefutable-unit.rs +++ b/tests/ui/pattern/usefulness/irrefutable-unit.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let ((),()) = ((),()); diff --git a/tests/ui/pattern/usefulness/issue-31561.stderr b/tests/ui/pattern/usefulness/issue-31561.stderr index cc720565828..ba7ae3fa9a0 100644 --- a/tests/ui/pattern/usefulness/issue-31561.stderr +++ b/tests/ui/pattern/usefulness/issue-31561.stderr @@ -5,7 +5,7 @@ LL | let Thing::Foo(y) = Thing::Foo(1); | ^^^^^^^^^^^^^ patterns `Thing::Bar` and `Thing::Baz` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Thing` defined here --> $DIR/issue-31561.rs:1:6 | diff --git a/tests/ui/pattern/usefulness/nested-exhaustive-match.rs b/tests/ui/pattern/usefulness/nested-exhaustive-match.rs index 51b05c9a111..23782a49b5b 100644 --- a/tests/ui/pattern/usefulness/nested-exhaustive-match.rs +++ b/tests/ui/pattern/usefulness/nested-exhaustive-match.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Foo { foo: bool, bar: Option<isize>, baz: isize } diff --git a/tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs index 1d1ea8e4964..d0a8a10f2f3 100644 --- a/tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs +++ b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs @@ -44,7 +44,7 @@ fn by_val(e: E) { //~^ ERROR refutable pattern in local binding //~| patterns `E::B` and `E::C` not covered //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with - //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html //~| NOTE the matched value is of type `E` } @@ -60,7 +60,7 @@ fn by_ref_once(e: &E) { //~^ ERROR refutable pattern in local binding //~| patterns `&E::B` and `&E::C` not covered //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with - //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html //~| NOTE the matched value is of type `&E` } @@ -76,7 +76,7 @@ fn by_ref_thrice(e: & &mut &E) { //~^ ERROR refutable pattern in local binding //~| patterns `&&mut &E::B` and `&&mut &E::C` not covered //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with - //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html //~| NOTE the matched value is of type `&&mut &E` } @@ -103,7 +103,7 @@ fn ref_pat(e: Opt) { //~| NOTE the matched value is of type `Opt` //~| NOTE pattern `Opt::None` not covered //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with - //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html } fn main() {} diff --git a/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr index a9e55fa53a6..48d7a636055 100644 --- a/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr +++ b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr @@ -29,7 +29,7 @@ LL | let E::A = e; | ^^^^ patterns `E::B` and `E::C` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `E` defined here --> $DIR/non-exhaustive-defined-here.rs:8:6 | @@ -78,7 +78,7 @@ LL | let E::A = e; | ^^^^ patterns `&E::B` and `&E::C` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `E` defined here --> $DIR/non-exhaustive-defined-here.rs:8:6 | @@ -127,7 +127,7 @@ LL | let E::A = e; | ^^^^ patterns `&&mut &E::B` and `&&mut &E::C` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `E` defined here --> $DIR/non-exhaustive-defined-here.rs:8:6 | @@ -173,7 +173,7 @@ LL | let Opt::Some(ref _x) = e; | ^^^^^^^^^^^^^^^^^ pattern `Opt::None` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Opt` defined here --> $DIR/non-exhaustive-defined-here.rs:83:6 | diff --git a/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr index e66cd113023..23a5d895d6c 100644 --- a/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr +++ b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr @@ -13,7 +13,7 @@ LL | let (1, (Some(1), 2..=3)) = (1, (None, 2)); | ^^^^^^^^^^^^^^^^^^^^^ patterns `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `(i32, (Option<i32>, i32))` help: you might want to use `if let` to ignore the variants that aren't matched | diff --git a/tests/ui/print-request/macos-target.rs b/tests/ui/print-request/macos-target.rs index 197edd02474..af74babbed4 100644 --- a/tests/ui/print-request/macos-target.rs +++ b/tests/ui/print-request/macos-target.rs @@ -1,5 +1,6 @@ //@ only-apple //@ compile-flags: --print deployment-target +//@ normalize-stdout-test: "\w*_DEPLOYMENT_TARGET" -> "$$OS_DEPLOYMENT_TARGET" //@ normalize-stdout-test: "\d+\." -> "$$CURRENT_MAJOR_VERSION." //@ normalize-stdout-test: "\d+" -> "$$CURRENT_MINOR_VERSION" //@ check-pass diff --git a/tests/ui/print-request/macos-target.stdout b/tests/ui/print-request/macos-target.stdout index f55ef568ed6..34ade570969 100644 --- a/tests/ui/print-request/macos-target.stdout +++ b/tests/ui/print-request/macos-target.stdout @@ -1 +1 @@ -deployment_target=$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION +$OS_DEPLOYMENT_TARGET=$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION diff --git a/tests/ui/privacy/priv-impl-prim-ty.rs b/tests/ui/privacy/priv-impl-prim-ty.rs index f4c4973f61b..ea1145f3c34 100644 --- a/tests/ui/privacy/priv-impl-prim-ty.rs +++ b/tests/ui/privacy/priv-impl-prim-ty.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:priv-impl-prim-ty.rs -//@ pretty-expanded FIXME #23616 extern crate priv_impl_prim_ty as bar; diff --git a/tests/ui/privacy/privacy-ns.rs b/tests/ui/privacy/privacy-ns.rs index 10d5e722217..ab3d79e40f9 100644 --- a/tests/ui/privacy/privacy-ns.rs +++ b/tests/ui/privacy/privacy-ns.rs @@ -5,7 +5,6 @@ // Check we do the correct privacy checks when we import a name and there is an // item with that name in both the value and type namespaces. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] #![allow(unused_imports)] diff --git a/tests/ui/privacy/privacy-reexport.rs b/tests/ui/privacy/privacy-reexport.rs index df642a57372..74ac7cdce94 100644 --- a/tests/ui/privacy/privacy-reexport.rs +++ b/tests/ui/privacy/privacy-reexport.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:privacy_reexport.rs -//@ pretty-expanded FIXME #23616 extern crate privacy_reexport; diff --git a/tests/ui/privacy/privacy1-rpass.rs b/tests/ui/privacy/privacy1-rpass.rs index 10bc2492bc8..546492c8709 100644 --- a/tests/ui/privacy/privacy1-rpass.rs +++ b/tests/ui/privacy/privacy1-rpass.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub mod test2 { // This used to generate an ICE (make sure that default functions are diff --git a/tests/ui/privacy/private-method-rpass.rs b/tests/ui/privacy/private-method-rpass.rs index 2ec29327d46..f62dd682d2b 100644 --- a/tests/ui/privacy/private-method-rpass.rs +++ b/tests/ui/privacy/private-method-rpass.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct cat { meows : usize, diff --git a/tests/ui/privacy/pub-extern-privacy.rs b/tests/ui/privacy/pub-extern-privacy.rs index dc5e8951bfc..0f9131685b0 100644 --- a/tests/ui/privacy/pub-extern-privacy.rs +++ b/tests/ui/privacy/pub-extern-privacy.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::mem::transmute; diff --git a/tests/ui/privacy/pub-use-xcrate.rs b/tests/ui/privacy/pub-use-xcrate.rs index 96c650d0c68..76891161aed 100644 --- a/tests/ui/privacy/pub-use-xcrate.rs +++ b/tests/ui/privacy/pub-use-xcrate.rs @@ -2,7 +2,6 @@ //@ aux-build:pub_use_xcrate1.rs //@ aux-build:pub_use_xcrate2.rs -//@ pretty-expanded FIXME #23616 extern crate pub_use_xcrate2; diff --git a/tests/ui/privacy/pub_use_mods_xcrate_exe.rs b/tests/ui/privacy/pub_use_mods_xcrate_exe.rs index 12b16c8cec8..f986bfb76e1 100644 --- a/tests/ui/privacy/pub_use_mods_xcrate_exe.rs +++ b/tests/ui/privacy/pub_use_mods_xcrate_exe.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:pub_use_mods_xcrate.rs -//@ pretty-expanded FIXME #23616 #![allow(unused_imports)] diff --git a/tests/ui/proc-macro/add-impl.rs b/tests/ui/proc-macro/add-impl.rs index 7780c39f0c1..2299f05c2e7 100644 --- a/tests/ui/proc-macro/add-impl.rs +++ b/tests/ui/proc-macro/add-impl.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:add-impl.rs +//@ proc-macro: add-impl.rs #[macro_use] extern crate add_impl; diff --git a/tests/ui/proc-macro/allowed-attr-stmt-expr.rs b/tests/ui/proc-macro/allowed-attr-stmt-expr.rs index c5e3ffa1672..10c2d3f9d13 100644 --- a/tests/ui/proc-macro/allowed-attr-stmt-expr.rs +++ b/tests/ui/proc-macro/allowed-attr-stmt-expr.rs @@ -1,5 +1,5 @@ -//@ aux-build:attr-stmt-expr.rs -//@ aux-build:test-macros.rs +//@ proc-macro: attr-stmt-expr.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug //@ check-pass diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs index 3f191cba745..8ee2223822a 100644 --- a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs +++ b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs @@ -1,4 +1,4 @@ -//@ aux-build:builtin-attrs.rs +//@ proc-macro: builtin-attrs.rs //@ compile-flags:--test #![feature(decl_macro, test)] diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs.rs b/tests/ui/proc-macro/ambiguous-builtin-attrs.rs index c82663541a7..edc7748eff3 100644 --- a/tests/ui/proc-macro/ambiguous-builtin-attrs.rs +++ b/tests/ui/proc-macro/ambiguous-builtin-attrs.rs @@ -1,5 +1,5 @@ //@ edition:2018 -//@ aux-build:builtin-attrs.rs +//@ proc-macro: builtin-attrs.rs #![feature(decl_macro)] //~ ERROR `feature` is ambiguous extern crate builtin_attrs; diff --git a/tests/ui/proc-macro/amputate-span.fixed b/tests/ui/proc-macro/amputate-span.fixed index 0fdaf01357c..9742f585d49 100644 --- a/tests/ui/proc-macro/amputate-span.fixed +++ b/tests/ui/proc-macro/amputate-span.fixed @@ -1,4 +1,4 @@ -//@ aux-build:amputate-span.rs +//@ proc-macro: amputate-span.rs //@ run-rustfix //@ edition:2018 //@ compile-flags: --extern amputate_span diff --git a/tests/ui/proc-macro/amputate-span.rs b/tests/ui/proc-macro/amputate-span.rs index 7081660bc29..6cdde46962e 100644 --- a/tests/ui/proc-macro/amputate-span.rs +++ b/tests/ui/proc-macro/amputate-span.rs @@ -1,4 +1,4 @@ -//@ aux-build:amputate-span.rs +//@ proc-macro: amputate-span.rs //@ run-rustfix //@ edition:2018 //@ compile-flags: --extern amputate_span diff --git a/tests/ui/proc-macro/append-impl.rs b/tests/ui/proc-macro/append-impl.rs index f5163e965a0..c0f208460b2 100644 --- a/tests/ui/proc-macro/append-impl.rs +++ b/tests/ui/proc-macro/append-impl.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:append-impl.rs +//@ proc-macro: append-impl.rs #![allow(warnings)] diff --git a/tests/ui/proc-macro/attr-args.rs b/tests/ui/proc-macro/attr-args.rs index ed7e96bcc89..1d3e0f725d2 100644 --- a/tests/ui/proc-macro/attr-args.rs +++ b/tests/ui/proc-macro/attr-args.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:attr-args.rs +//@ proc-macro: attr-args.rs #![allow(warnings)] diff --git a/tests/ui/proc-macro/attr-cfg.rs b/tests/ui/proc-macro/attr-cfg.rs index 4679807ad79..af0c6e1b541 100644 --- a/tests/ui/proc-macro/attr-cfg.rs +++ b/tests/ui/proc-macro/attr-cfg.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:attr-cfg.rs +//@ proc-macro: attr-cfg.rs //@ revisions: foo bar extern crate attr_cfg; diff --git a/tests/ui/proc-macro/attr-complex-fn.rs b/tests/ui/proc-macro/attr-complex-fn.rs index 7baf469d7d0..bf100401a65 100644 --- a/tests/ui/proc-macro/attr-complex-fn.rs +++ b/tests/ui/proc-macro/attr-complex-fn.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug --error-format human -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(stmt_expr_attributes)] #![feature(custom_inner_attributes)] diff --git a/tests/ui/proc-macro/attr-invalid-exprs.rs b/tests/ui/proc-macro/attr-invalid-exprs.rs index ec0b79469a4..f476858a32b 100644 --- a/tests/ui/proc-macro/attr-invalid-exprs.rs +++ b/tests/ui/proc-macro/attr-invalid-exprs.rs @@ -1,6 +1,6 @@ //! Attributes producing expressions in invalid locations -//@ aux-build:attr-stmt-expr.rs +//@ proc-macro: attr-stmt-expr.rs #![feature(proc_macro_hygiene)] #![feature(stmt_expr_attributes)] diff --git a/tests/ui/proc-macro/attr-on-trait.rs b/tests/ui/proc-macro/attr-on-trait.rs index 659b461f759..e95760a837c 100644 --- a/tests/ui/proc-macro/attr-on-trait.rs +++ b/tests/ui/proc-macro/attr-on-trait.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:attr-on-trait.rs +//@ proc-macro: attr-on-trait.rs extern crate attr_on_trait; diff --git a/tests/ui/proc-macro/attr-stmt-expr-rpass.rs b/tests/ui/proc-macro/attr-stmt-expr-rpass.rs index 18e477f0129..c4188bde309 100644 --- a/tests/ui/proc-macro/attr-stmt-expr-rpass.rs +++ b/tests/ui/proc-macro/attr-stmt-expr-rpass.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:attr-stmt-expr-rpass.rs +//@ proc-macro: attr-stmt-expr-rpass.rs #![feature(stmt_expr_attributes, proc_macro_hygiene)] diff --git a/tests/ui/proc-macro/attr-stmt-expr.rs b/tests/ui/proc-macro/attr-stmt-expr.rs index f33c686f284..1ed2bd048e6 100644 --- a/tests/ui/proc-macro/attr-stmt-expr.rs +++ b/tests/ui/proc-macro/attr-stmt-expr.rs @@ -1,5 +1,5 @@ -//@ aux-build:attr-stmt-expr.rs -//@ aux-build:test-macros.rs +//@ proc-macro: attr-stmt-expr.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug #![feature(proc_macro_hygiene)] diff --git a/tests/ui/proc-macro/attribute-after-derive.rs b/tests/ui/proc-macro/attribute-after-derive.rs index 3120b23e97e..f2e2eb12a19 100644 --- a/tests/ui/proc-macro/attribute-after-derive.rs +++ b/tests/ui/proc-macro/attribute-after-derive.rs @@ -3,7 +3,7 @@ //@ check-pass //@ compile-flags: -Z span-debug -//@ aux-build: test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/attribute-spans-preserved.rs b/tests/ui/proc-macro/attribute-spans-preserved.rs index 946b16a0c80..4d5b93797e6 100644 --- a/tests/ui/proc-macro/attribute-spans-preserved.rs +++ b/tests/ui/proc-macro/attribute-spans-preserved.rs @@ -1,4 +1,4 @@ -//@ aux-build:attribute-spans-preserved.rs +//@ proc-macro: attribute-spans-preserved.rs extern crate attribute_spans_preserved as foo; diff --git a/tests/ui/proc-macro/attribute-with-error.rs b/tests/ui/proc-macro/attribute-with-error.rs index 5e81a9c7011..d44d558badd 100644 --- a/tests/ui/proc-macro/attribute-with-error.rs +++ b/tests/ui/proc-macro/attribute-with-error.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(custom_inner_attributes)] diff --git a/tests/ui/proc-macro/attributes-included.rs b/tests/ui/proc-macro/attributes-included.rs index 47fd21fdd24..73d1c1a8f05 100644 --- a/tests/ui/proc-macro/attributes-included.rs +++ b/tests/ui/proc-macro/attributes-included.rs @@ -1,4 +1,4 @@ -//@ aux-build:attributes-included.rs +//@ proc-macro: attributes-included.rs //@ check-pass #![warn(unused)] diff --git a/tests/ui/proc-macro/attributes-on-definitions.rs b/tests/ui/proc-macro/attributes-on-definitions.rs index 187d1be2364..d9700434b51 100644 --- a/tests/ui/proc-macro/attributes-on-definitions.rs +++ b/tests/ui/proc-macro/attributes-on-definitions.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:attributes-on-definitions.rs +//@ proc-macro: attributes-on-definitions.rs #![forbid(unsafe_code)] diff --git a/tests/ui/proc-macro/attributes-on-modules-fail.rs b/tests/ui/proc-macro/attributes-on-modules-fail.rs index 9b2eb703eac..80300b47c5f 100644 --- a/tests/ui/proc-macro/attributes-on-modules-fail.rs +++ b/tests/ui/proc-macro/attributes-on-modules-fail.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/attributes-on-modules.rs b/tests/ui/proc-macro/attributes-on-modules.rs index 26c8d8e113b..f1be7e44a47 100644 --- a/tests/ui/proc-macro/attributes-on-modules.rs +++ b/tests/ui/proc-macro/attributes-on-modules.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/auxiliary/add-impl.rs b/tests/ui/proc-macro/auxiliary/add-impl.rs index 23a86e76ef9..327e6065ef2 100644 --- a/tests/ui/proc-macro/auxiliary/add-impl.rs +++ b/tests/ui/proc-macro/auxiliary/add-impl.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/amputate-span.rs b/tests/ui/proc-macro/auxiliary/amputate-span.rs index c1ab0477ba2..969176eaa67 100644 --- a/tests/ui/proc-macro/auxiliary/amputate-span.rs +++ b/tests/ui/proc-macro/auxiliary/amputate-span.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/api/mod.rs b/tests/ui/proc-macro/auxiliary/api/proc_macro_api_tests.rs index e0a381cb6c1..abd667d8ce1 100644 --- a/tests/ui/proc-macro/auxiliary/api/mod.rs +++ b/tests/ui/proc-macro/auxiliary/api/proc_macro_api_tests.rs @@ -1,9 +1,5 @@ -//@ force-host -//@ no-prefer-dynamic //@ edition: 2021 -#![crate_type = "proc-macro"] -#![crate_name = "proc_macro_api_tests"] #![feature(proc_macro_span)] #![deny(dead_code)] // catch if a test function is never called diff --git a/tests/ui/proc-macro/auxiliary/append-impl.rs b/tests/ui/proc-macro/auxiliary/append-impl.rs index 30657d2738e..e286f01a971 100644 --- a/tests/ui/proc-macro/auxiliary/append-impl.rs +++ b/tests/ui/proc-macro/auxiliary/append-impl.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/assert-span-pos.rs b/tests/ui/proc-macro/auxiliary/assert-span-pos.rs index 8935ce2bc0a..6459d2169a9 100644 --- a/tests/ui/proc-macro/auxiliary/assert-span-pos.rs +++ b/tests/ui/proc-macro/auxiliary/assert-span-pos.rs @@ -1,8 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_diagnostic, proc_macro_span)] -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/attr-args.rs b/tests/ui/proc-macro/auxiliary/attr-args.rs index 1fac41c3721..6a1041603f1 100644 --- a/tests/ui/proc-macro/auxiliary/attr-args.rs +++ b/tests/ui/proc-macro/auxiliary/attr-args.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/attr-cfg.rs b/tests/ui/proc-macro/auxiliary/attr-cfg.rs index 3645128b509..0e625932512 100644 --- a/tests/ui/proc-macro/auxiliary/attr-cfg.rs +++ b/tests/ui/proc-macro/auxiliary/attr-cfg.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/attr-on-trait.rs b/tests/ui/proc-macro/auxiliary/attr-on-trait.rs index c4581359da1..012243febce 100644 --- a/tests/ui/proc-macro/auxiliary/attr-on-trait.rs +++ b/tests/ui/proc-macro/auxiliary/attr-on-trait.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs b/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs index c8b7aa412b5..022f10e5615 100644 --- a/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs +++ b/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs b/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs index 888aab848d4..7efeda16b9c 100644 --- a/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs +++ b/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/attribute-spans-preserved.rs b/tests/ui/proc-macro/auxiliary/attribute-spans-preserved.rs index d06903c2708..76cf959279c 100644 --- a/tests/ui/proc-macro/auxiliary/attribute-spans-preserved.rs +++ b/tests/ui/proc-macro/auxiliary/attribute-spans-preserved.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/attributes-included.rs b/tests/ui/proc-macro/auxiliary/attributes-included.rs index cc29818380b..3a129c8185e 100644 --- a/tests/ui/proc-macro/auxiliary/attributes-included.rs +++ b/tests/ui/proc-macro/auxiliary/attributes-included.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, TokenTree, Delimiter, Literal, Spacing, Group}; diff --git a/tests/ui/proc-macro/auxiliary/attributes-on-definitions.rs b/tests/ui/proc-macro/auxiliary/attributes-on-definitions.rs index c7e6e681da3..ef981ba8500 100644 --- a/tests/ui/proc-macro/auxiliary/attributes-on-definitions.rs +++ b/tests/ui/proc-macro/auxiliary/attributes-on-definitions.rs @@ -1,11 +1,6 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(allow_internal_unsafe)] #![feature(allow_internal_unstable)] -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/bang-macro.rs b/tests/ui/proc-macro/auxiliary/bang-macro.rs index 361643aa8e5..3ac30ab8e32 100644 --- a/tests/ui/proc-macro/auxiliary/bang-macro.rs +++ b/tests/ui/proc-macro/auxiliary/bang-macro.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/bang_proc_macro2.rs b/tests/ui/proc-macro/auxiliary/bang_proc_macro2.rs index 3df2676ddab..7a094c2d477 100644 --- a/tests/ui/proc-macro/auxiliary/bang_proc_macro2.rs +++ b/tests/ui/proc-macro/auxiliary/bang_proc_macro2.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/builtin-attrs.rs b/tests/ui/proc-macro/auxiliary/builtin-attrs.rs index bd634b4f41c..9743ec78c96 100644 --- a/tests/ui/proc-macro/auxiliary/builtin-attrs.rs +++ b/tests/ui/proc-macro/auxiliary/builtin-attrs.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/call-deprecated.rs b/tests/ui/proc-macro/auxiliary/call-deprecated.rs index 8864de17ed3..28919ab29ec 100644 --- a/tests/ui/proc-macro/auxiliary/call-deprecated.rs +++ b/tests/ui/proc-macro/auxiliary/call-deprecated.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/call-site.rs b/tests/ui/proc-macro/auxiliary/call-site.rs index ce0fc70c1a6..8201ec5c48f 100644 --- a/tests/ui/proc-macro/auxiliary/call-site.rs +++ b/tests/ui/proc-macro/auxiliary/call-site.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/cond_plugin.rs b/tests/ui/proc-macro/auxiliary/cond_plugin.rs index c6cdc8ce8ba..9858be230c9 100644 --- a/tests/ui/proc-macro/auxiliary/cond_plugin.rs +++ b/tests/ui/proc-macro/auxiliary/cond_plugin.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/count_compound_ops.rs b/tests/ui/proc-macro/auxiliary/count_compound_ops.rs index 86c27f2d818..c5a1c561976 100644 --- a/tests/ui/proc-macro/auxiliary/count_compound_ops.rs +++ b/tests/ui/proc-macro/auxiliary/count_compound_ops.rs @@ -1,8 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/custom-attr-only-one-derive.rs b/tests/ui/proc-macro/auxiliary/custom-attr-only-one-derive.rs index eab7d903e91..0f50aedcd9e 100644 --- a/tests/ui/proc-macro/auxiliary/custom-attr-only-one-derive.rs +++ b/tests/ui/proc-macro/auxiliary/custom-attr-only-one-derive.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/custom-quote.rs b/tests/ui/proc-macro/auxiliary/custom-quote.rs index 88800596ce5..bccbed8a6b4 100644 --- a/tests/ui/proc-macro/auxiliary/custom-quote.rs +++ b/tests/ui/proc-macro/auxiliary/custom-quote.rs @@ -1,9 +1,6 @@ -//@ force-host -//@ no-prefer-dynamic // ignore-tidy-linelength #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] extern crate proc_macro; use std::iter::FromIterator; diff --git a/tests/ui/proc-macro/auxiliary/derive-a.rs b/tests/ui/proc-macro/auxiliary/derive-a.rs index 50e963a0a41..89d0263c9e2 100644 --- a/tests/ui/proc-macro/auxiliary/derive-a.rs +++ b/tests/ui/proc-macro/auxiliary/derive-a.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-atob.rs b/tests/ui/proc-macro/auxiliary/derive-atob.rs index 8a1f81450fa..0ed62565771 100644 --- a/tests/ui/proc-macro/auxiliary/derive-atob.rs +++ b/tests/ui/proc-macro/auxiliary/derive-atob.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-attr-cfg.rs b/tests/ui/proc-macro/auxiliary/derive-attr-cfg.rs index b9c0b5e6f77..cb60c182a43 100644 --- a/tests/ui/proc-macro/auxiliary/derive-attr-cfg.rs +++ b/tests/ui/proc-macro/auxiliary/derive-attr-cfg.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs b/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs index 82f0b4f19ed..de2935eb9c1 100644 --- a/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs +++ b/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-b.rs b/tests/ui/proc-macro/auxiliary/derive-b.rs index 0b2cf31b059..efdb785c23b 100644 --- a/tests/ui/proc-macro/auxiliary/derive-b.rs +++ b/tests/ui/proc-macro/auxiliary/derive-b.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-bad.rs b/tests/ui/proc-macro/auxiliary/derive-bad.rs index 3fd2bfc4b63..bd25478fb1d 100644 --- a/tests/ui/proc-macro/auxiliary/derive-bad.rs +++ b/tests/ui/proc-macro/auxiliary/derive-bad.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-clona.rs b/tests/ui/proc-macro/auxiliary/derive-clona.rs index 83bcc5b08be..b38bf31dbcc 100644 --- a/tests/ui/proc-macro/auxiliary/derive-clona.rs +++ b/tests/ui/proc-macro/auxiliary/derive-clona.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-ctod.rs b/tests/ui/proc-macro/auxiliary/derive-ctod.rs index 78b1b8615b0..1e08ec61262 100644 --- a/tests/ui/proc-macro/auxiliary/derive-ctod.rs +++ b/tests/ui/proc-macro/auxiliary/derive-ctod.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-foo.rs b/tests/ui/proc-macro/auxiliary/derive-foo.rs index 5c63c3937e4..22fbc4bc54f 100644 --- a/tests/ui/proc-macro/auxiliary/derive-foo.rs +++ b/tests/ui/proc-macro/auxiliary/derive-foo.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-helper-shadowing-2.rs b/tests/ui/proc-macro/auxiliary/derive-helper-shadowing-2.rs index d09ff6cadc5..da474cf5614 100644 --- a/tests/ui/proc-macro/auxiliary/derive-helper-shadowing-2.rs +++ b/tests/ui/proc-macro/auxiliary/derive-helper-shadowing-2.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs b/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs index d1f5b67cf85..32136f79ff2 100644 --- a/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs +++ b/tests/ui/proc-macro/auxiliary/derive-helper-shadowing.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/derive-nothing.rs b/tests/ui/proc-macro/auxiliary/derive-nothing.rs index adf9b4e83fd..eefa2c40ac3 100644 --- a/tests/ui/proc-macro/auxiliary/derive-nothing.rs +++ b/tests/ui/proc-macro/auxiliary/derive-nothing.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-same-struct.rs b/tests/ui/proc-macro/auxiliary/derive-same-struct.rs index bfdd71e9a15..8e7bcb6aaba 100644 --- a/tests/ui/proc-macro/auxiliary/derive-same-struct.rs +++ b/tests/ui/proc-macro/auxiliary/derive-same-struct.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-two-attrs.rs b/tests/ui/proc-macro/auxiliary/derive-two-attrs.rs index 24a88dceb4b..532c72dacff 100644 --- a/tests/ui/proc-macro/auxiliary/derive-two-attrs.rs +++ b/tests/ui/proc-macro/auxiliary/derive-two-attrs.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/derive-union.rs b/tests/ui/proc-macro/auxiliary/derive-union.rs index 8bf7041ebad..da4132604a7 100644 --- a/tests/ui/proc-macro/auxiliary/derive-union.rs +++ b/tests/ui/proc-macro/auxiliary/derive-union.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-unstable-2.rs b/tests/ui/proc-macro/auxiliary/derive-unstable-2.rs index f80a2cfdd99..4bc56efecdb 100644 --- a/tests/ui/proc-macro/auxiliary/derive-unstable-2.rs +++ b/tests/ui/proc-macro/auxiliary/derive-unstable-2.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/derive-unstable.rs b/tests/ui/proc-macro/auxiliary/derive-unstable.rs index c92df49191b..8ba3a06e354 100644 --- a/tests/ui/proc-macro/auxiliary/derive-unstable.rs +++ b/tests/ui/proc-macro/auxiliary/derive-unstable.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/double.rs b/tests/ui/proc-macro/auxiliary/double.rs index ffde0bce245..b6d952437ea 100644 --- a/tests/ui/proc-macro/auxiliary/double.rs +++ b/tests/ui/proc-macro/auxiliary/double.rs @@ -1,10 +1,5 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/duplicate.rs b/tests/ui/proc-macro/auxiliary/duplicate.rs index bcbb1c7474c..0474aed2266 100644 --- a/tests/ui/proc-macro/auxiliary/duplicate.rs +++ b/tests/ui/proc-macro/auxiliary/duplicate.rs @@ -1,8 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic - #![deny(unused)] -#![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/edition-gated-async-move-syntax.rs b/tests/ui/proc-macro/auxiliary/edition-gated-async-move-syntax.rs index da6584e31e5..9347a2e975b 100644 --- a/tests/ui/proc-macro/auxiliary/edition-gated-async-move-syntax.rs +++ b/tests/ui/proc-macro/auxiliary/edition-gated-async-move-syntax.rs @@ -1,12 +1,7 @@ -//@ force-host -//@ no-prefer-dynamic - // Proc macro helper for issue #89699, used by tests/ui/proc-macro/edition-gated-async-move- // syntax-issue89699.rs, emitting an `async move` closure. This syntax is only available in // editions 2018 and up, but is used in edition 2015 in the test. -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/edition-imports-2015.rs b/tests/ui/proc-macro/auxiliary/edition-imports-2015.rs index c33736a74a7..6d584f4e6ab 100644 --- a/tests/ui/proc-macro/auxiliary/edition-imports-2015.rs +++ b/tests/ui/proc-macro/auxiliary/edition-imports-2015.rs @@ -1,8 +1,4 @@ //@ edition:2015 -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/empty-crate.rs b/tests/ui/proc-macro/auxiliary/empty-crate.rs index c502cd921cc..5e15112a9cb 100644 --- a/tests/ui/proc-macro/auxiliary/empty-crate.rs +++ b/tests/ui/proc-macro/auxiliary/empty-crate.rs @@ -1,5 +1 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![deny(unused_variables)] diff --git a/tests/ui/proc-macro/auxiliary/env.rs b/tests/ui/proc-macro/auxiliary/env.rs index da9aaa5cb56..d01e3b42d4c 100644 --- a/tests/ui/proc-macro/auxiliary/env.rs +++ b/tests/ui/proc-macro/auxiliary/env.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_tracked_env)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/expand-expr.rs b/tests/ui/proc-macro/auxiliary/expand-expr.rs index 68d0843be5a..78c9fa75d9f 100644 --- a/tests/ui/proc-macro/auxiliary/expand-expr.rs +++ b/tests/ui/proc-macro/auxiliary/expand-expr.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![deny(warnings)] #![feature(proc_macro_expand, proc_macro_span)] diff --git a/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs b/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs index 9096fd71397..c6281a42d2a 100644 --- a/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs +++ b/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![deny(warnings)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/first-second.rs b/tests/ui/proc-macro/auxiliary/first-second.rs index c8c1defa9f1..110d054add7 100644 --- a/tests/ui/proc-macro/auxiliary/first-second.rs +++ b/tests/ui/proc-macro/auxiliary/first-second.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, TokenTree, Group, Delimiter}; diff --git a/tests/ui/proc-macro/auxiliary/gen-lifetime-token.rs b/tests/ui/proc-macro/auxiliary/gen-lifetime-token.rs index fb05c97833c..b0728b8a0b8 100644 --- a/tests/ui/proc-macro/auxiliary/gen-lifetime-token.rs +++ b/tests/ui/proc-macro/auxiliary/gen-lifetime-token.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/gen-macro-rules-hygiene.rs b/tests/ui/proc-macro/auxiliary/gen-macro-rules-hygiene.rs index 9d6767dc11f..40ecf4ef704 100644 --- a/tests/ui/proc-macro/auxiliary/gen-macro-rules-hygiene.rs +++ b/tests/ui/proc-macro/auxiliary/gen-macro-rules-hygiene.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/gen-macro-rules.rs b/tests/ui/proc-macro/auxiliary/gen-macro-rules.rs index d2f82c52c58..855cb1d7095 100644 --- a/tests/ui/proc-macro/auxiliary/gen-macro-rules.rs +++ b/tests/ui/proc-macro/auxiliary/gen-macro-rules.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs b/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs index 855084be84d..28d35c82148 100644 --- a/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs +++ b/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs @@ -1,8 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/generate-mod.rs b/tests/ui/proc-macro/auxiliary/generate-mod.rs index 2ef1faffaa6..62710bd1e2d 100644 --- a/tests/ui/proc-macro/auxiliary/generate-mod.rs +++ b/tests/ui/proc-macro/auxiliary/generate-mod.rs @@ -1,10 +1,6 @@ //@ run-pass -//@ force-host -//@ no-prefer-dynamic //@ ignore-pass -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/helper-attr.rs b/tests/ui/proc-macro/auxiliary/helper-attr.rs index 79ccefd9844..ee2968688f9 100644 --- a/tests/ui/proc-macro/auxiliary/helper-attr.rs +++ b/tests/ui/proc-macro/auxiliary/helper-attr.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; // Doesn't do anything, but has a helper attribute. diff --git a/tests/ui/proc-macro/auxiliary/hygiene_example.rs b/tests/ui/proc-macro/auxiliary/hygiene_example.rs index f7e7e0b5751..b690dbfaae7 100644 --- a/tests/ui/proc-macro/auxiliary/hygiene_example.rs +++ b/tests/ui/proc-macro/auxiliary/hygiene_example.rs @@ -1,3 +1,5 @@ +//@ proc-macro: hygiene_example_codegen.rs + extern crate hygiene_example_codegen; pub use hygiene_example_codegen::hello; diff --git a/tests/ui/proc-macro/auxiliary/hygiene_example_codegen.rs b/tests/ui/proc-macro/auxiliary/hygiene_example_codegen.rs index e324e3f3129..dde997bf3ea 100644 --- a/tests/ui/proc-macro/auxiliary/hygiene_example_codegen.rs +++ b/tests/ui/proc-macro/auxiliary/hygiene_example_codegen.rs @@ -1,8 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] extern crate proc_macro as proc_macro_renamed; // This does not break `quote!` diff --git a/tests/ui/proc-macro/auxiliary/invalid-punct-ident.rs b/tests/ui/proc-macro/auxiliary/invalid-punct-ident.rs index 19b3632dc3f..47d06086467 100644 --- a/tests/ui/proc-macro/auxiliary/invalid-punct-ident.rs +++ b/tests/ui/proc-macro/auxiliary/invalid-punct-ident.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_raw_ident)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/is-available.rs b/tests/ui/proc-macro/auxiliary/is-available.rs index f1d0e3c78f5..1eeffa50913 100644 --- a/tests/ui/proc-macro/auxiliary/is-available.rs +++ b/tests/ui/proc-macro/auxiliary/is-available.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{Literal, TokenStream, TokenTree}; diff --git a/tests/ui/proc-macro/auxiliary/issue-104884.rs b/tests/ui/proc-macro/auxiliary/issue-104884.rs index 55d0d76ad18..64922d997b6 100644 --- a/tests/ui/proc-macro/auxiliary/issue-104884.rs +++ b/tests/ui/proc-macro/auxiliary/issue-104884.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-107113.rs b/tests/ui/proc-macro/auxiliary/issue-107113.rs index 5662277acce..f7c2c856435 100644 --- a/tests/ui/proc-macro/auxiliary/issue-107113.rs +++ b/tests/ui/proc-macro/auxiliary/issue-107113.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-118809.rs b/tests/ui/proc-macro/auxiliary/issue-118809.rs index f662f623b19..2751b16b6b5 100644 --- a/tests/ui/proc-macro/auxiliary/issue-118809.rs +++ b/tests/ui/proc-macro/auxiliary/issue-118809.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-38586.rs b/tests/ui/proc-macro/auxiliary/issue-38586.rs index e2bba3e13d1..7e30ba371d1 100644 --- a/tests/ui/proc-macro/auxiliary/issue-38586.rs +++ b/tests/ui/proc-macro/auxiliary/issue-38586.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; #[proc_macro_derive(A)] diff --git a/tests/ui/proc-macro/auxiliary/issue-39889.rs b/tests/ui/proc-macro/auxiliary/issue-39889.rs index b1659d6168e..e4975fddd4c 100644 --- a/tests/ui/proc-macro/auxiliary/issue-39889.rs +++ b/tests/ui/proc-macro/auxiliary/issue-39889.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-42708.rs b/tests/ui/proc-macro/auxiliary/issue-42708.rs index ed5ba530341..c055409ba06 100644 --- a/tests/ui/proc-macro/auxiliary/issue-42708.rs +++ b/tests/ui/proc-macro/auxiliary/issue-42708.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-50061.rs b/tests/ui/proc-macro/auxiliary/issue-50061.rs index 9ecbb383d4b..9137a78f530 100644 --- a/tests/ui/proc-macro/auxiliary/issue-50061.rs +++ b/tests/ui/proc-macro/auxiliary/issue-50061.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-50493.rs b/tests/ui/proc-macro/auxiliary/issue-50493.rs index e9ad8600533..22bf1428e56 100644 --- a/tests/ui/proc-macro/auxiliary/issue-50493.rs +++ b/tests/ui/proc-macro/auxiliary/issue-50493.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-59191.rs b/tests/ui/proc-macro/auxiliary/issue-59191.rs index 40ba0063e43..84b156d61e5 100644 --- a/tests/ui/proc-macro/auxiliary/issue-59191.rs +++ b/tests/ui/proc-macro/auxiliary/issue-59191.rs @@ -1,8 +1,4 @@ //@ edition:2018 -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-66286.rs b/tests/ui/proc-macro/auxiliary/issue-66286.rs index d224dcda590..a317e68a3d7 100644 --- a/tests/ui/proc-macro/auxiliary/issue-66286.rs +++ b/tests/ui/proc-macro/auxiliary/issue-66286.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-75801.rs b/tests/ui/proc-macro/auxiliary/issue-75801.rs index bd553b7ab84..f1554f0fe75 100644 --- a/tests/ui/proc-macro/auxiliary/issue-75801.rs +++ b/tests/ui/proc-macro/auxiliary/issue-75801.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-79242.rs b/tests/ui/proc-macro/auxiliary/issue-79242.rs index 7b24e5a2ef2..165318d67b0 100644 --- a/tests/ui/proc-macro/auxiliary/issue-79242.rs +++ b/tests/ui/proc-macro/auxiliary/issue-79242.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-79825.rs b/tests/ui/proc-macro/auxiliary/issue-79825.rs index 4326712458b..912a3c2147c 100644 --- a/tests/ui/proc-macro/auxiliary/issue-79825.rs +++ b/tests/ui/proc-macro/auxiliary/issue-79825.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-83510.rs b/tests/ui/proc-macro/auxiliary/issue-83510.rs index 6e8e2d1f780..50bdd36607d 100644 --- a/tests/ui/proc-macro/auxiliary/issue-83510.rs +++ b/tests/ui/proc-macro/auxiliary/issue-83510.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/issue-91800-macro.rs b/tests/ui/proc-macro/auxiliary/issue-91800-macro.rs index a638a33cf25..e6f91a52de5 100644 --- a/tests/ui/proc-macro/auxiliary/issue-91800-macro.rs +++ b/tests/ui/proc-macro/auxiliary/issue-91800-macro.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/lifetimes-rpass.rs b/tests/ui/proc-macro/auxiliary/lifetimes-rpass.rs index 4f605ed07b3..d487d8f989c 100644 --- a/tests/ui/proc-macro/auxiliary/lifetimes-rpass.rs +++ b/tests/ui/proc-macro/auxiliary/lifetimes-rpass.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/lifetimes.rs b/tests/ui/proc-macro/auxiliary/lifetimes.rs index 79885a92f68..5d7ebecf832 100644 --- a/tests/ui/proc-macro/auxiliary/lifetimes.rs +++ b/tests/ui/proc-macro/auxiliary/lifetimes.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs b/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs index 501a03985cb..4971de284b7 100644 --- a/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs +++ b/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs @@ -1,6 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - // These are tests for syntax that is accepted by the Rust parser but // unconditionally rejected semantically after macro expansion. Attribute macros // are permitted to accept such syntax as long as they replace it with something @@ -9,7 +6,6 @@ // We also inspect some of the spans to verify the syntax is not triggering the // lossy string reparse hack (https://github.com/rust-lang/rust/issues/43081). -#![crate_type = "proc-macro"] #![feature(proc_macro_span)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/macro_rules_edition_pm.rs b/tests/ui/proc-macro/auxiliary/macro_rules_edition_pm.rs new file mode 100644 index 00000000000..fb244d09d9c --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/macro_rules_edition_pm.rs @@ -0,0 +1,37 @@ +extern crate proc_macro; + +use proc_macro::TokenStream; + +#[proc_macro] +pub fn make_edition_macro(_input: TokenStream) -> TokenStream { + "macro_rules! edition { + ($_:expr) => { + 2024 + }; + (const {}) => { + 2021 + }; + } + " + .parse() + .unwrap() +} + +#[proc_macro] +pub fn make_nested_edition_macro(_input: TokenStream) -> TokenStream { + "macro_rules! make_inner { + () => { + macro_rules! edition_inner { + ($_:expr) => { + 2024 + }; + (const {}) => { + 2021 + }; + } + }; + } + " + .parse() + .unwrap() +} diff --git a/tests/ui/proc-macro/auxiliary/meta-macro.rs b/tests/ui/proc-macro/auxiliary/meta-macro.rs index cbe882c173f..3436b1944d0 100644 --- a/tests/ui/proc-macro/auxiliary/meta-macro.rs +++ b/tests/ui/proc-macro/auxiliary/meta-macro.rs @@ -1,9 +1,6 @@ -//@ force-host -//@ no-prefer-dynamic //@ edition:2018 #![feature(proc_macro_def_site)] -#![crate_type = "proc-macro"] extern crate proc_macro; extern crate make_macro; diff --git a/tests/ui/proc-macro/auxiliary/mixed-site-span.rs b/tests/ui/proc-macro/auxiliary/mixed-site-span.rs index c143e2d40f3..d837c88c955 100644 --- a/tests/ui/proc-macro/auxiliary/mixed-site-span.rs +++ b/tests/ui/proc-macro/auxiliary/mixed-site-span.rs @@ -1,10 +1,5 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/modify-ast.rs b/tests/ui/proc-macro/auxiliary/modify-ast.rs index 174c588e8bf..389b0968814 100644 --- a/tests/ui/proc-macro/auxiliary/modify-ast.rs +++ b/tests/ui/proc-macro/auxiliary/modify-ast.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/multiple-derives.rs b/tests/ui/proc-macro/auxiliary/multiple-derives.rs index 84a826cf1f6..6f03f0a08f0 100644 --- a/tests/ui/proc-macro/auxiliary/multiple-derives.rs +++ b/tests/ui/proc-macro/auxiliary/multiple-derives.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/multispan.rs b/tests/ui/proc-macro/auxiliary/multispan.rs index b5f1ed9b56a..1eb379d3877 100644 --- a/tests/ui/proc-macro/auxiliary/multispan.rs +++ b/tests/ui/proc-macro/auxiliary/multispan.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/negative-token.rs b/tests/ui/proc-macro/auxiliary/negative-token.rs index 43355bfd20b..d3731c1c8cc 100644 --- a/tests/ui/proc-macro/auxiliary/negative-token.rs +++ b/tests/ui/proc-macro/auxiliary/negative-token.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/nonterminal-recollect-attr.rs b/tests/ui/proc-macro/auxiliary/nonterminal-recollect-attr.rs index 48ae3600192..96aed8625aa 100644 --- a/tests/ui/proc-macro/auxiliary/nonterminal-recollect-attr.rs +++ b/tests/ui/proc-macro/auxiliary/nonterminal-recollect-attr.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/not-joint.rs b/tests/ui/proc-macro/auxiliary/not-joint.rs index 5f94805361a..bc15ced0566 100644 --- a/tests/ui/proc-macro/auxiliary/not-joint.rs +++ b/tests/ui/proc-macro/auxiliary/not-joint.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/parent-source-spans.rs b/tests/ui/proc-macro/auxiliary/parent-source-spans.rs index 3ec92d71332..257d1489ce2 100644 --- a/tests/ui/proc-macro/auxiliary/parent-source-spans.rs +++ b/tests/ui/proc-macro/auxiliary/parent-source-spans.rs @@ -1,8 +1,4 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_diagnostic, proc_macro_span)] -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs b/tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs index 07e135ee8eb..2b77b45565a 100644 --- a/tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs +++ b/tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/print-tokens.rs b/tests/ui/proc-macro/auxiliary/print-tokens.rs index 6d25f1f8471..171ff6e61fb 100644 --- a/tests/ui/proc-macro/auxiliary/print-tokens.rs +++ b/tests/ui/proc-macro/auxiliary/print-tokens.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, TokenTree}; diff --git a/tests/ui/proc-macro/auxiliary/proc-macro-panic.rs b/tests/ui/proc-macro/auxiliary/proc-macro-panic.rs index cfd6464661e..8506c9f0de0 100644 --- a/tests/ui/proc-macro/auxiliary/proc-macro-panic.rs +++ b/tests/ui/proc-macro/auxiliary/proc-macro-panic.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, Ident, Span}; diff --git a/tests/ui/proc-macro/auxiliary/raw-ident.rs b/tests/ui/proc-macro/auxiliary/raw-ident.rs index 1fec6179756..7fd73dd97ba 100644 --- a/tests/ui/proc-macro/auxiliary/raw-ident.rs +++ b/tests/ui/proc-macro/auxiliary/raw-ident.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, TokenTree, Ident, Punct, Spacing, Span}; diff --git a/tests/ui/proc-macro/auxiliary/re-export.rs b/tests/ui/proc-macro/auxiliary/re-export.rs index a886015a031..ae88e2f3e11 100644 --- a/tests/ui/proc-macro/auxiliary/re-export.rs +++ b/tests/ui/proc-macro/auxiliary/re-export.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/recollect.rs b/tests/ui/proc-macro/auxiliary/recollect.rs index 7db29035f71..439f37c8832 100644 --- a/tests/ui/proc-macro/auxiliary/recollect.rs +++ b/tests/ui/proc-macro/auxiliary/recollect.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/proc-macro/auxiliary/resolved-located-at.rs b/tests/ui/proc-macro/auxiliary/resolved-located-at.rs index 032d41688af..493956c00e9 100644 --- a/tests/ui/proc-macro/auxiliary/resolved-located-at.rs +++ b/tests/ui/proc-macro/auxiliary/resolved-located-at.rs @@ -1,10 +1,6 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_def_site)] #![feature(proc_macro_diagnostic)] #![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/proc-macro/auxiliary/span-api-tests.rs b/tests/ui/proc-macro/auxiliary/span-api-tests.rs index 16640a32098..99db66ed6a9 100644 --- a/tests/ui/proc-macro/auxiliary/span-api-tests.rs +++ b/tests/ui/proc-macro/auxiliary/span-api-tests.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_span)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs b/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs index fdcca29e177..16ca5e3f9e2 100644 --- a/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs +++ b/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs @@ -1,9 +1,5 @@ -//@ force-host -//@ no-prefer-dynamic - #![feature(proc_macro_quote)] #![feature(proc_macro_internals)] // FIXME - this shouldn't be necessary -#![crate_type = "proc-macro"] extern crate proc_macro; extern crate custom_quote; diff --git a/tests/ui/proc-macro/auxiliary/subspan.rs b/tests/ui/proc-macro/auxiliary/subspan.rs index 69a9c8a9fa8..edfb053d6f1 100644 --- a/tests/ui/proc-macro/auxiliary/subspan.rs +++ b/tests/ui/proc-macro/auxiliary/subspan.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_diagnostic, proc_macro_span)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/test-macros.rs b/tests/ui/proc-macro/auxiliary/test-macros.rs index 69a89e94cd6..8375767d6fb 100644 --- a/tests/ui/proc-macro/auxiliary/test-macros.rs +++ b/tests/ui/proc-macro/auxiliary/test-macros.rs @@ -1,11 +1,6 @@ -//@ force-host -//@ no-prefer-dynamic - // Proc macros commonly used by tests. // `panic`/`print` -> `panic_bang`/`print_bang` to avoid conflicts with standard macros. -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, TokenTree}; diff --git a/tests/ui/proc-macro/auxiliary/three-equals.rs b/tests/ui/proc-macro/auxiliary/three-equals.rs index f0ff0437a8b..56cfd4a2828 100644 --- a/tests/ui/proc-macro/auxiliary/three-equals.rs +++ b/tests/ui/proc-macro/auxiliary/three-equals.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)] extern crate proc_macro; diff --git a/tests/ui/proc-macro/auxiliary/weird-hygiene.rs b/tests/ui/proc-macro/auxiliary/weird-hygiene.rs index f401f7d55ba..c37eed360f0 100644 --- a/tests/ui/proc-macro/auxiliary/weird-hygiene.rs +++ b/tests/ui/proc-macro/auxiliary/weird-hygiene.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{TokenStream, TokenTree, Group}; diff --git a/tests/ui/proc-macro/bang-macro.rs b/tests/ui/proc-macro/bang-macro.rs index 03d4174d652..2287e34c5dd 100644 --- a/tests/ui/proc-macro/bang-macro.rs +++ b/tests/ui/proc-macro/bang-macro.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:bang-macro.rs +//@ proc-macro: bang-macro.rs extern crate bang_macro; use bang_macro::rewrite; diff --git a/tests/ui/proc-macro/break-token-spans.rs b/tests/ui/proc-macro/break-token-spans.rs index ae90e04e081..efbd0c0d7e2 100644 --- a/tests/ui/proc-macro/break-token-spans.rs +++ b/tests/ui/proc-macro/break-token-spans.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs // Regression test for issues #68489 and #70987 // Tests that we properly break tokens in `probably_equal_for_proc_macro` // See #72306 diff --git a/tests/ui/proc-macro/call-deprecated.rs b/tests/ui/proc-macro/call-deprecated.rs index 1779e33f3b1..fc9354331cc 100644 --- a/tests/ui/proc-macro/call-deprecated.rs +++ b/tests/ui/proc-macro/call-deprecated.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:call-deprecated.rs +//@ proc-macro: call-deprecated.rs extern crate call_deprecated; diff --git a/tests/ui/proc-macro/call-site.rs b/tests/ui/proc-macro/call-site.rs index 31fa78902d5..9c285e1ed11 100644 --- a/tests/ui/proc-macro/call-site.rs +++ b/tests/ui/proc-macro/call-site.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:call-site.rs +//@ proc-macro: call-site.rs extern crate call_site; diff --git a/tests/ui/proc-macro/capture-macro-rules-invoke.rs b/tests/ui/proc-macro/capture-macro-rules-invoke.rs index 71a290c1fc0..101461854c4 100644 --- a/tests/ui/proc-macro/capture-macro-rules-invoke.rs +++ b/tests/ui/proc-macro/capture-macro-rules-invoke.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ check-pass //@ compile-flags: -Z span-debug diff --git a/tests/ui/proc-macro/capture-unglued-token.rs b/tests/ui/proc-macro/capture-unglued-token.rs index 32286ed084c..586fb934931 100644 --- a/tests/ui/proc-macro/capture-unglued-token.rs +++ b/tests/ui/proc-macro/capture-unglued-token.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug //@ check-pass diff --git a/tests/ui/proc-macro/cfg-eval-inner.rs b/tests/ui/proc-macro/cfg-eval-inner.rs index d0a6c1afa23..7493f3ea523 100644 --- a/tests/ui/proc-macro/cfg-eval-inner.rs +++ b/tests/ui/proc-macro/cfg-eval-inner.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ check-pass #![feature(cfg_eval)] diff --git a/tests/ui/proc-macro/cfg-eval.rs b/tests/ui/proc-macro/cfg-eval.rs index bbf11949e7e..1d9b4f23ea5 100644 --- a/tests/ui/proc-macro/cfg-eval.rs +++ b/tests/ui/proc-macro/cfg-eval.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(cfg_eval)] #![feature(proc_macro_hygiene)] diff --git a/tests/ui/proc-macro/count_compound_ops.rs b/tests/ui/proc-macro/count_compound_ops.rs index e58c36e047d..20b0b87817e 100644 --- a/tests/ui/proc-macro/count_compound_ops.rs +++ b/tests/ui/proc-macro/count_compound_ops.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:count_compound_ops.rs +//@ proc-macro: count_compound_ops.rs extern crate count_compound_ops; use count_compound_ops::count_compound_ops; diff --git a/tests/ui/proc-macro/crate-attrs-multiple.rs b/tests/ui/proc-macro/crate-attrs-multiple.rs index 24f46b0a2fa..ebd14590a21 100644 --- a/tests/ui/proc-macro/crate-attrs-multiple.rs +++ b/tests/ui/proc-macro/crate-attrs-multiple.rs @@ -1,7 +1,7 @@ // Multiple custom crate-level attributes, both inert and active. //@ check-pass -//@ aux-crate:test_macros=test-macros.rs +//@ proc-macro: test-macros.rs #![feature(custom_inner_attributes)] #![feature(prelude_import)] diff --git a/tests/ui/proc-macro/crate-var.rs b/tests/ui/proc-macro/crate-var.rs index 7388ca68358..cea5d48e080 100644 --- a/tests/ui/proc-macro/crate-var.rs +++ b/tests/ui/proc-macro/crate-var.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:double.rs +//@ proc-macro: double.rs //@ aux-build:external-crate-var.rs #![allow(unused)] diff --git a/tests/ui/proc-macro/custom-attr-only-one-derive.rs b/tests/ui/proc-macro/custom-attr-only-one-derive.rs index 2616c122a65..f0e82f36757 100644 --- a/tests/ui/proc-macro/custom-attr-only-one-derive.rs +++ b/tests/ui/proc-macro/custom-attr-only-one-derive.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:custom-attr-only-one-derive.rs +//@ proc-macro: custom-attr-only-one-derive.rs #[macro_use] extern crate custom_attr_only_one_derive; diff --git a/tests/ui/proc-macro/custom-attr-panic.rs b/tests/ui/proc-macro/custom-attr-panic.rs index 23bcb66319d..560af228c2a 100644 --- a/tests/ui/proc-macro/custom-attr-panic.rs +++ b/tests/ui/proc-macro/custom-attr-panic.rs @@ -1,4 +1,4 @@ -//@ aux-build: test-macros.rs +//@ proc-macro: test-macros.rs extern crate test_macros; diff --git a/tests/ui/proc-macro/debug/auxiliary/macro-dump-debug.rs b/tests/ui/proc-macro/debug/auxiliary/macro-dump-debug.rs index 2d7bff83681..1e261ea3213 100644 --- a/tests/ui/proc-macro/debug/auxiliary/macro-dump-debug.rs +++ b/tests/ui/proc-macro/debug/auxiliary/macro-dump-debug.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] #![crate_name = "macro_dump_debug"] extern crate proc_macro; diff --git a/tests/ui/proc-macro/debug/dump-debug-span-debug.rs b/tests/ui/proc-macro/debug/dump-debug-span-debug.rs index d4d9199bf3b..618e13c0f15 100644 --- a/tests/ui/proc-macro/debug/dump-debug-span-debug.rs +++ b/tests/ui/proc-macro/debug/dump-debug-span-debug.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:macro-dump-debug.rs +//@ proc-macro: macro-dump-debug.rs //@ compile-flags: -Z span-debug diff --git a/tests/ui/proc-macro/debug/dump-debug.rs b/tests/ui/proc-macro/debug/dump-debug.rs index 7a5cc979df9..b20cd2dc948 100644 --- a/tests/ui/proc-macro/debug/dump-debug.rs +++ b/tests/ui/proc-macro/debug/dump-debug.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:macro-dump-debug.rs +//@ proc-macro: macro-dump-debug.rs extern crate macro_dump_debug; use macro_dump_debug::dump_debug; diff --git a/tests/ui/proc-macro/debug/dump-debug.stderr b/tests/ui/proc-macro/debug/dump-debug.stderr index 6aefacacd00..abcbfbfd5ec 100644 --- a/tests/ui/proc-macro/debug/dump-debug.stderr +++ b/tests/ui/proc-macro/debug/dump-debug.stderr @@ -1,166 +1,166 @@ -TokenStream [Ident { ident: "ident", span: #0 bytes(132..137) }, Ident { ident: "r#ident", span: #0 bytes(153..160) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(178..179) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(205..206) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(206..207) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(207..208) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(232..234) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(260..261) }], span: #0 bytes(259..262) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(317..318) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(323..326) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(331..334) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(339..343) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(348..352) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(357..365) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(370..376) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(381..391) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(396..399) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(404..408) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(439..441) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(446..450) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(455..459) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(464..469) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(474..479) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(484..493) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(498..505) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(510..521) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(526..530) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(535..540) }] +TokenStream [Ident { ident: "ident", span: #0 bytes(134..139) }, Ident { ident: "r#ident", span: #0 bytes(155..162) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(180..181) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(207..208) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(208..209) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(209..210) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(234..236) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(262..263) }], span: #0 bytes(261..264) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(319..320) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(325..328) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(333..336) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(341..345) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(350..354) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(359..367) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(372..378) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(383..393) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(398..401) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(406..410) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(441..443) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(448..452) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(457..461) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(466..471) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(476..481) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(486..495) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(500..507) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(512..523) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(528..532) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(537..542) }] TokenStream [ Ident { ident: "ident", - span: #0 bytes(132..137), + span: #0 bytes(134..139), }, Ident { ident: "r#ident", - span: #0 bytes(153..160), + span: #0 bytes(155..162), }, Punct { ch: ',', spacing: Alone, - span: #0 bytes(178..179), + span: #0 bytes(180..181), }, Punct { ch: '=', spacing: Joint, - span: #0 bytes(205..206), + span: #0 bytes(207..208), }, Punct { ch: '=', spacing: Joint, - span: #0 bytes(206..207), + span: #0 bytes(208..209), }, Punct { ch: '>', spacing: Alone, - span: #0 bytes(207..208), + span: #0 bytes(209..210), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: #0 bytes(232..234), + span: #0 bytes(234..236), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "_", - span: #0 bytes(260..261), + span: #0 bytes(262..263), }, ], - span: #0 bytes(259..262), + span: #0 bytes(261..264), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #0 bytes(317..318), + span: #0 bytes(319..320), }, Literal { kind: Float, symbol: "1.0", suffix: None, - span: #0 bytes(323..326), + span: #0 bytes(325..328), }, Literal { kind: Str, symbol: "S", suffix: None, - span: #0 bytes(331..334), + span: #0 bytes(333..336), }, Literal { kind: ByteStr, symbol: "B", suffix: None, - span: #0 bytes(339..343), + span: #0 bytes(341..345), }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, - span: #0 bytes(348..352), + span: #0 bytes(350..354), }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, - span: #0 bytes(357..365), + span: #0 bytes(359..367), }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, - span: #0 bytes(370..376), + span: #0 bytes(372..378), }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, - span: #0 bytes(381..391), + span: #0 bytes(383..393), }, Literal { kind: Char, symbol: "C", suffix: None, - span: #0 bytes(396..399), + span: #0 bytes(398..401), }, Literal { kind: Byte, symbol: "B", suffix: None, - span: #0 bytes(404..408), + span: #0 bytes(406..410), }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), - span: #0 bytes(439..441), + span: #0 bytes(441..443), }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), - span: #0 bytes(446..450), + span: #0 bytes(448..452), }, Literal { kind: Str, symbol: "S", suffix: Some("q"), - span: #0 bytes(455..459), + span: #0 bytes(457..461), }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), - span: #0 bytes(464..469), + span: #0 bytes(466..471), }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), - span: #0 bytes(474..479), + span: #0 bytes(476..481), }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), - span: #0 bytes(484..493), + span: #0 bytes(486..495), }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), - span: #0 bytes(498..505), + span: #0 bytes(500..507), }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), - span: #0 bytes(510..521), + span: #0 bytes(512..523), }, Literal { kind: Char, symbol: "C", suffix: Some("q"), - span: #0 bytes(526..530), + span: #0 bytes(528..532), }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), - span: #0 bytes(535..540), + span: #0 bytes(537..542), }, ] diff --git a/tests/ui/proc-macro/derive-attr-cfg.rs b/tests/ui/proc-macro/derive-attr-cfg.rs index 162be0754d9..2f3516cabae 100644 --- a/tests/ui/proc-macro/derive-attr-cfg.rs +++ b/tests/ui/proc-macro/derive-attr-cfg.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(dead_code)] -//@ aux-build:derive-attr-cfg.rs +//@ proc-macro: derive-attr-cfg.rs extern crate derive_attr_cfg; use derive_attr_cfg::Foo; diff --git a/tests/ui/proc-macro/derive-b.rs b/tests/ui/proc-macro/derive-b.rs index 6cbe1fd0a3f..68d341478f1 100644 --- a/tests/ui/proc-macro/derive-b.rs +++ b/tests/ui/proc-macro/derive-b.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:derive-b-rpass.rs +//@ proc-macro: derive-b-rpass.rs extern crate derive_b_rpass as derive_b; diff --git a/tests/ui/proc-macro/derive-bad.rs b/tests/ui/proc-macro/derive-bad.rs index c8f3a77ea4c..9b237c731db 100644 --- a/tests/ui/proc-macro/derive-bad.rs +++ b/tests/ui/proc-macro/derive-bad.rs @@ -1,4 +1,4 @@ -//@ aux-build:derive-bad.rs +//@ proc-macro: derive-bad.rs #[macro_use] extern crate derive_bad; diff --git a/tests/ui/proc-macro/derive-expand-order.rs b/tests/ui/proc-macro/derive-expand-order.rs index 75981f16a7f..076590bdb4c 100644 --- a/tests/ui/proc-macro/derive-expand-order.rs +++ b/tests/ui/proc-macro/derive-expand-order.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:multiple-derives.rs +//@ proc-macro: multiple-derives.rs extern crate multiple_derives; diff --git a/tests/ui/proc-macro/derive-helper-configured.rs b/tests/ui/proc-macro/derive-helper-configured.rs index 45e6e64d392..b753e29b8bf 100644 --- a/tests/ui/proc-macro/derive-helper-configured.rs +++ b/tests/ui/proc-macro/derive-helper-configured.rs @@ -1,7 +1,7 @@ // Derive helpers are resolved successfully inside `cfg_attr`. //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/derive-helper-legacy-limits.rs b/tests/ui/proc-macro/derive-helper-legacy-limits.rs index ff09095a60f..76b09f33ecc 100644 --- a/tests/ui/proc-macro/derive-helper-legacy-limits.rs +++ b/tests/ui/proc-macro/derive-helper-legacy-limits.rs @@ -2,7 +2,7 @@ // (that's exactly the reason why they are deprecated). //@ edition:2018 -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/derive-helper-legacy-spurious.rs b/tests/ui/proc-macro/derive-helper-legacy-spurious.rs index 2b5bb905e83..8e902f30419 100644 --- a/tests/ui/proc-macro/derive-helper-legacy-spurious.rs +++ b/tests/ui/proc-macro/derive-helper-legacy-spurious.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![dummy] //~ ERROR cannot find attribute `dummy` in this scope diff --git a/tests/ui/proc-macro/derive-helper-shadowed.rs b/tests/ui/proc-macro/derive-helper-shadowed.rs index 9b2a4ab6bc7..ea2c56b0b73 100644 --- a/tests/ui/proc-macro/derive-helper-shadowed.rs +++ b/tests/ui/proc-macro/derive-helper-shadowed.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ aux-build:derive-helper-shadowed-2.rs #[macro_use] diff --git a/tests/ui/proc-macro/derive-helper-shadowing-2.rs b/tests/ui/proc-macro/derive-helper-shadowing-2.rs index dc35dd05498..6aba061acf3 100644 --- a/tests/ui/proc-macro/derive-helper-shadowing-2.rs +++ b/tests/ui/proc-macro/derive-helper-shadowing-2.rs @@ -2,7 +2,7 @@ // then make sure that it's usable without ambiguities. //@ check-pass -//@ aux-build:derive-helper-shadowing-2.rs +//@ proc-macro: derive-helper-shadowing-2.rs #[macro_use] extern crate derive_helper_shadowing_2; diff --git a/tests/ui/proc-macro/derive-helper-shadowing.rs b/tests/ui/proc-macro/derive-helper-shadowing.rs index 1c66a60b294..e774e464053 100644 --- a/tests/ui/proc-macro/derive-helper-shadowing.rs +++ b/tests/ui/proc-macro/derive-helper-shadowing.rs @@ -1,6 +1,6 @@ //@ edition:2018 -//@ aux-build:test-macros.rs -//@ aux-build:derive-helper-shadowing.rs +//@ proc-macro: test-macros.rs +//@ proc-macro: derive-helper-shadowing.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/derive-helper-vs-legacy.rs b/tests/ui/proc-macro/derive-helper-vs-legacy.rs index feae7adda68..83917a2fbf7 100644 --- a/tests/ui/proc-macro/derive-helper-vs-legacy.rs +++ b/tests/ui/proc-macro/derive-helper-vs-legacy.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/derive-in-mod.rs b/tests/ui/proc-macro/derive-in-mod.rs index 3bd70f1090d..7ec7cf62fb4 100644 --- a/tests/ui/proc-macro/derive-in-mod.rs +++ b/tests/ui/proc-macro/derive-in-mod.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs extern crate test_macros; diff --git a/tests/ui/proc-macro/derive-same-struct.rs b/tests/ui/proc-macro/derive-same-struct.rs index 432476d1ebb..f7669ba1480 100644 --- a/tests/ui/proc-macro/derive-same-struct.rs +++ b/tests/ui/proc-macro/derive-same-struct.rs @@ -2,7 +2,7 @@ #![allow(path_statements)] #![allow(dead_code)] -//@ aux-build:derive-same-struct.rs +//@ proc-macro: derive-same-struct.rs #[macro_use] extern crate derive_same_struct; diff --git a/tests/ui/proc-macro/derive-still-gated.rs b/tests/ui/proc-macro/derive-still-gated.rs index bce7badeffe..518ed9d51be 100644 --- a/tests/ui/proc-macro/derive-still-gated.rs +++ b/tests/ui/proc-macro/derive-still-gated.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/derive-two-attrs.rs b/tests/ui/proc-macro/derive-two-attrs.rs index 91116097665..33a8fef2ac7 100644 --- a/tests/ui/proc-macro/derive-two-attrs.rs +++ b/tests/ui/proc-macro/derive-two-attrs.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(dead_code)] -//@ aux-build:derive-two-attrs.rs +//@ proc-macro: derive-two-attrs.rs extern crate derive_two_attrs as foo; diff --git a/tests/ui/proc-macro/derive-union.rs b/tests/ui/proc-macro/derive-union.rs index d1e65bf4595..e0fe9dee85c 100644 --- a/tests/ui/proc-macro/derive-union.rs +++ b/tests/ui/proc-macro/derive-union.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_variables)] -//@ aux-build:derive-union.rs +//@ proc-macro: derive-union.rs #[macro_use] extern crate derive_union; diff --git a/tests/ui/proc-macro/disappearing-resolution.rs b/tests/ui/proc-macro/disappearing-resolution.rs index b8bc2953576..8e7fa85eba1 100644 --- a/tests/ui/proc-macro/disappearing-resolution.rs +++ b/tests/ui/proc-macro/disappearing-resolution.rs @@ -1,6 +1,6 @@ // Regression test for issue #64803 (initial attribute resolution can disappear later). -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/disappearing-resolution.stderr b/tests/ui/proc-macro/disappearing-resolution.stderr index e6d0868687e..e66f721444f 100644 --- a/tests/ui/proc-macro/disappearing-resolution.stderr +++ b/tests/ui/proc-macro/disappearing-resolution.stderr @@ -16,7 +16,7 @@ note: the derive macro import `Empty` is defined here... LL | use test_macros::Empty; | ^^^^^^^^^^^^^^^^^^ note: ...and refers to the derive macro `Empty` which is defined here - --> $DIR/auxiliary/test-macros.rs:25:1 + --> $DIR/auxiliary/test-macros.rs:20:1 | LL | pub fn empty_derive(_: TokenStream) -> TokenStream { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ you could import this directly diff --git a/tests/ui/proc-macro/doc-comment-preserved.rs b/tests/ui/proc-macro/doc-comment-preserved.rs index f0891e7d6a7..a4bfd105d36 100644 --- a/tests/ui/proc-macro/doc-comment-preserved.rs +++ b/tests/ui/proc-macro/doc-comment-preserved.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/dollar-crate-issue-101211.rs b/tests/ui/proc-macro/dollar-crate-issue-101211.rs index fd5768dc7d1..ca871d57a69 100644 --- a/tests/ui/proc-macro/dollar-crate-issue-101211.rs +++ b/tests/ui/proc-macro/dollar-crate-issue-101211.rs @@ -1,6 +1,6 @@ //@ check-pass //@ edition:2021 -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/dollar-crate-issue-57089.rs b/tests/ui/proc-macro/dollar-crate-issue-57089.rs index d4540643e02..52f41b78375 100644 --- a/tests/ui/proc-macro/dollar-crate-issue-57089.rs +++ b/tests/ui/proc-macro/dollar-crate-issue-57089.rs @@ -1,7 +1,7 @@ //@ check-pass //@ edition:2018 //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/dollar-crate-issue-62325.rs b/tests/ui/proc-macro/dollar-crate-issue-62325.rs index ee2e0c3973d..716bf6790fe 100644 --- a/tests/ui/proc-macro/dollar-crate-issue-62325.rs +++ b/tests/ui/proc-macro/dollar-crate-issue-62325.rs @@ -1,7 +1,7 @@ //@ check-pass //@ edition:2018 //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ aux-build:dollar-crate-external.rs diff --git a/tests/ui/proc-macro/dollar-crate.rs b/tests/ui/proc-macro/dollar-crate.rs index a487e77a833..0d13bbd8967 100644 --- a/tests/ui/proc-macro/dollar-crate.rs +++ b/tests/ui/proc-macro/dollar-crate.rs @@ -1,7 +1,7 @@ //@ check-pass //@ edition:2018 //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ aux-build:dollar-crate-external.rs #![no_std] // Don't load unnecessary hygiene information from std diff --git a/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs index 0f302708537..e4878a93af1 100644 --- a/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs +++ b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs @@ -1,4 +1,4 @@ -//@ aux-build:edition-gated-async-move-syntax.rs +//@ proc-macro: edition-gated-async-move-syntax.rs //@ edition: 2015 // Non-regression test for issue #89699, where a proc-macro emitting syntax only available in diff --git a/tests/ui/proc-macro/edition-imports-2018.rs b/tests/ui/proc-macro/edition-imports-2018.rs index de05868ebf9..a3808d9dce8 100644 --- a/tests/ui/proc-macro/edition-imports-2018.rs +++ b/tests/ui/proc-macro/edition-imports-2018.rs @@ -1,6 +1,6 @@ //@ check-pass //@ edition:2018 -//@ aux-build:edition-imports-2015.rs +//@ proc-macro: edition-imports-2015.rs #[macro_use] extern crate edition_imports_2015; diff --git a/tests/ui/proc-macro/empty-crate.rs b/tests/ui/proc-macro/empty-crate.rs index ba4de590e63..f82660ac4fd 100644 --- a/tests/ui/proc-macro/empty-crate.rs +++ b/tests/ui/proc-macro/empty-crate.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_imports)] -//@ aux-build:empty-crate.rs +//@ proc-macro: empty-crate.rs #[macro_use] extern crate empty_crate; diff --git a/tests/ui/proc-macro/empty-where-clause.rs b/tests/ui/proc-macro/empty-where-clause.rs index 4e432934e3c..770b44515f9 100644 --- a/tests/ui/proc-macro/empty-where-clause.rs +++ b/tests/ui/proc-macro/empty-where-clause.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs extern crate test_macros; use test_macros::recollect_attr; diff --git a/tests/ui/proc-macro/env.rs b/tests/ui/proc-macro/env.rs index 85bcf4521fe..94e3b09e526 100644 --- a/tests/ui/proc-macro/env.rs +++ b/tests/ui/proc-macro/env.rs @@ -1,4 +1,4 @@ -//@ aux-build:env.rs +//@ proc-macro: env.rs //@ run-pass //@ rustc-env: THE_CONST=1 //@ compile-flags: -Zunstable-options --env-set THE_CONST=12 --env-set ANOTHER=4 diff --git a/tests/ui/proc-macro/expand-expr.rs b/tests/ui/proc-macro/expand-expr.rs index e06ddc51a29..8a4ed9768d5 100644 --- a/tests/ui/proc-macro/expand-expr.rs +++ b/tests/ui/proc-macro/expand-expr.rs @@ -1,4 +1,4 @@ -//@ aux-build:expand-expr.rs +//@ proc-macro: expand-expr.rs // no-remap-src-base: check_expand_expr_file!() fails when enabled. #![feature(concat_bytes)] diff --git a/tests/ui/proc-macro/expand-to-derive.rs b/tests/ui/proc-macro/expand-to-derive.rs index 0b603cd4bcc..0e38e471980 100644 --- a/tests/ui/proc-macro/expand-to-derive.rs +++ b/tests/ui/proc-macro/expand-to-derive.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug --error-format human -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(rustc_attrs)] diff --git a/tests/ui/proc-macro/expand-to-unstable.rs b/tests/ui/proc-macro/expand-to-unstable.rs index c4eaba6bba2..8968471ebd8 100644 --- a/tests/ui/proc-macro/expand-to-unstable.rs +++ b/tests/ui/proc-macro/expand-to-unstable.rs @@ -1,4 +1,4 @@ -//@ aux-build:derive-unstable.rs +//@ proc-macro: derive-unstable.rs #![allow(warnings)] diff --git a/tests/ui/proc-macro/expand-with-a-macro.rs b/tests/ui/proc-macro/expand-with-a-macro.rs index fcaafbbc149..e5baf3601db 100644 --- a/tests/ui/proc-macro/expand-with-a-macro.rs +++ b/tests/ui/proc-macro/expand-with-a-macro.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-unwind -//@ aux-build:expand-with-a-macro.rs +//@ proc-macro: expand-with-a-macro.rs #![deny(warnings)] diff --git a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.rs b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.rs index 0b34b07edbe..6f31c07ff89 100644 --- a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.rs +++ b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(decl_macro)] #![feature(stmt_expr_attributes)] diff --git a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout index 0168689b605..7555ef8f632 100644 --- a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout +++ b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout @@ -2,39 +2,39 @@ PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = #[allow(warnings)] 0; 0 }, PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #3 bytes(301..305), + span: #3 bytes(303..307), }, Ident { ident: "E", - span: #3 bytes(306..307), + span: #3 bytes(308..309), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #3 bytes(322..323), + span: #3 bytes(324..325), }, Punct { ch: '=', spacing: Alone, - span: #3 bytes(324..325), + span: #3 bytes(326..327), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #3 bytes(328..331), + span: #3 bytes(330..333), }, Ident { ident: "_", - span: #3 bytes(332..333), + span: #3 bytes(334..335), }, Punct { ch: '=', spacing: Alone, - span: #3 bytes(334..335), + span: #3 bytes(336..337), }, Group { delimiter: None, @@ -42,97 +42,97 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: #0 bytes(543..544), + span: #0 bytes(545..546), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "allow", - span: #0 bytes(545..550), + span: #0 bytes(547..552), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "warnings", - span: #0 bytes(551..559), + span: #0 bytes(553..561), }, ], - span: #0 bytes(550..560), + span: #0 bytes(552..562), }, ], - span: #0 bytes(544..561), + span: #0 bytes(546..563), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #0 bytes(562..563), + span: #0 bytes(564..565), }, ], - span: #3 bytes(336..341), + span: #3 bytes(338..343), }, Punct { ch: ';', spacing: Alone, - span: #3 bytes(341..342), + span: #3 bytes(343..344), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #3 bytes(343..344), + span: #3 bytes(345..346), }, ], - span: #3 bytes(326..346), + span: #3 bytes(328..348), }, Punct { ch: ',', spacing: Alone, - span: #3 bytes(346..347), + span: #3 bytes(348..349), }, ], - span: #3 bytes(308..357), + span: #3 bytes(310..359), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 }; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #7 bytes(425..429), + span: #7 bytes(427..431), }, Ident { ident: "E", - span: #7 bytes(430..431), + span: #7 bytes(432..433), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #7 bytes(446..447), + span: #7 bytes(448..449), }, Punct { ch: '=', spacing: Alone, - span: #7 bytes(448..449), + span: #7 bytes(450..451), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #7 bytes(452..455), + span: #7 bytes(454..457), }, Ident { ident: "_", - span: #7 bytes(456..457), + span: #7 bytes(458..459), }, Punct { ch: '=', spacing: Alone, - span: #7 bytes(458..459), + span: #7 bytes(460..461), }, Group { delimiter: Brace, @@ -144,74 +144,74 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "0", suffix: None, - span: #0 bytes(580..581), + span: #0 bytes(582..583), }, ], - span: #7 bytes(462..467), + span: #7 bytes(464..469), }, ], - span: #7 bytes(460..469), + span: #7 bytes(462..471), }, Punct { ch: ';', spacing: Alone, - span: #7 bytes(469..470), + span: #7 bytes(471..472), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #7 bytes(471..472), + span: #7 bytes(473..474), }, ], - span: #7 bytes(450..474), + span: #7 bytes(452..476), }, Punct { ch: ',', spacing: Alone, - span: #7 bytes(474..475), + span: #7 bytes(476..477), }, ], - span: #7 bytes(432..485), + span: #7 bytes(434..487), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { {} }; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #11 bytes(425..429), + span: #11 bytes(427..431), }, Ident { ident: "E", - span: #11 bytes(430..431), + span: #11 bytes(432..433), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #11 bytes(446..447), + span: #11 bytes(448..449), }, Punct { ch: '=', spacing: Alone, - span: #11 bytes(448..449), + span: #11 bytes(450..451), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #11 bytes(452..455), + span: #11 bytes(454..457), }, Ident { ident: "_", - span: #11 bytes(456..457), + span: #11 bytes(458..459), }, Punct { ch: '=', spacing: Alone, - span: #11 bytes(458..459), + span: #11 bytes(460..461), }, Group { delimiter: Brace, @@ -222,74 +222,74 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Group { delimiter: Brace, stream: TokenStream [], - span: #0 bytes(598..600), + span: #0 bytes(600..602), }, ], - span: #11 bytes(462..467), + span: #11 bytes(464..469), }, ], - span: #11 bytes(460..469), + span: #11 bytes(462..471), }, Punct { ch: ';', spacing: Alone, - span: #11 bytes(469..470), + span: #11 bytes(471..472), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #11 bytes(471..472), + span: #11 bytes(473..474), }, ], - span: #11 bytes(450..474), + span: #11 bytes(452..476), }, Punct { ch: ',', spacing: Alone, - span: #11 bytes(474..475), + span: #11 bytes(476..477), }, ], - span: #11 bytes(432..485), + span: #11 bytes(434..487), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH }; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #15 bytes(425..429), + span: #15 bytes(427..431), }, Ident { ident: "E", - span: #15 bytes(430..431), + span: #15 bytes(432..433), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #15 bytes(446..447), + span: #15 bytes(448..449), }, Punct { ch: '=', spacing: Alone, - span: #15 bytes(448..449), + span: #15 bytes(450..451), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #15 bytes(452..455), + span: #15 bytes(454..457), }, Ident { ident: "_", - span: #15 bytes(456..457), + span: #15 bytes(458..459), }, Punct { ch: '=', spacing: Alone, - span: #15 bytes(458..459), + span: #15 bytes(460..461), }, Group { delimiter: Brace, @@ -299,74 +299,74 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ stream: TokenStream [ Ident { ident: "PATH", - span: #0 bytes(617..621), + span: #0 bytes(619..623), }, ], - span: #15 bytes(462..467), + span: #15 bytes(464..469), }, ], - span: #15 bytes(460..469), + span: #15 bytes(462..471), }, Punct { ch: ';', spacing: Alone, - span: #15 bytes(469..470), + span: #15 bytes(471..472), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #15 bytes(471..472), + span: #15 bytes(473..474), }, ], - span: #15 bytes(450..474), + span: #15 bytes(452..476), }, Punct { ch: ',', spacing: Alone, - span: #15 bytes(474..475), + span: #15 bytes(476..477), }, ], - span: #15 bytes(432..485), + span: #15 bytes(434..487), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 + 1 }; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #19 bytes(425..429), + span: #19 bytes(427..431), }, Ident { ident: "E", - span: #19 bytes(430..431), + span: #19 bytes(432..433), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #19 bytes(446..447), + span: #19 bytes(448..449), }, Punct { ch: '=', spacing: Alone, - span: #19 bytes(448..449), + span: #19 bytes(450..451), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #19 bytes(452..455), + span: #19 bytes(454..457), }, Ident { ident: "_", - span: #19 bytes(456..457), + span: #19 bytes(458..459), }, Punct { ch: '=', spacing: Alone, - span: #19 bytes(458..459), + span: #19 bytes(460..461), }, Group { delimiter: Brace, @@ -378,85 +378,85 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "0", suffix: None, - span: #0 bytes(638..639), + span: #0 bytes(640..641), }, Punct { ch: '+', spacing: Alone, - span: #0 bytes(640..641), + span: #0 bytes(642..643), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: #0 bytes(642..643), + span: #0 bytes(644..645), }, ], - span: #19 bytes(462..467), + span: #19 bytes(464..469), }, ], - span: #19 bytes(460..469), + span: #19 bytes(462..471), }, Punct { ch: ';', spacing: Alone, - span: #19 bytes(469..470), + span: #19 bytes(471..472), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #19 bytes(471..472), + span: #19 bytes(473..474), }, ], - span: #19 bytes(450..474), + span: #19 bytes(452..476), }, Punct { ch: ',', spacing: Alone, - span: #19 bytes(474..475), + span: #19 bytes(476..477), }, ], - span: #19 bytes(432..485), + span: #19 bytes(434..487), }, ] PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH + 1 }; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #23 bytes(425..429), + span: #23 bytes(427..431), }, Ident { ident: "E", - span: #23 bytes(430..431), + span: #23 bytes(432..433), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "V", - span: #23 bytes(446..447), + span: #23 bytes(448..449), }, Punct { ch: '=', spacing: Alone, - span: #23 bytes(448..449), + span: #23 bytes(450..451), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "let", - span: #23 bytes(452..455), + span: #23 bytes(454..457), }, Ident { ident: "_", - span: #23 bytes(456..457), + span: #23 bytes(458..459), }, Punct { ch: '=', spacing: Alone, - span: #23 bytes(458..459), + span: #23 bytes(460..461), }, Group { delimiter: Brace, @@ -466,45 +466,45 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ stream: TokenStream [ Ident { ident: "PATH", - span: #0 bytes(660..664), + span: #0 bytes(662..666), }, Punct { ch: '+', spacing: Alone, - span: #0 bytes(665..666), + span: #0 bytes(667..668), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: #0 bytes(667..668), + span: #0 bytes(669..670), }, ], - span: #23 bytes(462..467), + span: #23 bytes(464..469), }, ], - span: #23 bytes(460..469), + span: #23 bytes(462..471), }, Punct { ch: ';', spacing: Alone, - span: #23 bytes(469..470), + span: #23 bytes(471..472), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #23 bytes(471..472), + span: #23 bytes(473..474), }, ], - span: #23 bytes(450..474), + span: #23 bytes(452..476), }, Punct { ch: ',', spacing: Alone, - span: #23 bytes(474..475), + span: #23 bytes(476..477), }, ], - span: #23 bytes(432..485), + span: #23 bytes(434..487), }, ] diff --git a/tests/ui/proc-macro/gen-lifetime-token.rs b/tests/ui/proc-macro/gen-lifetime-token.rs index d65efb5c464..4296d58df0d 100644 --- a/tests/ui/proc-macro/gen-lifetime-token.rs +++ b/tests/ui/proc-macro/gen-lifetime-token.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:gen-lifetime-token.rs +//@ proc-macro: gen-lifetime-token.rs extern crate gen_lifetime_token as bar; diff --git a/tests/ui/proc-macro/gen-macro-rules-hygiene.rs b/tests/ui/proc-macro/gen-macro-rules-hygiene.rs index 2bfbf9dccca..3deec94fa34 100644 --- a/tests/ui/proc-macro/gen-macro-rules-hygiene.rs +++ b/tests/ui/proc-macro/gen-macro-rules-hygiene.rs @@ -2,7 +2,7 @@ // Local variables and labels are hygienic, items are not hygienic. // `$crate` refers to the crate that defines `macro_rules` and not the outer transparent macro. -//@ aux-build:gen-macro-rules-hygiene.rs +//@ proc-macro: gen-macro-rules-hygiene.rs #[macro_use] extern crate gen_macro_rules_hygiene; diff --git a/tests/ui/proc-macro/gen-macro-rules.rs b/tests/ui/proc-macro/gen-macro-rules.rs index 5f2cfc70d8e..121d029e2e3 100644 --- a/tests/ui/proc-macro/gen-macro-rules.rs +++ b/tests/ui/proc-macro/gen-macro-rules.rs @@ -1,7 +1,7 @@ // Derive macros can generate `macro_rules` items, regression test for issue #63651. //@ check-pass -//@ aux-build:gen-macro-rules.rs +//@ proc-macro: gen-macro-rules.rs extern crate gen_macro_rules as repro; diff --git a/tests/ui/proc-macro/generate-dollar-ident.rs b/tests/ui/proc-macro/generate-dollar-ident.rs index c087a206566..54e872fefb6 100644 --- a/tests/ui/proc-macro/generate-dollar-ident.rs +++ b/tests/ui/proc-macro/generate-dollar-ident.rs @@ -2,7 +2,7 @@ // without it being recognized as an unknown macro variable. //@ check-pass -//@ aux-build:generate-dollar-ident.rs +//@ proc-macro: generate-dollar-ident.rs extern crate generate_dollar_ident; use generate_dollar_ident::*; diff --git a/tests/ui/proc-macro/generate-mod.rs b/tests/ui/proc-macro/generate-mod.rs index ab93666f28a..729bfc1db66 100644 --- a/tests/ui/proc-macro/generate-mod.rs +++ b/tests/ui/proc-macro/generate-mod.rs @@ -1,6 +1,6 @@ // Modules generated by transparent proc macros still acts as barriers for names (issue #50504). -//@ aux-build:generate-mod.rs +//@ proc-macro: generate-mod.rs extern crate generate_mod; diff --git a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs index 03bb04b7786..1197dd7f3bf 100644 --- a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs +++ b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use(Empty)] extern crate test_macros; diff --git a/tests/ui/proc-macro/helper-attr-blocked-by-import.rs b/tests/ui/proc-macro/helper-attr-blocked-by-import.rs index 03c30783411..53c079fd19c 100644 --- a/tests/ui/proc-macro/helper-attr-blocked-by-import.rs +++ b/tests/ui/proc-macro/helper-attr-blocked-by-import.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use(Empty)] extern crate test_macros; diff --git a/tests/ui/proc-macro/helper-attr-builtin-derive.rs b/tests/ui/proc-macro/helper-attr-builtin-derive.rs index eb7292e093c..7d36e055c14 100644 --- a/tests/ui/proc-macro/helper-attr-builtin-derive.rs +++ b/tests/ui/proc-macro/helper-attr-builtin-derive.rs @@ -2,7 +2,7 @@ // other built-in derive macros. // issue: rust-lang/rust#132561 //@ check-pass -//@ aux-build:helper-attr.rs +//@ proc-macro: helper-attr.rs //@ edition:2021 #[macro_use] diff --git a/tests/ui/proc-macro/hygiene_example.rs b/tests/ui/proc-macro/hygiene_example.rs index 6c3e1067436..84b5e345608 100644 --- a/tests/ui/proc-macro/hygiene_example.rs +++ b/tests/ui/proc-macro/hygiene_example.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ aux-build:hygiene_example_codegen.rs //@ aux-build:hygiene_example.rs extern crate hygiene_example; diff --git a/tests/ui/proc-macro/import.rs b/tests/ui/proc-macro/import.rs index 53dc0f4cbed..44a37dad5c5 100644 --- a/tests/ui/proc-macro/import.rs +++ b/tests/ui/proc-macro/import.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs extern crate test_macros; diff --git a/tests/ui/proc-macro/inert-attribute-order.rs b/tests/ui/proc-macro/inert-attribute-order.rs index bca4df96040..5a4eae03594 100644 --- a/tests/ui/proc-macro/inert-attribute-order.rs +++ b/tests/ui/proc-macro/inert-attribute-order.rs @@ -2,7 +2,7 @@ //@ check-pass //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/inner-attr-non-inline-mod.rs b/tests/ui/proc-macro/inner-attr-non-inline-mod.rs index df006a4d7a9..714463b6225 100644 --- a/tests/ui/proc-macro/inner-attr-non-inline-mod.rs +++ b/tests/ui/proc-macro/inner-attr-non-inline-mod.rs @@ -2,7 +2,7 @@ //@ error-pattern:custom inner attributes are unstable //@ error-pattern:inner macro attributes are unstable //@ error-pattern:this was previously accepted -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/inner-attrs.rs b/tests/ui/proc-macro/inner-attrs.rs index 45bb4d3c5bf..34c37ddfac3 100644 --- a/tests/ui/proc-macro/inner-attrs.rs +++ b/tests/ui/proc-macro/inner-attrs.rs @@ -1,7 +1,7 @@ // gate-test-custom_inner_attributes //@ compile-flags: -Z span-debug --error-format human //@ error-pattern:expected non-macro inner attribute -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ edition:2018 #![feature(custom_inner_attributes)] diff --git a/tests/ui/proc-macro/input-interpolated.rs b/tests/ui/proc-macro/input-interpolated.rs index d84572a6afe..a20fe72c6d5 100644 --- a/tests/ui/proc-macro/input-interpolated.rs +++ b/tests/ui/proc-macro/input-interpolated.rs @@ -2,7 +2,7 @@ //@ check-pass //@ edition:2018 -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/input-interpolated.stdout b/tests/ui/proc-macro/input-interpolated.stdout index 1bccd8806be..b567292ea9a 100644 --- a/tests/ui/proc-macro/input-interpolated.stdout +++ b/tests/ui/proc-macro/input-interpolated.stdout @@ -2,58 +2,58 @@ PRINT-BANG INPUT (DISPLAY): A PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "A", - span: #0 bytes(506..507), + span: #0 bytes(508..509), }, ] PRINT-ATTR INPUT (DISPLAY): const A : u8 = 0; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "const", - span: #3 bytes(419..424), + span: #3 bytes(421..426), }, Ident { ident: "A", - span: #0 bytes(506..507), + span: #0 bytes(508..509), }, Punct { ch: ':', spacing: Alone, - span: #3 bytes(427..428), + span: #3 bytes(429..430), }, Ident { ident: "u8", - span: #3 bytes(429..431), + span: #3 bytes(431..433), }, Punct { ch: '=', spacing: Alone, - span: #3 bytes(432..433), + span: #3 bytes(434..435), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #3 bytes(434..435), + span: #3 bytes(436..437), }, Punct { ch: ';', spacing: Alone, - span: #3 bytes(435..436), + span: #3 bytes(437..438), }, ] PRINT-DERIVE INPUT (DISPLAY): struct A {} PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #3 bytes(471..477), + span: #3 bytes(473..479), }, Ident { ident: "A", - span: #0 bytes(506..507), + span: #0 bytes(508..509), }, Group { delimiter: Brace, stream: TokenStream [], - span: #3 bytes(481..483), + span: #3 bytes(483..485), }, ] diff --git a/tests/ui/proc-macro/invalid-punct-ident-1.rs b/tests/ui/proc-macro/invalid-punct-ident-1.rs index b0f163adc02..e7306a7e8ba 100644 --- a/tests/ui/proc-macro/invalid-punct-ident-1.rs +++ b/tests/ui/proc-macro/invalid-punct-ident-1.rs @@ -1,4 +1,4 @@ -//@ aux-build:invalid-punct-ident.rs +//@ proc-macro: invalid-punct-ident.rs //@ needs-unwind proc macro panics to report errors #[macro_use] diff --git a/tests/ui/proc-macro/invalid-punct-ident-2.rs b/tests/ui/proc-macro/invalid-punct-ident-2.rs index b1f7f570d3f..14656652e1d 100644 --- a/tests/ui/proc-macro/invalid-punct-ident-2.rs +++ b/tests/ui/proc-macro/invalid-punct-ident-2.rs @@ -1,4 +1,4 @@ -//@ aux-build:invalid-punct-ident.rs +//@ proc-macro: invalid-punct-ident.rs //@ needs-unwind proc macro panics to report errors #[macro_use] diff --git a/tests/ui/proc-macro/invalid-punct-ident-3.rs b/tests/ui/proc-macro/invalid-punct-ident-3.rs index 7698d2c4b39..266e8d3d925 100644 --- a/tests/ui/proc-macro/invalid-punct-ident-3.rs +++ b/tests/ui/proc-macro/invalid-punct-ident-3.rs @@ -1,4 +1,4 @@ -//@ aux-build:invalid-punct-ident.rs +//@ proc-macro: invalid-punct-ident.rs //@ needs-unwind proc macro panics to report errors #[macro_use] diff --git a/tests/ui/proc-macro/invalid-punct-ident-4.rs b/tests/ui/proc-macro/invalid-punct-ident-4.rs index 042fe6c600d..dbffddd1585 100644 --- a/tests/ui/proc-macro/invalid-punct-ident-4.rs +++ b/tests/ui/proc-macro/invalid-punct-ident-4.rs @@ -1,4 +1,4 @@ -//@ aux-build:invalid-punct-ident.rs +//@ proc-macro: invalid-punct-ident.rs //@ needs-unwind proc macro panics to report errors #[macro_use] diff --git a/tests/ui/proc-macro/is-available.rs b/tests/ui/proc-macro/is-available.rs index 36fd44b266f..faee560d7a9 100644 --- a/tests/ui/proc-macro/is-available.rs +++ b/tests/ui/proc-macro/is-available.rs @@ -2,7 +2,7 @@ extern crate proc_macro; -//@ aux-build:is-available.rs +//@ proc-macro: is-available.rs extern crate is_available; fn main() { diff --git a/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs b/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs index 29793e9f734..abdd6bf136d 100644 --- a/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs +++ b/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-104884.rs +//@ proc-macro: issue-104884.rs use std::collections::BinaryHeap; diff --git a/tests/ui/proc-macro/issue-107113-wrap.rs b/tests/ui/proc-macro/issue-107113-wrap.rs index 01bf3615acf..2799e79bb1c 100644 --- a/tests/ui/proc-macro/issue-107113-wrap.rs +++ b/tests/ui/proc-macro/issue-107113-wrap.rs @@ -1,5 +1,5 @@ //@ edition:2021 -//@ aux-build:issue-107113.rs +//@ proc-macro: issue-107113.rs #[macro_use] extern crate issue_107113; diff --git a/tests/ui/proc-macro/issue-118809.rs b/tests/ui/proc-macro/issue-118809.rs index 770b19e8172..a6a3956981a 100644 --- a/tests/ui/proc-macro/issue-118809.rs +++ b/tests/ui/proc-macro/issue-118809.rs @@ -1,4 +1,4 @@ -//@ aux-build: issue-118809.rs +//@ proc-macro: issue-118809.rs #[macro_use] extern crate issue_118809; diff --git a/tests/ui/proc-macro/issue-36935.rs b/tests/ui/proc-macro/issue-36935.rs index eb019d1e174..51d85c7dfa9 100644 --- a/tests/ui/proc-macro/issue-36935.rs +++ b/tests/ui/proc-macro/issue-36935.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ needs-unwind proc macro panics to report errors #[macro_use] diff --git a/tests/ui/proc-macro/issue-37788.rs b/tests/ui/proc-macro/issue-37788.rs index c32ab6b8116..b44525b3b20 100644 --- a/tests/ui/proc-macro/issue-37788.rs +++ b/tests/ui/proc-macro/issue-37788.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/issue-38586.rs b/tests/ui/proc-macro/issue-38586.rs index 54d5d1038a6..88dbb8037be 100644 --- a/tests/ui/proc-macro/issue-38586.rs +++ b/tests/ui/proc-macro/issue-38586.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-38586.rs +//@ proc-macro: issue-38586.rs #[macro_use] extern crate issue_38586; diff --git a/tests/ui/proc-macro/issue-39889.rs b/tests/ui/proc-macro/issue-39889.rs index 687aefbc068..a10fa02e14a 100644 --- a/tests/ui/proc-macro/issue-39889.rs +++ b/tests/ui/proc-macro/issue-39889.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(dead_code, unused_macros)] -//@ aux-build:issue-39889.rs +//@ proc-macro: issue-39889.rs extern crate issue_39889; use issue_39889::Issue39889; diff --git a/tests/ui/proc-macro/issue-42708.rs b/tests/ui/proc-macro/issue-42708.rs index 27cb2f73d56..9eb616008de 100644 --- a/tests/ui/proc-macro/issue-42708.rs +++ b/tests/ui/proc-macro/issue-42708.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:issue-42708.rs +//@ proc-macro: issue-42708.rs #![feature(decl_macro)] #![allow(unused)] diff --git a/tests/ui/proc-macro/issue-50061.rs b/tests/ui/proc-macro/issue-50061.rs index 34999bb5070..8a660c2f350 100644 --- a/tests/ui/proc-macro/issue-50061.rs +++ b/tests/ui/proc-macro/issue-50061.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(path_statements)] -//@ aux-build:issue-50061.rs +//@ proc-macro: issue-50061.rs #![feature(decl_macro)] diff --git a/tests/ui/proc-macro/issue-50493.rs b/tests/ui/proc-macro/issue-50493.rs index 5456eddb78d..e23f1f7c7d8 100644 --- a/tests/ui/proc-macro/issue-50493.rs +++ b/tests/ui/proc-macro/issue-50493.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-50493.rs +//@ proc-macro: issue-50493.rs #[macro_use] extern crate issue_50493; diff --git a/tests/ui/proc-macro/issue-53481.rs b/tests/ui/proc-macro/issue-53481.rs index 636b8e0c0ae..11e11e2e6b6 100644 --- a/tests/ui/proc-macro/issue-53481.rs +++ b/tests/ui/proc-macro/issue-53481.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs index 24e3be0ed2e..c1b55fd99df 100644 --- a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs +++ b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs @@ -2,7 +2,7 @@ // `issue_59191::no_main` replaces whatever's passed in with `fn main() {}`. //@ edition:2018 -//@ aux-crate:issue_59191=issue-59191.rs +//@ proc-macro: issue-59191.rs //@ error-pattern: requires `sized` lang_item #![feature(custom_inner_attributes)] diff --git a/tests/ui/proc-macro/issue-66286.rs b/tests/ui/proc-macro/issue-66286.rs index 3ca064768b2..57d1af26e93 100644 --- a/tests/ui/proc-macro/issue-66286.rs +++ b/tests/ui/proc-macro/issue-66286.rs @@ -1,4 +1,4 @@ -//@ aux-build:issue-66286.rs +//@ proc-macro: issue-66286.rs // Regression test for #66286. diff --git a/tests/ui/proc-macro/issue-73933-procedural-masquerade.rs b/tests/ui/proc-macro/issue-73933-procedural-masquerade.rs index 8f07cd34cc9..3421d13f4d9 100644 --- a/tests/ui/proc-macro/issue-73933-procedural-masquerade.rs +++ b/tests/ui/proc-macro/issue-73933-procedural-masquerade.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ check-pass #[macro_use] diff --git a/tests/ui/proc-macro/issue-73933-procedural-masquerade.stdout b/tests/ui/proc-macro/issue-73933-procedural-masquerade.stdout index 5e39c01ab5e..83a3f580958 100644 --- a/tests/ui/proc-macro/issue-73933-procedural-masquerade.stdout +++ b/tests/ui/proc-macro/issue-73933-procedural-masquerade.stdout @@ -2,20 +2,20 @@ PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", - span: #0 bytes(102..106), + span: #0 bytes(104..108), }, Ident { ident: "ProceduralMasqueradeDummyType", - span: #0 bytes(107..136), + span: #0 bytes(109..138), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "Input", - span: #0 bytes(143..148), + span: #0 bytes(145..150), }, ], - span: #0 bytes(137..150), + span: #0 bytes(139..152), }, ] diff --git a/tests/ui/proc-macro/issue-75734-pp-paren.rs b/tests/ui/proc-macro/issue-75734-pp-paren.rs index ab0f4f72e62..d084c4a2873 100644 --- a/tests/ui/proc-macro/issue-75734-pp-paren.rs +++ b/tests/ui/proc-macro/issue-75734-pp-paren.rs @@ -3,7 +3,7 @@ // normally insert extra parentheses. //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug #![no_std] // Don't load unnecessary hygiene information from std diff --git a/tests/ui/proc-macro/issue-75801.rs b/tests/ui/proc-macro/issue-75801.rs index f0a1940cb5c..feda5e60b0d 100644 --- a/tests/ui/proc-macro/issue-75801.rs +++ b/tests/ui/proc-macro/issue-75801.rs @@ -1,4 +1,4 @@ -//@ aux-build: issue-75801.rs +//@ proc-macro: issue-75801.rs // Regression test for #75801. diff --git a/tests/ui/proc-macro/issue-75930-derive-cfg.rs b/tests/ui/proc-macro/issue-75930-derive-cfg.rs index f480de24e3e..376a8ea4278 100644 --- a/tests/ui/proc-macro/issue-75930-derive-cfg.rs +++ b/tests/ui/proc-macro/issue-75930-derive-cfg.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs // Regression test for issue #75930 // Tests that we cfg-strip all targets before invoking diff --git a/tests/ui/proc-macro/issue-76182-leading-vert-pat.rs b/tests/ui/proc-macro/issue-76182-leading-vert-pat.rs index dc40a1715a6..218debf3e7c 100644 --- a/tests/ui/proc-macro/issue-76182-leading-vert-pat.rs +++ b/tests/ui/proc-macro/issue-76182-leading-vert-pat.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug // // Regression test for issue #76182 diff --git a/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs b/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs index 001a09fc552..2a003c30bf9 100644 --- a/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs +++ b/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs @@ -1,4 +1,4 @@ -//@ aux-build:proc-macro-panic.rs +//@ proc-macro: proc-macro-panic.rs //@ edition:2018 //@ needs-unwind proc macro panics to report errors diff --git a/tests/ui/proc-macro/issue-78675-captured-inner-attrs.rs b/tests/ui/proc-macro/issue-78675-captured-inner-attrs.rs index d3716b22729..63e8af31027 100644 --- a/tests/ui/proc-macro/issue-78675-captured-inner-attrs.rs +++ b/tests/ui/proc-macro/issue-78675-captured-inner-attrs.rs @@ -1,7 +1,7 @@ //@ check-pass //@ edition:2018 //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/issue-79148.rs b/tests/ui/proc-macro/issue-79148.rs index 96ee5e033e1..b2248759b5f 100644 --- a/tests/ui/proc-macro/issue-79148.rs +++ b/tests/ui/proc-macro/issue-79148.rs @@ -1,4 +1,4 @@ -//@ aux-build:re-export.rs +//@ proc-macro: re-export.rs //@ edition:2018 extern crate re_export; diff --git a/tests/ui/proc-macro/issue-79242-slow-retokenize-check.rs b/tests/ui/proc-macro/issue-79242-slow-retokenize-check.rs index d0c14d8b5d0..3306bc21e3a 100644 --- a/tests/ui/proc-macro/issue-79242-slow-retokenize-check.rs +++ b/tests/ui/proc-macro/issue-79242-slow-retokenize-check.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:issue-79242.rs +//@ proc-macro: issue-79242.rs // Regression test for issue #79242 // Tests that compilation time doesn't blow up for a proc-macro diff --git a/tests/ui/proc-macro/issue-79825.rs b/tests/ui/proc-macro/issue-79825.rs index f846bb40486..67b79172bb3 100644 --- a/tests/ui/proc-macro/issue-79825.rs +++ b/tests/ui/proc-macro/issue-79825.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:issue-79825.rs +//@ proc-macro: issue-79825.rs #![feature(trait_alias)] extern crate issue_79825; diff --git a/tests/ui/proc-macro/issue-80760-empty-stmt.rs b/tests/ui/proc-macro/issue-80760-empty-stmt.rs index 59244e12eb8..b940da6778a 100644 --- a/tests/ui/proc-macro/issue-80760-empty-stmt.rs +++ b/tests/ui/proc-macro/issue-80760-empty-stmt.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug #![no_std] // Don't load unnecessary hygiene information from std diff --git a/tests/ui/proc-macro/issue-81007-item-attrs.rs b/tests/ui/proc-macro/issue-81007-item-attrs.rs index ab47c9df081..f3b8aa8c7c5 100644 --- a/tests/ui/proc-macro/issue-81007-item-attrs.rs +++ b/tests/ui/proc-macro/issue-81007-item-attrs.rs @@ -1,7 +1,7 @@ //@ check-pass //@ edition:2018 //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(rustc_attrs)] diff --git a/tests/ui/proc-macro/issue-81543-item-parse-err.rs b/tests/ui/proc-macro/issue-81543-item-parse-err.rs index f3c307318a0..6cd8c0d6c40 100644 --- a/tests/ui/proc-macro/issue-81543-item-parse-err.rs +++ b/tests/ui/proc-macro/issue-81543-item-parse-err.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs // Regression test for issue #81543 // Tests that we emit a properly spanned error diff --git a/tests/ui/proc-macro/issue-81555.rs b/tests/ui/proc-macro/issue-81555.rs index 7a61a31952f..bbc7542cb24 100644 --- a/tests/ui/proc-macro/issue-81555.rs +++ b/tests/ui/proc-macro/issue-81555.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(stmt_expr_attributes, proc_macro_hygiene)] extern crate test_macros; diff --git a/tests/ui/proc-macro/issue-83510.rs b/tests/ui/proc-macro/issue-83510.rs index ea8a334f57c..67469511fc3 100644 --- a/tests/ui/proc-macro/issue-83510.rs +++ b/tests/ui/proc-macro/issue-83510.rs @@ -1,4 +1,4 @@ -//@ aux-build: issue-83510.rs +//@ proc-macro: issue-83510.rs extern crate issue_83510; diff --git a/tests/ui/proc-macro/issue-86781-bad-inner-doc.fixed b/tests/ui/proc-macro/issue-86781-bad-inner-doc.fixed index 367ad66a1a6..b8b3e6f3f7e 100644 --- a/tests/ui/proc-macro/issue-86781-bad-inner-doc.fixed +++ b/tests/ui/proc-macro/issue-86781-bad-inner-doc.fixed @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ run-rustfix #[macro_use] diff --git a/tests/ui/proc-macro/issue-86781-bad-inner-doc.rs b/tests/ui/proc-macro/issue-86781-bad-inner-doc.rs index c49619ef2ac..ce1a0da6cad 100644 --- a/tests/ui/proc-macro/issue-86781-bad-inner-doc.rs +++ b/tests/ui/proc-macro/issue-86781-bad-inner-doc.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ run-rustfix #[macro_use] diff --git a/tests/ui/proc-macro/issue-91800.rs b/tests/ui/proc-macro/issue-91800.rs index b69fce4cf77..bc78bcacfd0 100644 --- a/tests/ui/proc-macro/issue-91800.rs +++ b/tests/ui/proc-macro/issue-91800.rs @@ -1,4 +1,4 @@ -//@ aux-build: issue-91800-macro.rs +//@ proc-macro: issue-91800-macro.rs #[macro_use] extern crate issue_91800_macro; diff --git a/tests/ui/proc-macro/item-error.rs b/tests/ui/proc-macro/item-error.rs index f3e3eafcd8d..5f798faf436 100644 --- a/tests/ui/proc-macro/item-error.rs +++ b/tests/ui/proc-macro/item-error.rs @@ -1,4 +1,4 @@ -//@ aux-build:derive-b.rs +//@ proc-macro: derive-b.rs #![allow(warnings)] diff --git a/tests/ui/proc-macro/keep-expr-tokens.rs b/tests/ui/proc-macro/keep-expr-tokens.rs index ced7fad47b9..2bd66da90e2 100644 --- a/tests/ui/proc-macro/keep-expr-tokens.rs +++ b/tests/ui/proc-macro/keep-expr-tokens.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug #![feature(stmt_expr_attributes)] diff --git a/tests/ui/proc-macro/lifetimes-rpass.rs b/tests/ui/proc-macro/lifetimes-rpass.rs index a6b1f46a5d1..c462b27722f 100644 --- a/tests/ui/proc-macro/lifetimes-rpass.rs +++ b/tests/ui/proc-macro/lifetimes-rpass.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_variables)] -//@ aux-build:lifetimes-rpass.rs +//@ proc-macro: lifetimes-rpass.rs extern crate lifetimes_rpass as lifetimes; use lifetimes::*; diff --git a/tests/ui/proc-macro/lifetimes.rs b/tests/ui/proc-macro/lifetimes.rs index 0c5d3e2f72f..cfff3cb1785 100644 --- a/tests/ui/proc-macro/lifetimes.rs +++ b/tests/ui/proc-macro/lifetimes.rs @@ -1,4 +1,4 @@ -//@ aux-build:lifetimes.rs +//@ proc-macro: lifetimes.rs extern crate lifetimes; diff --git a/tests/ui/proc-macro/lints_in_proc_macros.rs b/tests/ui/proc-macro/lints_in_proc_macros.rs index 13ae7239a14..6714b8b6e1d 100644 --- a/tests/ui/proc-macro/lints_in_proc_macros.rs +++ b/tests/ui/proc-macro/lints_in_proc_macros.rs @@ -1,4 +1,4 @@ -//@ aux-build:bang_proc_macro2.rs +//@ proc-macro: bang_proc_macro2.rs extern crate bang_proc_macro2; diff --git a/tests/ui/proc-macro/literal-to-string.rs b/tests/ui/proc-macro/literal-to-string.rs index e87315fe144..7a56e08109c 100644 --- a/tests/ui/proc-macro/literal-to-string.rs +++ b/tests/ui/proc-macro/literal-to-string.rs @@ -1,7 +1,7 @@ //@ check-pass //@ edition: 2021 -//@ aux-build: print-tokens.rs +//@ proc-macro: print-tokens.rs extern crate print_tokens; fn main() { diff --git a/tests/ui/proc-macro/literal-to-string.stdout b/tests/ui/proc-macro/literal-to-string.stdout index c3114265e0a..18c0c20dde4 100644 --- a/tests/ui/proc-macro/literal-to-string.stdout +++ b/tests/ui/proc-macro/literal-to-string.stdout @@ -3,91 +3,91 @@ TokenStream [ kind: Integer, symbol: "1", suffix: None, - span: #0 bytes(147..148), + span: #0 bytes(148..149), }, Literal { kind: Integer, symbol: "17", suffix: Some("u8"), - span: #0 bytes(157..161), + span: #0 bytes(158..162), }, Literal { kind: Float, symbol: "42.", suffix: None, - span: #0 bytes(170..173), + span: #0 bytes(171..174), }, Literal { kind: Float, symbol: "3.14", suffix: Some("f32"), - span: #0 bytes(182..189), + span: #0 bytes(183..190), }, Literal { kind: Byte, symbol: "a", suffix: None, - span: #0 bytes(198..202), + span: #0 bytes(199..203), }, Literal { kind: Byte, symbol: "\xFF", suffix: None, - span: #0 bytes(211..218), + span: #0 bytes(212..219), }, Literal { kind: Char, symbol: "c", suffix: None, - span: #0 bytes(227..230), + span: #0 bytes(228..231), }, Literal { kind: Char, symbol: "\x32", suffix: None, - span: #0 bytes(239..245), + span: #0 bytes(240..246), }, Literal { kind: Str, symbol: "\\"str\\"", suffix: None, - span: #0 bytes(254..263), + span: #0 bytes(255..264), }, Literal { kind: StrRaw(1), symbol: "\"raw\" str", suffix: None, - span: #0 bytes(272..286), + span: #0 bytes(273..287), }, Literal { kind: StrRaw(3), symbol: "very ##\"raw\"## str", suffix: None, - span: #0 bytes(295..322), + span: #0 bytes(296..323), }, Literal { kind: ByteStr, symbol: "\\"byte\\" str", suffix: None, - span: #0 bytes(331..346), + span: #0 bytes(332..347), }, Literal { kind: ByteStrRaw(1), symbol: "\"raw\" \"byte\" str", suffix: None, - span: #0 bytes(355..377), + span: #0 bytes(356..378), }, Literal { kind: CStr, symbol: "\\"c\\" str", suffix: None, - span: #0 bytes(386..398), + span: #0 bytes(387..399), }, Literal { kind: CStrRaw(1), symbol: "\"raw\" \"c\" str", suffix: None, - span: #0 bytes(407..426), + span: #0 bytes(408..427), }, ] 1 diff --git a/tests/ui/proc-macro/load-panic-backtrace.rs b/tests/ui/proc-macro/load-panic-backtrace.rs index 15badedef97..302bcaea75e 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.rs +++ b/tests/ui/proc-macro/load-panic-backtrace.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z proc-macro-backtrace //@ rustc-env:RUST_BACKTRACE=0 //@ normalize-stderr-test: "thread '.*' panicked " -> "" diff --git a/tests/ui/proc-macro/load-panic-backtrace.stderr b/tests/ui/proc-macro/load-panic-backtrace.stderr index 18f51358672..0f3db6c831e 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.stderr +++ b/tests/ui/proc-macro/load-panic-backtrace.stderr @@ -1,4 +1,4 @@ -at $DIR/auxiliary/test-macros.rs:43:5: +at $DIR/auxiliary/test-macros.rs:38:5: panic-derive error: proc-macro derive panicked --> $DIR/load-panic-backtrace.rs:11:10 diff --git a/tests/ui/proc-macro/load-panic.rs b/tests/ui/proc-macro/load-panic.rs index 50475a34226..18bfb71050b 100644 --- a/tests/ui/proc-macro/load-panic.rs +++ b/tests/ui/proc-macro/load-panic.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ needs-unwind proc macro panics to report errors #[macro_use] diff --git a/tests/ui/proc-macro/load-two.rs b/tests/ui/proc-macro/load-two.rs index 44fcdb056dd..608379949e6 100644 --- a/tests/ui/proc-macro/load-two.rs +++ b/tests/ui/proc-macro/load-two.rs @@ -2,8 +2,8 @@ #![allow(path_statements)] #![allow(dead_code)] -//@ aux-build:derive-atob.rs -//@ aux-build:derive-ctod.rs +//@ proc-macro: derive-atob.rs +//@ proc-macro: derive-ctod.rs #[macro_use] extern crate derive_atob; diff --git a/tests/ui/proc-macro/macro-brackets.rs b/tests/ui/proc-macro/macro-brackets.rs index 91bd652d37b..70686eed0bd 100644 --- a/tests/ui/proc-macro/macro-brackets.rs +++ b/tests/ui/proc-macro/macro-brackets.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/macro-crate-multi-decorator.rs b/tests/ui/proc-macro/macro-crate-multi-decorator.rs index 26a2d1592ab..c4f02e7adfc 100644 --- a/tests/ui/proc-macro/macro-crate-multi-decorator.rs +++ b/tests/ui/proc-macro/macro-crate-multi-decorator.rs @@ -1,7 +1,7 @@ // The duplicate macro will create a copy of the item with the given identifier. //@ check-pass -//@ aux-build:duplicate.rs +//@ proc-macro: duplicate.rs #[macro_use] extern crate duplicate; diff --git a/tests/ui/proc-macro/macro-quote-cond.rs b/tests/ui/proc-macro/macro-quote-cond.rs index 3658e2a28f2..062511eec9b 100644 --- a/tests/ui/proc-macro/macro-quote-cond.rs +++ b/tests/ui/proc-macro/macro-quote-cond.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:cond_plugin.rs +//@ proc-macro: cond_plugin.rs #![allow(unused_parens)] diff --git a/tests/ui/proc-macro/macro-rules-derive-cfg.rs b/tests/ui/proc-macro/macro-rules-derive-cfg.rs index c34f1695761..ab504bc63a2 100644 --- a/tests/ui/proc-macro/macro-rules-derive-cfg.rs +++ b/tests/ui/proc-macro/macro-rules-derive-cfg.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug --error-format human -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(rustc_attrs)] #![feature(stmt_expr_attributes)] diff --git a/tests/ui/proc-macro/macro-rules-derive.rs b/tests/ui/proc-macro/macro-rules-derive.rs index 4023a9a044a..c4e906fb5ed 100644 --- a/tests/ui/proc-macro/macro-rules-derive.rs +++ b/tests/ui/proc-macro/macro-rules-derive.rs @@ -1,4 +1,4 @@ -//@ aux-build:first-second.rs +//@ proc-macro: first-second.rs extern crate first_second; use first_second::*; diff --git a/tests/ui/proc-macro/macro-use-attr.rs b/tests/ui/proc-macro/macro-use-attr.rs index fe071b26383..b2d4b9e6ffa 100644 --- a/tests/ui/proc-macro/macro-use-attr.rs +++ b/tests/ui/proc-macro/macro-use-attr.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/macro-use-bang.rs b/tests/ui/proc-macro/macro-use-bang.rs index f8ccba6b094..9397baff1d6 100644 --- a/tests/ui/proc-macro/macro-use-bang.rs +++ b/tests/ui/proc-macro/macro-use-bang.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/macro_rules_edition_from_pm.rs b/tests/ui/proc-macro/macro_rules_edition_from_pm.rs new file mode 100644 index 00000000000..8fc7d909749 --- /dev/null +++ b/tests/ui/proc-macro/macro_rules_edition_from_pm.rs @@ -0,0 +1,26 @@ +// Tests how edition hygiene works for macro_rules macros generated from a +// proc-macro. +// See https://github.com/rust-lang/rust/issues/132906 + +//@ proc-macro: macro_rules_edition_pm.rs +//@ revisions: edition2021 edition2024 +//@[edition2021] edition:2021 +//@[edition2024] edition:2024 +//@ check-pass + +// This checks how the expr fragment specifier works. +macro_rules_edition_pm::make_edition_macro!{} + +const _: () = { + assert!(edition!(const {}) == 2021); +}; + +// This checks how the expr fragment specifier from a nested macro. +macro_rules_edition_pm::make_nested_edition_macro!{} +make_inner!{} + +const _: () = { + assert!(edition_inner!(const {}) == 2021); +}; + +fn main() {} diff --git a/tests/ui/proc-macro/macros-in-extern.rs b/tests/ui/proc-macro/macros-in-extern.rs index da384d1b141..f39322d126e 100644 --- a/tests/ui/proc-macro/macros-in-extern.rs +++ b/tests/ui/proc-macro/macros-in-extern.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/macros-in-type.rs b/tests/ui/proc-macro/macros-in-type.rs index 4db7cf273f7..1874bb80db3 100644 --- a/tests/ui/proc-macro/macros-in-type.rs +++ b/tests/ui/proc-macro/macros-in-type.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/meta-macro-hygiene.rs b/tests/ui/proc-macro/meta-macro-hygiene.rs index 98496d5a4c6..9fbe9763b44 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.rs +++ b/tests/ui/proc-macro/meta-macro-hygiene.rs @@ -1,5 +1,5 @@ //@ aux-build:make-macro.rs -//@ aux-build:meta-macro.rs +//@ proc-macro: meta-macro.rs //@ edition:2018 //@ compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene -Z trim-diagnostic-paths=no //@ check-pass diff --git a/tests/ui/proc-macro/meta-macro-hygiene.stdout b/tests/ui/proc-macro/meta-macro-hygiene.stdout index 3c6ec6fbdd4..ae02b24e1d0 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.stdout +++ b/tests/ui/proc-macro/meta-macro-hygiene.stdout @@ -3,7 +3,7 @@ Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:26 Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#4) }] #![feature /* 0#0 */(prelude_import)] //@ aux-build:make-macro.rs -//@ aux-build:meta-macro.rs +//@ proc-macro: meta-macro.rs //@ edition:2018 //@ compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene -Z trim-diagnostic-paths=no //@ check-pass diff --git a/tests/ui/proc-macro/meta-macro.rs b/tests/ui/proc-macro/meta-macro.rs index abe63c60fb8..02ef45c0c21 100644 --- a/tests/ui/proc-macro/meta-macro.rs +++ b/tests/ui/proc-macro/meta-macro.rs @@ -1,5 +1,5 @@ //@ aux-build:make-macro.rs -//@ aux-build:meta-macro.rs +//@ proc-macro: meta-macro.rs //@ edition:2018 //@ compile-flags: -Z span-debug //@ run-pass diff --git a/tests/ui/proc-macro/mixed-site-span.rs b/tests/ui/proc-macro/mixed-site-span.rs index bab76a8c433..2b5d9757043 100644 --- a/tests/ui/proc-macro/mixed-site-span.rs +++ b/tests/ui/proc-macro/mixed-site-span.rs @@ -1,6 +1,6 @@ // Proc macros using `mixed_site` spans exhibit usual properties of `macro_rules` hygiene. -//@ aux-build:mixed-site-span.rs +//@ proc-macro: mixed-site-span.rs #[macro_use] extern crate mixed_site_span; diff --git a/tests/ui/proc-macro/modify-ast.rs b/tests/ui/proc-macro/modify-ast.rs index 4c125c1c6e8..9e890f3ebaa 100644 --- a/tests/ui/proc-macro/modify-ast.rs +++ b/tests/ui/proc-macro/modify-ast.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:modify-ast.rs +//@ proc-macro: modify-ast.rs extern crate modify_ast; diff --git a/tests/ui/proc-macro/multispan.rs b/tests/ui/proc-macro/multispan.rs index 60f67c8c67c..e06aa9f7c5a 100644 --- a/tests/ui/proc-macro/multispan.rs +++ b/tests/ui/proc-macro/multispan.rs @@ -1,4 +1,4 @@ -//@ aux-build:multispan.rs +//@ proc-macro: multispan.rs extern crate multispan; diff --git a/tests/ui/proc-macro/negative-token.rs b/tests/ui/proc-macro/negative-token.rs index 32408e0d936..8c6fa9ca689 100644 --- a/tests/ui/proc-macro/negative-token.rs +++ b/tests/ui/proc-macro/negative-token.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:negative-token.rs +//@ proc-macro: negative-token.rs extern crate negative_token; diff --git a/tests/ui/proc-macro/nested-derive-cfg.rs b/tests/ui/proc-macro/nested-derive-cfg.rs index 696a5024ec2..bd8f231ac2c 100644 --- a/tests/ui/proc-macro/nested-derive-cfg.rs +++ b/tests/ui/proc-macro/nested-derive-cfg.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Z span-debug --error-format human -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ check-pass #![no_std] // Don't load unnecessary hygiene information from std diff --git a/tests/ui/proc-macro/nested-item-spans.rs b/tests/ui/proc-macro/nested-item-spans.rs index c19af0f9796..f7e2365586d 100644 --- a/tests/ui/proc-macro/nested-item-spans.rs +++ b/tests/ui/proc-macro/nested-item-spans.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/nested-macro-rules.rs b/tests/ui/proc-macro/nested-macro-rules.rs index 2f0d85c4bbf..95a38e4c1b6 100644 --- a/tests/ui/proc-macro/nested-macro-rules.rs +++ b/tests/ui/proc-macro/nested-macro-rules.rs @@ -1,6 +1,6 @@ //@ run-pass //@ aux-build:nested-macro-rules.rs -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug -Z macro-backtrace //@ edition:2018 diff --git a/tests/ui/proc-macro/nested-nonterminal-tokens.rs b/tests/ui/proc-macro/nested-nonterminal-tokens.rs index 6e28cabd2fe..630e33dbd83 100644 --- a/tests/ui/proc-macro/nested-nonterminal-tokens.rs +++ b/tests/ui/proc-macro/nested-nonterminal-tokens.rs @@ -1,7 +1,7 @@ //@ check-pass //@ edition:2018 //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs // Tests that we properly pass tokens to proc-macro when nested // nonterminals are involved. diff --git a/tests/ui/proc-macro/no-macro-use-attr.rs b/tests/ui/proc-macro/no-macro-use-attr.rs index ae507a31ba7..d44f51bfd8d 100644 --- a/tests/ui/proc-macro/no-macro-use-attr.rs +++ b/tests/ui/proc-macro/no-macro-use-attr.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(rustc_attrs)] #![warn(unused_extern_crates)] diff --git a/tests/ui/proc-macro/nodelim-groups.rs b/tests/ui/proc-macro/nodelim-groups.rs index f13d97aaff5..9acdc7023c0 100644 --- a/tests/ui/proc-macro/nodelim-groups.rs +++ b/tests/ui/proc-macro/nodelim-groups.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug //@ edition:2018 // diff --git a/tests/ui/proc-macro/nonterminal-expansion.rs b/tests/ui/proc-macro/nonterminal-expansion.rs index 96ea4aef85b..99a68996c30 100644 --- a/tests/ui/proc-macro/nonterminal-expansion.rs +++ b/tests/ui/proc-macro/nonterminal-expansion.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/nonterminal-recollect-attr.rs b/tests/ui/proc-macro/nonterminal-recollect-attr.rs index 7d922bafdcd..3f3348b18c1 100644 --- a/tests/ui/proc-macro/nonterminal-recollect-attr.rs +++ b/tests/ui/proc-macro/nonterminal-recollect-attr.rs @@ -1,6 +1,6 @@ //@ check-pass //@ compile-flags: -Z span-debug -//@ aux-build:nonterminal-recollect-attr.rs +//@ proc-macro: nonterminal-recollect-attr.rs #![no_std] // Don't load unnecessary hygiene information from std extern crate std; diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.rs b/tests/ui/proc-macro/nonterminal-token-hygiene.rs index 6a4406b053d..76c71441c80 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.rs +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.rs @@ -7,7 +7,7 @@ //@ normalize-stdout-test: "\d+#" -> "0#" //@ normalize-stdout-test: "expn\d{3,}" -> "expnNNN" //@ normalize-stdout-test: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */" -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(decl_macro)] #![no_std] // Don't load unnecessary hygiene information from std diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout index de3265e9281..1ad14059028 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout @@ -31,7 +31,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ //@ normalize-stdout-test: "\d+#" -> "0#" //@ normalize-stdout-test: "expn\d{3,}" -> "expnNNN" //@ normalize-stdout-test: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */" -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature /* 0#0 */(decl_macro)] #![no_std /* 0#0 */] diff --git a/tests/ui/proc-macro/not-joint.rs b/tests/ui/proc-macro/not-joint.rs index 16b89bc6e81..c585e7e33dc 100644 --- a/tests/ui/proc-macro/not-joint.rs +++ b/tests/ui/proc-macro/not-joint.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:not-joint.rs +//@ proc-macro: not-joint.rs extern crate not_joint as bar; use bar::{tokens, nothing}; diff --git a/tests/ui/proc-macro/out-of-line-mod.rs b/tests/ui/proc-macro/out-of-line-mod.rs index 2a4fb16a09a..efe9588bef6 100644 --- a/tests/ui/proc-macro/out-of-line-mod.rs +++ b/tests/ui/proc-macro/out-of-line-mod.rs @@ -1,7 +1,7 @@ // Out-of-line module is found on the filesystem if passed through a proc macro (issue #58818). //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/parent-source-spans.rs b/tests/ui/proc-macro/parent-source-spans.rs index 12a1ab1a43d..cc3ac795f7f 100644 --- a/tests/ui/proc-macro/parent-source-spans.rs +++ b/tests/ui/proc-macro/parent-source-spans.rs @@ -1,4 +1,4 @@ -//@ aux-build:parent-source-spans.rs +//@ proc-macro: parent-source-spans.rs #![feature(decl_macro)] diff --git a/tests/ui/proc-macro/parse-invis-delim-issue-128895.rs b/tests/ui/proc-macro/parse-invis-delim-issue-128895.rs index 3d5af5fee21..2dc32202465 100644 --- a/tests/ui/proc-macro/parse-invis-delim-issue-128895.rs +++ b/tests/ui/proc-macro/parse-invis-delim-issue-128895.rs @@ -1,4 +1,4 @@ -//@ aux-build:parse-invis-delim-issue-128895.rs +//@ proc-macro: parse-invis-delim-issue-128895.rs //@ check-pass #![no_std] // Don't load unnecessary hygiene information from std diff --git a/tests/ui/proc-macro/pretty-print-hack-hide.rs b/tests/ui/proc-macro/pretty-print-hack-hide.rs index 26db43341ab..fd98f16a780 100644 --- a/tests/ui/proc-macro/pretty-print-hack-hide.rs +++ b/tests/ui/proc-macro/pretty-print-hack-hide.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug //@ check-pass diff --git a/tests/ui/proc-macro/pretty-print-hack-show.rs b/tests/ui/proc-macro/pretty-print-hack-show.rs index 1b6794ae698..de6453c6a82 100644 --- a/tests/ui/proc-macro/pretty-print-hack-show.rs +++ b/tests/ui/proc-macro/pretty-print-hack-show.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug //@ revisions: local remapped // [local] no-remap-src-base: The hack should work regardless of remapping. diff --git a/tests/ui/proc-macro/pretty-print-tts.rs b/tests/ui/proc-macro/pretty-print-tts.rs index e3240e27c2a..b1b4f278e2a 100644 --- a/tests/ui/proc-macro/pretty-print-tts.rs +++ b/tests/ui/proc-macro/pretty-print-tts.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug #![feature(rustc_attrs)] diff --git a/tests/ui/proc-macro/proc-macro-attributes.rs b/tests/ui/proc-macro/proc-macro-attributes.rs index 6d5e7b67c78..455fcc56e58 100644 --- a/tests/ui/proc-macro/proc-macro-attributes.rs +++ b/tests/ui/proc-macro/proc-macro-attributes.rs @@ -1,4 +1,4 @@ -//@ aux-build:derive-b.rs +//@ proc-macro: derive-b.rs #[macro_use] extern crate derive_b; diff --git a/tests/ui/proc-macro/proc-macro-gates.rs b/tests/ui/proc-macro/proc-macro-gates.rs index 585d9a3c9be..bf384bc479b 100644 --- a/tests/ui/proc-macro/proc-macro-gates.rs +++ b/tests/ui/proc-macro/proc-macro-gates.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs // gate-test-proc_macro_hygiene #![feature(stmt_expr_attributes)] diff --git a/tests/ui/proc-macro/proc-macro-gates2.rs b/tests/ui/proc-macro/proc-macro-gates2.rs index 76d8036d8a4..450f64982b0 100644 --- a/tests/ui/proc-macro/proc-macro-gates2.rs +++ b/tests/ui/proc-macro/proc-macro-gates2.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![feature(stmt_expr_attributes)] diff --git a/tests/ui/proc-macro/raw-ident.rs b/tests/ui/proc-macro/raw-ident.rs index 2ea2d3079dc..95ada295f5c 100644 --- a/tests/ui/proc-macro/raw-ident.rs +++ b/tests/ui/proc-macro/raw-ident.rs @@ -1,4 +1,4 @@ -//@ aux-build:raw-ident.rs +//@ proc-macro: raw-ident.rs #[macro_use] extern crate raw_ident; diff --git a/tests/ui/proc-macro/resolve-error.rs b/tests/ui/proc-macro/resolve-error.rs index 2670d8884ae..0ca250194f0 100644 --- a/tests/ui/proc-macro/resolve-error.rs +++ b/tests/ui/proc-macro/resolve-error.rs @@ -1,6 +1,6 @@ -//@ aux-build:derive-foo.rs -//@ aux-build:derive-clona.rs -//@ aux-build:test-macros.rs +//@ proc-macro: derive-foo.rs +//@ proc-macro: derive-clona.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate derive_foo; diff --git a/tests/ui/proc-macro/resolve-error.stderr b/tests/ui/proc-macro/resolve-error.stderr index e7639f474c7..963298311ef 100644 --- a/tests/ui/proc-macro/resolve-error.stderr +++ b/tests/ui/proc-macro/resolve-error.stderr @@ -4,7 +4,7 @@ error: cannot find macro `bang_proc_macrp` in this scope LL | bang_proc_macrp!(); | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` | - ::: $DIR/auxiliary/test-macros.rs:15:1 + ::: $DIR/auxiliary/test-macros.rs:10:1 | LL | pub fn empty(_: TokenStream) -> TokenStream { | ------------------------------------------- similarly named macro `bang_proc_macro` defined here @@ -53,7 +53,7 @@ error: cannot find derive macro `Dlona` in this scope LL | #[derive(Dlona)] | ^^^^^ help: a derive macro with a similar name exists: `Clona` | - ::: $DIR/auxiliary/derive-clona.rs:11:1 + ::: $DIR/auxiliary/derive-clona.rs:6:1 | LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { | ------------------------------------------------------- similarly named derive macro `Clona` defined here @@ -64,7 +64,7 @@ error: cannot find derive macro `Dlona` in this scope LL | #[derive(Dlona)] | ^^^^^ help: a derive macro with a similar name exists: `Clona` | - ::: $DIR/auxiliary/derive-clona.rs:11:1 + ::: $DIR/auxiliary/derive-clona.rs:6:1 | LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { | ------------------------------------------------------- similarly named derive macro `Clona` defined here @@ -103,7 +103,7 @@ error: cannot find attribute `attr_proc_macra` in this scope LL | #[attr_proc_macra] | ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro` | - ::: $DIR/auxiliary/test-macros.rs:20:1 + ::: $DIR/auxiliary/test-macros.rs:15:1 | LL | pub fn empty_attr(_: TokenStream, _: TokenStream) -> TokenStream { | ---------------------------------------------------------------- similarly named attribute macro `attr_proc_macro` defined here @@ -114,7 +114,7 @@ error: cannot find derive macro `FooWithLongNan` in this scope LL | #[derive(FooWithLongNan)] | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` | - ::: $DIR/auxiliary/derive-foo.rs:11:1 + ::: $DIR/auxiliary/derive-foo.rs:6:1 | LL | pub fn derive_foo(input: TokenStream) -> TokenStream { | ---------------------------------------------------- similarly named derive macro `FooWithLongName` defined here @@ -125,7 +125,7 @@ error: cannot find derive macro `FooWithLongNan` in this scope LL | #[derive(FooWithLongNan)] | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` | - ::: $DIR/auxiliary/derive-foo.rs:11:1 + ::: $DIR/auxiliary/derive-foo.rs:6:1 | LL | pub fn derive_foo(input: TokenStream) -> TokenStream { | ---------------------------------------------------- similarly named derive macro `FooWithLongName` defined here diff --git a/tests/ui/proc-macro/resolved-located-at.rs b/tests/ui/proc-macro/resolved-located-at.rs index 2f906d91e6b..c932c401896 100644 --- a/tests/ui/proc-macro/resolved-located-at.rs +++ b/tests/ui/proc-macro/resolved-located-at.rs @@ -1,4 +1,4 @@ -//@ aux-build:resolved-located-at.rs +//@ proc-macro: resolved-located-at.rs #[macro_use] extern crate resolved_located_at; diff --git a/tests/ui/proc-macro/shadow.rs b/tests/ui/proc-macro/shadow.rs index 22aecb7c05f..bcb38f97dbf 100644 --- a/tests/ui/proc-macro/shadow.rs +++ b/tests/ui/proc-macro/shadow.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/smoke.rs b/tests/ui/proc-macro/smoke.rs index dc32adb2e27..667112837c1 100644 --- a/tests/ui/proc-macro/smoke.rs +++ b/tests/ui/proc-macro/smoke.rs @@ -2,7 +2,7 @@ #![allow(unused_must_use)] #![allow(path_statements)] -//@ aux-build:derive-a.rs +//@ proc-macro: derive-a.rs #[macro_use] extern crate derive_a; diff --git a/tests/ui/proc-macro/span-absolute-posititions.rs b/tests/ui/proc-macro/span-absolute-posititions.rs index ddbc5902d6b..fc9f06a9e9f 100644 --- a/tests/ui/proc-macro/span-absolute-posititions.rs +++ b/tests/ui/proc-macro/span-absolute-posititions.rs @@ -1,4 +1,4 @@ -//@ aux-build:assert-span-pos.rs +//@ proc-macro: assert-span-pos.rs // ignore-tidy-tab extern crate assert_span_pos; diff --git a/tests/ui/proc-macro/span-api-tests.rs b/tests/ui/proc-macro/span-api-tests.rs index 1e00f3ad7ac..ac42a7ea611 100644 --- a/tests/ui/proc-macro/span-api-tests.rs +++ b/tests/ui/proc-macro/span-api-tests.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:span-api-tests.rs +//@ proc-macro: span-api-tests.rs //@ aux-build:span-test-macros.rs //@ compile-flags: -Ztranslate-remapped-path-to-local-path=yes diff --git a/tests/ui/proc-macro/span-from-proc-macro.rs b/tests/ui/proc-macro/span-from-proc-macro.rs index 9d851d62d12..4e12a695a5c 100644 --- a/tests/ui/proc-macro/span-from-proc-macro.rs +++ b/tests/ui/proc-macro/span-from-proc-macro.rs @@ -1,5 +1,5 @@ -//@ aux-build:custom-quote.rs -//@ aux-build:span-from-proc-macro.rs +//@ proc-macro: custom-quote.rs +//@ proc-macro: span-from-proc-macro.rs //@ compile-flags: -Z macro-backtrace #[macro_use] diff --git a/tests/ui/proc-macro/span-from-proc-macro.stderr b/tests/ui/proc-macro/span-from-proc-macro.stderr index 7beed505a7e..452c04df877 100644 --- a/tests/ui/proc-macro/span-from-proc-macro.stderr +++ b/tests/ui/proc-macro/span-from-proc-macro.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `MissingType` in this scope - --> $DIR/auxiliary/span-from-proc-macro.rs:37:20 + --> $DIR/auxiliary/span-from-proc-macro.rs:33:20 | LL | pub fn error_from_attribute(_args: TokenStream, _input: TokenStream) -> TokenStream { | ----------------------------------------------------------------------------------- in this expansion of `#[error_from_attribute]` @@ -13,7 +13,7 @@ LL | #[error_from_attribute] | ----------------------- in this procedural macro expansion error[E0412]: cannot find type `OtherMissingType` in this scope - --> $DIR/auxiliary/span-from-proc-macro.rs:46:21 + --> $DIR/auxiliary/span-from-proc-macro.rs:42:21 | LL | pub fn error_from_derive(_input: TokenStream) -> TokenStream { | ------------------------------------------------------------ in this expansion of `#[derive(ErrorFromDerive)]` @@ -27,7 +27,7 @@ LL | #[derive(ErrorFromDerive)] | --------------- in this derive macro expansion error[E0425]: cannot find value `my_ident` in this scope - --> $DIR/auxiliary/span-from-proc-macro.rs:29:9 + --> $DIR/auxiliary/span-from-proc-macro.rs:25:9 | LL | pub fn other_error_from_bang(_input: TokenStream) -> TokenStream { | ---------------------------------------------------------------- in this expansion of `other_error_from_bang!` @@ -41,7 +41,7 @@ LL | other_error_from_bang!(); | ------------------------ in this macro invocation error[E0308]: mismatched types - --> $DIR/auxiliary/span-from-proc-macro.rs:16:36 + --> $DIR/auxiliary/span-from-proc-macro.rs:12:36 | LL | let bang_error: bool = 25; | ---- ^^ expected `bool`, found integer diff --git a/tests/ui/proc-macro/span-preservation.rs b/tests/ui/proc-macro/span-preservation.rs index 25a44505c77..fc914865678 100644 --- a/tests/ui/proc-macro/span-preservation.rs +++ b/tests/ui/proc-macro/span-preservation.rs @@ -1,7 +1,7 @@ // For each of these, we should get the appropriate type mismatch error message, // and the function should be echoed. -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #[macro_use] extern crate test_macros; diff --git a/tests/ui/proc-macro/struct-field-macro.rs b/tests/ui/proc-macro/struct-field-macro.rs index b2c3dd49de9..9b1ddcaf274 100644 --- a/tests/ui/proc-macro/struct-field-macro.rs +++ b/tests/ui/proc-macro/struct-field-macro.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(dead_code)] -//@ aux-build:derive-nothing.rs +//@ proc-macro: derive-nothing.rs #[macro_use] extern crate derive_nothing; diff --git a/tests/ui/proc-macro/subspan.rs b/tests/ui/proc-macro/subspan.rs index 78804cba342..a87b11f3288 100644 --- a/tests/ui/proc-macro/subspan.rs +++ b/tests/ui/proc-macro/subspan.rs @@ -1,4 +1,4 @@ -//@ aux-build:subspan.rs +//@ proc-macro: subspan.rs extern crate subspan; diff --git a/tests/ui/proc-macro/test.rs b/tests/ui/proc-macro/test.rs index 9e76deab9ce..b36910a414b 100644 --- a/tests/ui/proc-macro/test.rs +++ b/tests/ui/proc-macro/test.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:api/mod.rs +//@ proc-macro: api/proc_macro_api_tests.rs //@ edition: 2021 //! This is for everything that *would* be a #[test] inside of libproc_macro, diff --git a/tests/ui/proc-macro/three-equals.rs b/tests/ui/proc-macro/three-equals.rs index d16fc55656c..ad528e144b0 100644 --- a/tests/ui/proc-macro/three-equals.rs +++ b/tests/ui/proc-macro/three-equals.rs @@ -1,4 +1,4 @@ -//@ aux-build:three-equals.rs +//@ proc-macro: three-equals.rs extern crate three_equals; diff --git a/tests/ui/proc-macro/trailing-plus.rs b/tests/ui/proc-macro/trailing-plus.rs index 875225c15ca..a69ec510bed 100644 --- a/tests/ui/proc-macro/trailing-plus.rs +++ b/tests/ui/proc-macro/trailing-plus.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ compile-flags: -Z span-debug #![no_std] // Don't load unnecessary hygiene information from std diff --git a/tests/ui/proc-macro/trait-fn-args-2015.rs b/tests/ui/proc-macro/trait-fn-args-2015.rs index 389bb5b6a92..c25bd768efe 100644 --- a/tests/ui/proc-macro/trait-fn-args-2015.rs +++ b/tests/ui/proc-macro/trait-fn-args-2015.rs @@ -1,7 +1,7 @@ // Unnamed arguments in trait functions can be passed through proc macros on 2015 edition. //@ check-pass -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs #![allow(anonymous_parameters)] diff --git a/tests/ui/proc-macro/unsafe-foreign-mod.rs b/tests/ui/proc-macro/unsafe-foreign-mod.rs index b863b0fc114..e1e4ce96f1f 100644 --- a/tests/ui/proc-macro/unsafe-foreign-mod.rs +++ b/tests/ui/proc-macro/unsafe-foreign-mod.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:macro-only-syntax.rs +//@ proc-macro: macro-only-syntax.rs extern crate macro_only_syntax; diff --git a/tests/ui/proc-macro/unsafe-mod.rs b/tests/ui/proc-macro/unsafe-mod.rs index 00ea388af93..f8453c2f62c 100644 --- a/tests/ui/proc-macro/unsafe-mod.rs +++ b/tests/ui/proc-macro/unsafe-mod.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:macro-only-syntax.rs +//@ proc-macro: macro-only-syntax.rs #![feature(proc_macro_hygiene)] diff --git a/tests/ui/proc-macro/weird-braces.rs b/tests/ui/proc-macro/weird-braces.rs index b17b90742b5..1197156f6b0 100644 --- a/tests/ui/proc-macro/weird-braces.rs +++ b/tests/ui/proc-macro/weird-braces.rs @@ -1,4 +1,4 @@ -//@ aux-build:test-macros.rs +//@ proc-macro: test-macros.rs //@ check-pass //@ compile-flags: -Z span-debug diff --git a/tests/ui/proc-macro/weird-hygiene.rs b/tests/ui/proc-macro/weird-hygiene.rs index 8b35898a4d2..de55484109a 100644 --- a/tests/ui/proc-macro/weird-hygiene.rs +++ b/tests/ui/proc-macro/weird-hygiene.rs @@ -1,4 +1,4 @@ -//@ aux-build:weird-hygiene.rs +//@ proc-macro: weird-hygiene.rs #![feature(stmt_expr_attributes)] #![feature(proc_macro_hygiene)] diff --git a/tests/ui/process/env-funky-keys.rs b/tests/ui/process/env-funky-keys.rs index 314ccaea015..a4a71c94020 100644 --- a/tests/ui/process/env-funky-keys.rs +++ b/tests/ui/process/env-funky-keys.rs @@ -1,4 +1,5 @@ //@ run-pass +//@ edition: 2021 // Ignore this test on Android, because it segfaults there. //@ ignore-android @@ -32,10 +33,9 @@ fn main() { .unwrap() .as_os_str() .as_bytes()).unwrap(); - let new_env_var = CString::new("FOOBAR").unwrap(); let filename: *const c_char = current_exe.as_ptr(); let argv: &[*const c_char] = &[filename, filename, ptr::null()]; - let envp: &[*const c_char] = &[new_env_var.as_ptr(), ptr::null()]; + let envp: &[*const c_char] = &[c"FOOBAR".as_ptr(), ptr::null()]; unsafe { execve(filename, &argv[0], &envp[0]); } diff --git a/tests/ui/process/println-with-broken-pipe.run.stderr b/tests/ui/process/println-with-broken-pipe.run.stderr index f9d138a0424..a334c0ad204 100644 --- a/tests/ui/process/println-with-broken-pipe.run.stderr +++ b/tests/ui/process/println-with-broken-pipe.run.stderr @@ -1,3 +1,3 @@ -thread 'main' panicked at std/src/io/stdio.rs:LL:CC: +thread 'main' panicked at library/std/src/io/stdio.rs:LL:CC: failed printing to stdout: Broken pipe (os error 32) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/ptr-coercion-rpass.rs b/tests/ui/ptr-coercion-rpass.rs index 5d9b907f0e4..8cc4120328e 100644 --- a/tests/ui/ptr-coercion-rpass.rs +++ b/tests/ui/ptr-coercion-rpass.rs @@ -3,7 +3,6 @@ #![allow(unused_variables)] // Test coercions between pointers which don't do anything fancy like unsizing. -//@ pretty-expanded FIXME #23616 pub fn main() { // &mut -> & diff --git a/tests/ui/reachable/issue-11225-1.rs b/tests/ui/reachable/issue-11225-1.rs index 6af270555c3..c87dd0d819b 100644 --- a/tests/ui/reachable/issue-11225-1.rs +++ b/tests/ui/reachable/issue-11225-1.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-11225-1.rs -//@ pretty-expanded FIXME #23616 extern crate issue_11225_1 as foo; diff --git a/tests/ui/reachable/issue-11225-2.rs b/tests/ui/reachable/issue-11225-2.rs index d9449564e7f..2f2ca47aa04 100644 --- a/tests/ui/reachable/issue-11225-2.rs +++ b/tests/ui/reachable/issue-11225-2.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-11225-2.rs -//@ pretty-expanded FIXME #23616 extern crate issue_11225_2 as foo; diff --git a/tests/ui/reachable/issue-11225-3.rs b/tests/ui/reachable/issue-11225-3.rs index 6f2d7dafdf6..0d2911bde8b 100644 --- a/tests/ui/reachable/issue-11225-3.rs +++ b/tests/ui/reachable/issue-11225-3.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:issue-11225-3.rs -//@ pretty-expanded FIXME #23616 extern crate issue_11225_3; diff --git a/tests/ui/recursion/instantiable.rs b/tests/ui/recursion/instantiable.rs index 9bbae7dfca0..3fe50e8d011 100644 --- a/tests/ui/recursion/instantiable.rs +++ b/tests/ui/recursion/instantiable.rs @@ -2,7 +2,6 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 use std::ptr; diff --git a/tests/ui/recursion/recursive-types-are-not-uninhabited.stderr b/tests/ui/recursion/recursive-types-are-not-uninhabited.stderr index 5abec88eeff..35d436a1413 100644 --- a/tests/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/tests/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -5,7 +5,7 @@ LL | let Ok(x) = res; | ^^^^^ pattern `Err(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Result<u32, &R<'_>>` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/regions/issue-11612.rs b/tests/ui/regions/issue-11612.rs index b95229ffa4a..af0071e1088 100644 --- a/tests/ui/regions/issue-11612.rs +++ b/tests/ui/regions/issue-11612.rs @@ -4,7 +4,6 @@ // We weren't updating the auto adjustments with all the resolved // type information after type check. -//@ pretty-expanded FIXME #23616 trait A { fn dummy(&self) { } } diff --git a/tests/ui/regions/issue-21520.rs b/tests/ui/regions/issue-21520.rs index 4f92109ab90..825d6f2ee56 100644 --- a/tests/ui/regions/issue-21520.rs +++ b/tests/ui/regions/issue-21520.rs @@ -3,7 +3,6 @@ // Test that the requirement (in `Bar`) that `T::Bar : 'static` does // not wind up propagating to `T`. -//@ pretty-expanded FIXME #23616 pub trait Foo { type Bar; diff --git a/tests/ui/regions/issue-5243.rs b/tests/ui/regions/issue-5243.rs index a346903d652..d3c77403a37 100644 --- a/tests/ui/regions/issue-5243.rs +++ b/tests/ui/regions/issue-5243.rs @@ -4,7 +4,6 @@ // enough for codegen to consider this as non-monomorphic, // which led to various assertions and failures in turn. -//@ pretty-expanded FIXME #23616 struct S<'a> { v: &'a isize diff --git a/tests/ui/regions/issue-6157.rs b/tests/ui/regions/issue-6157.rs index 03a8c14e1a6..8d3002e52c8 100644 --- a/tests/ui/regions/issue-6157.rs +++ b/tests/ui/regions/issue-6157.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub trait OpInt { fn call(&mut self, _: isize, _: isize) -> isize; } diff --git a/tests/ui/regions/owned-implies-static.rs b/tests/ui/regions/owned-implies-static.rs index d97e2f2d239..ffbee5a4bb7 100644 --- a/tests/ui/regions/owned-implies-static.rs +++ b/tests/ui/regions/owned-implies-static.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn f<T: 'static>(_x: T) {} diff --git a/tests/ui/regions/regions-addr-of-interior-of-unique-box.rs b/tests/ui/regions/regions-addr-of-interior-of-unique-box.rs index bd3d4a1acdc..9dd49d35d44 100644 --- a/tests/ui/regions/regions-addr-of-interior-of-unique-box.rs +++ b/tests/ui/regions/regions-addr-of-interior-of-unique-box.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Point { x: isize, diff --git a/tests/ui/regions/regions-assoc-type-region-bound.rs b/tests/ui/regions/regions-assoc-type-region-bound.rs index 1b7fdf11251..86c8359b61a 100644 --- a/tests/ui/regions/regions-assoc-type-region-bound.rs +++ b/tests/ui/regions/regions-assoc-type-region-bound.rs @@ -3,7 +3,6 @@ // Test that the compiler considers the 'a bound declared in the // trait. Issue #20890. -//@ pretty-expanded FIXME #23616 trait Foo<'a> { type Value: 'a; diff --git a/tests/ui/regions/regions-assoc-type-static-bound.rs b/tests/ui/regions/regions-assoc-type-static-bound.rs index 9ffc66d284d..111cffcaf27 100644 --- a/tests/ui/regions/regions-assoc-type-static-bound.rs +++ b/tests/ui/regions/regions-assoc-type-static-bound.rs @@ -3,7 +3,6 @@ // Test that the compiler considers the 'static bound declared in the // trait. Issue #20890. -//@ pretty-expanded FIXME #23616 trait Foo { type Value: 'static; diff --git a/tests/ui/regions/regions-creating-enums2.rs b/tests/ui/regions/regions-creating-enums2.rs index b81344cceec..de6e51b1fbd 100644 --- a/tests/ui/regions/regions-creating-enums2.rs +++ b/tests/ui/regions/regions-creating-enums2.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum ast<'a> { num(usize), diff --git a/tests/ui/regions/regions-creating-enums5.rs b/tests/ui/regions/regions-creating-enums5.rs index 55793fb6202..14221a9d75f 100644 --- a/tests/ui/regions/regions-creating-enums5.rs +++ b/tests/ui/regions/regions-creating-enums5.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum ast<'a> { num(usize), diff --git a/tests/ui/regions/regions-debruijn-of-object.rs b/tests/ui/regions/regions-debruijn-of-object.rs index 04bedf18ef0..a2de66aef37 100644 --- a/tests/ui/regions/regions-debruijn-of-object.rs +++ b/tests/ui/regions/regions-debruijn-of-object.rs @@ -3,7 +3,6 @@ #![allow(unused_variables)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct ctxt<'tcx> { x: &'tcx i32 diff --git a/tests/ui/regions/regions-dependent-autofn.rs b/tests/ui/regions/regions-dependent-autofn.rs index ccbb1219ce2..c58ae5e24ee 100644 --- a/tests/ui/regions/regions-dependent-autofn.rs +++ b/tests/ui/regions/regions-dependent-autofn.rs @@ -2,7 +2,6 @@ // Test lifetimes are linked properly when we autoslice a vector. // Issue #3148. -//@ pretty-expanded FIXME #23616 fn subslice<F>(v: F) -> F where F: FnOnce() { v } diff --git a/tests/ui/regions/regions-dependent-let-ref.rs b/tests/ui/regions/regions-dependent-let-ref.rs index f3127abafb7..23b46abc91d 100644 --- a/tests/ui/regions/regions-dependent-let-ref.rs +++ b/tests/ui/regions/regions-dependent-let-ref.rs @@ -2,7 +2,6 @@ // Test lifetimes are linked properly when we take reference // to interior. -//@ pretty-expanded FIXME #23616 struct Foo(isize); pub fn main() { diff --git a/tests/ui/regions/regions-early-bound-lifetime-in-assoc-fn.rs b/tests/ui/regions/regions-early-bound-lifetime-in-assoc-fn.rs index 1b6c3c93377..c08142154ed 100644 --- a/tests/ui/regions/regions-early-bound-lifetime-in-assoc-fn.rs +++ b/tests/ui/regions/regions-early-bound-lifetime-in-assoc-fn.rs @@ -6,7 +6,6 @@ // lifetime parameters must be early bound in the type of the // associated item. -//@ pretty-expanded FIXME #23616 use std::marker; diff --git a/tests/ui/regions/regions-expl-self.rs b/tests/ui/regions/regions-expl-self.rs index 812201d7e52..552204867f6 100644 --- a/tests/ui/regions/regions-expl-self.rs +++ b/tests/ui/regions/regions-expl-self.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // Test that you can insert an explicit lifetime in explicit self. -//@ pretty-expanded FIXME #23616 struct Foo { f: usize diff --git a/tests/ui/regions/regions-fn-subtyping-2.rs b/tests/ui/regions/regions-fn-subtyping-2.rs index f5332ac1280..98be8de8671 100644 --- a/tests/ui/regions/regions-fn-subtyping-2.rs +++ b/tests/ui/regions/regions-fn-subtyping-2.rs @@ -5,7 +5,6 @@ // Here, `f` is a function that takes a pointer `x` and a function // `g`, where `g` requires its argument `y` to be in the same region // that `x` is in. -//@ pretty-expanded FIXME #23616 fn has_same_region(f: Box<dyn for<'a> FnMut(&'a isize, Box<dyn FnMut(&'a isize)>)>) { // `f` should be the type that `wants_same_region` wants, but diff --git a/tests/ui/regions/regions-fn-subtyping.rs b/tests/ui/regions/regions-fn-subtyping.rs index 7e264eb03d8..dacd2f007c1 100644 --- a/tests/ui/regions/regions-fn-subtyping.rs +++ b/tests/ui/regions/regions-fn-subtyping.rs @@ -3,7 +3,6 @@ #![allow(unused_assignments)] // Issue #2263. -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/tests/ui/regions/regions-infer-reborrow-ref-mut-recurse.rs b/tests/ui/regions/regions-infer-reborrow-ref-mut-recurse.rs index f5d28a28154..f4e5c3a93a6 100644 --- a/tests/ui/regions/regions-infer-reborrow-ref-mut-recurse.rs +++ b/tests/ui/regions/regions-infer-reborrow-ref-mut-recurse.rs @@ -3,7 +3,6 @@ // Test an edge case in region inference: the lifetime of the borrow // of `*x` must be extended to at least 'a. -//@ pretty-expanded FIXME #23616 fn foo<'a,'b>(x: &'a &'b mut isize) -> &'a isize { let y = &*x; // should be inferred to have type &'a &'b mut isize... diff --git a/tests/ui/regions/regions-infer-region-in-fn-but-not-type.rs b/tests/ui/regions/regions-infer-region-in-fn-but-not-type.rs index 165a246935f..402cee201be 100644 --- a/tests/ui/regions/regions-infer-region-in-fn-but-not-type.rs +++ b/tests/ui/regions/regions-infer-region-in-fn-but-not-type.rs @@ -6,7 +6,6 @@ // check that the &isize here does not cause us to think that `foo` // contains region pointers -//@ pretty-expanded FIXME #23616 struct foo(Box<dyn FnMut(&isize)+'static>); diff --git a/tests/ui/regions/regions-infer-static-from-proc.rs b/tests/ui/regions/regions-infer-static-from-proc.rs index 9a130808ae8..09e1c8f635b 100644 --- a/tests/ui/regions/regions-infer-static-from-proc.rs +++ b/tests/ui/regions/regions-infer-static-from-proc.rs @@ -5,7 +5,6 @@ // region variables contained within (otherwise, region inference will // give `x` a very short lifetime). -//@ pretty-expanded FIXME #23616 static i: usize = 3; fn foo<F:FnOnce()+'static>(_: F) {} diff --git a/tests/ui/regions/regions-issue-21422.rs b/tests/ui/regions/regions-issue-21422.rs index 54beed9b3ac..25f5d0f5013 100644 --- a/tests/ui/regions/regions-issue-21422.rs +++ b/tests/ui/regions/regions-issue-21422.rs @@ -3,7 +3,6 @@ // add inference constraints that the operands of a binary operator // should outlive the binary operation itself. -//@ pretty-expanded FIXME #23616 pub struct P<'a> { _ptr: *const &'a u8, diff --git a/tests/ui/regions/regions-issue-22246.rs b/tests/ui/regions/regions-issue-22246.rs index e3bf7b31205..c943f33150e 100644 --- a/tests/ui/regions/regions-issue-22246.rs +++ b/tests/ui/regions/regions-issue-22246.rs @@ -3,7 +3,6 @@ // Regression test for issue #22246 -- we should be able to deduce // that `&'a B::Owned` implies that `B::Owned : 'a`. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/regions/regions-lifetime-nonfree-late-bound.rs b/tests/ui/regions/regions-lifetime-nonfree-late-bound.rs index ee29f44ecc9..57ad6cbbaf7 100644 --- a/tests/ui/regions/regions-lifetime-nonfree-late-bound.rs +++ b/tests/ui/regions/regions-lifetime-nonfree-late-bound.rs @@ -13,7 +13,6 @@ // doing region-folding, when really all clients of the region-folding // case only want to see FREE lifetime variables, not bound ones. -//@ pretty-expanded FIXME #23616 pub fn main() { fn explicit() { diff --git a/tests/ui/regions/regions-link-fn-args.rs b/tests/ui/regions/regions-link-fn-args.rs index 5fed86d5048..9172ebf9664 100644 --- a/tests/ui/regions/regions-link-fn-args.rs +++ b/tests/ui/regions/regions-link-fn-args.rs @@ -2,7 +2,6 @@ // Test that region inference correctly links up the regions when a // `ref` borrow occurs inside a fn argument. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/regions/regions-mock-codegen.rs b/tests/ui/regions/regions-mock-codegen.rs index 4cdbc680e6f..99c86364066 100644 --- a/tests/ui/regions/regions-mock-codegen.rs +++ b/tests/ui/regions/regions-mock-codegen.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 #![feature(allocator_api)] use std::alloc::{handle_alloc_error, Allocator, Global, Layout}; diff --git a/tests/ui/regions/regions-no-bound-in-argument-cleanup.rs b/tests/ui/regions/regions-no-bound-in-argument-cleanup.rs index 2c02ce670b9..3836c661df8 100644 --- a/tests/ui/regions/regions-no-bound-in-argument-cleanup.rs +++ b/tests/ui/regions/regions-no-bound-in-argument-cleanup.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::marker; diff --git a/tests/ui/regions/regions-nullary-variant.rs b/tests/ui/regions/regions-nullary-variant.rs index 8fe0a97c61c..8624f9961f6 100644 --- a/tests/ui/regions/regions-nullary-variant.rs +++ b/tests/ui/regions/regions-nullary-variant.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum roption<'a> { a, b(&'a usize) diff --git a/tests/ui/regions/regions-reassign-let-bound-pointer.rs b/tests/ui/regions/regions-reassign-let-bound-pointer.rs index d2f35973511..7ecfd958512 100644 --- a/tests/ui/regions/regions-reassign-let-bound-pointer.rs +++ b/tests/ui/regions/regions-reassign-let-bound-pointer.rs @@ -5,7 +5,6 @@ // started out with a longer lifetime and was reassigned to a shorter // one (it should infer to be the intersection). -//@ pretty-expanded FIXME #23616 fn foo(x: &isize) { let a = 1; diff --git a/tests/ui/regions/regions-reassign-match-bound-pointer.rs b/tests/ui/regions/regions-reassign-match-bound-pointer.rs index 5e69396aa37..e549804db43 100644 --- a/tests/ui/regions/regions-reassign-match-bound-pointer.rs +++ b/tests/ui/regions/regions-reassign-match-bound-pointer.rs @@ -5,7 +5,6 @@ // started out with a longer lifetime and was reassigned to a shorter // one (it should infer to be the intersection). -//@ pretty-expanded FIXME #23616 fn foo(x: &isize) { let a = 1; diff --git a/tests/ui/regions/regions-scope-chain-example.rs b/tests/ui/regions/regions-scope-chain-example.rs index 01ce04b63d0..184ce015892 100644 --- a/tests/ui/regions/regions-scope-chain-example.rs +++ b/tests/ui/regions/regions-scope-chain-example.rs @@ -9,7 +9,6 @@ // wrong path. The new algorithm avoids this problem and hence this // example typechecks correctly. -//@ pretty-expanded FIXME #23616 enum ScopeChain<'a> { Link(Scope<'a>), diff --git a/tests/ui/regions/regions-variance-contravariant-use-contravariant.rs b/tests/ui/regions/regions-variance-contravariant-use-contravariant.rs index b177f3a0110..db7cf869450 100644 --- a/tests/ui/regions/regions-variance-contravariant-use-contravariant.rs +++ b/tests/ui/regions/regions-variance-contravariant-use-contravariant.rs @@ -7,7 +7,6 @@ // Note: see ui/variance/variance-regions-*.rs for the tests that check that the // variance inference works in the first place. -//@ pretty-expanded FIXME #23616 struct Contravariant<'a> { f: &'a isize diff --git a/tests/ui/regions/regions-variance-covariant-use-covariant.rs b/tests/ui/regions/regions-variance-covariant-use-covariant.rs index bd5959df2e1..4258268c3e0 100644 --- a/tests/ui/regions/regions-variance-covariant-use-covariant.rs +++ b/tests/ui/regions/regions-variance-covariant-use-covariant.rs @@ -9,7 +9,6 @@ // This is covariant with respect to 'a, meaning that // Covariant<'foo> <: Covariant<'static> because // 'foo <= 'static -//@ pretty-expanded FIXME #23616 struct Covariant<'a> { f: extern "Rust" fn(&'a isize) diff --git a/tests/ui/regions/wf-bound-region-in-object-type.rs b/tests/ui/regions/wf-bound-region-in-object-type.rs index caa265b4ea2..c77845ab306 100644 --- a/tests/ui/regions/wf-bound-region-in-object-type.rs +++ b/tests/ui/regions/wf-bound-region-in-object-type.rs @@ -5,7 +5,6 @@ // Test that the `wf` checker properly handles bound regions in object // types. Compiling this code used to trigger an ICE. -//@ pretty-expanded FIXME #23616 pub struct Context<'tcx> { vec: &'tcx Vec<isize> diff --git a/tests/ui/resolve/auxiliary/issue-112831-aux.rs b/tests/ui/resolve/auxiliary/issue-112831-aux.rs index e5c1486d8ae..7d258299c18 100644 --- a/tests/ui/resolve/auxiliary/issue-112831-aux.rs +++ b/tests/ui/resolve/auxiliary/issue-112831-aux.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; struct Zeroable; diff --git a/tests/ui/resolve/auxiliary/proc_macro_generate_packed.rs b/tests/ui/resolve/auxiliary/proc_macro_generate_packed.rs index c0b24706dcb..9a9e0eb3ff7 100644 --- a/tests/ui/resolve/auxiliary/proc_macro_generate_packed.rs +++ b/tests/ui/resolve/auxiliary/proc_macro_generate_packed.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -//@ compile-flags: --crate-type proc-macro - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/resolve/blind-item-mixed-crate-use-item.rs b/tests/ui/resolve/blind-item-mixed-crate-use-item.rs index 9869881db9a..6c1ae737cc2 100644 --- a/tests/ui/resolve/blind-item-mixed-crate-use-item.rs +++ b/tests/ui/resolve/blind-item-mixed-crate-use-item.rs @@ -2,7 +2,6 @@ //@ aux-build:blind-item-mixed-crate-use-item-foo.rs //@ aux-build:blind-item-mixed-crate-use-item-foo2.rs -//@ pretty-expanded FIXME #23616 mod m { pub fn f<T>(_: T, _: (), _: ()) { } diff --git a/tests/ui/resolve/blind-item-mixed-use-item.rs b/tests/ui/resolve/blind-item-mixed-use-item.rs index 416496f3219..7796233c419 100644 --- a/tests/ui/resolve/blind-item-mixed-use-item.rs +++ b/tests/ui/resolve/blind-item-mixed-use-item.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 mod m { pub fn f<T>(_: T, _: ()) { } diff --git a/tests/ui/resolve/const-with-typo-in-pattern-binding.rs b/tests/ui/resolve/const-with-typo-in-pattern-binding.rs new file mode 100644 index 00000000000..fe45cee91db --- /dev/null +++ b/tests/ui/resolve/const-with-typo-in-pattern-binding.rs @@ -0,0 +1,45 @@ +#![deny(unreachable_patterns)] //~ NOTE the lint level is defined here +#![allow(non_snake_case, non_upper_case_globals)] +mod x { + pub use std::env::consts::ARCH; + const X: i32 = 0; //~ NOTE there is a constant of the same name +} +fn main() { + let input: i32 = 42; + + const god: i32 = 1; + const GOOD: i32 = 1; + const BAD: i32 = 2; + + let name: i32 = 42; //~ NOTE there is a binding of the same name + + match input { + X => {} //~ NOTE matches any value + _ => {} //~ ERROR unreachable pattern + //~^ NOTE no value can reach this + } + match input { + GOD => {} //~ HELP you might have meant to pattern match against the value of similarly named constant `god` + //~^ NOTE matches any value + _ => {} //~ ERROR unreachable pattern + //~^ NOTE no value can reach this + } + match input { + GOOOD => {} //~ HELP you might have meant to pattern match against the value of similarly named constant `GOOD` + //~^ NOTE matches any value + _ => {} //~ ERROR unreachable pattern + //~^ NOTE no value can reach this + } + match input { + name => {} + //~^ NOTE matches any value + _ => {} //~ ERROR unreachable pattern + //~^ NOTE no value can reach this + } + match "" { + ARCH => {} //~ HELP you might have meant to pattern match against the value of constant `ARCH` + //~^ NOTE matches any value + _ => {} //~ ERROR unreachable pattern + //~^ NOTE no value can reach this + } +} diff --git a/tests/ui/resolve/const-with-typo-in-pattern-binding.stderr b/tests/ui/resolve/const-with-typo-in-pattern-binding.stderr new file mode 100644 index 00000000000..a0cdac3fa25 --- /dev/null +++ b/tests/ui/resolve/const-with-typo-in-pattern-binding.stderr @@ -0,0 +1,78 @@ +error: unreachable pattern + --> $DIR/const-with-typo-in-pattern-binding.rs:18:9 + | +LL | X => {} + | - matches any value +LL | _ => {} + | ^ no value can reach this + | +note: there is a constant of the same name, which could have been used to pattern match against its value instead of introducing a new catch-all binding, but it is not accessible from this scope + --> $DIR/const-with-typo-in-pattern-binding.rs:5:5 + | +LL | const X: i32 = 0; + | ^^^^^^^^^^^^ +note: the lint level is defined here + --> $DIR/const-with-typo-in-pattern-binding.rs:1:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/const-with-typo-in-pattern-binding.rs:24:9 + | +LL | GOD => {} + | --- matches any value +LL | +LL | _ => {} + | ^ no value can reach this + | +help: you might have meant to pattern match against the value of similarly named constant `god` instead of introducing a new catch-all binding + | +LL | god => {} + | ~~~ + +error: unreachable pattern + --> $DIR/const-with-typo-in-pattern-binding.rs:30:9 + | +LL | GOOOD => {} + | ----- matches any value +LL | +LL | _ => {} + | ^ no value can reach this + | +help: you might have meant to pattern match against the value of similarly named constant `GOOD` instead of introducing a new catch-all binding + | +LL | GOOD => {} + | ~~~~ + +error: unreachable pattern + --> $DIR/const-with-typo-in-pattern-binding.rs:36:9 + | +LL | name => {} + | ---- matches any value +LL | +LL | _ => {} + | ^ no value can reach this + | +note: there is a binding of the same name; if you meant to pattern match against the value of that binding, that is a feature of constants that is not available for `let` bindings + --> $DIR/const-with-typo-in-pattern-binding.rs:14:9 + | +LL | let name: i32 = 42; + | ^^^^ + +error: unreachable pattern + --> $DIR/const-with-typo-in-pattern-binding.rs:42:9 + | +LL | ARCH => {} + | ---- matches any value +LL | +LL | _ => {} + | ^ no value can reach this + | +help: you might have meant to pattern match against the value of constant `ARCH` instead of introducing a new catch-all binding + | +LL | std::env::consts::ARCH => {} + | ~~~~~~~~~~~~~~~~~~~~~~ + +error: aborting due to 5 previous errors + diff --git a/tests/ui/resolve/derive-macro-1.rs b/tests/ui/resolve/derive-macro-1.rs index f4fbb1d2c7c..d39eeba2e6c 100644 --- a/tests/ui/resolve/derive-macro-1.rs +++ b/tests/ui/resolve/derive-macro-1.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:issue-112831-aux.rs +//@ proc-macro: issue-112831-aux.rs mod z { pub trait Zeroable {} diff --git a/tests/ui/resolve/derive-macro-2.rs b/tests/ui/resolve/derive-macro-2.rs index 126f5ae107f..71d791eaef8 100644 --- a/tests/ui/resolve/derive-macro-2.rs +++ b/tests/ui/resolve/derive-macro-2.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:issue-112831-aux.rs +//@ proc-macro: issue-112831-aux.rs extern crate issue_112831_aux; use issue_112831_aux::Zeroable; diff --git a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr index fbb9ede8aa1..c7e9df10d41 100644 --- a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr +++ b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.default.stderr @@ -29,6 +29,20 @@ LL | const _: u32 = T::C; | = note: a `const` is a separate item from the item that contains it +note: erroneous constant encountered + --> $DIR/generic-params-from-outer-item-in-const-item.rs:22:9 + | +LL | I + | ^ + +note: erroneous constant encountered + --> $DIR/generic-params-from-outer-item-in-const-item.rs:22:9 + | +LL | I + | ^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0401`. diff --git a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr index 60aa94038c3..64c436d3ceb 100644 --- a/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr +++ b/tests/ui/resolve/generic-params-from-outer-item-in-const-item.generic_const_items.stderr @@ -35,6 +35,20 @@ LL | const _: u32 = T::C; | = note: a `const` is a separate item from the item that contains it +note: erroneous constant encountered + --> $DIR/generic-params-from-outer-item-in-const-item.rs:22:9 + | +LL | I + | ^ + +note: erroneous constant encountered + --> $DIR/generic-params-from-outer-item-in-const-item.rs:22:9 + | +LL | I + | ^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0401`. diff --git a/tests/ui/resolve/issue-10200.stderr b/tests/ui/resolve/issue-10200.stderr index 172d016c6e6..4b6d9b6f1df 100644 --- a/tests/ui/resolve/issue-10200.stderr +++ b/tests/ui/resolve/issue-10200.stderr @@ -7,7 +7,7 @@ LL | struct Foo(bool); LL | foo(x) | ^^^ help: a tuple struct with a similar name exists (notice the capitalization): `Foo` | - = note: function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-50599.stderr b/tests/ui/resolve/issue-50599.stderr index 24fb3d580b8..427dc9f2049 100644 --- a/tests/ui/resolve/issue-50599.stderr +++ b/tests/ui/resolve/issue-50599.stderr @@ -20,6 +20,12 @@ LL - const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize; LL + const M: usize = (f64::from(N) * LOG10_2) as usize; | +note: erroneous constant encountered + --> $DIR/issue-50599.rs:4:29 + | +LL | let mut digits = [0u32; M]; + | ^ + error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/resolve/proc_macro_generated_packed.rs b/tests/ui/resolve/proc_macro_generated_packed.rs index e8d04f808d0..8459fb79f1e 100644 --- a/tests/ui/resolve/proc_macro_generated_packed.rs +++ b/tests/ui/resolve/proc_macro_generated_packed.rs @@ -1,7 +1,7 @@ //! This test ICEs because the `repr(packed)` attribute //! was generated by a proc macro, so `#[derive]` didn't see it. -//@aux-build: proc_macro_generate_packed.rs +//@proc-macro: proc_macro_generate_packed.rs //@known-bug: #120873 //@ failure-status: 101 //@ normalize-stderr-test: "note: .*\n\n" -> "" diff --git a/tests/ui/return/return-nil.rs b/tests/ui/return/return-nil.rs index 403eae260dc..c2591a77b30 100644 --- a/tests/ui/return/return-nil.rs +++ b/tests/ui/return/return-nil.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn f() { let x = (); return x; } diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr index 1037033c4b7..f89ae241f44 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr @@ -136,7 +136,7 @@ LL | let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit | ^^^^^^^^^^^^^^^ pattern `_` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `NonExhaustiveEnum` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr index 606f808f093..eab2604d4c0 100644 --- a/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr +++ b/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr @@ -6,5 +6,11 @@ LL | !let y = 42; | = note: only supported directly in conditions of `if` and `while` expressions +note: erroneous constant encountered + --> $DIR/avoid-invalid-mir.rs:11:13 + | +LL | x: [(); N] + | ^ + error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs index 389c76337f0..2c7fe2eea33 100644 --- a/tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs +++ b/tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs @@ -1,5 +1,5 @@ // issue-103476 -//@ compile-flags: -Zlint-mir -Zunstable-options +//@ compile-flags: -Zlint-mir //@ edition: 2024 //@ check-pass diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs index 93c2901fe66..176ba837043 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs index c427cf7af6d..9a813666c33 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::TokenStream; diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs b/tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs index 17b59009bb8..cd97587bf03 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs @@ -1,4 +1,4 @@ -//@ aux-build:param-attrs.rs +//@ proc-macro: param-attrs.rs //@ check-pass diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs index 6ed2d4fad0e..89864348eda 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs @@ -1,4 +1,4 @@ -//@ aux-build:param-attrs.rs +//@ proc-macro: param-attrs.rs //@ check-pass diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs index c1e6a92e317..049c5b32cb3 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs @@ -1,4 +1,4 @@ -//@ aux-build:ident-mac.rs +//@ proc-macro: ident-mac.rs #![feature(c_variadic)] #![allow(anonymous_parameters)] diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/auxiliary/count.rs b/tests/ui/rfcs/rfc-3348-c-string-literals/auxiliary/count.rs index e7c560a2c35..aebf8d1e0fc 100644 --- a/tests/ui/rfcs/rfc-3348-c-string-literals/auxiliary/count.rs +++ b/tests/ui/rfcs/rfc-3348-c-string-literals/auxiliary/count.rs @@ -1,7 +1,4 @@ -//@ force-host //@ edition: 2018 -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs b/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs index 57c1ba05560..414d5518e1f 100644 --- a/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs +++ b/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs @@ -6,7 +6,7 @@ //@ edition: 2021 //@ check-pass -//@ aux-build: count.rs +//@ proc-macro: count.rs extern crate count; const _: () = { diff --git a/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs b/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs index d8e5eb884cf..bccde8e8de7 100644 --- a/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs +++ b/tests/ui/rust-2018/auxiliary/suggestions-not-always-applicable.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/rust-2018/suggestions-not-always-applicable.fixed b/tests/ui/rust-2018/suggestions-not-always-applicable.fixed index f94bf2d66d3..e3070ba150b 100644 --- a/tests/ui/rust-2018/suggestions-not-always-applicable.fixed +++ b/tests/ui/rust-2018/suggestions-not-always-applicable.fixed @@ -1,4 +1,4 @@ -//@ aux-build:suggestions-not-always-applicable.rs +//@ proc-macro: suggestions-not-always-applicable.rs //@ edition:2015 //@ run-rustfix //@ rustfix-only-machine-applicable diff --git a/tests/ui/rust-2018/suggestions-not-always-applicable.rs b/tests/ui/rust-2018/suggestions-not-always-applicable.rs index f94bf2d66d3..e3070ba150b 100644 --- a/tests/ui/rust-2018/suggestions-not-always-applicable.rs +++ b/tests/ui/rust-2018/suggestions-not-always-applicable.rs @@ -1,4 +1,4 @@ -//@ aux-build:suggestions-not-always-applicable.rs +//@ proc-macro: suggestions-not-always-applicable.rs //@ edition:2015 //@ run-rustfix //@ rustfix-only-machine-applicable diff --git a/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2018.rs b/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2018.rs index 1273969c4af..469c2e7f8d9 100644 --- a/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2018.rs +++ b/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2018.rs @@ -1,8 +1,4 @@ -//@ force-host //@ edition:2018 -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2021.rs b/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2021.rs index b68701a5165..cfc39d5208b 100644 --- a/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2021.rs +++ b/tests/ui/rust-2021/auxiliary/reserved-prefixes-macro-2021.rs @@ -1,8 +1,4 @@ -//@ force-host //@ edition:2021 -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/rust-2021/reserved-prefixes-via-macro-2.rs b/tests/ui/rust-2021/reserved-prefixes-via-macro-2.rs index b64761b55e9..6c0c7b38c01 100644 --- a/tests/ui/rust-2021/reserved-prefixes-via-macro-2.rs +++ b/tests/ui/rust-2021/reserved-prefixes-via-macro-2.rs @@ -1,6 +1,6 @@ //@ edition:2018 -//@ aux-build:reserved-prefixes-macro-2018.rs -//@ aux-build:reserved-prefixes-macro-2021.rs +//@ proc-macro: reserved-prefixes-macro-2018.rs +//@ proc-macro: reserved-prefixes-macro-2021.rs extern crate reserved_prefixes_macro_2018 as m2018; extern crate reserved_prefixes_macro_2021 as m2021; diff --git a/tests/ui/rust-2021/reserved-prefixes-via-macro.rs b/tests/ui/rust-2021/reserved-prefixes-via-macro.rs index 85f894d7f79..eec1b859c20 100644 --- a/tests/ui/rust-2021/reserved-prefixes-via-macro.rs +++ b/tests/ui/rust-2021/reserved-prefixes-via-macro.rs @@ -1,6 +1,6 @@ //@ run-pass //@ edition:2021 -//@ aux-build:reserved-prefixes-macro-2018.rs +//@ proc-macro: reserved-prefixes-macro-2018.rs extern crate reserved_prefixes_macro_2018 as m2018; diff --git a/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2021.rs b/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2021.rs index 81080fcdce3..ab23e63c0da 100644 --- a/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2021.rs +++ b/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2021.rs @@ -1,8 +1,4 @@ -//@ force-host //@ edition:2021 -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2024.rs b/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2024.rs index 2c3dc30f0ae..0fa908411f5 100644 --- a/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2024.rs +++ b/tests/ui/rust-2024/auxiliary/reserved-guarded-strings-macro-2024.rs @@ -1,9 +1,4 @@ -//@ force-host -//@ compile-flags: -Zunstable-options //@ edition:2024 -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs b/tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs index 7bf5118c340..0f0120b721f 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs +++ b/tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs @@ -1,7 +1,6 @@ //@ revisions: e2021 e2024 //@[e2021] edition: 2021 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@ check-pass #![deny(rust_2024_prelude_collisions)] diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed index 44850c8c45b..ff8c4beca6b 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed +++ b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] 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 496b3197c34..15a3fa11414 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 @@ -1,5 +1,5 @@ error: trait method `poll` will become ambiguous in Rust 2024 - --> $DIR/future-poll-async-block.rs:14:5 + --> $DIR/future-poll-async-block.rs:13:5 | LL | core::pin::pin!(async {}).poll(&mut context()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(async {}), &mut context())` @@ -7,7 +7,7 @@ LL | core::pin::pin!(async {}).poll(&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: the lint level is defined here - --> $DIR/future-poll-async-block.rs:8:9 + --> $DIR/future-poll-async-block.rs:7:9 | LL | #![deny(rust_2024_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs index 614e4c786c5..60b0b2689c2 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs +++ b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed index c96d1dcecc2..f68729e483a 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed +++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] 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 020a00ccdec..633731c2a5a 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 @@ -1,5 +1,5 @@ error: trait method `poll` will become ambiguous in Rust 2024 - --> $DIR/future-poll-not-future-pinned.rs:18:5 + --> $DIR/future-poll-not-future-pinned.rs:17:5 | LL | core::pin::pin!(()).poll(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(()))` @@ -7,7 +7,7 @@ LL | core::pin::pin!(()).poll(); = 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: the lint level is defined here - --> $DIR/future-poll-not-future-pinned.rs:8:9 + --> $DIR/future-poll-not-future-pinned.rs:7:9 | LL | #![deny(rust_2024_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs index 21b170a5f1d..4845ef779e0 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs +++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs b/tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs index 899b69ebfc2..36578e28b80 100644 --- a/tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs +++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs @@ -1,7 +1,6 @@ //@ revisions: e2021 e2024 //@[e2021] edition: 2021 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@ check-pass #![deny(rust_2024_prelude_collisions)] diff --git a/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed index 0b0873eb238..03bf4ab19c1 100644 --- a/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed +++ b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] 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 b74e80e2a4a..e67f07b4e46 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 @@ -1,5 +1,5 @@ error: trait method `into_future` will become ambiguous in Rust 2024 - --> $DIR/into-future-adt.rs:26:5 + --> $DIR/into-future-adt.rs:25:5 | LL | Cat.into_future(); | ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::into_future(&Cat)` @@ -7,7 +7,7 @@ LL | Cat.into_future(); = 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: the lint level is defined here - --> $DIR/into-future-adt.rs:8:9 + --> $DIR/into-future-adt.rs:7:9 | LL | #![deny(rust_2024_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/prelude-migration/into-future-adt.rs b/tests/ui/rust-2024/prelude-migration/into-future-adt.rs index 0db70930bc7..65edc88baab 100644 --- a/tests/ui/rust-2024/prelude-migration/into-future-adt.rs +++ b/tests/ui/rust-2024/prelude-migration/into-future-adt.rs @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] diff --git a/tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs b/tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs index 6bc2ea31705..16ac89759f3 100644 --- a/tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs +++ b/tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs @@ -1,7 +1,6 @@ //@ revisions: e2021 e2024 //@[e2021] edition: 2021 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@ check-pass #![deny(rust_2024_prelude_collisions)] diff --git a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed index a798014d93d..4e082883395 100644 --- a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed +++ b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] 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 6ea4580ca72..0588f5bf3f5 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 @@ -1,5 +1,5 @@ error: trait method `into_future` will become ambiguous in Rust 2024 - --> $DIR/into-future-not-into-future.rs:20:5 + --> $DIR/into-future-not-into-future.rs:19:5 | LL | Cat.into_future(); | ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::into_future(&Cat)` @@ -7,7 +7,7 @@ LL | Cat.into_future(); = 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: the lint level is defined here - --> $DIR/into-future-not-into-future.rs:8:9 + --> $DIR/into-future-not-into-future.rs:7:9 | LL | #![deny(rust_2024_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs index 23e81cfe6b4..f640d9b50bb 100644 --- a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs +++ b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs @@ -2,7 +2,6 @@ //@[e2021] edition: 2021 //@[e2021] run-rustfix //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options //@[e2024] check-pass #![deny(rust_2024_prelude_collisions)] diff --git a/tests/ui/rust-2024/prelude2024.rs b/tests/ui/rust-2024/prelude2024.rs index e58ebe74188..b7573948d9a 100644 --- a/tests/ui/rust-2024/prelude2024.rs +++ b/tests/ui/rust-2024/prelude2024.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ compile-flags: -Zunstable-options //@ edition:2024 fn main() { diff --git a/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs b/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs index 83e0dcbb4be..43413f7470e 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs +++ b/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs @@ -26,24 +26,24 @@ macro_rules! demo7 { fn main() { demo3!(## "foo"); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!(### "foo"); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!(## "foo"#); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo7!(### "foo"###); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo5!(###"foo"#); @@ -56,14 +56,14 @@ fn main() { demo5!(#"foo"###); //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!("foo"###); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 // Non-ascii identifiers diff --git a/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr b/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr index e2e1ac42f05..4d54a08617b 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr +++ b/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr @@ -28,7 +28,7 @@ error: identifiers cannot contain emoji: `🙃` LL | demo3!(🙃#""); | ^^ -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:28:12 | LL | demo3!(## "foo"); @@ -41,12 +41,12 @@ note: the lint level is defined here | LL | #![warn(rust_2024_guarded_string_incompatible_syntax)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo3!(# # "foo"); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:31:12 | LL | demo4!(### "foo"); @@ -54,12 +54,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# ## "foo"); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:31:13 | LL | demo4!(### "foo"); @@ -67,12 +67,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(## # "foo"); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:36:12 | LL | demo4!(## "foo"#); @@ -80,12 +80,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# # "foo"#); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:39:12 | LL | demo7!(### "foo"###); @@ -93,12 +93,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(# ## "foo"###); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:39:13 | LL | demo7!(### "foo"###); @@ -106,12 +106,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(## # "foo"###); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:39:21 | LL | demo7!(### "foo"###); @@ -119,12 +119,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(### "foo"# ##); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:39:22 | LL | demo7!(### "foo"###); @@ -132,7 +132,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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo7!(### "foo"## #); | + @@ -189,7 +189,7 @@ help: insert whitespace here to avoid this being parsed as a guarded string in R LL | demo5!(# "foo"###); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:56:18 | LL | demo5!(#"foo"###); @@ -197,12 +197,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo5!(#"foo"# ##); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:56:19 | LL | demo5!(#"foo"###); @@ -210,12 +210,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo5!(#"foo"## #); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:63:17 | LL | demo4!("foo"###); @@ -223,12 +223,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"# ##); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-lexing.rs:63:18 | LL | demo4!("foo"###); @@ -236,7 +236,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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"## #); | + diff --git a/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed b/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed index d92df7b5375..ef00ed3f610 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed +++ b/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed @@ -38,28 +38,28 @@ fn main() { demo2!("foo"#); demo3!(# # "foo"); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!(# # # "foo"); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!(# # "foo"#); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo6!(# # # "foo"# #); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!("foo"# # #); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo2!(# ""); @@ -94,6 +94,6 @@ fn main() { //~| WARNING hard error in Rust 2024 //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 } diff --git a/tests/ui/rust-2024/reserved-guarded-strings-migration.rs b/tests/ui/rust-2024/reserved-guarded-strings-migration.rs index 5905f2abe32..cf2d8716ad2 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-migration.rs +++ b/tests/ui/rust-2024/reserved-guarded-strings-migration.rs @@ -38,28 +38,28 @@ fn main() { demo2!("foo"#); demo3!(## "foo"); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!(### "foo"); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!(## "foo"#); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo6!(### "foo"##); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo4!("foo"###); - //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 demo2!(#""); @@ -94,6 +94,6 @@ fn main() { //~| WARNING hard error in Rust 2024 //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 - //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] + //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax] //~| WARNING hard error in Rust 2024 } diff --git a/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr b/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr index d7f8e5c9b4b..b17ae941ef4 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr +++ b/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr @@ -1,4 +1,4 @@ -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:40:12 | LL | demo3!(## "foo"); @@ -11,12 +11,12 @@ note: the lint level is defined here | LL | #![warn(rust_2024_guarded_string_incompatible_syntax)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo3!(# # "foo"); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:43:12 | LL | demo4!(### "foo"); @@ -24,12 +24,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# ## "foo"); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:43:13 | LL | demo4!(### "foo"); @@ -37,12 +37,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(## # "foo"); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:48:12 | LL | demo4!(## "foo"#); @@ -50,12 +50,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!(# # "foo"#); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:51:12 | LL | demo6!(### "foo"##); @@ -63,12 +63,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo6!(# ## "foo"##); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:51:13 | LL | demo6!(### "foo"##); @@ -76,12 +76,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo6!(## # "foo"##); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:51:21 | LL | demo6!(### "foo"##); @@ -89,12 +89,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo6!(### "foo"# #); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:59:17 | LL | demo4!("foo"###); @@ -102,12 +102,12 @@ 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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"# ##); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:59:18 | LL | demo4!("foo"###); @@ -115,7 +115,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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024 | LL | demo4!("foo"## #); | + @@ -276,7 +276,7 @@ help: insert whitespace here to avoid this being parsed as a guarded string in R LL | demo5!(## "foo"##); | + -warning: will be parsed as a guarded string in Rust 2024 +warning: reserved token in Rust 2024 --> $DIR/reserved-guarded-strings-migration.rs:92:19 | LL | demo5!(##"foo"##); @@ -284,7 +284,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 issue #123735 <https://github.com/rust-lang/rust/issues/123735> -help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024 +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/reserved-guarded-strings-via-macro-2.rs b/tests/ui/rust-2024/reserved-guarded-strings-via-macro-2.rs index 3f9f373ba22..6b0103d4a50 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-via-macro-2.rs +++ b/tests/ui/rust-2024/reserved-guarded-strings-via-macro-2.rs @@ -1,6 +1,6 @@ //@ edition:2021 -//@ aux-build:reserved-guarded-strings-macro-2021.rs -//@ aux-build:reserved-guarded-strings-macro-2024.rs +//@ proc-macro: reserved-guarded-strings-macro-2021.rs +//@ proc-macro: reserved-guarded-strings-macro-2024.rs extern crate reserved_guarded_strings_macro_2021 as m2021; extern crate reserved_guarded_strings_macro_2024 as m2024; diff --git a/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs b/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs index f9e3c1e3c51..ead2ab40b77 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs +++ b/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs @@ -1,7 +1,6 @@ //@ run-pass -//@ compile-flags: -Zunstable-options //@ edition:2024 -//@ aux-build:reserved-guarded-strings-macro-2021.rs +//@ proc-macro: reserved-guarded-strings-macro-2021.rs extern crate reserved_guarded_strings_macro_2021 as m2021; diff --git a/tests/ui/rust-2024/reserved-guarded-strings.rs b/tests/ui/rust-2024/reserved-guarded-strings.rs index dab97039be0..ae68d34cb86 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings.rs +++ b/tests/ui/rust-2024/reserved-guarded-strings.rs @@ -1,4 +1,3 @@ -//@ compile-flags: -Zunstable-options //@ edition:2024 // ignore-tidy-linelength @@ -47,13 +46,13 @@ fn main() { //~^ ERROR prefix `blah` is unknown //~| ERROR invalid string literal - demo2!(## "foo"); //~ ERROR invalid string literal - demo3!("foo"###); //~ ERROR invalid string literal - demo3!(### "foo"); //~ ERROR invalid string literal - demo3!(## "foo"#); //~ ERROR invalid string literal + demo2!(## "foo"); //~ reserved multi-hash token is forbidden + demo3!("foo"###); //~ reserved multi-hash token is forbidden + demo3!(### "foo"); //~ reserved multi-hash token is forbidden + demo3!(## "foo"#); //~ reserved multi-hash token is forbidden demo5!(### "foo"###); - //~^ ERROR invalid string literal - //~| ERROR invalid string literal + //~^ reserved multi-hash token is forbidden + //~| reserved multi-hash token is forbidden demo1!(#""); //~ ERROR invalid string literal demo1!(#""#); //~ ERROR invalid string literal @@ -66,7 +65,7 @@ fn main() { demo1!(###"foo"###); //~ ERROR invalid string literal demo2!(#"foo"###); //~^ ERROR invalid string literal - //~| ERROR invalid string literal + //~| ERROR reserved multi-hash token is forbidden // More than 255 hashes demon!(####################################################################################################################################################################################################################################################################"foo"); diff --git a/tests/ui/rust-2024/reserved-guarded-strings.stderr b/tests/ui/rust-2024/reserved-guarded-strings.stderr index f465ba7944a..0f3b06147c4 100644 --- a/tests/ui/rust-2024/reserved-guarded-strings.stderr +++ b/tests/ui/rust-2024/reserved-guarded-strings.stderr @@ -1,5 +1,5 @@ error: prefix `blah` is unknown - --> $DIR/reserved-guarded-strings.rs:45:12 + --> $DIR/reserved-guarded-strings.rs:44:12 | LL | demo2!(blah"xx"); | ^^^^ unknown prefix @@ -11,7 +11,7 @@ LL | demo2!(blah "xx"); | + error: prefix `blah` is unknown - --> $DIR/reserved-guarded-strings.rs:46:12 + --> $DIR/reserved-guarded-strings.rs:45:12 | LL | demo2!(blah#"xx"#); | ^^^^ unknown prefix @@ -23,7 +23,7 @@ LL | demo2!(blah #"xx"#); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:46:16 + --> $DIR/reserved-guarded-strings.rs:45:16 | LL | demo2!(blah#"xx"#); | ^^^^^^ @@ -34,80 +34,80 @@ help: consider inserting whitespace here LL | demo2!(blah# "xx"#); | + -error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:50:12 +error: reserved multi-hash token is forbidden + --> $DIR/reserved-guarded-strings.rs:49:12 | LL | demo2!(## "foo"); | ^^ | - = note: unprefixed guarded string literals are reserved for future use since Rust 2024 + = note: sequences of two or more # are reserved for future use since Rust 2024 help: consider inserting whitespace here | LL | demo2!(# # "foo"); | + -error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:51:17 +error: reserved multi-hash token is forbidden + --> $DIR/reserved-guarded-strings.rs:50:17 | LL | demo3!("foo"###); | ^^ | - = note: unprefixed guarded string literals are reserved for future use since Rust 2024 + = note: sequences of two or more # are reserved for future use since Rust 2024 help: consider inserting whitespace here | LL | demo3!("foo"# ##); | + -error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:52:12 +error: reserved multi-hash token is forbidden + --> $DIR/reserved-guarded-strings.rs:51:12 | LL | demo3!(### "foo"); | ^^ | - = note: unprefixed guarded string literals are reserved for future use since Rust 2024 + = note: sequences of two or more # are reserved for future use since Rust 2024 help: consider inserting whitespace here | LL | demo3!(# ## "foo"); | + -error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:53:12 +error: reserved multi-hash token is forbidden + --> $DIR/reserved-guarded-strings.rs:52:12 | LL | demo3!(## "foo"#); | ^^ | - = note: unprefixed guarded string literals are reserved for future use since Rust 2024 + = note: sequences of two or more # are reserved for future use since Rust 2024 help: consider inserting whitespace here | LL | demo3!(# # "foo"#); | + -error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:54:12 +error: reserved multi-hash token is forbidden + --> $DIR/reserved-guarded-strings.rs:53:12 | LL | demo5!(### "foo"###); | ^^ | - = note: unprefixed guarded string literals are reserved for future use since Rust 2024 + = note: sequences of two or more # are reserved for future use since Rust 2024 help: consider inserting whitespace here | LL | demo5!(# ## "foo"###); | + -error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:54:21 +error: reserved multi-hash token is forbidden + --> $DIR/reserved-guarded-strings.rs:53:21 | LL | demo5!(### "foo"###); | ^^ | - = note: unprefixed guarded string literals are reserved for future use since Rust 2024 + = note: sequences of two or more # are reserved for future use since Rust 2024 help: consider inserting whitespace here | LL | demo5!(### "foo"# ##); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:58:12 + --> $DIR/reserved-guarded-strings.rs:57:12 | LL | demo1!(#""); | ^^^ @@ -119,7 +119,7 @@ LL | demo1!(# ""); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:59:12 + --> $DIR/reserved-guarded-strings.rs:58:12 | LL | demo1!(#""#); | ^^^^ @@ -131,7 +131,7 @@ LL | demo1!(# ""#); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:60:12 + --> $DIR/reserved-guarded-strings.rs:59:12 | LL | demo1!(####""); | ^^^^^^ @@ -143,7 +143,7 @@ LL | demo1!(# ###""); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:61:12 + --> $DIR/reserved-guarded-strings.rs:60:12 | LL | demo1!(#"foo"); | ^^^^^^ @@ -155,7 +155,7 @@ LL | demo1!(# "foo"); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:62:12 + --> $DIR/reserved-guarded-strings.rs:61:12 | LL | demo1!(###"foo"); | ^^^^^^^^ @@ -167,7 +167,7 @@ LL | demo1!(# ##"foo"); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:63:12 + --> $DIR/reserved-guarded-strings.rs:62:12 | LL | demo1!(#"foo"#); | ^^^^^^^ @@ -179,7 +179,7 @@ LL | demo1!(# "foo"#); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:64:12 + --> $DIR/reserved-guarded-strings.rs:63:12 | LL | demo1!(###"foo"#); | ^^^^^^^^^ @@ -191,7 +191,7 @@ LL | demo1!(# ##"foo"#); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:65:12 + --> $DIR/reserved-guarded-strings.rs:64:12 | LL | demo1!(###"foo"##); | ^^^^^^^^^^ @@ -203,7 +203,7 @@ LL | demo1!(# ##"foo"##); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:66:12 + --> $DIR/reserved-guarded-strings.rs:65:12 | LL | demo1!(###"foo"###); | ^^^^^^^^^^^ @@ -215,7 +215,7 @@ LL | demo1!(# ##"foo"###); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:67:12 + --> $DIR/reserved-guarded-strings.rs:66:12 | LL | demo2!(#"foo"###); | ^^^^^^^ @@ -226,20 +226,20 @@ help: consider inserting whitespace here LL | demo2!(# "foo"###); | + -error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:67:19 +error: reserved multi-hash token is forbidden + --> $DIR/reserved-guarded-strings.rs:66:19 | LL | demo2!(#"foo"###); | ^^ | - = note: unprefixed guarded string literals are reserved for future use since Rust 2024 + = note: sequences of two or more # are reserved for future use since Rust 2024 help: consider inserting whitespace here | LL | demo2!(#"foo"## #); | + error: invalid string literal - --> $DIR/reserved-guarded-strings.rs:72:12 + --> $DIR/reserved-guarded-strings.rs:71:12 | LL | ...n!(####################################################################################################################################################################################################################################################################"foo... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/unsafe-attributes/auxiliary/unsafe-attributes-pm.rs b/tests/ui/rust-2024/unsafe-attributes/auxiliary/unsafe-attributes-pm.rs new file mode 100644 index 00000000000..cab6af57cb1 --- /dev/null +++ b/tests/ui/rust-2024/unsafe-attributes/auxiliary/unsafe-attributes-pm.rs @@ -0,0 +1,19 @@ +//@ edition: 2018 + +extern crate proc_macro; + +use proc_macro::TokenStream; + +#[proc_macro] +pub fn missing_unsafe(_input: TokenStream) -> TokenStream { + "#[no_mangle] pub fn abc() {}".parse().unwrap() +} + +#[proc_macro] +pub fn macro_rules_missing_unsafe(_input: TokenStream) -> TokenStream { + "macro_rules! make_fn { + () => { #[no_mangle] pub fn foo() { } }; + }" + .parse() + .unwrap() +} diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs index 7c919fed976..79fba46c77f 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs @@ -1,7 +1,6 @@ //@ revisions: edition2021 edition2024 //@[edition2021] edition:2021 //@[edition2024] edition:2024 -//@[edition2024] compile-flags: -Zunstable-options //@ check-pass diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs new file mode 100644 index 00000000000..e2c504e708c --- /dev/null +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs @@ -0,0 +1,16 @@ +// Test for unsafe attributes generated by a proc-macro. +// See https://github.com/rust-lang/rust/issues/132906 + +//@ revisions: edition2021 edition2024 +//@ check-pass +//@[edition2021] edition:2021 +//@[edition2024] edition:2024 +//@ proc-macro: unsafe-attributes-pm.rs + +unsafe_attributes_pm::missing_unsafe!(); + +unsafe_attributes_pm::macro_rules_missing_unsafe!(); + +make_fn!(); + +fn main() {} diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr index fb697e14ef1..5c3927a0928 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr @@ -1,5 +1,5 @@ error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes.rs:8:3 + --> $DIR/unsafe-attributes.rs:7:3 | LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs index f6f2994bb6d..4b161bc34ea 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs @@ -2,7 +2,6 @@ //@[edition2021] edition:2021 //@[edition2021] check-pass //@[edition2024] edition:2024 -//@[edition2024] compile-flags: -Zunstable-options #[no_mangle] //[edition2024]~ ERROR: unsafe attribute used without unsafe diff --git a/tests/ui/rust-2024/unsafe-before_exec.e2024.stderr b/tests/ui/rust-2024/unsafe-before_exec.e2024.stderr index 2798ccdefd0..10d0e8b830c 100644 --- a/tests/ui/rust-2024/unsafe-before_exec.e2024.stderr +++ b/tests/ui/rust-2024/unsafe-before_exec.e2024.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `before_exec` is unsafe and requires unsafe block - --> $DIR/unsafe-before_exec.rs:14:5 + --> $DIR/unsafe-before_exec.rs:13:5 | LL | cmd.before_exec(|| Ok(())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/rust-2024/unsafe-before_exec.rs b/tests/ui/rust-2024/unsafe-before_exec.rs index 540394da80e..44a955e229d 100644 --- a/tests/ui/rust-2024/unsafe-before_exec.rs +++ b/tests/ui/rust-2024/unsafe-before_exec.rs @@ -3,7 +3,6 @@ //@[e2021] edition: 2021 //@[e2021] check-pass //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options use std::process::Command; use std::os::unix::process::CommandExt; diff --git a/tests/ui/rust-2024/unsafe-env.e2021.stderr b/tests/ui/rust-2024/unsafe-env.e2021.stderr index 90c1df192aa..6f9618eb14b 100644 --- a/tests/ui/rust-2024/unsafe-env.e2021.stderr +++ b/tests/ui/rust-2024/unsafe-env.e2021.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `unsafe_fn` is unsafe and requires unsafe block - --> $DIR/unsafe-env.rs:15:9 + --> $DIR/unsafe-env.rs:14:9 | LL | unsafe_fn(); | ^^^^^^^^^^^ call to unsafe function @@ -7,18 +7,18 @@ LL | unsafe_fn(); = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668> = 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:9:1 + --> $DIR/unsafe-env.rs:8:1 | LL | unsafe fn unsafe_fn() { | ^^^^^^^^^^^^^^^^^^^^^ note: the lint level is defined here - --> $DIR/unsafe-env.rs:8:8 + --> $DIR/unsafe-env.rs:7:8 | LL | #[deny(unsafe_op_in_unsafe_fn)] | ^^^^^^^^^^^^^^^^^^^^^^ error[E0133]: call to unsafe function `unsafe_fn` is unsafe and requires unsafe function or block - --> $DIR/unsafe-env.rs:33:5 + --> $DIR/unsafe-env.rs:32:5 | LL | unsafe_fn(); | ^^^^^^^^^^^ call to unsafe function @@ -26,13 +26,13 @@ LL | unsafe_fn(); = note: consult the function's documentation for information on how to avoid undefined behavior error: unnecessary `unsafe` block - --> $DIR/unsafe-env.rs:36:5 + --> $DIR/unsafe-env.rs:35:5 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/unsafe-env.rs:21:8 + --> $DIR/unsafe-env.rs:20:8 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/unsafe-env.e2024.stderr b/tests/ui/rust-2024/unsafe-env.e2024.stderr index 5ecdf3cd7a7..04a35933c79 100644 --- a/tests/ui/rust-2024/unsafe-env.e2024.stderr +++ b/tests/ui/rust-2024/unsafe-env.e2024.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `std::env::set_var` is unsafe and requires unsafe block - --> $DIR/unsafe-env.rs:10:5 + --> $DIR/unsafe-env.rs:9:5 | LL | env::set_var("FOO", "BAR"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -7,18 +7,18 @@ LL | env::set_var("FOO", "BAR"); = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668> = 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:9:1 + --> $DIR/unsafe-env.rs:8:1 | LL | unsafe fn unsafe_fn() { | ^^^^^^^^^^^^^^^^^^^^^ note: the lint level is defined here - --> $DIR/unsafe-env.rs:8:8 + --> $DIR/unsafe-env.rs:7:8 | LL | #[deny(unsafe_op_in_unsafe_fn)] | ^^^^^^^^^^^^^^^^^^^^^^ error[E0133]: call to unsafe function `std::env::remove_var` is unsafe and requires unsafe block - --> $DIR/unsafe-env.rs:12:5 + --> $DIR/unsafe-env.rs:11:5 | LL | env::remove_var("FOO"); | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -27,7 +27,7 @@ LL | env::remove_var("FOO"); = 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 - --> $DIR/unsafe-env.rs:15:9 + --> $DIR/unsafe-env.rs:14:9 | LL | unsafe_fn(); | ^^^^^^^^^^^ call to unsafe function @@ -36,7 +36,7 @@ LL | unsafe_fn(); = 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 - --> $DIR/unsafe-env.rs:23:5 + --> $DIR/unsafe-env.rs:22:5 | LL | env::set_var("FOO", "BAR"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -44,7 +44,7 @@ LL | env::set_var("FOO", "BAR"); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `remove_var` is unsafe and requires unsafe block - --> $DIR/unsafe-env.rs:25:5 + --> $DIR/unsafe-env.rs:24:5 | LL | env::remove_var("FOO"); | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -52,7 +52,7 @@ LL | env::remove_var("FOO"); = 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 - --> $DIR/unsafe-env.rs:33:5 + --> $DIR/unsafe-env.rs:32:5 | LL | unsafe_fn(); | ^^^^^^^^^^^ call to unsafe function @@ -60,13 +60,13 @@ LL | unsafe_fn(); = note: consult the function's documentation for information on how to avoid undefined behavior error: unnecessary `unsafe` block - --> $DIR/unsafe-env.rs:36:5 + --> $DIR/unsafe-env.rs:35:5 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/unsafe-env.rs:21:8 + --> $DIR/unsafe-env.rs:20:8 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/unsafe-env.rs b/tests/ui/rust-2024/unsafe-env.rs index 601f44e1d3e..4a7c646323a 100644 --- a/tests/ui/rust-2024/unsafe-env.rs +++ b/tests/ui/rust-2024/unsafe-env.rs @@ -1,7 +1,6 @@ //@ revisions: e2021 e2024 //@[e2021] edition: 2021 //@[e2024] edition: 2024 -//@[e2024] compile-flags: -Zunstable-options use std::env; diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr index 77554da10e6..50201140cda 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe function or block - --> $DIR/extern-items-unsafe.rs:12:5 + --> $DIR/extern-items-unsafe.rs:11:5 | LL | test1(TEST1); | ^^^^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | test1(TEST1); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/extern-items-unsafe.rs:12:11 + --> $DIR/extern-items-unsafe.rs:11:11 | LL | test1(TEST1); | ^^^^^ use of extern static diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr index 33b752782d5..fa79d76546a 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe block - --> $DIR/extern-items-unsafe.rs:12:5 + --> $DIR/extern-items-unsafe.rs:11:5 | LL | test1(TEST1); | ^^^^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | test1(TEST1); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: use of extern static is unsafe and requires unsafe block - --> $DIR/extern-items-unsafe.rs:12:11 + --> $DIR/extern-items-unsafe.rs:11:11 | LL | test1(TEST1); | ^^^^^ use of extern static diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs index 721e07acca5..7bb4f666924 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs @@ -1,7 +1,6 @@ //@ revisions: edition2021 edition2024 //@[edition2021] edition:2021 //@[edition2024] edition:2024 -//@[edition2024] compile-flags: -Zunstable-options unsafe extern "C" { static TEST1: i32; diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr index 8ef7c2caf21..17b49d8ed5c 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr @@ -1,5 +1,5 @@ error: extern blocks must be unsafe - --> $DIR/extern-items.rs:7:1 + --> $DIR/extern-items.rs:6:1 | LL | / extern "C" { LL | | diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs index 08805c36347..8c0b8bc8899 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs @@ -2,7 +2,6 @@ //@[edition2021] edition:2021 //@[edition2021] check-pass //@[edition2024] edition:2024 -//@[edition2024] compile-flags: -Zunstable-options extern "C" { //[edition2024]~^ ERROR extern blocks must be unsafe diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs b/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs index b0b8a8b012a..2b2d58c3eb3 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs @@ -1,7 +1,6 @@ //@ revisions: edition2021 edition2024 //@[edition2021] edition:2021 //@[edition2024] edition:2024 -//@[edition2024] compile-flags: -Zunstable-options //@ check-pass unsafe extern "C" { diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr index ddc5477116f..07d934da24b 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr @@ -1,5 +1,5 @@ error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers - --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5 + --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:7:5 | LL | safe static TEST1: i32; | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -10,7 +10,7 @@ LL | unsafe extern "C" { | ++++++ error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers - --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5 + --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:9:5 | LL | safe fn test1(i: i32); | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr index ae7b4cd47c0..cceb3bddef4 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr @@ -1,5 +1,5 @@ error: extern blocks must be unsafe - --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:6:1 + --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:5:1 | LL | / extern "C" { LL | | @@ -11,7 +11,7 @@ LL | | } | |_^ error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers - --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5 + --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:7:5 | LL | safe static TEST1: i32; | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -22,7 +22,7 @@ LL | unsafe extern "C" { | ++++++ error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers - --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5 + --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:9:5 | LL | safe fn test1(i: i32); | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs index 89415a69f08..a5a6ccdffa0 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs @@ -1,7 +1,6 @@ //@ revisions: edition2021 edition2024 //@[edition2021] edition:2021 //@[edition2024] edition:2024 -//@[edition2024] compile-flags: -Zunstable-options extern "C" { //[edition2024]~^ ERROR extern blocks must be unsafe diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr index e3626bb497e..9433dd1f2e5 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe function or block - --> $DIR/unsafe-items.rs:18:5 + --> $DIR/unsafe-items.rs:17:5 | LL | test1(TEST1); | ^^^^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | test1(TEST1); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/unsafe-items.rs:18:11 + --> $DIR/unsafe-items.rs:17:11 | LL | test1(TEST1); | ^^^^^ use of extern static diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr index 89bc501b7b5..af86b4c5805 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe block - --> $DIR/unsafe-items.rs:18:5 + --> $DIR/unsafe-items.rs:17:5 | LL | test1(TEST1); | ^^^^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | test1(TEST1); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: use of extern static is unsafe and requires unsafe block - --> $DIR/unsafe-items.rs:18:11 + --> $DIR/unsafe-items.rs:17:11 | LL | test1(TEST1); | ^^^^^ use of extern static diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs index dc2bae892a9..50c97b51768 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs @@ -1,7 +1,6 @@ //@ revisions: edition2021 edition2024 //@[edition2021] edition:2021 //@[edition2024] edition:2024 -//@[edition2024] compile-flags: -Zunstable-options unsafe extern "C" { unsafe static TEST1: i32; diff --git a/tests/ui/sanitizer/cfi/can-reveal-opaques.rs b/tests/ui/sanitizer/cfi/can-reveal-opaques.rs index 55988a62a8c..99c12d72eb5 100644 --- a/tests/ui/sanitizer/cfi/can-reveal-opaques.rs +++ b/tests/ui/sanitizer/cfi/can-reveal-opaques.rs @@ -39,6 +39,6 @@ fn main() { // So why is the second generic of `test` "`()`", and not the // `impl Sized` since we inferred it from the return type of `rpit_fn` // during typeck? Well, that's because we're using the generics from the - // terminator of the MIR, which has had the RevealAll pass performed on it. + // terminator of the MIR, which has had the PostAnalysisNormalize pass performed on it. let _ = test(rpit_fn); } diff --git a/tests/ui/sanitizer/cfi/coroutine.rs b/tests/ui/sanitizer/cfi/coroutine.rs index ad994fcf737..ec7c5888968 100644 --- a/tests/ui/sanitizer/cfi/coroutine.rs +++ b/tests/ui/sanitizer/cfi/coroutine.rs @@ -11,7 +11,7 @@ //@ [cfi] compile-flags: -Z sanitizer=cfi //@ [kcfi] compile-flags: -Z sanitizer=kcfi //@ [kcfi] compile-flags: -C panic=abort -Z panic-abort-tests -C prefer-dynamic=off -//@ compile-flags: --test -Z unstable-options +//@ compile-flags: --test //@ run-pass #![feature(coroutines, stmt_expr_attributes)] diff --git a/tests/ui/self/arbitrary-self-from-method-substs-ice.rs b/tests/ui/self/arbitrary-self-from-method-substs-ice.rs index d121a194be6..2c0f25fc6ff 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-ice.rs +++ b/tests/ui/self/arbitrary-self-from-method-substs-ice.rs @@ -11,7 +11,7 @@ impl Foo { //~^ ERROR invalid generic `self` parameter type //~| ERROR destructor of `R` cannot be evaluated at compile-time self.0 - //~^ ERROR cannot call non-const fn `<R as Deref>::deref` in constant function + //~^ ERROR cannot call conditionally-const method `<R as Deref>::deref` in constant function } } diff --git a/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr b/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr index 7252b5890fd..e4991823d28 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr +++ b/tests/ui/self/arbitrary-self-from-method-substs-ice.stderr @@ -1,10 +1,12 @@ -error[E0015]: cannot call non-const fn `<R as Deref>::deref` in constant functions +error[E0658]: cannot call conditionally-const method `<R as Deref>::deref` in constant functions --> $DIR/arbitrary-self-from-method-substs-ice.rs:13:9 | LL | self.0 | ^^^^^^ | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants + = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> 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 error[E0493]: destructor of `R` cannot be evaluated at compile-time --> $DIR/arbitrary-self-from-method-substs-ice.rs:10:43 @@ -15,6 +17,12 @@ LL | const fn get<R: Deref<Target = Self>>(self: R) -> u32 { LL | } | - value is dropped here +note: erroneous constant encountered + --> $DIR/arbitrary-self-from-method-substs-ice.rs:24:5 + | +LL | FOO; + | ^^^ + error[E0801]: invalid generic `self` parameter type: `R` --> $DIR/arbitrary-self-from-method-substs-ice.rs:10:49 | @@ -26,5 +34,5 @@ LL | const fn get<R: Deref<Target = Self>>(self: R) -> u32 { error: aborting due to 3 previous errors -Some errors have detailed explanations: E0015, E0493, E0801. -For more information about an error, try `rustc --explain E0015`. +Some errors have detailed explanations: E0493, E0658, E0801. +For more information about an error, try `rustc --explain E0493`. diff --git a/tests/ui/self/explicit-self-closures.rs b/tests/ui/self/explicit-self-closures.rs index ea85caa22ce..cb8b89e90ce 100644 --- a/tests/ui/self/explicit-self-closures.rs +++ b/tests/ui/self/explicit-self-closures.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // Test to make sure that explicit self params work inside closures -//@ pretty-expanded FIXME #23616 struct Box { x: usize diff --git a/tests/ui/self/explicit_self_xcrate_exe.rs b/tests/ui/self/explicit_self_xcrate_exe.rs index f9daf91bdfa..3bd64d6a4ab 100644 --- a/tests/ui/self/explicit_self_xcrate_exe.rs +++ b/tests/ui/self/explicit_self_xcrate_exe.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:explicit_self_xcrate.rs -//@ pretty-expanded FIXME #23616 extern crate explicit_self_xcrate; use explicit_self_xcrate::{Foo, Bar}; diff --git a/tests/ui/self/self-impl-2.rs b/tests/ui/self/self-impl-2.rs index 8c09f1ef756..7316adfde1a 100644 --- a/tests/ui/self/self-impl-2.rs +++ b/tests/ui/self/self-impl-2.rs @@ -3,7 +3,6 @@ #![allow(unused_variables)] // Test that we can use `Self` types in impls in the expected way. -//@ pretty-expanded FIXME #23616 struct Foo; diff --git a/tests/ui/self/self-type-param.rs b/tests/ui/self/self-type-param.rs index 0b123de2531..3b107f465ea 100644 --- a/tests/ui/self/self-type-param.rs +++ b/tests/ui/self/self-type-param.rs @@ -1,6 +1,5 @@ //@ build-pass (FIXME(62277): could be check-pass?) #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait MyTrait { fn f(&self) -> Self; diff --git a/tests/ui/simd-abi-checks-empty-list.stderr b/tests/ui/simd-abi-checks-empty-list.stderr index d7ce52eab80..c49fe1a01de 100644 --- a/tests/ui/simd-abi-checks-empty-list.stderr +++ b/tests/ui/simd-abi-checks-empty-list.stderr @@ -10,3 +10,14 @@ LL | pub extern "C" fn pass_by_vec(_: SimdVec) {} warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function definition uses a SIMD vector type that is not currently supported with the chosen ABI + --> $DIR/simd-abi-checks-empty-list.rs:17:1 + | +LL | pub extern "C" fn pass_by_vec(_: SimdVec) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = note: `#[warn(abi_unsupported_vector_types)]` on by default + diff --git a/tests/ui/simd-abi-checks-s390x.rs b/tests/ui/simd-abi-checks-s390x.rs new file mode 100644 index 00000000000..15df66a2ced --- /dev/null +++ b/tests/ui/simd-abi-checks-s390x.rs @@ -0,0 +1,174 @@ +//@ revisions: z10 z13_no_vector z13_soft_float +//@ build-fail +//@[z10] compile-flags: --target s390x-unknown-linux-gnu +//@[z10] needs-llvm-components: systemz +//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector +//@[z13_no_vector] needs-llvm-components: systemz +// FIXME: +soft-float itself doesn't set -vector +//@[z13_soft_float] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector,+soft-float +//@[z13_soft_float] needs-llvm-components: systemz + +#![feature(no_core, lang_items, repr_simd, s390x_target_feature)] +#![no_core] +#![crate_type = "lib"] +#![allow(non_camel_case_types, improper_ctypes_definitions)] +#![deny(abi_unsupported_vector_types)] + +#[lang = "sized"] +pub trait Sized {} +#[lang = "copy"] +pub trait Copy {} +#[lang = "freeze"] +pub trait Freeze {} + +impl<T: Copy, const N: usize> Copy for [T; N] {} + +#[repr(simd)] +pub struct i8x8([i8; 8]); +#[repr(simd)] +pub struct i8x16([i8; 16]); +#[repr(simd)] +pub struct i8x32([i8; 32]); +#[repr(C)] +pub struct Wrapper<T>(T); +#[repr(transparent)] +pub struct TransparentWrapper<T>(T); + +impl Copy for i8 {} +impl Copy for i64 {} +impl Copy for i8x8 {} +impl Copy for i8x16 {} +impl Copy for i8x32 {} +impl<T: Copy> Copy for Wrapper<T> {} +impl<T: Copy> Copy for TransparentWrapper<T> {} + +#[no_mangle] +extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + *x +} +#[no_mangle] +extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + *x +} +#[no_mangle] +extern "C" fn vector_ret_large(x: &i8x32) -> i8x32 { + // Ok + *x +} + +#[no_mangle] +#[target_feature(enable = "vector")] +unsafe extern "C" fn vector_ret_target_feature_small(x: &i8x8) -> i8x8 { + // Ok + *x +} +#[no_mangle] +#[target_feature(enable = "vector")] +unsafe extern "C" fn vector_target_feature_ret(x: &i8x16) -> i8x16 { + // Ok + *x +} +#[no_mangle] +#[target_feature(enable = "vector")] +unsafe extern "C" fn vector_ret_target_feature_large(x: &i8x32) -> i8x32 { + // Ok + *x +} + +#[no_mangle] +extern "C" fn vector_wrapper_ret_small(x: &Wrapper<i8x8>) -> Wrapper<i8x8> { + // Ok + *x +} +#[no_mangle] +extern "C" fn vector_wrapper_ret(x: &Wrapper<i8x16>) -> Wrapper<i8x16> { + // Ok + *x +} +#[no_mangle] +extern "C" fn vector_wrapper_ret_large(x: &Wrapper<i8x32>) -> Wrapper<i8x32> { + // Ok + *x +} + +#[no_mangle] +extern "C" fn vector_transparent_wrapper_ret_small( + x: &TransparentWrapper<i8x8>, +) -> TransparentWrapper<i8x8> { + //~^^^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^^^ WARN this was previously accepted + *x +} +#[no_mangle] +extern "C" fn vector_transparent_wrapper_ret( + x: &TransparentWrapper<i8x16>, +) -> TransparentWrapper<i8x16> { + //~^^^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^^^ WARN this was previously accepted + *x +} +#[no_mangle] +extern "C" fn vector_transparent_wrapper_ret_large( + x: &TransparentWrapper<i8x32>, +) -> TransparentWrapper<i8x32> { + // Ok + *x +} + +#[no_mangle] +extern "C" fn vector_arg_small(x: i8x8) -> i64 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + unsafe { *(&x as *const i8x8 as *const i64) } +} +#[no_mangle] +extern "C" fn vector_arg(x: i8x16) -> i64 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + unsafe { *(&x as *const i8x16 as *const i64) } +} +#[no_mangle] +extern "C" fn vector_arg_large(x: i8x32) -> i64 { + // Ok + unsafe { *(&x as *const i8x32 as *const i64) } +} + +#[no_mangle] +extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + unsafe { *(&x as *const Wrapper<i8x8> as *const i64) } +} +#[no_mangle] +extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + unsafe { *(&x as *const Wrapper<i8x16> as *const i64) } +} +#[no_mangle] +extern "C" fn vector_wrapper_arg_large(x: Wrapper<i8x32>) -> i64 { + // Ok + unsafe { *(&x as *const Wrapper<i8x32> as *const i64) } +} + +#[no_mangle] +extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + unsafe { *(&x as *const TransparentWrapper<i8x8> as *const i64) } +} +#[no_mangle] +extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + //~^^ WARN this was previously accepted + unsafe { *(&x as *const TransparentWrapper<i8x16> as *const i64) } +} +#[no_mangle] +extern "C" fn vector_transparent_wrapper_arg_large(x: TransparentWrapper<i8x32>) -> i64 { + // Ok + unsafe { *(&x as *const TransparentWrapper<i8x32> as *const i64) } +} diff --git a/tests/ui/simd-abi-checks-s390x.z10.stderr b/tests/ui/simd-abi-checks-s390x.z10.stderr new file mode 100644 index 00000000000..cf135afb428 --- /dev/null +++ b/tests/ui/simd-abi-checks-s390x.z10.stderr @@ -0,0 +1,275 @@ +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:46:1 + | +LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:52:1 + | +LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:99:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret_small( +LL | | x: &TransparentWrapper<i8x8>, +LL | | ) -> TransparentWrapper<i8x8> { + | |_____________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:107:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret( +LL | | x: &TransparentWrapper<i8x16>, +LL | | ) -> TransparentWrapper<i8x16> { + | |______________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:123:1 + | +LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:129:1 + | +LL | extern "C" fn vector_arg(x: i8x16) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:141:1 + | +LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:147:1 + | +LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:159:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:165:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: aborting due to 10 previous errors + +Future incompatibility report: Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:46:1 + | +LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:52:1 + | +LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:99:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret_small( +LL | | x: &TransparentWrapper<i8x8>, +LL | | ) -> TransparentWrapper<i8x8> { + | |_____________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:107:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret( +LL | | x: &TransparentWrapper<i8x16>, +LL | | ) -> TransparentWrapper<i8x16> { + | |______________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:123:1 + | +LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:129:1 + | +LL | extern "C" fn vector_arg(x: i8x16) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:141:1 + | +LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:147:1 + | +LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:159:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:165:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/simd-abi-checks-s390x.z13_no_vector.stderr b/tests/ui/simd-abi-checks-s390x.z13_no_vector.stderr new file mode 100644 index 00000000000..cf135afb428 --- /dev/null +++ b/tests/ui/simd-abi-checks-s390x.z13_no_vector.stderr @@ -0,0 +1,275 @@ +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:46:1 + | +LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:52:1 + | +LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:99:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret_small( +LL | | x: &TransparentWrapper<i8x8>, +LL | | ) -> TransparentWrapper<i8x8> { + | |_____________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:107:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret( +LL | | x: &TransparentWrapper<i8x16>, +LL | | ) -> TransparentWrapper<i8x16> { + | |______________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:123:1 + | +LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:129:1 + | +LL | extern "C" fn vector_arg(x: i8x16) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:141:1 + | +LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:147:1 + | +LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:159:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:165:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: aborting due to 10 previous errors + +Future incompatibility report: Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:46:1 + | +LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:52:1 + | +LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:99:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret_small( +LL | | x: &TransparentWrapper<i8x8>, +LL | | ) -> TransparentWrapper<i8x8> { + | |_____________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:107:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret( +LL | | x: &TransparentWrapper<i8x16>, +LL | | ) -> TransparentWrapper<i8x16> { + | |______________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:123:1 + | +LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:129:1 + | +LL | extern "C" fn vector_arg(x: i8x16) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:141:1 + | +LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:147:1 + | +LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:159:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:165:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/simd-abi-checks-s390x.z13_soft_float.stderr b/tests/ui/simd-abi-checks-s390x.z13_soft_float.stderr new file mode 100644 index 00000000000..cf135afb428 --- /dev/null +++ b/tests/ui/simd-abi-checks-s390x.z13_soft_float.stderr @@ -0,0 +1,275 @@ +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:46:1 + | +LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:52:1 + | +LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:99:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret_small( +LL | | x: &TransparentWrapper<i8x8>, +LL | | ) -> TransparentWrapper<i8x8> { + | |_____________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:107:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret( +LL | | x: &TransparentWrapper<i8x16>, +LL | | ) -> TransparentWrapper<i8x16> { + | |______________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:123:1 + | +LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:129:1 + | +LL | extern "C" fn vector_arg(x: i8x16) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:141:1 + | +LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:147:1 + | +LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:159:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:165:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) + +error: aborting due to 10 previous errors + +Future incompatibility report: Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:46:1 + | +LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:52:1 + | +LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:99:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret_small( +LL | | x: &TransparentWrapper<i8x8>, +LL | | ) -> TransparentWrapper<i8x8> { + | |_____________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:107:1 + | +LL | / extern "C" fn vector_transparent_wrapper_ret( +LL | | x: &TransparentWrapper<i8x16>, +LL | | ) -> TransparentWrapper<i8x16> { + | |______________________________^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:123:1 + | +LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:129:1 + | +LL | extern "C" fn vector_arg(x: i8x16) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:141:1 + | +LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:147:1 + | +LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:159:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Future breakage diagnostic: +error: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled + --> $DIR/simd-abi-checks-s390x.rs:165:1 + | +LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`) +note: the lint level is defined here + --> $DIR/simd-abi-checks-s390x.rs:15:9 + | +LL | #![deny(abi_unsupported_vector_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/ui/simd-abi-checks.rs b/tests/ui/simd-abi-checks.rs index 9e3af26e9c4..c97767b2794 100644 --- a/tests/ui/simd-abi-checks.rs +++ b/tests/ui/simd-abi-checks.rs @@ -4,6 +4,7 @@ #![feature(avx512_target_feature)] #![feature(portable_simd)] +#![feature(target_feature_11, simd_ffi)] #![allow(improper_ctypes_definitions)] use std::arch::x86_64::*; @@ -50,6 +51,14 @@ unsafe fn test() { as_f64x8(arg); } +#[target_feature(enable = "avx")] +unsafe fn in_closure() -> impl FnOnce() -> __m256 { + #[inline(always)] // this disables target-feature inheritance + || g() + //~^ WARNING this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + //~| WARNING this was previously accepted by the compiler +} + fn main() { unsafe { f(g()); @@ -78,4 +87,24 @@ fn main() { //~| WARNING this was previously accepted by the compiler //~| WARNING this was previously accepted by the compiler } + + unsafe { + in_closure()(); + } + + unsafe { + #[expect(improper_ctypes)] + extern "C" { + fn some_extern() -> __m256; + } + some_extern(); + //~^ WARNING this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + //~| WARNING this was previously accepted by the compiler + } +} + +#[no_mangle] +#[target_feature(enable = "avx")] +fn some_extern() -> __m256 { + todo!() } diff --git a/tests/ui/simd-abi-checks.stderr b/tests/ui/simd-abi-checks.stderr index 7d2915f7dea..eb7d9e81029 100644 --- a/tests/ui/simd-abi-checks.stderr +++ b/tests/ui/simd-abi-checks.stderr @@ -1,5 +1,5 @@ warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller - --> $DIR/simd-abi-checks.rs:55:11 + --> $DIR/simd-abi-checks.rs:64:11 | LL | f(g()); | ^^^ function called here @@ -10,7 +10,7 @@ LL | f(g()); = note: `#[warn(abi_unsupported_vector_types)]` on by default warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller - --> $DIR/simd-abi-checks.rs:55:9 + --> $DIR/simd-abi-checks.rs:64:9 | LL | f(g()); | ^^^^^^ function called here @@ -20,7 +20,7 @@ LL | f(g()); = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller - --> $DIR/simd-abi-checks.rs:63:14 + --> $DIR/simd-abi-checks.rs:72:14 | LL | gavx(favx()); | ^^^^^^ function called here @@ -30,7 +30,7 @@ LL | gavx(favx()); = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller - --> $DIR/simd-abi-checks.rs:63:9 + --> $DIR/simd-abi-checks.rs:72:9 | LL | gavx(favx()); | ^^^^^^^^^^^^ function called here @@ -40,7 +40,7 @@ LL | gavx(favx()); = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller - --> $DIR/simd-abi-checks.rs:75:19 + --> $DIR/simd-abi-checks.rs:84:19 | LL | w(Wrapper(g())); | ^^^ function called here @@ -50,7 +50,7 @@ LL | w(Wrapper(g())); = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller - --> $DIR/simd-abi-checks.rs:75:9 + --> $DIR/simd-abi-checks.rs:84:9 | LL | w(Wrapper(g())); | ^^^^^^^^^^^^^^^ function called here @@ -59,8 +59,145 @@ LL | w(Wrapper(g())); = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:100:9 + | +LL | some_extern(); + | ^^^^^^^^^^^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + +warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled + --> $DIR/simd-abi-checks.rs:27:1 + | +LL | unsafe extern "C" fn g() -> __m256 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + +warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled + --> $DIR/simd-abi-checks.rs:21:1 + | +LL | unsafe extern "C" fn f(_: __m256) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + +warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled + --> $DIR/simd-abi-checks.rs:15:1 + | +LL | unsafe extern "C" fn w(_: Wrapper) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:57:8 + | +LL | || g() + | ^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + +warning: 11 warnings emitted + +Future incompatibility report: Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:64:11 + | +LL | f(g()); + | ^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + +Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:64:9 + | +LL | f(g()); + | ^^^^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + +Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:72:14 + | +LL | gavx(favx()); + | ^^^^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + +Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:72:9 + | +LL | gavx(favx()); + | ^^^^^^^^^^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + +Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:84:19 + | +LL | w(Wrapper(g())); + | ^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + +Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:84:9 + | +LL | w(Wrapper(g())); + | ^^^^^^^^^^^^^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + +Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:100:9 + | +LL | some_extern(); + | ^^^^^^^^^^^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + +Future breakage diagnostic: warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled - --> $DIR/simd-abi-checks.rs:26:1 + --> $DIR/simd-abi-checks.rs:27:1 | LL | unsafe extern "C" fn g() -> __m256 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here @@ -68,9 +205,11 @@ LL | unsafe extern "C" fn g() -> __m256 { = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default +Future breakage diagnostic: warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled - --> $DIR/simd-abi-checks.rs:20:1 + --> $DIR/simd-abi-checks.rs:21:1 | LL | unsafe extern "C" fn f(_: __m256) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here @@ -78,9 +217,11 @@ LL | unsafe extern "C" fn f(_: __m256) { = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default +Future breakage diagnostic: warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled - --> $DIR/simd-abi-checks.rs:14:1 + --> $DIR/simd-abi-checks.rs:15:1 | LL | unsafe extern "C" fn w(_: Wrapper) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here @@ -88,6 +229,17 @@ LL | unsafe extern "C" fn w(_: Wrapper) { = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default -warning: 9 warnings emitted +Future breakage diagnostic: +warning: this function call uses a SIMD vector type that (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller + --> $DIR/simd-abi-checks.rs:57:8 + | +LL | || g() + | ^^^ function called here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default diff --git a/tests/ui/simd/array-trait.rs b/tests/ui/simd/array-trait.rs index d2f246a2146..67583bf8208 100644 --- a/tests/ui/simd/array-trait.rs +++ b/tests/ui/simd/array-trait.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![feature(repr_simd, intrinsics, generic_const_exprs)] #![allow(non_camel_case_types, incomplete_features)] diff --git a/tests/ui/simd/array-trait.stderr b/tests/ui/simd/array-trait.stderr index a63dbf37959..2d2a11f25ad 100644 --- a/tests/ui/simd/array-trait.stderr +++ b/tests/ui/simd/array-trait.stderr @@ -1,5 +1,5 @@ error: unconstrained generic constant - --> $DIR/array-trait.rs:23:23 + --> $DIR/array-trait.rs:22:23 | LL | pub struct T<S: Simd>([S::Lane; S::SIZE]); | ^^^^^^^^^^^^^^^^^^ @@ -10,13 +10,13 @@ LL | pub struct T<S: Simd>([S::Lane; S::SIZE]) where [(); S::SIZE]:; | ++++++++++++++++++++ error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type - --> $DIR/array-trait.rs:23:1 + --> $DIR/array-trait.rs:22:1 | LL | pub struct T<S: Simd>([S::Lane; S::SIZE]); | ^^^^^^^^^^^^^^^^^^^^^ error: unconstrained generic constant - --> $DIR/array-trait.rs:23:23 + --> $DIR/array-trait.rs:22:23 | LL | #[derive(Copy, Clone)] | ----- in this derive macro expansion diff --git a/tests/ui/simd/array-type.rs b/tests/ui/simd/array-type.rs index 4063dcd703c..8ca53b1a453 100644 --- a/tests/ui/simd/array-type.rs +++ b/tests/ui/simd/array-type.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![feature(repr_simd, intrinsics)] diff --git a/tests/ui/simd/intrinsic/float-math-pass.rs b/tests/ui/simd/intrinsic/float-math-pass.rs index 9b14d410acb..24b9941133e 100644 --- a/tests/ui/simd/intrinsic/float-math-pass.rs +++ b/tests/ui/simd/intrinsic/float-math-pass.rs @@ -23,6 +23,7 @@ extern "rust-intrinsic" { fn simd_fexp<T>(x: T) -> T; fn simd_fexp2<T>(x: T) -> T; fn simd_fma<T>(x: T, y: T, z: T) -> T; + fn simd_relaxed_fma<T>(x: T, y: T, z: T) -> T; fn simd_flog<T>(x: T) -> T; fn simd_flog10<T>(x: T) -> T; fn simd_flog2<T>(x: T) -> T; @@ -77,6 +78,9 @@ fn main() { let r = simd_fma(x, h, h); assert_approx_eq!(x, r); + let r = simd_relaxed_fma(x, h, h); + assert_approx_eq!(x, r); + let r = simd_fsqrt(x); assert_approx_eq!(x, r); diff --git a/tests/ui/sized-borrowed-pointer.rs b/tests/ui/sized-borrowed-pointer.rs index f1635531e4e..bd213c067db 100644 --- a/tests/ui/sized-borrowed-pointer.rs +++ b/tests/ui/sized-borrowed-pointer.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] // Possibly-dynamic size of typaram should be cleared at pointer boundary. -//@ pretty-expanded FIXME #23616 fn bar<T: Sized>() { } fn foo<T>() { bar::<&T>() } diff --git a/tests/ui/sized-owned-pointer.rs b/tests/ui/sized-owned-pointer.rs index 48f870de9ae..b35c0f91abd 100644 --- a/tests/ui/sized-owned-pointer.rs +++ b/tests/ui/sized-owned-pointer.rs @@ -4,7 +4,6 @@ // Possibly-dynamic size of typaram should be cleared at pointer boundary. -//@ pretty-expanded FIXME #23616 fn bar<T: Sized>() { } fn foo<T>() { bar::<Box<T>>() } diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr index d40e9822435..eec2f5b42fd 100644 --- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr +++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr @@ -4,7 +4,7 @@ error: expected a pattern, found an expression LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; | ^^^^^^^^^^^^^^^^^^ not a pattern | - = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> + = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html> error[E0412]: cannot find type `T` in this scope --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:55 diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr index 60433e1c284..5ecbedf1867 100644 --- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr +++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr @@ -4,7 +4,7 @@ error[E0670]: `async fn` is not permitted in Rust 2015 LL | pub(crate) async fn new( | ^^^^^ to use `async fn`, switch to Rust 2018 or later | - = help: pass `--edition 2021` to `rustc` + = help: pass `--edition 2024` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0412]: cannot find type `Duration` in this scope diff --git a/tests/ui/specialization/issue-68830-spurious-diagnostics.rs b/tests/ui/specialization/issue-68830-spurious-diagnostics.rs index a7487b8aecb..d11ec798332 100644 --- a/tests/ui/specialization/issue-68830-spurious-diagnostics.rs +++ b/tests/ui/specialization/issue-68830-spurious-diagnostics.rs @@ -17,7 +17,6 @@ impl<T, D> MyTrait<T> for D { } impl<T> MyTrait<T> for BadStruct { -//~^ ERROR: conflicting implementations of trait `MyTrait<_>` for type `BadStruct` fn foo() {} } diff --git a/tests/ui/specialization/issue-68830-spurious-diagnostics.stderr b/tests/ui/specialization/issue-68830-spurious-diagnostics.stderr index 13f6ae0805d..0ecec03a023 100644 --- a/tests/ui/specialization/issue-68830-spurious-diagnostics.stderr +++ b/tests/ui/specialization/issue-68830-spurious-diagnostics.stderr @@ -4,16 +4,6 @@ error[E0412]: cannot find type `MissingType` in this scope LL | err: MissingType | ^^^^^^^^^^^ not found in this scope -error[E0119]: conflicting implementations of trait `MyTrait<_>` for type `BadStruct` - --> $DIR/issue-68830-spurious-diagnostics.rs:19:1 - | -LL | impl<T, D> MyTrait<T> for D { - | --------------------------- first implementation here -... -LL | impl<T> MyTrait<T> for BadStruct { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `BadStruct` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0119, E0412. -For more information about an error, try `rustc --explain E0119`. +For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.stderr b/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.stderr index 2af75876d5b..04a41f0d9dd 100644 --- a/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.stderr +++ b/tests/ui/specialization/min_specialization/specialize_with_generalize_lifetimes.stderr @@ -4,11 +4,7 @@ error[E0477]: the type `&'a i32` does not fulfill the required lifetime LL | impl<'a> Tr for &'a i32 { | ^^^^^^^^^^^^^^^^^^^^^^^ | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/specialize_with_generalize_lifetimes.rs:12:15 - | -LL | impl<T: Any + 'static> Tr for T { - | ^^^^^^^ + = note: type must satisfy the static lifetime error[E0477]: the type `Wrapper<'a>` does not fulfill the required lifetime --> $DIR/specialize_with_generalize_lifetimes.rs:31:1 @@ -16,11 +12,7 @@ error[E0477]: the type `Wrapper<'a>` does not fulfill the required lifetime LL | impl<'a> Tr for Wrapper<'a> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: type must satisfy the static lifetime as required by this binding - --> $DIR/specialize_with_generalize_lifetimes.rs:12:15 - | -LL | impl<T: Any + 'static> Tr for T { - | ^^^^^^^ + = note: type must satisfy the static lifetime error: aborting due to 2 previous errors diff --git a/tests/ui/sse-abi-checks.stderr b/tests/ui/sse-abi-checks.stderr index 7dd13af5091..e08b2d4e191 100644 --- a/tests/ui/sse-abi-checks.stderr +++ b/tests/ui/sse-abi-checks.stderr @@ -11,3 +11,15 @@ LL | pub unsafe extern "C" fn f(_: SseVector) { warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `sse` target feature, which is not enabled + --> $DIR/sse-abi-checks.rs:21:1 + | +LL | pub unsafe extern "C" fn f(_: SseVector) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558> + = help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`) + = note: `#[warn(abi_unsupported_vector_types)]` on by default + diff --git a/tests/ui/stability-attribute/missing-const-stability.rs b/tests/ui/stability-attribute/missing-const-stability.rs index 10c31d79438..19820730736 100644 --- a/tests/ui/stability-attribute/missing-const-stability.rs +++ b/tests/ui/stability-attribute/missing-const-stability.rs @@ -27,7 +27,7 @@ pub trait Bar { } #[stable(feature = "stable", since = "1.0.0")] impl const Bar for Foo { - //~^ ERROR implementation has missing const stability attribute + // ok because all users must enable `const_trait_impl` fn fun() {} } diff --git a/tests/ui/stability-attribute/missing-const-stability.stderr b/tests/ui/stability-attribute/missing-const-stability.stderr index ad8a1fa9d36..baa4c34af06 100644 --- a/tests/ui/stability-attribute/missing-const-stability.stderr +++ b/tests/ui/stability-attribute/missing-const-stability.stderr @@ -4,15 +4,6 @@ error: function has missing const stability attribute LL | pub const fn foo() {} | ^^^^^^^^^^^^^^^^^^^^^ -error: implementation has missing const stability attribute - --> $DIR/missing-const-stability.rs:29:1 - | -LL | / impl const Bar for Foo { -LL | | -LL | | fn fun() {} -LL | | } - | |_^ - error: function has missing const stability attribute --> $DIR/missing-const-stability.rs:36:1 | @@ -25,5 +16,5 @@ error: associated function has missing const stability attribute LL | pub const fn foo() {} | ^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors diff --git a/tests/ui/static/issue-1660.rs b/tests/ui/static/issue-1660.rs index a114a908313..02a408d9a56 100644 --- a/tests/ui/static/issue-1660.rs +++ b/tests/ui/static/issue-1660.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(non_upper_case_globals)] -//@ pretty-expanded FIXME #23616 pub fn main() { static _x: isize = 1<<2; diff --git a/tests/ui/statics/check-recursion-foreign.rs b/tests/ui/statics/check-recursion-foreign.rs index 5a0ff7b5962..6804910f4cc 100644 --- a/tests/ui/statics/check-recursion-foreign.rs +++ b/tests/ui/statics/check-recursion-foreign.rs @@ -4,7 +4,6 @@ //@ aux-build:check_static_recursion_foreign_helper.rs -//@ pretty-expanded FIXME #23616 extern crate check_static_recursion_foreign_helper; diff --git a/tests/ui/statics/issue-15261.rs b/tests/ui/statics/issue-15261.rs index e168abce078..ed79a201488 100644 --- a/tests/ui/statics/issue-15261.rs +++ b/tests/ui/statics/issue-15261.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_upper_case_globals)] -//@ pretty-expanded FIXME #23616 static mut n_mut: usize = 0; diff --git a/tests/ui/statics/issue-15261.stderr b/tests/ui/statics/issue-15261.stderr index 417dbae9db1..4067d151de3 100644 --- a/tests/ui/statics/issue-15261.stderr +++ b/tests/ui/statics/issue-15261.stderr @@ -1,5 +1,5 @@ warning: creating a shared reference to mutable static is discouraged - --> $DIR/issue-15261.rs:9:37 + --> $DIR/issue-15261.rs:8:37 | LL | static n: &'static usize = unsafe { &n_mut }; | ^^^^^^ shared reference to mutable static diff --git a/tests/ui/statics/issue-17718-static-unsafe-interior.rs b/tests/ui/statics/issue-17718-static-unsafe-interior.rs index 82d5ec8db46..daff7ba873c 100644 --- a/tests/ui/statics/issue-17718-static-unsafe-interior.rs +++ b/tests/ui/statics/issue-17718-static-unsafe-interior.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(unused_variables)] #![allow(unused_imports)] -//@ pretty-expanded FIXME #23616 use std::marker; use std::cell::UnsafeCell; diff --git a/tests/ui/statics/static-fn-inline-xc.rs b/tests/ui/statics/static-fn-inline-xc.rs index fe230f04d3d..e75083b2188 100644 --- a/tests/ui/statics/static-fn-inline-xc.rs +++ b/tests/ui/statics/static-fn-inline-xc.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:static_fn_inline_xc_aux.rs -//@ pretty-expanded FIXME #23616 extern crate static_fn_inline_xc_aux as mycore; diff --git a/tests/ui/statics/static-fn-trait-xc.rs b/tests/ui/statics/static-fn-trait-xc.rs index 78810eb5645..73747416c60 100644 --- a/tests/ui/statics/static-fn-trait-xc.rs +++ b/tests/ui/statics/static-fn-trait-xc.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:static_fn_trait_xc_aux.rs -//@ pretty-expanded FIXME #23616 extern crate static_fn_trait_xc_aux as mycore; diff --git a/tests/ui/statics/static-methods-in-traits2.rs b/tests/ui/statics/static-methods-in-traits2.rs index dbb7120d543..dbd5e77c1ba 100644 --- a/tests/ui/statics/static-methods-in-traits2.rs +++ b/tests/ui/statics/static-methods-in-traits2.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub trait Number: NumConv { fn from<T:Number>(n: T) -> Self; diff --git a/tests/ui/stats/input-stats.stderr b/tests/ui/stats/input-stats.stderr index 2cc2c8019fa..2adbcfab612 100644 --- a/tests/ui/stats/input-stats.stderr +++ b/tests/ui/stats/input-stats.stderr @@ -5,27 +5,27 @@ ast-stats-1 Crate 40 ( 0.6%) 1 40 ast-stats-1 GenericArgs 40 ( 0.6%) 1 40 ast-stats-1 - AngleBracketed 40 ( 0.6%) 1 ast-stats-1 ExprField 48 ( 0.7%) 1 48 -ast-stats-1 WherePredicate 56 ( 0.8%) 1 56 -ast-stats-1 - BoundPredicate 56 ( 0.8%) 1 ast-stats-1 Attribute 64 ( 1.0%) 2 32 ast-stats-1 - DocComment 32 ( 0.5%) 1 ast-stats-1 - Normal 32 ( 0.5%) 1 +ast-stats-1 WherePredicate 64 ( 1.0%) 1 64 +ast-stats-1 - BoundPredicate 64 ( 1.0%) 1 ast-stats-1 Local 80 ( 1.2%) 1 80 ast-stats-1 ForeignItem 88 ( 1.3%) 1 88 ast-stats-1 - Fn 88 ( 1.3%) 1 ast-stats-1 Arm 96 ( 1.4%) 2 48 ast-stats-1 FnDecl 120 ( 1.8%) 5 24 -ast-stats-1 FieldDef 160 ( 2.4%) 2 80 ast-stats-1 Param 160 ( 2.4%) 4 40 ast-stats-1 Stmt 160 ( 2.4%) 5 32 ast-stats-1 - Let 32 ( 0.5%) 1 ast-stats-1 - MacCall 32 ( 0.5%) 1 ast-stats-1 - Expr 96 ( 1.4%) 3 +ast-stats-1 FieldDef 176 ( 2.6%) 2 88 ast-stats-1 Block 192 ( 2.9%) 6 32 ast-stats-1 Variant 208 ( 3.1%) 2 104 ast-stats-1 AssocItem 352 ( 5.3%) 4 88 -ast-stats-1 - Type 176 ( 2.7%) 2 -ast-stats-1 - Fn 176 ( 2.7%) 2 +ast-stats-1 - Type 176 ( 2.6%) 2 +ast-stats-1 - Fn 176 ( 2.6%) 2 ast-stats-1 GenericBound 352 ( 5.3%) 4 88 ast-stats-1 - Trait 352 ( 5.3%) 4 ast-stats-1 GenericParam 480 ( 7.2%) 5 96 @@ -33,14 +33,14 @@ ast-stats-1 Pat 504 ( 7.6%) 7 72 ast-stats-1 - Struct 72 ( 1.1%) 1 ast-stats-1 - Wild 72 ( 1.1%) 1 ast-stats-1 - Ident 360 ( 5.4%) 5 -ast-stats-1 Expr 576 ( 8.7%) 8 72 +ast-stats-1 Expr 576 ( 8.6%) 8 72 ast-stats-1 - Path 72 ( 1.1%) 1 ast-stats-1 - Match 72 ( 1.1%) 1 ast-stats-1 - Struct 72 ( 1.1%) 1 ast-stats-1 - Lit 144 ( 2.2%) 2 -ast-stats-1 - Block 216 ( 3.3%) 3 +ast-stats-1 - Block 216 ( 3.2%) 3 ast-stats-1 PathSegment 744 (11.2%) 31 24 -ast-stats-1 Ty 896 (13.5%) 14 64 +ast-stats-1 Ty 896 (13.4%) 14 64 ast-stats-1 - Ref 64 ( 1.0%) 1 ast-stats-1 - Ptr 64 ( 1.0%) 1 ast-stats-1 - ImplicitSelf 128 ( 1.9%) 2 @@ -53,7 +53,7 @@ ast-stats-1 - Enum 136 ( 2.0%) 1 ast-stats-1 - Fn 272 ( 4.1%) 2 ast-stats-1 - Use 408 ( 6.1%) 3 ast-stats-1 ---------------------------------------------------------------- -ast-stats-1 Total 6_640 116 +ast-stats-1 Total 6_664 116 ast-stats-1 ast-stats-2 POST EXPANSION AST STATS ast-stats-2 Name Accumulated Size Count Item Size @@ -62,8 +62,8 @@ ast-stats-2 Crate 40 ( 0.5%) 1 40 ast-stats-2 GenericArgs 40 ( 0.5%) 1 40 ast-stats-2 - AngleBracketed 40 ( 0.5%) 1 ast-stats-2 ExprField 48 ( 0.7%) 1 48 -ast-stats-2 WherePredicate 56 ( 0.8%) 1 56 -ast-stats-2 - BoundPredicate 56 ( 0.8%) 1 +ast-stats-2 WherePredicate 64 ( 0.9%) 1 64 +ast-stats-2 - BoundPredicate 64 ( 0.9%) 1 ast-stats-2 Local 80 ( 1.1%) 1 80 ast-stats-2 ForeignItem 88 ( 1.2%) 1 88 ast-stats-2 - Fn 88 ( 1.2%) 1 @@ -73,14 +73,14 @@ ast-stats-2 InlineAsm 120 ( 1.6%) 1 120 ast-stats-2 Attribute 128 ( 1.8%) 4 32 ast-stats-2 - DocComment 32 ( 0.4%) 1 ast-stats-2 - Normal 96 ( 1.3%) 3 -ast-stats-2 FieldDef 160 ( 2.2%) 2 80 ast-stats-2 Param 160 ( 2.2%) 4 40 ast-stats-2 Stmt 160 ( 2.2%) 5 32 ast-stats-2 - Let 32 ( 0.4%) 1 ast-stats-2 - Semi 32 ( 0.4%) 1 ast-stats-2 - Expr 96 ( 1.3%) 3 +ast-stats-2 FieldDef 176 ( 2.4%) 2 88 ast-stats-2 Block 192 ( 2.6%) 6 32 -ast-stats-2 Variant 208 ( 2.9%) 2 104 +ast-stats-2 Variant 208 ( 2.8%) 2 104 ast-stats-2 AssocItem 352 ( 4.8%) 4 88 ast-stats-2 - Type 176 ( 2.4%) 2 ast-stats-2 - Fn 176 ( 2.4%) 2 @@ -98,7 +98,7 @@ ast-stats-2 - Struct 72 ( 1.0%) 1 ast-stats-2 - InlineAsm 72 ( 1.0%) 1 ast-stats-2 - Lit 144 ( 2.0%) 2 ast-stats-2 - Block 216 ( 3.0%) 3 -ast-stats-2 PathSegment 864 (11.9%) 36 24 +ast-stats-2 PathSegment 864 (11.8%) 36 24 ast-stats-2 Ty 896 (12.3%) 14 64 ast-stats-2 - Ref 64 ( 0.9%) 1 ast-stats-2 - Ptr 64 ( 0.9%) 1 @@ -111,9 +111,9 @@ ast-stats-2 - Impl 136 ( 1.9%) 1 ast-stats-2 - ExternCrate 136 ( 1.9%) 1 ast-stats-2 - ForeignMod 136 ( 1.9%) 1 ast-stats-2 - Fn 272 ( 3.7%) 2 -ast-stats-2 - Use 544 ( 7.5%) 4 +ast-stats-2 - Use 544 ( 7.4%) 4 ast-stats-2 ---------------------------------------------------------------- -ast-stats-2 Total 7_288 127 +ast-stats-2 Total 7_312 127 ast-stats-2 hir-stats HIR STATS hir-stats Name Accumulated Size Count Item Size @@ -131,39 +131,39 @@ hir-stats Param 64 ( 0.7%) 2 32 hir-stats Body 72 ( 0.8%) 3 24 hir-stats ImplItemRef 72 ( 0.8%) 2 36 hir-stats InlineAsm 72 ( 0.8%) 1 72 +hir-stats WherePredicate 72 ( 0.8%) 3 24 +hir-stats - BoundPredicate 72 ( 0.8%) 3 hir-stats Arm 80 ( 0.9%) 2 40 -hir-stats FieldDef 96 ( 1.1%) 2 48 hir-stats Stmt 96 ( 1.1%) 3 32 hir-stats - Let 32 ( 0.4%) 1 hir-stats - Semi 32 ( 0.4%) 1 hir-stats - Expr 32 ( 0.4%) 1 +hir-stats FieldDef 112 ( 1.3%) 2 56 hir-stats FnDecl 120 ( 1.3%) 3 40 hir-stats Attribute 128 ( 1.4%) 4 32 hir-stats GenericArgs 144 ( 1.6%) 3 48 hir-stats Variant 144 ( 1.6%) 2 72 -hir-stats WherePredicate 192 ( 2.1%) 3 64 -hir-stats - BoundPredicate 192 ( 2.1%) 3 -hir-stats GenericBound 256 ( 2.8%) 4 64 -hir-stats - Trait 256 ( 2.8%) 4 +hir-stats GenericBound 256 ( 2.9%) 4 64 +hir-stats - Trait 256 ( 2.9%) 4 hir-stats Block 288 ( 3.2%) 6 48 hir-stats GenericParam 360 ( 4.0%) 5 72 hir-stats Pat 360 ( 4.0%) 5 72 hir-stats - Struct 72 ( 0.8%) 1 hir-stats - Wild 72 ( 0.8%) 1 hir-stats - Binding 216 ( 2.4%) 3 -hir-stats Generics 560 ( 6.2%) 10 56 -hir-stats Ty 720 ( 8.0%) 15 48 +hir-stats Generics 560 ( 6.3%) 10 56 +hir-stats Ty 720 ( 8.1%) 15 48 hir-stats - Ref 48 ( 0.5%) 1 hir-stats - Ptr 48 ( 0.5%) 1 -hir-stats - Path 624 ( 6.9%) 13 -hir-stats Expr 768 ( 8.5%) 12 64 +hir-stats - Path 624 ( 7.0%) 13 +hir-stats Expr 768 ( 8.6%) 12 64 hir-stats - Path 64 ( 0.7%) 1 hir-stats - Match 64 ( 0.7%) 1 hir-stats - Struct 64 ( 0.7%) 1 hir-stats - InlineAsm 64 ( 0.7%) 1 hir-stats - Lit 128 ( 1.4%) 2 hir-stats - Block 384 ( 4.3%) 6 -hir-stats Item 968 (10.7%) 11 88 +hir-stats Item 968 (10.9%) 11 88 hir-stats - Enum 88 ( 1.0%) 1 hir-stats - Trait 88 ( 1.0%) 1 hir-stats - Impl 88 ( 1.0%) 1 @@ -171,8 +171,8 @@ hir-stats - ExternCrate 88 ( 1.0%) 1 hir-stats - ForeignMod 88 ( 1.0%) 1 hir-stats - Fn 176 ( 2.0%) 2 hir-stats - Use 352 ( 3.9%) 4 -hir-stats Path 1_240 (13.7%) 31 40 -hir-stats PathSegment 1_920 (21.3%) 40 48 +hir-stats Path 1_240 (13.9%) 31 40 +hir-stats PathSegment 1_920 (21.5%) 40 48 hir-stats ---------------------------------------------------------------- -hir-stats Total 9_024 180 +hir-stats Total 8_920 180 hir-stats diff --git a/tests/ui/structs-enums/class-dtor.rs b/tests/ui/structs-enums/class-dtor.rs index ee6220b6fa4..a08f0f0b0a4 100644 --- a/tests/ui/structs-enums/class-dtor.rs +++ b/tests/ui/structs-enums/class-dtor.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct cat { done : extern "C" fn(usize), diff --git a/tests/ui/structs-enums/class-str-field.rs b/tests/ui/structs-enums/class-str-field.rs index a33a635344e..24f648afc90 100644 --- a/tests/ui/structs-enums/class-str-field.rs +++ b/tests/ui/structs-enums/class-str-field.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct cat { diff --git a/tests/ui/structs-enums/class-typarams.rs b/tests/ui/structs-enums/class-typarams.rs index 01cfa47024f..b5a3923983f 100644 --- a/tests/ui/structs-enums/class-typarams.rs +++ b/tests/ui/structs-enums/class-typarams.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 use std::marker::PhantomData; diff --git a/tests/ui/structs-enums/classes-self-referential.rs b/tests/ui/structs-enums/classes-self-referential.rs index 35696a9cff9..f819e558aa2 100644 --- a/tests/ui/structs-enums/classes-self-referential.rs +++ b/tests/ui/structs-enums/classes-self-referential.rs @@ -3,7 +3,6 @@ #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 struct kitten { cat: Option<cat>, diff --git a/tests/ui/structs-enums/enum-discrim-range-overflow.rs b/tests/ui/structs-enums/enum-discrim-range-overflow.rs index 51cabd10e30..91be8014ebd 100644 --- a/tests/ui/structs-enums/enum-discrim-range-overflow.rs +++ b/tests/ui/structs-enums/enum-discrim-range-overflow.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(overflowing_literals)] -//@ pretty-expanded FIXME #23616 pub enum E64 { H64 = 0x7FFF_FFFF_FFFF_FFFF, diff --git a/tests/ui/structs-enums/enum-export-inheritance.rs b/tests/ui/structs-enums/enum-export-inheritance.rs index 5bb689260c2..1fd697830db 100644 --- a/tests/ui/structs-enums/enum-export-inheritance.rs +++ b/tests/ui/structs-enums/enum-export-inheritance.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 mod a { pub enum Foo { diff --git a/tests/ui/structs-enums/enum-variants.rs b/tests/ui/structs-enums/enum-variants.rs index 1f5206b8de5..d9639b32941 100644 --- a/tests/ui/structs-enums/enum-variants.rs +++ b/tests/ui/structs-enums/enum-variants.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_assignments)] -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/tests/ui/structs-enums/enum-vec-initializer.rs b/tests/ui/structs-enums/enum-vec-initializer.rs index 2fa77ec6ecd..8c610456c22 100644 --- a/tests/ui/structs-enums/enum-vec-initializer.rs +++ b/tests/ui/structs-enums/enum-vec-initializer.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 enum Flopsy { Bunny = 2 diff --git a/tests/ui/structs-enums/export-abstract-tag.rs b/tests/ui/structs-enums/export-abstract-tag.rs index ff36fa95903..e6d35980385 100644 --- a/tests/ui/structs-enums/export-abstract-tag.rs +++ b/tests/ui/structs-enums/export-abstract-tag.rs @@ -4,7 +4,6 @@ // We can export tags without exporting the variants to create a simple // sort of ADT. -//@ pretty-expanded FIXME #23616 mod foo { pub enum t { t1, } diff --git a/tests/ui/structs-enums/export-tag-variant.rs b/tests/ui/structs-enums/export-tag-variant.rs index bd762a0166e..c6216d1b567 100644 --- a/tests/ui/structs-enums/export-tag-variant.rs +++ b/tests/ui/structs-enums/export-tag-variant.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 mod foo { pub enum t { t1, } diff --git a/tests/ui/structs-enums/foreign-struct.rs b/tests/ui/structs-enums/foreign-struct.rs index 4f2e413ab40..f339c191ae8 100644 --- a/tests/ui/structs-enums/foreign-struct.rs +++ b/tests/ui/structs-enums/foreign-struct.rs @@ -4,7 +4,6 @@ // Passing enums by value -//@ pretty-expanded FIXME #23616 pub enum void {} diff --git a/tests/ui/structs-enums/module-qualified-struct-destructure.rs b/tests/ui/structs-enums/module-qualified-struct-destructure.rs index b90acb1b98c..9d06980fca9 100644 --- a/tests/ui/structs-enums/module-qualified-struct-destructure.rs +++ b/tests/ui/structs-enums/module-qualified-struct-destructure.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 mod m { pub struct S { diff --git a/tests/ui/structs-enums/namespaced-enum-emulate-flat-xc.rs b/tests/ui/structs-enums/namespaced-enum-emulate-flat-xc.rs index ea56faef09c..fca89728f21 100644 --- a/tests/ui/structs-enums/namespaced-enum-emulate-flat-xc.rs +++ b/tests/ui/structs-enums/namespaced-enum-emulate-flat-xc.rs @@ -3,7 +3,6 @@ //@ aux-build:namespaced_enum_emulate_flat.rs -//@ pretty-expanded FIXME #23616 extern crate namespaced_enum_emulate_flat; diff --git a/tests/ui/structs-enums/namespaced-enum-emulate-flat.rs b/tests/ui/structs-enums/namespaced-enum-emulate-flat.rs index 4a6352b328a..774cfa1a380 100644 --- a/tests/ui/structs-enums/namespaced-enum-emulate-flat.rs +++ b/tests/ui/structs-enums/namespaced-enum-emulate-flat.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub use Foo::*; use nest::{Bar, D, E, F}; diff --git a/tests/ui/structs-enums/namespaced-enum-glob-import-xcrate.rs b/tests/ui/structs-enums/namespaced-enum-glob-import-xcrate.rs index 4e58c1f717f..80d5231fc85 100644 --- a/tests/ui/structs-enums/namespaced-enum-glob-import-xcrate.rs +++ b/tests/ui/structs-enums/namespaced-enum-glob-import-xcrate.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:namespaced_enums.rs -//@ pretty-expanded FIXME #23616 extern crate namespaced_enums; diff --git a/tests/ui/structs-enums/namespaced-enum-glob-import.rs b/tests/ui/structs-enums/namespaced-enum-glob-import.rs index d02ee5a122d..e8a709d5bd0 100644 --- a/tests/ui/structs-enums/namespaced-enum-glob-import.rs +++ b/tests/ui/structs-enums/namespaced-enum-glob-import.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 mod m2 { pub enum Foo { diff --git a/tests/ui/structs-enums/namespaced-enums-xcrate.rs b/tests/ui/structs-enums/namespaced-enums-xcrate.rs index b5655e68a47..36bc973749c 100644 --- a/tests/ui/structs-enums/namespaced-enums-xcrate.rs +++ b/tests/ui/structs-enums/namespaced-enums-xcrate.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:namespaced_enums.rs -//@ pretty-expanded FIXME #23616 extern crate namespaced_enums; diff --git a/tests/ui/structs-enums/namespaced-enums.rs b/tests/ui/structs-enums/namespaced-enums.rs index 1ce9319b8ec..3e2e0b5ffa8 100644 --- a/tests/ui/structs-enums/namespaced-enums.rs +++ b/tests/ui/structs-enums/namespaced-enums.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 enum Foo { A, diff --git a/tests/ui/structs-enums/nested-enum-same-names.rs b/tests/ui/structs-enums/nested-enum-same-names.rs index e24073c38e9..5ff730aff44 100644 --- a/tests/ui/structs-enums/nested-enum-same-names.rs +++ b/tests/ui/structs-enums/nested-enum-same-names.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 /* diff --git a/tests/ui/structs-enums/newtype-struct-with-dtor.rs b/tests/ui/structs-enums/newtype-struct-with-dtor.rs index 19672e41c9a..35476c5ed2d 100644 --- a/tests/ui/structs-enums/newtype-struct-with-dtor.rs +++ b/tests/ui/structs-enums/newtype-struct-with-dtor.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_unsafe)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 pub struct Fd(u32); diff --git a/tests/ui/structs-enums/newtype-struct-xc-2.rs b/tests/ui/structs-enums/newtype-struct-xc-2.rs index e83025346d7..a52c41dde27 100644 --- a/tests/ui/structs-enums/newtype-struct-xc-2.rs +++ b/tests/ui/structs-enums/newtype-struct-xc-2.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:newtype_struct_xc.rs -//@ pretty-expanded FIXME #23616 extern crate newtype_struct_xc; use newtype_struct_xc::Au; diff --git a/tests/ui/structs-enums/newtype-struct-xc.rs b/tests/ui/structs-enums/newtype-struct-xc.rs index 6f90cfe8e4a..138bf4878f0 100644 --- a/tests/ui/structs-enums/newtype-struct-xc.rs +++ b/tests/ui/structs-enums/newtype-struct-xc.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:newtype_struct_xc.rs -//@ pretty-expanded FIXME #23616 extern crate newtype_struct_xc; diff --git a/tests/ui/structs-enums/simple-generic-tag.rs b/tests/ui/structs-enums/simple-generic-tag.rs index 59521a446f4..b78505edd1f 100644 --- a/tests/ui/structs-enums/simple-generic-tag.rs +++ b/tests/ui/structs-enums/simple-generic-tag.rs @@ -4,7 +4,6 @@ -//@ pretty-expanded FIXME #23616 enum clam<T> { a(T), } diff --git a/tests/ui/structs-enums/struct-like-variant-construct.rs b/tests/ui/structs-enums/struct-like-variant-construct.rs index 5a49d715b21..ec60fef9d3f 100644 --- a/tests/ui/structs-enums/struct-like-variant-construct.rs +++ b/tests/ui/structs-enums/struct-like-variant-construct.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 enum Foo { Bar { diff --git a/tests/ui/structs-enums/struct-variant-field-visibility.rs b/tests/ui/structs-enums/struct-variant-field-visibility.rs index 02d1ceb0513..a6528f9a2b1 100644 --- a/tests/ui/structs-enums/struct-variant-field-visibility.rs +++ b/tests/ui/structs-enums/struct-variant-field-visibility.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 mod foo { pub enum Foo { diff --git a/tests/ui/structs-enums/struct_variant_xc.rs b/tests/ui/structs-enums/struct_variant_xc.rs index 4723f229185..bf69a2aead9 100644 --- a/tests/ui/structs-enums/struct_variant_xc.rs +++ b/tests/ui/structs-enums/struct_variant_xc.rs @@ -1,6 +1,5 @@ //@ run-pass //@ aux-build:struct_variant_xc_aux.rs -//@ pretty-expanded FIXME #23616 extern crate struct_variant_xc_aux; diff --git a/tests/ui/structs-enums/tag-exports.rs b/tests/ui/structs-enums/tag-exports.rs index a01b951e675..bac428e6723 100644 --- a/tests/ui/structs-enums/tag-exports.rs +++ b/tests/ui/structs-enums/tag-exports.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 use alder::*; diff --git a/tests/ui/structs-enums/tag-in-block.rs b/tests/ui/structs-enums/tag-in-block.rs index 944a611c71a..27b48aae51f 100644 --- a/tests/ui/structs-enums/tag-in-block.rs +++ b/tests/ui/structs-enums/tag-in-block.rs @@ -4,7 +4,6 @@ -//@ pretty-expanded FIXME #23616 fn foo() { fn zed(_z: bar) { } diff --git a/tests/ui/structs-enums/tag-variant-disr-type-mismatch.rs b/tests/ui/structs-enums/tag-variant-disr-type-mismatch.rs index 9205ac81650..f4c202d91a7 100644 --- a/tests/ui/structs-enums/tag-variant-disr-type-mismatch.rs +++ b/tests/ui/structs-enums/tag-variant-disr-type-mismatch.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum color { red = 1, diff --git a/tests/ui/structs-enums/tuple-struct-trivial.rs b/tests/ui/structs-enums/tuple-struct-trivial.rs index 329f80a462e..e2395036551 100644 --- a/tests/ui/structs-enums/tuple-struct-trivial.rs +++ b/tests/ui/structs-enums/tuple-struct-trivial.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 struct Foo(isize, isize, isize); diff --git a/tests/ui/structs-enums/type-sizes.rs b/tests/ui/structs-enums/type-sizes.rs index 1961f10bd0a..a8fadcc1d1e 100644 --- a/tests/ui/structs-enums/type-sizes.rs +++ b/tests/ui/structs-enums/type-sizes.rs @@ -5,6 +5,7 @@ #![allow(dead_code)] #![feature(never_type)] #![feature(pointer_is_aligned_to)] +#![feature(rustc_attrs)] use std::mem::size_of; use std::num::NonZero; @@ -237,6 +238,10 @@ struct VecDummy { len: usize, } +#[rustc_layout_scalar_valid_range_start(1)] +#[rustc_layout_scalar_valid_range_end(100)] +struct PointerWithRange(#[allow(dead_code)] *const u8); + pub fn main() { assert_eq!(size_of::<u8>(), 1 as usize); assert_eq!(size_of::<u32>(), 4 as usize); @@ -354,4 +359,6 @@ pub fn main() { assert!(ptr::from_ref(&v.a).addr() > ptr::from_ref(&v.b).addr()); + assert_eq!(size_of::<Option<PointerWithRange>>(), size_of::<PointerWithRange>()); + assert_eq!(size_of::<Option<Option<PointerWithRange>>>(), size_of::<PointerWithRange>()); } diff --git a/tests/ui/structs-enums/variant-structs-trivial.rs b/tests/ui/structs-enums/variant-structs-trivial.rs index 8ca86fa35ee..a7b05751184 100644 --- a/tests/ui/structs-enums/variant-structs-trivial.rs +++ b/tests/ui/structs-enums/variant-structs-trivial.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 enum Foo { Bar { x: isize }, diff --git a/tests/ui/structs/large-records.rs b/tests/ui/structs/large-records.rs index c78b6259667..d02a9f488c6 100644 --- a/tests/ui/structs/large-records.rs +++ b/tests/ui/structs/large-records.rs @@ -5,7 +5,6 @@ -//@ pretty-expanded FIXME #23616 struct Large {a: isize, b: isize, diff --git a/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr index 05e087fd9f9..a040e71cf3b 100644 --- a/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr +++ b/tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr @@ -31,6 +31,10 @@ note: required by a bound in `bar` | LL | fn bar(f: impl Future<Output=()>) {} | ^^^^^^^^^^^^^^^^^ required by this bound in `bar` +help: use parentheses to call this closure + | +LL | bar(async_closure()); + | ++ error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/auxiliary/issue-61963-1.rs b/tests/ui/suggestions/auxiliary/issue-61963-1.rs index 33e5f9db2c3..2e7b0dbef19 100644 --- a/tests/ui/suggestions/auxiliary/issue-61963-1.rs +++ b/tests/ui/suggestions/auxiliary/issue-61963-1.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{Group, TokenStream, TokenTree}; diff --git a/tests/ui/suggestions/auxiliary/issue-61963.rs b/tests/ui/suggestions/auxiliary/issue-61963.rs index bfea8061c4b..07e6f319585 100644 --- a/tests/ui/suggestions/auxiliary/issue-61963.rs +++ b/tests/ui/suggestions/auxiliary/issue-61963.rs @@ -1,7 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::{Group, Spacing, Punct, TokenTree, TokenStream}; diff --git a/tests/ui/suggestions/auxiliary/proc-macro-type-error.rs b/tests/ui/suggestions/auxiliary/proc-macro-type-error.rs index aebc5a6aaa9..2930b87d1bb 100644 --- a/tests/ui/suggestions/auxiliary/proc-macro-type-error.rs +++ b/tests/ui/suggestions/auxiliary/proc-macro-type-error.rs @@ -1,6 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic -#![crate_type = "proc-macro"] #![feature(proc_macro_quote)] extern crate proc_macro; diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr index a275d8e4e83..4f92d3aceef 100644 --- a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr +++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr @@ -8,7 +8,7 @@ LL | const A: i32 = 2; | ------------ missing patterns are not covered because `A` is interpreted as a constant pattern, not a new variable | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `i32` help: introduce a variable instead | diff --git a/tests/ui/suggestions/issue-61963.rs b/tests/ui/suggestions/issue-61963.rs index de82700d7e4..2fafe629db9 100644 --- a/tests/ui/suggestions/issue-61963.rs +++ b/tests/ui/suggestions/issue-61963.rs @@ -1,5 +1,5 @@ -//@ aux-build:issue-61963.rs -//@ aux-build:issue-61963-1.rs +//@ proc-macro: issue-61963.rs +//@ proc-macro: issue-61963-1.rs #![deny(bare_trait_objects)] #[macro_use] diff --git a/tests/ui/suggestions/suggest-ref-macro.rs b/tests/ui/suggestions/suggest-ref-macro.rs index e5084e54115..2f31af33782 100644 --- a/tests/ui/suggestions/suggest-ref-macro.rs +++ b/tests/ui/suggestions/suggest-ref-macro.rs @@ -1,5 +1,5 @@ // run-check -//@ aux-build:proc-macro-type-error.rs +//@ proc-macro: proc-macro-type-error.rs extern crate proc_macro_type_error; diff --git a/tests/ui/suggestions/trait-hidden-method.rs b/tests/ui/suggestions/trait-hidden-method.rs index ae7ef47e1d4..1efc1cc6fae 100644 --- a/tests/ui/suggestions/trait-hidden-method.rs +++ b/tests/ui/suggestions/trait-hidden-method.rs @@ -1,8 +1,6 @@ // #107983 - testing that `__iterator_get_unchecked` isn't suggested // HELP included so that compiletest errors on the bad suggestion pub fn i_can_has_iterator() -> impl Iterator<Item = u32> { - //~^ ERROR expected `Box<dyn Iterator>` - //~| HELP consider constraining the associated type Box::new(1..=10) as Box<dyn Iterator> //~^ ERROR the value of the associated type `Item` //~| HELP specify the associated type diff --git a/tests/ui/suggestions/trait-hidden-method.stderr b/tests/ui/suggestions/trait-hidden-method.stderr index 729523cde55..87753e57846 100644 --- a/tests/ui/suggestions/trait-hidden-method.stderr +++ b/tests/ui/suggestions/trait-hidden-method.stderr @@ -1,24 +1,9 @@ error[E0191]: the value of the associated type `Item` in `Iterator` must be specified - --> $DIR/trait-hidden-method.rs:6:33 + --> $DIR/trait-hidden-method.rs:4:33 | LL | Box::new(1..=10) as Box<dyn Iterator> | ^^^^^^^^ help: specify the associated type: `Iterator<Item = Type>` -error[E0271]: expected `Box<dyn Iterator>` to be an iterator that yields `u32`, but it yields `<dyn Iterator as Iterator>::Item` - --> $DIR/trait-hidden-method.rs:3:32 - | -LL | pub fn i_can_has_iterator() -> impl Iterator<Item = u32> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found associated type -... -LL | Box::new(1..=10) as Box<dyn Iterator> - | ------------------------------------- return type was inferred to be `Box<dyn Iterator>` here - | - = note: expected type `u32` - found associated type `<dyn Iterator as Iterator>::Item` - = help: consider constraining the associated type `<dyn Iterator as Iterator>::Item` to `u32` - = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0191, E0271. -For more information about an error, try `rustc --explain E0191`. +For more information about this error, try `rustc --explain E0191`. diff --git a/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.rs b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.rs index ed262fd39a5..c2387bf5411 100644 --- a/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.rs +++ b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.rs @@ -5,8 +5,7 @@ pub trait T<X, Y> { } pub struct Foo { i: Box<dyn T<usize, usize, usize, usize, B=usize>>, - //~^ ERROR must be specified - //~| ERROR trait takes 2 generic arguments but 4 generic arguments were supplied + //~^ ERROR trait takes 2 generic arguments but 4 generic arguments were supplied } diff --git a/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr index 7c84dd4b8ff..18cf0674f02 100644 --- a/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr +++ b/tests/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr @@ -14,19 +14,6 @@ help: replace the generic bounds with the associated types LL | i: Box<dyn T<usize, usize, A = usize, C = usize, B=usize>>, | +++ +++ -error[E0191]: the value of the associated types `C` and `A` in `T` must be specified - --> $DIR/use-type-argument-instead-of-assoc-type.rs:7:16 - | -LL | type A; - | ------ `A` defined here -LL | type B; -LL | type C; - | ------ `C` defined here -... -LL | i: Box<dyn T<usize, usize, usize, usize, B=usize>>, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated types `A`, `C` must be specified - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0107, E0191. -For more information about an error, try `rustc --explain E0107`. +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/super.rs b/tests/ui/super.rs index 5d2ea92e921..69aff4f98e0 100644 --- a/tests/ui/super.rs +++ b/tests/ui/super.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub mod a { pub fn f() {} diff --git a/tests/ui/svh-add-nothing.rs b/tests/ui/svh-add-nothing.rs index 75ef82d0fa3..6e4b9fa7f4c 100644 --- a/tests/ui/svh-add-nothing.rs +++ b/tests/ui/svh-add-nothing.rs @@ -4,7 +4,6 @@ //@ aux-build:svh-b.rs //@ aux-build:svh-a-base.rs -//@ pretty-expanded FIXME #23616 extern crate a; extern crate b; diff --git a/tests/ui/swap-overlapping.rs b/tests/ui/swap-overlapping.rs index f7720e0470d..38d5a8109d1 100644 --- a/tests/ui/swap-overlapping.rs +++ b/tests/ui/swap-overlapping.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] // Issue #5041 - avoid overlapping memcpy when src and dest of a swap are the same -//@ pretty-expanded FIXME #23616 use std::ptr; diff --git a/tests/ui/tail-call-arg-leak.rs b/tests/ui/tail-call-arg-leak.rs index 003fb212fcb..234924307c3 100644 --- a/tests/ui/tail-call-arg-leak.rs +++ b/tests/ui/tail-call-arg-leak.rs @@ -1,6 +1,5 @@ //@ run-pass // use of tail calls causes arg slot leaks, issue #160. -//@ pretty-expanded FIXME #23616 fn inner(dummy: String, b: bool) { if b { return inner(dummy, false); } } diff --git a/tests/ui/thir-print/thir-tree-match.stdout b/tests/ui/thir-print/thir-tree-match.stdout index a9d6985928a..d56f15fb221 100644 --- a/tests/ui/thir-print/thir-tree-match.stdout +++ b/tests/ui/thir-print/thir-tree-match.stdout @@ -92,7 +92,7 @@ body: adt_def: AdtDef { did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo) - variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], tainted: None, flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], tainted: None, flags: }] + variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])), safety: Safe }], tainted: None, flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], tainted: None, flags: }] flags: IS_ENUM repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 } args: [] @@ -154,7 +154,7 @@ body: adt_def: AdtDef { did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo) - variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], tainted: None, flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], tainted: None, flags: }] + variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])), safety: Safe }], tainted: None, flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], tainted: None, flags: }] flags: IS_ENUM repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 } args: [] @@ -206,7 +206,7 @@ body: adt_def: AdtDef { did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo) - variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], tainted: None, flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], tainted: None, flags: }] + variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])), safety: Safe }], tainted: None, flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], tainted: None, flags: }] flags: IS_ENUM repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 } args: [] diff --git a/tests/ui/threads-sendsync/child-outlives-parent.rs b/tests/ui/threads-sendsync/child-outlives-parent.rs index e965bac5713..fd6e0c4630d 100644 --- a/tests/ui/threads-sendsync/child-outlives-parent.rs +++ b/tests/ui/threads-sendsync/child-outlives-parent.rs @@ -1,7 +1,6 @@ //@ run-pass // Reported as issue #126, child leaks the string. -//@ pretty-expanded FIXME #23616 //@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/send-resource.rs b/tests/ui/threads-sendsync/send-resource.rs index c02a3717d3d..e4c08dd598f 100644 --- a/tests/ui/threads-sendsync/send-resource.rs +++ b/tests/ui/threads-sendsync/send-resource.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 //@ needs-threads use std::sync::mpsc::channel; diff --git a/tests/ui/threads-sendsync/send-type-inference.rs b/tests/ui/threads-sendsync/send-type-inference.rs index 7608c19b575..c6150026c0a 100644 --- a/tests/ui/threads-sendsync/send-type-inference.rs +++ b/tests/ui/threads-sendsync/send-type-inference.rs @@ -2,7 +2,6 @@ #![allow(unused_must_use)] #![allow(dead_code)] #![allow(unused_mut)] -//@ pretty-expanded FIXME #23616 use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/threads-sendsync/sendable-class.rs b/tests/ui/threads-sendsync/sendable-class.rs index 8e5e76d826a..da61ea6be2c 100644 --- a/tests/ui/threads-sendsync/sendable-class.rs +++ b/tests/ui/threads-sendsync/sendable-class.rs @@ -6,7 +6,6 @@ // Test that a class with only sendable fields can be sent -//@ pretty-expanded FIXME #23616 use std::sync::mpsc::channel; diff --git a/tests/ui/threads-sendsync/std-sync-right-kind-impls.rs b/tests/ui/threads-sendsync/std-sync-right-kind-impls.rs index a443785a678..b2d22631c1a 100644 --- a/tests/ui/threads-sendsync/std-sync-right-kind-impls.rs +++ b/tests/ui/threads-sendsync/std-sync-right-kind-impls.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::sync; diff --git a/tests/ui/threads-sendsync/sync-send-atomics.rs b/tests/ui/threads-sendsync/sync-send-atomics.rs index f64506af0a3..fc7f3971e76 100644 --- a/tests/ui/threads-sendsync/sync-send-atomics.rs +++ b/tests/ui/threads-sendsync/sync-send-atomics.rs @@ -1,6 +1,5 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 use std::sync::atomic::*; diff --git a/tests/ui/threads-sendsync/sync-send-iterators-in-libcore.rs b/tests/ui/threads-sendsync/sync-send-iterators-in-libcore.rs index 512c81a85fc..4baf123295e 100644 --- a/tests/ui/threads-sendsync/sync-send-iterators-in-libcore.rs +++ b/tests/ui/threads-sendsync/sync-send-iterators-in-libcore.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(warnings)] diff --git a/tests/ui/threads-sendsync/task-comm-11.rs b/tests/ui/threads-sendsync/task-comm-11.rs index 7c349c716fa..1585ec3b4f6 100644 --- a/tests/ui/threads-sendsync/task-comm-11.rs +++ b/tests/ui/threads-sendsync/task-comm-11.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_must_use)] -//@ pretty-expanded FIXME #23616 //@ needs-threads use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/threads-sendsync/task-comm-15.rs b/tests/ui/threads-sendsync/task-comm-15.rs index 1308446893b..54e7b08b6a6 100644 --- a/tests/ui/threads-sendsync/task-comm-15.rs +++ b/tests/ui/threads-sendsync/task-comm-15.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_must_use)] //@ needs-threads -//@ pretty-expanded FIXME #23616 use std::sync::mpsc::{channel, Sender}; use std::thread; diff --git a/tests/ui/threads-sendsync/task-comm-17.rs b/tests/ui/threads-sendsync/task-comm-17.rs index a545beee599..37208265266 100644 --- a/tests/ui/threads-sendsync/task-comm-17.rs +++ b/tests/ui/threads-sendsync/task-comm-17.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_must_use)] //@ needs-threads -//@ pretty-expanded FIXME #23616 // Issue #922 diff --git a/tests/ui/threads-sendsync/task-life-0.rs b/tests/ui/threads-sendsync/task-life-0.rs index f08a281e76c..c2440bc44bc 100644 --- a/tests/ui/threads-sendsync/task-life-0.rs +++ b/tests/ui/threads-sendsync/task-life-0.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_must_use)] //@ needs-threads -//@ pretty-expanded FIXME #23616 use std::thread; diff --git a/tests/ui/trailing-comma.rs b/tests/ui/trailing-comma.rs index 95a8b366ad9..53b76fb6037 100644 --- a/tests/ui/trailing-comma.rs +++ b/tests/ui/trailing-comma.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn f<T,>(_: T,) {} diff --git a/tests/ui/trait-bounds/maybe-bound-has-path-args.rs b/tests/ui/trait-bounds/maybe-bound-has-path-args.rs index 2cb63f25d06..fd0e9691700 100644 --- a/tests/ui/trait-bounds/maybe-bound-has-path-args.rs +++ b/tests/ui/trait-bounds/maybe-bound-has-path-args.rs @@ -1,7 +1,7 @@ trait Trait {} fn test<T: ?self::<i32>::Trait>() {} -//~^ ERROR type arguments are not allowed on this type +//~^ ERROR type arguments are not allowed on module `maybe_bound_has_path_args` //~| WARN relaxing a default bound only does something for `?Sized` fn main() {} diff --git a/tests/ui/trait-bounds/maybe-bound-has-path-args.stderr b/tests/ui/trait-bounds/maybe-bound-has-path-args.stderr index 701e493f5a5..0c167fff940 100644 --- a/tests/ui/trait-bounds/maybe-bound-has-path-args.stderr +++ b/tests/ui/trait-bounds/maybe-bound-has-path-args.stderr @@ -4,13 +4,13 @@ warning: relaxing a default bound only does something for `?Sized`; all other tr LL | fn test<T: ?self::<i32>::Trait>() {} | ^^^^^^^^^^^^^^^^^^^ -error[E0109]: type arguments are not allowed on this type +error[E0109]: type arguments are not allowed on module `maybe_bound_has_path_args` --> $DIR/maybe-bound-has-path-args.rs:3:20 | LL | fn test<T: ?self::<i32>::Trait>() {} | ---- ^^^ type argument not allowed | | - | not allowed on this type + | not allowed on module `maybe_bound_has_path_args` error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/traits/astconv-cycle-between-and-type.rs b/tests/ui/traits/astconv-cycle-between-and-type.rs index 1d45028657e..cb2e172f02e 100644 --- a/tests/ui/traits/astconv-cycle-between-and-type.rs +++ b/tests/ui/traits/astconv-cycle-between-and-type.rs @@ -4,7 +4,6 @@ // carries a predicate that references the trait (`u32 : Trait1`, // substituted). -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/traits/bad-sized.rs b/tests/ui/traits/bad-sized.rs index a1521967978..7e4f37e4ae2 100644 --- a/tests/ui/traits/bad-sized.rs +++ b/tests/ui/traits/bad-sized.rs @@ -3,7 +3,4 @@ trait Trait {} pub fn main() { let x: Vec<dyn Trait + Sized> = Vec::new(); //~^ ERROR only auto traits can be used as additional traits in a trait object - //~| ERROR the size for values of type - //~| ERROR the size for values of type - //~| ERROR the size for values of type } diff --git a/tests/ui/traits/bad-sized.stderr b/tests/ui/traits/bad-sized.stderr index 4c1835dfed0..0e82867ef03 100644 --- a/tests/ui/traits/bad-sized.stderr +++ b/tests/ui/traits/bad-sized.stderr @@ -9,37 +9,6 @@ LL | let x: Vec<dyn Trait + Sized> = Vec::new(); = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Trait + Sized {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> -error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time - --> $DIR/bad-sized.rs:4:12 - | -LL | let x: Vec<dyn Trait + Sized> = Vec::new(); - | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `dyn Trait` -note: required by an implicit `Sized` bound in `Vec` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - -error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time - --> $DIR/bad-sized.rs:4:37 - | -LL | let x: Vec<dyn Trait + Sized> = Vec::new(); - | ^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `dyn Trait` -note: required by a bound in `Vec::<T>::new` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - -error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time - --> $DIR/bad-sized.rs:4:37 - | -LL | let x: Vec<dyn Trait + Sized> = Vec::new(); - | ^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `dyn Trait` -note: required by an implicit `Sized` bound in `Vec` - --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - -error: aborting due to 4 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0225, E0277. -For more information about an error, try `rustc --explain E0225`. +For more information about this error, try `rustc --explain E0225`. diff --git a/tests/ui/traits/bound/basic.rs b/tests/ui/traits/bound/basic.rs index 85157fdbf62..acd8056bee0 100644 --- a/tests/ui/traits/bound/basic.rs +++ b/tests/ui/traits/bound/basic.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(unconditional_recursion)] -//@ pretty-expanded FIXME #23616 trait Foo { } diff --git a/tests/ui/traits/bound/impl-comparison-duplicates.rs b/tests/ui/traits/bound/impl-comparison-duplicates.rs index 68b64de3e96..14553ed27b7 100644 --- a/tests/ui/traits/bound/impl-comparison-duplicates.rs +++ b/tests/ui/traits/bound/impl-comparison-duplicates.rs @@ -3,7 +3,6 @@ // trait exactly, as long as the implementation doesn't demand *more* bounds // than the trait. -//@ pretty-expanded FIXME #23616 trait A { fn foo<T: Eq + Ord>(&self); diff --git a/tests/ui/traits/bound/multiple.rs b/tests/ui/traits/bound/multiple.rs index 385fa8851c1..30f229b285a 100644 --- a/tests/ui/traits/bound/multiple.rs +++ b/tests/ui/traits/bound/multiple.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn f<T:PartialEq + PartialOrd>(_: T) { } diff --git a/tests/ui/traits/bound/on-structs-and-enums-rpass.rs b/tests/ui/traits/bound/on-structs-and-enums-rpass.rs index 25e1b6b4bc3..8dd24301505 100644 --- a/tests/ui/traits/bound/on-structs-and-enums-rpass.rs +++ b/tests/ui/traits/bound/on-structs-and-enums-rpass.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 trait U {} trait T<X: U> { fn get(self) -> X; } diff --git a/tests/ui/traits/bound/recursion.rs b/tests/ui/traits/bound/recursion.rs index 1d9832ac917..90cdfed0c99 100644 --- a/tests/ui/traits/bound/recursion.rs +++ b/tests/ui/traits/bound/recursion.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait I { fn i(&self) -> Self; } diff --git a/tests/ui/traits/bug-7295.rs b/tests/ui/traits/bug-7295.rs index bd4e126c220..a1cbcf1601e 100644 --- a/tests/ui/traits/bug-7295.rs +++ b/tests/ui/traits/bug-7295.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub trait Foo<T> { fn func1<U>(&self, t: U, w: T); diff --git a/tests/ui/traits/cache-issue-18209.rs b/tests/ui/traits/cache-issue-18209.rs index e0c309ed97d..6a027d6b3f3 100644 --- a/tests/ui/traits/cache-issue-18209.rs +++ b/tests/ui/traits/cache-issue-18209.rs @@ -4,7 +4,6 @@ // // See issue #18209. -//@ pretty-expanded FIXME #23616 pub trait Foo { fn load_from() -> Box<Self>; diff --git a/tests/ui/traits/composition-trivial.rs b/tests/ui/traits/composition-trivial.rs index 26f7673e616..8a5a36f4cfd 100644 --- a/tests/ui/traits/composition-trivial.rs +++ b/tests/ui/traits/composition-trivial.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Foo { fn foo(&self); diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr index 86bd07a5f59..c7af0a220ca 100644 --- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr +++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr @@ -2,13 +2,13 @@ error[E0277]: the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not sati --> $DIR/assoc-type-const-bound-usage-fail-2.rs:23:5 | LL | T::Assoc::<U>::func(); - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error[E0277]: the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied --> $DIR/assoc-type-const-bound-usage-fail-2.rs:25:5 | LL | <T as Trait>::Assoc::<U>::func(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr index 145fe2c41dd..99fc924ad06 100644 --- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr +++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr @@ -2,13 +2,13 @@ error[E0277]: the trait bound `T: ~const Trait` is not satisfied --> $DIR/assoc-type-const-bound-usage-fail.rs:16:5 | LL | T::Assoc::func(); - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0277]: the trait bound `T: ~const Trait` is not satisfied --> $DIR/assoc-type-const-bound-usage-fail.rs:18:5 | LL | <T as Trait>::Assoc::func(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/traits/const-traits/call-const-closure.stderr b/tests/ui/traits/const-traits/call-const-closure.stderr index 3fed67f5d08..fe7c115aaab 100644 --- a/tests/ui/traits/const-traits/call-const-closure.stderr +++ b/tests/ui/traits/const-traits/call-const-closure.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `(): ~const Bar` is not satisfied - --> $DIR/call-const-closure.rs:17:15 + --> $DIR/call-const-closure.rs:17:18 | LL | (const || ().foo())(); - | ^^^^^^^^ + | ^^^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr b/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr index e56968b9097..b9dabceb5de 100644 --- a/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr +++ b/tests/ui/traits/const-traits/call-const-in-tilde-const.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: const Foo` is not satisfied --> $DIR/call-const-in-tilde-const.rs:9:13 | LL | const { T::foo() } - | ^^^^^^^^ + | ^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr b/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr index b461fd9e39e..64850335c2a 100644 --- a/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr +++ b/tests/ui/traits/const-traits/call-const-trait-method-fail.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `u32: ~const Plus` is not satisfied --> $DIR/call-const-trait-method-fail.rs:26:5 | LL | a.plus(b) - | ^^^^^^^^^ + | ^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr b/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr index 9ae1ed18e35..1e48a0331cc 100644 --- a/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr +++ b/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr @@ -1,12 +1,3 @@ -error: const `impl` for trait `Add` which is not marked with `#[const_trait]` - --> $DIR/call-const-trait-method-pass.rs:7:12 - | -LL | impl const std::ops::Add for Int { - | ^^^^^^^^^^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` --> $DIR/call-const-trait-method-pass.rs:15:12 | @@ -16,14 +7,6 @@ LL | impl const PartialEq for Int { = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` = note: adding a non-const method body in the future would be a breaking change -error[E0015]: cannot call non-const operator in constants - --> $DIR/call-const-trait-method-pass.rs:39:22 - | -LL | const ADD_INT: Int = Int(1i32) + Int(2i32); - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: calls in constants are limited to constant functions, tuple structs and tuple variants - error[E0015]: cannot call non-const fn `<Int as PartialEq>::eq` in constant functions --> $DIR/call-const-trait-method-pass.rs:20:15 | @@ -32,6 +15,6 @@ LL | !self.eq(other) | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr b/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr index d881bd5f4de..74a22186a16 100644 --- a/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr +++ b/tests/ui/traits/const-traits/call-generic-method-nonconst.stderr @@ -1,8 +1,16 @@ error[E0277]: the trait bound `S: const Foo` is not satisfied - --> $DIR/call-generic-method-nonconst.rs:24:22 + --> $DIR/call-generic-method-nonconst.rs:24:34 | LL | pub const EQ: bool = equals_self(&S); - | ^^^^^^^^^^^^^^^ + | ----------- ^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `equals_self` + --> $DIR/call-generic-method-nonconst.rs:17:25 + | +LL | const fn equals_self<T: ~const Foo>(t: &T) -> bool { + | ^^^^^^ required by this bound in `equals_self` error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/const-and-non-const-impl.stderr b/tests/ui/traits/const-traits/const-and-non-const-impl.stderr index cf7af41cd4e..4eb15177347 100644 --- a/tests/ui/traits/const-traits/const-and-non-const-impl.stderr +++ b/tests/ui/traits/const-traits/const-and-non-const-impl.stderr @@ -1,21 +1,3 @@ -error: const `impl` for trait `Add` which is not marked with `#[const_trait]` - --> $DIR/const-and-non-const-impl.rs:7:12 - | -LL | impl const std::ops::Add for i32 { - | ^^^^^^^^^^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Add` which is not marked with `#[const_trait]` - --> $DIR/const-and-non-const-impl.rs:23:12 - | -LL | impl const std::ops::Add for Int { - | ^^^^^^^^^^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0119]: conflicting implementations of trait `Add` for type `Int` --> $DIR/const-and-non-const-impl.rs:23:1 | @@ -38,7 +20,7 @@ LL | impl const std::ops::Add for i32 { = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0117, E0119. For more information about an error, try `rustc --explain E0117`. diff --git a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr index 25c81ff900f..0970cd5225f 100644 --- a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr +++ b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr @@ -12,5 +12,13 @@ LL | const fn test() -> impl ~const Fn() { | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 2 previous errors +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-closure-parse-not-item.rs:7:25 + | +LL | const fn test() -> impl ~const Fn() { + | ^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 3 previous errors diff --git a/tests/ui/traits/const-traits/const-default-method-bodies.stderr b/tests/ui/traits/const-traits/const-default-method-bodies.stderr index 5879330f158..903f7d37f9d 100644 --- a/tests/ui/traits/const-traits/const-default-method-bodies.stderr +++ b/tests/ui/traits/const-traits/const-default-method-bodies.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `NonConstImpl: ~const ConstDefaultFn` is not satisfied - --> $DIR/const-default-method-bodies.rs:25:5 + --> $DIR/const-default-method-bodies.rs:25:18 | LL | NonConstImpl.a(); - | ^^^^^^^^^^^^^^^^ + | ^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/const-drop-bound.rs b/tests/ui/traits/const-traits/const-drop-bound.rs index b0790f86ef5..398fb390640 100644 --- a/tests/ui/traits/const-traits/const-drop-bound.rs +++ b/tests/ui/traits/const-traits/const-drop-bound.rs @@ -2,7 +2,7 @@ // FIXME check-pass #![feature(const_trait_impl)] -#![feature(const_precise_live_drops)] +#![feature(const_precise_live_drops, const_destruct)] use std::marker::Destruct; diff --git a/tests/ui/traits/const-traits/const-drop-bound.stderr b/tests/ui/traits/const-traits/const-drop-bound.stderr index 3f718645433..78ba0279566 100644 --- a/tests/ui/traits/const-traits/const-drop-bound.stderr +++ b/tests/ui/traits/const-traits/const-drop-bound.stderr @@ -1,51 +1,17 @@ -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:9:61 +error[E0277]: the trait bound `Foo<E>: ~const Destruct` is not satisfied + --> $DIR/const-drop-bound.rs:23:9 | -LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct { - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits +LL | foo(res) + | --- ^^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `foo` --> $DIR/const-drop-bound.rs:9:61 | LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct { - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:20:8 - | -LL | T: ~const Destruct, - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:21:8 - | -LL | E: ~const Destruct, - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:20:8 - | -LL | T: ~const Destruct, - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:21:8 - | -LL | E: ~const Destruct, - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0493]: destructor of `E` cannot be evaluated at compile-time - --> $DIR/const-drop-bound.rs:12:13 - | -LL | Err(_e) => None, - | ^^ the destructor for this type cannot be evaluated in constant functions + | ^^^^^^ required by this bound in `foo` -error: aborting due to 7 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0493`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr b/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr index 7529af9293d..7b2cafb6124 100644 --- a/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail-2.precise.stderr @@ -1,26 +1,15 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop-fail-2.rs:23:25 +error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: const Destruct` is not satisfied + --> $DIR/const-drop-fail-2.rs:31:23 | -LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> { - | ^^^^ +LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>( + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail-2.rs:29:26 +note: required by a bound in `check` + --> $DIR/const-drop-fail-2.rs:21:19 | LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^^^ - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop-fail-2.rs:39:25 - | -LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change + | ^^^^^^ required by this bound in `check` -error: aborting due to 3 previous errors +error: aborting due to 1 previous error +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop-fail-2.rs b/tests/ui/traits/const-traits/const-drop-fail-2.rs index 5d7bafa3887..1bcc87e9070 100644 --- a/tests/ui/traits/const-traits/const-drop-fail-2.rs +++ b/tests/ui/traits/const-traits/const-drop-fail-2.rs @@ -1,6 +1,7 @@ -//@ known-bug: #110395 -#![feature(const_trait_impl)] -// #![cfg_attr(precise, feature(const_precise_live_drops))] +//@ revisions: stock precise + +#![feature(const_trait_impl, const_destruct)] +#![cfg_attr(precise, feature(const_precise_live_drops))] use std::marker::{Destruct, PhantomData}; @@ -19,9 +20,7 @@ impl A for NonTrivialDrop {} const fn check<T: ~const Destruct>(_: T) {} - -/* FIXME(const_trait_impl) -struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>); +struct ConstDropImplWithBounds<T: A>(PhantomData<T>); impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> { fn drop(&mut self) { @@ -30,9 +29,9 @@ impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> { } const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>( + //~^ ERROR the trait bound ConstDropImplWithBounds(PhantomData) ); -*/ struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>); diff --git a/tests/ui/traits/const-traits/const-drop-fail-2.stderr b/tests/ui/traits/const-traits/const-drop-fail-2.stderr deleted file mode 100644 index fde106599c2..00000000000 --- a/tests/ui/traits/const-traits/const-drop-fail-2.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop-fail-2.rs:39:25 - | -LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail-2.rs:20:19 - | -LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail-2.rs:20:19 - | -LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0277]: the trait bound `T: ~const A` is not satisfied - --> $DIR/const-drop-fail-2.rs:41:9 - | -LL | T::a(); - | ^^^^^^ - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/const-drop-fail-2.rs:20:36 - | -LL | const fn check<T: ~const Destruct>(_: T) {} - | ^ - value is dropped here - | | - | the destructor for this type cannot be evaluated in constant functions - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0277, E0493. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr b/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr index 7529af9293d..7b2cafb6124 100644 --- a/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail-2.stock.stderr @@ -1,26 +1,15 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop-fail-2.rs:23:25 +error[E0277]: the trait bound `ConstDropImplWithBounds<NonTrivialDrop>: const Destruct` is not satisfied + --> $DIR/const-drop-fail-2.rs:31:23 | -LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> { - | ^^^^ +LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>( + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail-2.rs:29:26 +note: required by a bound in `check` + --> $DIR/const-drop-fail-2.rs:21:19 | LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^^^ - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop-fail-2.rs:39:25 - | -LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change + | ^^^^^^ required by this bound in `check` -error: aborting due to 3 previous errors +error: aborting due to 1 previous error +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop-fail.precise.stderr b/tests/ui/traits/const-traits/const-drop-fail.precise.stderr index 859fdfae81a..8b3e777a0b0 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.precise.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.precise.stderr @@ -1,85 +1,33 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop-fail.rs:19:12 +error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied + --> $DIR/const-drop-fail.rs:32:5 | -LL | impl const Drop for ConstImplWithDropGlue { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail.rs:23:19 +LL | const _: () = check($exp); + | ----- required by a bound introduced by this call +... +LL | NonTrivialDrop, + | ^^^^^^^^^^^^^^ | -LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits +note: required by a bound in `check` --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/const-drop-fail.rs:23:36 - | -LL | const fn check<T: ~const Destruct>(_: T) {} - | ^ the destructor for this type cannot be evaluated in constant functions + | ^^^^^^ required by this bound in `check` -error[E0080]: evaluation of constant value failed - --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL +error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied + --> $DIR/const-drop-fail.rs:34:5 | - = note: calling non-const function `<NonTrivialDrop as Drop>::drop` - | -note: inside `std::ptr::drop_in_place::<NonTrivialDrop> - shim(Some(NonTrivialDrop))` - --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL -note: inside `check::<NonTrivialDrop>` - --> $DIR/const-drop-fail.rs:23:43 - | -LL | const fn check<T: ~const Destruct>(_: T) {} - | ^ -note: inside `_` - --> $DIR/const-drop-fail.rs:27:23 - | -LL | const _: () = check($exp); - | ^^^^^^^^^^^ +LL | const _: () = check($exp); + | ----- required by a bound introduced by this call ... -LL | / check_all! { -LL | | NonTrivialDrop, -LL | | ConstImplWithDropGlue(NonTrivialDrop), -LL | | } - | |_- in this macro invocation - = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0080]: evaluation of constant value failed - --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL +LL | ConstImplWithDropGlue(NonTrivialDrop), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: calling non-const function `<NonTrivialDrop as Drop>::drop` - | -note: inside `std::ptr::drop_in_place::<NonTrivialDrop> - shim(Some(NonTrivialDrop))` - --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL -note: inside `std::ptr::drop_in_place::<ConstImplWithDropGlue> - shim(Some(ConstImplWithDropGlue))` - --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL -note: inside `check::<ConstImplWithDropGlue>` - --> $DIR/const-drop-fail.rs:23:43 +note: required by a bound in `check` + --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check<T: ~const Destruct>(_: T) {} - | ^ -note: inside `_` - --> $DIR/const-drop-fail.rs:27:23 - | -LL | const _: () = check($exp); - | ^^^^^^^^^^^ -... -LL | / check_all! { -LL | | NonTrivialDrop, -LL | | ConstImplWithDropGlue(NonTrivialDrop), -LL | | } - | |_- in this macro invocation - = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info) + | ^^^^^^ required by this bound in `check` -error: aborting due to 6 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0080, E0493. -For more information about an error, try `rustc --explain E0080`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop-fail.rs b/tests/ui/traits/const-traits/const-drop-fail.rs index 5a98c32e838..5e05b9db474 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.rs +++ b/tests/ui/traits/const-traits/const-drop-fail.rs @@ -1,7 +1,7 @@ -//@ known-bug: #110395 - +//@ compile-flags: -Znext-solver //@ revisions: stock precise -#![feature(const_trait_impl)] + +#![feature(const_trait_impl, const_destruct)] #![cfg_attr(precise, feature(const_precise_live_drops))] use std::marker::{Destruct, PhantomData}; @@ -30,7 +30,9 @@ macro_rules! check_all { check_all! { NonTrivialDrop, + //~^ ERROR the trait bound `NonTrivialDrop: const Destruct` is not satisfied ConstImplWithDropGlue(NonTrivialDrop), + //~^ ERROR the trait bound `NonTrivialDrop: const Destruct` is not satisfied } fn main() {} diff --git a/tests/ui/traits/const-traits/const-drop-fail.stock.stderr b/tests/ui/traits/const-traits/const-drop-fail.stock.stderr index 20dea28922b..8b3e777a0b0 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.stock.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.stock.stderr @@ -1,34 +1,33 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop-fail.rs:19:12 +error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied + --> $DIR/const-drop-fail.rs:32:5 | -LL | impl const Drop for ConstImplWithDropGlue { - | ^^^^ +LL | const _: () = check($exp); + | ----- required by a bound introduced by this call +... +LL | NonTrivialDrop, + | ^^^^^^^^^^^^^^ | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: `~const` can only be applied to `#[const_trait]` traits +note: required by a bound in `check` --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^ + | ^^^^^^ required by this bound in `check` -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail.rs:23:19 +error[E0277]: the trait bound `NonTrivialDrop: const Destruct` is not satisfied + --> $DIR/const-drop-fail.rs:34:5 | -LL | const fn check<T: ~const Destruct>(_: T) {} - | ^^^^^^ +LL | const _: () = check($exp); + | ----- required by a bound introduced by this call +... +LL | ConstImplWithDropGlue(NonTrivialDrop), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/const-drop-fail.rs:23:36 +note: required by a bound in `check` + --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check<T: ~const Destruct>(_: T) {} - | ^ - value is dropped here - | | - | the destructor for this type cannot be evaluated in constant functions + | ^^^^^^ required by this bound in `check` -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0493`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop.precise.stderr b/tests/ui/traits/const-traits/const-drop.precise.stderr deleted file mode 100644 index ed90b234761..00000000000 --- a/tests/ui/traits/const-traits/const-drop.precise.stderr +++ /dev/null @@ -1,90 +0,0 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:12:16 - | -LL | impl<'a> const Drop for S<'a> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:46:16 - | -LL | impl const Drop for ConstDrop { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:67:37 - | -LL | impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:75:30 - | -LL | impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:15 - | -LL | const fn a<T: ~const Destruct>(_: T) {} - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:15 - | -LL | const fn a<T: ~const Destruct>(_: T) {} - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0277]: the trait bound `T: const SomeTrait` is not satisfied - --> $DIR/const-drop.rs:67:46 - | -LL | impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> { - | ^^^^^^^^^^^^^^^^^^^^^ - | -note: required by a bound in `t::ConstDropWithBound` - --> $DIR/const-drop.rs:65:38 - | -LL | pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>); - | ^^^^^ required by this bound in `ConstDropWithBound` - -error[E0277]: the trait bound `T: const SomeTrait` is not satisfied - --> $DIR/const-drop.rs:68:22 - | -LL | fn drop(&mut self) { - | ^^^^ - | -note: required by a bound in `t::ConstDropWithBound` - --> $DIR/const-drop.rs:65:38 - | -LL | pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>); - | ^^^^^ required by this bound in `ConstDropWithBound` - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/const-drop.rs:18:32 - | -LL | const fn a<T: ~const Destruct>(_: T) {} - | ^ the destructor for this type cannot be evaluated in constant functions - -error[E0277]: the trait bound `T: ~const SomeTrait` is not satisfied - --> $DIR/const-drop.rs:69:13 - | -LL | T::foo(); - | ^^^^^^^^ - -error: aborting due to 10 previous errors - -Some errors have detailed explanations: E0277, E0493. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-drop.rs b/tests/ui/traits/const-traits/const-drop.rs index 5bd81fb3ab6..e2d87aeff47 100644 --- a/tests/ui/traits/const-traits/const-drop.rs +++ b/tests/ui/traits/const-traits/const-drop.rs @@ -1,7 +1,8 @@ -// FIXME run-pass -//@ known-bug: #110395 +//@ run-pass +//@ compile-flags: -Znext-solver //@ revisions: stock precise -#![feature(const_trait_impl)] + +#![feature(const_trait_impl, const_destruct)] #![feature(never_type)] #![cfg_attr(precise, feature(const_precise_live_drops))] @@ -64,7 +65,7 @@ mod t { pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>); - impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> { + impl<T: const SomeTrait> const Drop for ConstDropWithBound<T> { fn drop(&mut self) { T::foo(); } diff --git a/tests/ui/traits/const-traits/const-drop.stock.stderr b/tests/ui/traits/const-traits/const-drop.stock.stderr deleted file mode 100644 index 2b46b048e90..00000000000 --- a/tests/ui/traits/const-traits/const-drop.stock.stderr +++ /dev/null @@ -1,92 +0,0 @@ -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:12:16 - | -LL | impl<'a> const Drop for S<'a> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:46:16 - | -LL | impl const Drop for ConstDrop { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:67:37 - | -LL | impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Drop` which is not marked with `#[const_trait]` - --> $DIR/const-drop.rs:75:30 - | -LL | impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> { - | ^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:15 - | -LL | const fn a<T: ~const Destruct>(_: T) {} - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:15 - | -LL | const fn a<T: ~const Destruct>(_: T) {} - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0277]: the trait bound `T: const SomeTrait` is not satisfied - --> $DIR/const-drop.rs:67:46 - | -LL | impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> { - | ^^^^^^^^^^^^^^^^^^^^^ - | -note: required by a bound in `t::ConstDropWithBound` - --> $DIR/const-drop.rs:65:38 - | -LL | pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>); - | ^^^^^ required by this bound in `ConstDropWithBound` - -error[E0277]: the trait bound `T: const SomeTrait` is not satisfied - --> $DIR/const-drop.rs:68:22 - | -LL | fn drop(&mut self) { - | ^^^^ - | -note: required by a bound in `t::ConstDropWithBound` - --> $DIR/const-drop.rs:65:38 - | -LL | pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>); - | ^^^^^ required by this bound in `ConstDropWithBound` - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/const-drop.rs:18:32 - | -LL | const fn a<T: ~const Destruct>(_: T) {} - | ^ - value is dropped here - | | - | the destructor for this type cannot be evaluated in constant functions - -error[E0277]: the trait bound `T: ~const SomeTrait` is not satisfied - --> $DIR/const-drop.rs:69:13 - | -LL | T::foo(); - | ^^^^^^^^ - -error: aborting due to 10 previous errors - -Some errors have detailed explanations: E0277, E0493. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/const-traits/const-opaque.no.stderr b/tests/ui/traits/const-traits/const-opaque.no.stderr new file mode 100644 index 00000000000..1278e125746 --- /dev/null +++ b/tests/ui/traits/const-traits/const-opaque.no.stderr @@ -0,0 +1,23 @@ +error[E0277]: the trait bound `(): const Foo` is not satisfied + --> $DIR/const-opaque.rs:31:22 + | +LL | let opaque = bar(()); + | --- ^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `bar` + --> $DIR/const-opaque.rs:26:17 + | +LL | const fn bar<T: ~const Foo>(t: T) -> impl ~const Foo { + | ^^^^^^ required by this bound in `bar` + +error[E0277]: the trait bound `(): const Foo` is not satisfied + --> $DIR/const-opaque.rs:33:12 + | +LL | opaque.method(); + | ^^^^^^ + +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-opaque.rs b/tests/ui/traits/const-traits/const-opaque.rs new file mode 100644 index 00000000000..96cdd7d9f26 --- /dev/null +++ b/tests/ui/traits/const-traits/const-opaque.rs @@ -0,0 +1,38 @@ +//@ revisions: yes no +//@ compile-flags: -Znext-solver +//@[yes] check-pass + +#![feature(const_trait_impl)] + +#[const_trait] +trait Foo { + fn method(&self); +} + +impl<T: ~const Foo> const Foo for (T,) { + fn method(&self) {} +} + +#[cfg(yes)] +impl const Foo for () { + fn method(&self) {} +} + +#[cfg(no)] +impl Foo for () { + fn method(&self) {} +} + +const fn bar<T: ~const Foo>(t: T) -> impl ~const Foo { + (t,) +} + +const _: () = { + let opaque = bar(()); + //[no]~^ ERROR the trait bound `(): const Foo` is not satisfied + opaque.method(); + //[no]~^ ERROR the trait bound `(): const Foo` is not satisfied + std::mem::forget(opaque); +}; + +fn main() {} diff --git a/tests/ui/traits/const-traits/cross-crate.gatednc.stderr b/tests/ui/traits/const-traits/cross-crate.gatednc.stderr index b6f2434140d..4d5abf643a8 100644 --- a/tests/ui/traits/const-traits/cross-crate.gatednc.stderr +++ b/tests/ui/traits/const-traits/cross-crate.gatednc.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `cross_crate::NonConst: ~const cross_crate::MyTrait` is not satisfied - --> $DIR/cross-crate.rs:19:5 + --> $DIR/cross-crate.rs:19:14 | LL | NonConst.func(); - | ^^^^^^^^^^^^^^^ + | ^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr b/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr index 0534f3eb8d2..8c284bde67e 100644 --- a/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr +++ b/tests/ui/traits/const-traits/default-method-body-is-const-body-checking.stderr @@ -1,8 +1,14 @@ error[E0277]: the trait bound `(): ~const Tr` is not satisfied - --> $DIR/default-method-body-is-const-body-checking.rs:12:9 + --> $DIR/default-method-body-is-const-body-checking.rs:12:15 | LL | foo::<()>(); - | ^^^^^^^^^^^ + | ^^ + | +note: required by a bound in `foo` + --> $DIR/default-method-body-is-const-body-checking.rs:7:28 + | +LL | const fn foo<T>() where T: ~const Tr {} + | ^^^^^^ required by this bound in `foo` error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr b/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr index d987cad6f14..2bd71c940e7 100644 --- a/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr +++ b/tests/ui/traits/const-traits/default-method-body-is-const-same-trait-ck.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `(): ~const Tr` is not satisfied - --> $DIR/default-method-body-is-const-same-trait-ck.rs:9:9 + --> $DIR/default-method-body-is-const-same-trait-ck.rs:9:12 | LL | ().a() - | ^^^^^^ + | ^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/effects/auxiliary/minicore.rs b/tests/ui/traits/const-traits/effects/auxiliary/minicore.rs index 209a111c243..aaa61e21155 100644 --- a/tests/ui/traits/const-traits/effects/auxiliary/minicore.rs +++ b/tests/ui/traits/const-traits/effects/auxiliary/minicore.rs @@ -11,7 +11,8 @@ rustc_attrs, fundamental, marker_trait_attr, - const_trait_impl + const_trait_impl, + const_destruct )] #![allow(internal_features, incomplete_features)] #![no_std] @@ -444,12 +445,12 @@ impl<T: ?Sized> Deref for Ref<'_, T> { #[lang = "clone"] #[rustc_trivial_field_reads] -// FIXME: #[const_trait] +#[const_trait] pub trait Clone: Sized { fn clone(&self) -> Self; fn clone_from(&mut self, source: &Self) where - // FIXME: Self: ~const Destruct, + Self: ~const Destruct, { *self = source.clone() } @@ -458,7 +459,7 @@ pub trait Clone: Sized { #[lang = "structural_peq"] pub trait StructuralPartialEq {} -// FIXME: const fn drop<T: ~const Destruct>(_: T) {} +pub const fn drop<T: ~const Destruct>(_: T) {} #[rustc_intrinsic_must_be_overridden] #[rustc_intrinsic] diff --git a/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs b/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs new file mode 100644 index 00000000000..08dcd7d80b3 --- /dev/null +++ b/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs @@ -0,0 +1,16 @@ +//@ check-pass + +#![feature(const_trait_impl)] + +#[const_trait] +trait Foo {} + +impl<T> const Foo for (T,) where T: ~const Foo {} + +const fn needs_const_foo(_: impl ~const Foo + Copy) {} + +const fn test<T: ~const Foo + Copy>(t: T) { + needs_const_foo((t,)); +} + +fn main() {} diff --git a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.rs b/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.rs index c467088ab3d..8ff15dd09cc 100644 --- a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.rs +++ b/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.rs @@ -3,6 +3,7 @@ const fn test() -> impl ~const Fn() { //~^ ERROR `~const` can only be applied to `#[const_trait]` traits //~| ERROR `~const` can only be applied to `#[const_trait]` traits + //~| ERROR `~const` can only be applied to `#[const_trait]` traits const move || { //~ ERROR const closures are experimental let sl: &[u8] = b"foo"; diff --git a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr b/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr index 6d7edaf19f2..879d966b1f9 100644 --- a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr +++ b/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr @@ -1,5 +1,5 @@ error[E0658]: const closures are experimental - --> $DIR/ice-112822-expected-type-for-param.rs:6:5 + --> $DIR/ice-112822-expected-type-for-param.rs:7:5 | LL | const move || { | ^^^^^ @@ -22,8 +22,16 @@ LL | const fn test() -> impl ~const Fn() { | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/ice-112822-expected-type-for-param.rs:3:25 + | +LL | const fn test() -> impl ~const Fn() { + | ^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0015]: cannot call non-const operator in constant functions - --> $DIR/ice-112822-expected-type-for-param.rs:11:17 + --> $DIR/ice-112822-expected-type-for-param.rs:12:17 | LL | assert_eq!(first, &b'f'); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -32,7 +40,7 @@ LL | assert_eq!(first, &b'f'); = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0015]: cannot call non-const fn `core::panicking::assert_failed::<&u8, &u8>` in constant functions - --> $DIR/ice-112822-expected-type-for-param.rs:11:17 + --> $DIR/ice-112822-expected-type-for-param.rs:12:17 | LL | assert_eq!(first, &b'f'); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -40,7 +48,7 @@ LL | assert_eq!(first, &b'f'); = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors Some errors have detailed explanations: E0015, E0658. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-fail.rs b/tests/ui/traits/const-traits/effects/minicore-drop-fail.rs new file mode 100644 index 00000000000..274e5db21c4 --- /dev/null +++ b/tests/ui/traits/const-traits/effects/minicore-drop-fail.rs @@ -0,0 +1,37 @@ +//@ aux-build:minicore.rs +//@ compile-flags: --crate-type=lib -Znext-solver + +#![feature(no_core, const_trait_impl, const_destruct)] +#![no_std] +#![no_core] + +extern crate minicore; +use minicore::*; + +struct Contains<T>(T); + +struct NotDropImpl; +impl Drop for NotDropImpl { + fn drop(&mut self) {} +} + +#[const_trait] trait Foo {} +impl Foo for () {} + +struct Conditional<T: Foo>(T); +impl<T> const Drop for Conditional<T> where T: ~const Foo { + fn drop(&mut self) {} +} + +const fn test() { + let _ = NotDropImpl; + //~^ ERROR destructor of `NotDropImpl` cannot be evaluated at compile-time + let _ = Contains(NotDropImpl); + //~^ ERROR destructor of `Contains<NotDropImpl>` cannot be evaluated at compile-time + let _ = Conditional(()); + //~^ ERROR destructor of `Conditional<()>` cannot be evaluated at compile-time +} + +const fn drop_arbitrary<T>(_: T) { + //~^ ERROR destructor of `T` cannot be evaluated at compile-time +} diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-fail.stderr b/tests/ui/traits/const-traits/effects/minicore-drop-fail.stderr new file mode 100644 index 00000000000..12d1877a18a --- /dev/null +++ b/tests/ui/traits/const-traits/effects/minicore-drop-fail.stderr @@ -0,0 +1,36 @@ +error[E0493]: destructor of `NotDropImpl` cannot be evaluated at compile-time + --> $DIR/minicore-drop-fail.rs:27:13 + | +LL | let _ = NotDropImpl; + | ^^^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constant functions + +error[E0493]: destructor of `Contains<NotDropImpl>` cannot be evaluated at compile-time + --> $DIR/minicore-drop-fail.rs:29:13 + | +LL | let _ = Contains(NotDropImpl); + | ^^^^^^^^^^^^^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constant functions + +error[E0493]: destructor of `Conditional<()>` cannot be evaluated at compile-time + --> $DIR/minicore-drop-fail.rs:31:13 + | +LL | let _ = Conditional(()); + | ^^^^^^^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constant functions + +error[E0493]: destructor of `T` cannot be evaluated at compile-time + --> $DIR/minicore-drop-fail.rs:35:28 + | +LL | const fn drop_arbitrary<T>(_: T) { + | ^ the destructor for this type cannot be evaluated in constant functions +LL | +LL | } + | - value is dropped here + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.no.stderr b/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.no.stderr new file mode 100644 index 00000000000..218f3661e39 --- /dev/null +++ b/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.no.stderr @@ -0,0 +1,15 @@ +error[E0493]: destructor of `ConstDrop` cannot be evaluated at compile-time + --> $DIR/minicore-drop-without-feature-gate.rs:24:13 + | +LL | let _ = ConstDrop; + | ^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constant functions + | + = note: see issue #133214 <https://github.com/rust-lang/rust/issues/133214> for more information + = help: add `#![feature(const_destruct)]` 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: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.rs b/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.rs new file mode 100644 index 00000000000..e75bf3db007 --- /dev/null +++ b/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.rs @@ -0,0 +1,26 @@ +//@ aux-build:minicore.rs +//@ compile-flags: --crate-type=lib -Znext-solver +//@ revisions: yes no +//@[yes] check-pass +// gate-test-const_destruct + +#![feature(no_core, const_trait_impl)] +#![cfg_attr(yes, feature(const_destruct))] +#![no_std] +#![no_core] + +extern crate minicore; +use minicore::*; + +struct ConstDrop; +impl const Drop for ConstDrop { + fn drop(&mut self) {} +} + +// Make sure that `ConstDrop` can only be dropped when the `const_drop` +// feature gate is enabled. Otherwise, we should error if there is a drop +// impl at all. +const fn test() { + let _ = ConstDrop; + //[no]~^ ERROR destructor of `ConstDrop` cannot be evaluated at compile-time +} diff --git a/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr b/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr index cf158643b34..fa8be631a26 100644 --- a/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr +++ b/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr @@ -1,8 +1,16 @@ error[E0277]: the trait bound `(): ~const Foo` is not satisfied - --> $DIR/minicore-fn-fail.rs:19:5 + --> $DIR/minicore-fn-fail.rs:19:19 | LL | call_indirect(&foo::<()>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ------------- ^^^^^^^^^^ + | | + | required by a bound introduced by this call + | +note: required by a bound in `call_indirect` + --> $DIR/minicore-fn-fail.rs:11:27 + | +LL | const fn call_indirect<T: ~const Fn()>(t: &T) { t() } + | ^^^^^^ required by this bound in `call_indirect` error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr b/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr index 0b8e4696c46..9bd2c2cb8da 100644 --- a/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr +++ b/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr @@ -27,10 +27,10 @@ LL | trait Bar { | ^^^ error[E0277]: the trait bound `(): const Bar` is not satisfied - --> $DIR/no-explicit-const-params.rs:24:5 + --> $DIR/no-explicit-const-params.rs:24:6 | LL | <() as Bar<false>>::bar(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^ error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/no-explicit-const-params.rs:15:5 diff --git a/tests/crashes/112623.rs b/tests/ui/traits/const-traits/eval-bad-signature.rs index 592ad742e5f..97c573ea652 100644 --- a/tests/crashes/112623.rs +++ b/tests/ui/traits/const-traits/eval-bad-signature.rs @@ -1,4 +1,4 @@ -//@ known-bug: #112623 +// Make sure we don't ICE when evaluating a trait whose impl has a bad signature. #![feature(const_trait_impl)] @@ -15,6 +15,7 @@ struct FortyTwo; impl const Value for FortyTwo { fn value() -> i64 { + //~^ ERROR method `value` has an incompatible type for trait 42 } } diff --git a/tests/ui/traits/const-traits/eval-bad-signature.stderr b/tests/ui/traits/const-traits/eval-bad-signature.stderr new file mode 100644 index 00000000000..a64cf631743 --- /dev/null +++ b/tests/ui/traits/const-traits/eval-bad-signature.stderr @@ -0,0 +1,21 @@ +error[E0053]: method `value` has an incompatible type for trait + --> $DIR/eval-bad-signature.rs:17:19 + | +LL | fn value() -> i64 { + | ^^^ expected `u32`, found `i64` + | +note: type in trait + --> $DIR/eval-bad-signature.rs:7:19 + | +LL | fn value() -> u32; + | ^^^ + = note: expected signature `fn() -> u32` + found signature `fn() -> i64` +help: change the output type to match the trait + | +LL | fn value() -> u32 { + | ~~~ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/traits/const-traits/generic-bound.rs b/tests/ui/traits/const-traits/generic-bound.rs index 620e3259917..5eb236acde2 100644 --- a/tests/ui/traits/const-traits/generic-bound.rs +++ b/tests/ui/traits/const-traits/generic-bound.rs @@ -1,4 +1,4 @@ -//@ known-bug: #110395 +//@ check-pass #![feature(const_trait_impl)] @@ -26,5 +26,6 @@ const fn twice<T: std::ops::Add>(arg: S<T>) -> S<T> { } fn main() { + const _: S<i32> = twice(S(PhantomData)); let _ = twice(S(PhantomData::<i32>)); } diff --git a/tests/ui/traits/const-traits/generic-bound.stderr b/tests/ui/traits/const-traits/generic-bound.stderr deleted file mode 100644 index 0444c319577..00000000000 --- a/tests/ui/traits/const-traits/generic-bound.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: const `impl` for trait `Add` which is not marked with `#[const_trait]` - --> $DIR/generic-bound.rs:16:15 - | -LL | impl<T> const std::ops::Add for S<T> { - | ^^^^^^^^^^^^^ - | - = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0015]: cannot call non-const operator in constant functions - --> $DIR/generic-bound.rs:25:5 - | -LL | arg + arg - | ^^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/hir-const-check.rs b/tests/ui/traits/const-traits/hir-const-check.rs index ea1783b7c2c..c485fb12184 100644 --- a/tests/ui/traits/const-traits/hir-const-check.rs +++ b/tests/ui/traits/const-traits/hir-const-check.rs @@ -11,9 +11,9 @@ pub trait MyTrait { impl const MyTrait for () { fn method(&self) -> Option<()> { - Some(())?; //~ ERROR `?` is not allowed in a `const fn` - //~^ ERROR `?` cannot determine the branch of `Option<()>` in constant functions - //~| ERROR `?` cannot convert from residual of `Option<()>` in constant functions + Some(())?; + //~^ ERROR `?` is not allowed on + //~| ERROR `?` is not allowed on None } } diff --git a/tests/ui/traits/const-traits/hir-const-check.stderr b/tests/ui/traits/const-traits/hir-const-check.stderr index ef5dba0dc0e..d66a7ea3144 100644 --- a/tests/ui/traits/const-traits/hir-const-check.stderr +++ b/tests/ui/traits/const-traits/hir-const-check.stderr @@ -1,34 +1,19 @@ -error[E0658]: `?` is not allowed in a `const fn` +error[E0015]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/hir-const-check.rs:14:9 | LL | Some(())?; | ^^^^^^^^^ | - = note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information - = help: add `#![feature(const_try)]` 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[E0015]: `?` cannot determine the branch of `Option<()>` in constant functions - --> $DIR/hir-const-check.rs:14:9 - | -LL | Some(())?; - | ^^^^^^^^^ - | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions +error[E0015]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/hir-const-check.rs:14:9 | LL | Some(())?; | ^^^^^^^^^ | -note: impl defined here, but it is not `const` - --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0015, E0658. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs index 9ce81031b27..3473be565c1 100644 --- a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs +++ b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs @@ -18,8 +18,8 @@ impl const Try for TryMe { const fn t() -> TryMe { TryMe?; - //~^ ERROR `?` cannot determine the branch of `TryMe` in constant functions - //~| ERROR `?` cannot convert from residual of `TryMe` in constant functions + //~^ ERROR `?` is not allowed on + //~| ERROR `?` is not allowed on TryMe } diff --git a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr index db047bfd94d..9bd493e5fdb 100644 --- a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr +++ b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr @@ -33,7 +33,7 @@ LL | impl const Try for TryMe { = help: implement the missing item: `fn from_output(_: <Self as Try>::Output) -> Self { todo!() }` = help: implement the missing item: `fn branch(self) -> ControlFlow<<Self as Try>::Residual, <Self as Try>::Output> { todo!() }` -error[E0015]: `?` cannot determine the branch of `TryMe` in constant functions +error[E0015]: `?` is not allowed on `TryMe` in constant functions --> $DIR/ice-126148-failed-to-normalize.rs:20:5 | LL | TryMe?; @@ -41,7 +41,7 @@ LL | TryMe?; | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `TryMe` in constant functions +error[E0015]: `?` is not allowed on `TryMe` in constant functions --> $DIR/ice-126148-failed-to-normalize.rs:20:5 | LL | TryMe?; diff --git a/tests/ui/traits/const-traits/issue-92111.rs b/tests/ui/traits/const-traits/issue-92111.rs index 64fa32156c3..c8db5cc9e7a 100644 --- a/tests/ui/traits/const-traits/issue-92111.rs +++ b/tests/ui/traits/const-traits/issue-92111.rs @@ -1,9 +1,6 @@ -// Regression test for #92111. -// -//@ known-bug: #110395 -// FIXME check-pass +//@ check-pass -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_destruct)] use std::marker::Destruct; diff --git a/tests/ui/traits/const-traits/issue-92111.stderr b/tests/ui/traits/const-traits/issue-92111.stderr deleted file mode 100644 index 51c6a22b43b..00000000000 --- a/tests/ui/traits/const-traits/issue-92111.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/issue-92111.rs:20:15 - | -LL | const fn a<T: ~const Destruct>(t: T) {} - | ^^^^^^ - -error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/issue-92111.rs:20:15 - | -LL | const fn a<T: ~const Destruct>(t: T) {} - | ^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/issue-92111.rs:20:32 - | -LL | const fn a<T: ~const Destruct>(t: T) {} - | ^ - value is dropped here - | | - | the destructor for this type cannot be evaluated in constant functions - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/traits/const-traits/overlap-const-with-nonconst.min_spec.stderr b/tests/ui/traits/const-traits/overlap-const-with-nonconst.min_spec.stderr new file mode 100644 index 00000000000..bd822970ad1 --- /dev/null +++ b/tests/ui/traits/const-traits/overlap-const-with-nonconst.min_spec.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `Foo` for type `(_,)` + --> $DIR/overlap-const-with-nonconst.rs:23:1 + | +LL | / impl<T> const Foo for T +LL | | where +LL | | T: ~const Bar, + | |__________________- first implementation here +... +LL | impl<T> Foo for (T,) { + | ^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_,)` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/const-traits/overlap-const-with-nonconst.rs b/tests/ui/traits/const-traits/overlap-const-with-nonconst.rs new file mode 100644 index 00000000000..eb66d03faa6 --- /dev/null +++ b/tests/ui/traits/const-traits/overlap-const-with-nonconst.rs @@ -0,0 +1,38 @@ +//@ revisions: spec min_spec + +#![feature(const_trait_impl)] +#![cfg_attr(spec, feature(specialization))] +//[spec]~^ WARN the feature `specialization` is incomplete +#![cfg_attr(min_spec, feature(min_specialization))] + +#[const_trait] +trait Bar {} +impl<T> const Bar for T {} + +#[const_trait] +trait Foo { + fn method(&self); +} +impl<T> const Foo for T +where + T: ~const Bar, +{ + default fn method(&self) {} +} +// specializing impl: +impl<T> Foo for (T,) { +//~^ ERROR conflicting implementations + fn method(&self) { + println!("hi"); + } +} + +const fn dispatch<T: ~const Bar + Copy>(t: T) { + t.method(); +} + +fn main() { + const { + dispatch(((),)); + } +} diff --git a/tests/ui/traits/const-traits/overlap-const-with-nonconst.spec.stderr b/tests/ui/traits/const-traits/overlap-const-with-nonconst.spec.stderr new file mode 100644 index 00000000000..cbdcb45f6be --- /dev/null +++ b/tests/ui/traits/const-traits/overlap-const-with-nonconst.spec.stderr @@ -0,0 +1,24 @@ +warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/overlap-const-with-nonconst.rs:4:27 + | +LL | #![cfg_attr(spec, feature(specialization))] + | ^^^^^^^^^^^^^^ + | + = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information + = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default + +error[E0119]: conflicting implementations of trait `Foo` for type `(_,)` + --> $DIR/overlap-const-with-nonconst.rs:23:1 + | +LL | / impl<T> const Foo for T +LL | | where +LL | | T: ~const Bar, + | |__________________- first implementation here +... +LL | impl<T> Foo for (T,) { + | ^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_,)` + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr b/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr index bffc60c65fc..9166b8ca5d2 100644 --- a/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr +++ b/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr @@ -1,11 +1,31 @@ -error: cannot specialize on const impl with non-const impl +error[E0119]: conflicting implementations of trait `Bar` --> $DIR/const-default-bound-non-const-specialized-bound.rs:28:1 | +LL | / impl<T> const Bar for T +LL | | where +LL | | T: ~const Foo, + | |__________________- first implementation here +... LL | / impl<T> Bar for T LL | | where LL | | T: Foo, //FIXME ~ ERROR missing `~const` qualifier LL | | T: Specialize, - | |__________________^ + | |__________________^ conflicting implementation + +error[E0119]: conflicting implementations of trait `Baz` + --> $DIR/const-default-bound-non-const-specialized-bound.rs:48:1 + | +LL | / impl<T> const Baz for T +LL | | where +LL | | T: ~const Foo, + | |__________________- first implementation here +... +LL | / impl<T> const Baz for T //FIXME ~ ERROR conflicting implementations of trait `Baz` +LL | | where +LL | | T: Foo, +LL | | T: Specialize, + | |__________________^ conflicting implementation -error: aborting due to 1 previous error +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.min_spec.stderr b/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.min_spec.stderr new file mode 100644 index 00000000000..38fc5ddfbef --- /dev/null +++ b/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.min_spec.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `Value` for type `FortyTwo` + --> $DIR/const-default-impl-non-const-specialized-impl.rs:22:1 + | +LL | impl<T> const Value for T { + | ------------------------- first implementation here +... +LL | impl Value for FortyTwo { + | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `FortyTwo` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.rs b/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.rs index a3bb9b3f93e..acf0a967a88 100644 --- a/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.rs +++ b/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.rs @@ -1,7 +1,10 @@ // Tests that specializing trait impls must be at least as const as the default impl. +//@ revisions: spec min_spec #![feature(const_trait_impl)] -#![feature(min_specialization)] +#![cfg_attr(spec, feature(specialization))] +//[spec]~^ WARN the feature `specialization` is incomplete +#![cfg_attr(min_spec, feature(min_specialization))] #[const_trait] trait Value { @@ -16,7 +19,8 @@ impl<T> const Value for T { struct FortyTwo; -impl Value for FortyTwo { //~ ERROR cannot specialize on const impl with non-const impl +impl Value for FortyTwo { + //~^ ERROR conflicting implementations fn value() -> u32 { println!("You can't do that (constly)"); 42 diff --git a/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.spec.stderr b/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.spec.stderr new file mode 100644 index 00000000000..b59c42f5189 --- /dev/null +++ b/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.spec.stderr @@ -0,0 +1,22 @@ +warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-default-impl-non-const-specialized-impl.rs:5:27 + | +LL | #![cfg_attr(spec, feature(specialization))] + | ^^^^^^^^^^^^^^ + | + = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information + = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default + +error[E0119]: conflicting implementations of trait `Value` for type `FortyTwo` + --> $DIR/const-default-impl-non-const-specialized-impl.rs:22:1 + | +LL | impl<T> const Value for T { + | ------------------------- first implementation here +... +LL | impl Value for FortyTwo { + | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `FortyTwo` + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.stderr b/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.stderr deleted file mode 100644 index e356621ba47..00000000000 --- a/tests/ui/traits/const-traits/specialization/const-default-impl-non-const-specialized-impl.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: cannot specialize on const impl with non-const impl - --> $DIR/const-default-impl-non-const-specialized-impl.rs:19:1 - | -LL | impl Value for FortyTwo { - | ^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/traits/const-traits/specializing-constness-2.stderr b/tests/ui/traits/const-traits/specializing-constness-2.stderr index 4ad5e3157d4..edba836aac3 100644 --- a/tests/ui/traits/const-traits/specializing-constness-2.stderr +++ b/tests/ui/traits/const-traits/specializing-constness-2.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `T: ~const A` is not satisfied - --> $DIR/specializing-constness-2.rs:27:5 + --> $DIR/specializing-constness-2.rs:27:6 | LL | <T as A>::a(); - | ^^^^^^^^^^^^^ + | ^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/specializing-constness.rs b/tests/ui/traits/const-traits/specializing-constness.rs index 632121924a6..94b6da7124d 100644 --- a/tests/ui/traits/const-traits/specializing-constness.rs +++ b/tests/ui/traits/const-traits/specializing-constness.rs @@ -21,8 +21,7 @@ impl<T: ~const Spec> const A for T { } impl<T: Spec + Sup> A for T { -//~^ ERROR: cannot specialize -//FIXME(const_trait_impl) ~| ERROR: missing `~const` qualifier + //~^ ERROR conflicting implementations of trait `A` fn a() -> u32 { 3 } diff --git a/tests/ui/traits/const-traits/specializing-constness.stderr b/tests/ui/traits/const-traits/specializing-constness.stderr index 21e21c2cb71..2ca70b53e4e 100644 --- a/tests/ui/traits/const-traits/specializing-constness.stderr +++ b/tests/ui/traits/const-traits/specializing-constness.stderr @@ -1,8 +1,12 @@ -error: cannot specialize on const impl with non-const impl +error[E0119]: conflicting implementations of trait `A` --> $DIR/specializing-constness.rs:23:1 | +LL | impl<T: ~const Spec> const A for T { + | ---------------------------------- first implementation here +... LL | impl<T: Spec + Sup> A for T { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation error: aborting due to 1 previous error +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr index 01ae209016a..ee49810bace 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr @@ -11,10 +11,10 @@ LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: ~const Foo` is not satisfied - --> $DIR/super-traits-fail-2.rs:20:5 + --> $DIR/super-traits-fail-2.rs:20:7 | LL | x.a(); - | ^^^^^ + | ^ error: aborting due to 2 previous errors diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr index ae4c65e4aee..a213273c1c7 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `T: ~const Foo` is not satisfied - --> $DIR/super-traits-fail-2.rs:20:5 + --> $DIR/super-traits-fail-2.rs:20:7 | LL | x.a(); - | ^^^^^ + | ^ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr index 8fcada1bfd1..ecee348222d 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr @@ -25,10 +25,10 @@ LL | const fn foo<T: ~const Bar>(x: &T) { = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0277]: the trait bound `T: ~const Foo` is not satisfied - --> $DIR/super-traits-fail-3.rs:24:5 + --> $DIR/super-traits-fail-3.rs:24:7 | LL | x.a(); - | ^^^^^ + | ^ error: aborting due to 4 previous errors diff --git a/tests/ui/traits/const-traits/syntax.rs b/tests/ui/traits/const-traits/syntax.rs index 1064713ac59..cfac6e0a93e 100644 --- a/tests/ui/traits/const-traits/syntax.rs +++ b/tests/ui/traits/const-traits/syntax.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only //@ check-pass #![feature(const_trait_bound_opt_out)] diff --git a/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr b/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr index 78bf85e9c6d..f77d63db054 100644 --- a/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr +++ b/tests/ui/traits/const-traits/tilde-const-and-const-params.stderr @@ -26,13 +26,13 @@ error[E0277]: the trait bound `A: const Add42` is not satisfied --> $DIR/tilde-const-and-const-params.rs:27:61 | LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> { - | ^^^^^^^^^ + | ^ error[E0277]: the trait bound `A: const Add42` is not satisfied --> $DIR/tilde-const-and-const-params.rs:9:44 | LL | fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> { - | ^^^^^^^^^ + | ^ error: aborting due to 4 previous errors diff --git a/tests/ui/traits/const-traits/tilde-const-syntax.rs b/tests/ui/traits/const-traits/tilde-const-syntax.rs index d65ecae3d06..f9944c426cc 100644 --- a/tests/ui/traits/const-traits/tilde-const-syntax.rs +++ b/tests/ui/traits/const-traits/tilde-const-syntax.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only //@ check-pass #![feature(const_trait_impl)] diff --git a/tests/ui/traits/const-traits/tilde-twice.rs b/tests/ui/traits/const-traits/tilde-twice.rs index c3f9f8e6764..d341513b8a8 100644 --- a/tests/ui/traits/const-traits/tilde-twice.rs +++ b/tests/ui/traits/const-traits/tilde-twice.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z parse-only +//@ compile-flags: -Z parse-crate-root-only #![feature(const_trait_impl)] diff --git a/tests/ui/traits/const-traits/trait-default-body-stability.stderr b/tests/ui/traits/const-traits/trait-default-body-stability.stderr index 5806b6d6fd2..b471cb81c3b 100644 --- a/tests/ui/traits/const-traits/trait-default-body-stability.stderr +++ b/tests/ui/traits/const-traits/trait-default-body-stability.stderr @@ -16,7 +16,7 @@ LL | impl const FromResidual for T { = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` = note: adding a non-const method body in the future would be a breaking change -error[E0015]: `?` cannot determine the branch of `T` in constant functions +error[E0015]: `?` is not allowed on `T` in constant functions --> $DIR/trait-default-body-stability.rs:45:9 | LL | T? @@ -24,7 +24,7 @@ LL | T? | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error[E0015]: `?` cannot convert from residual of `T` in constant functions +error[E0015]: `?` is not allowed on `T` in constant functions --> $DIR/trait-default-body-stability.rs:45:9 | LL | T? diff --git a/tests/ui/traits/const-traits/trait-where-clause-const.stderr b/tests/ui/traits/const-traits/trait-where-clause-const.stderr index d7735ef282f..4100ae1c6bf 100644 --- a/tests/ui/traits/const-traits/trait-where-clause-const.stderr +++ b/tests/ui/traits/const-traits/trait-where-clause-const.stderr @@ -2,13 +2,25 @@ error[E0277]: the trait bound `T: ~const Bar` is not satisfied --> $DIR/trait-where-clause-const.rs:21:5 | LL | T::b(); - | ^^^^^^ + | ^ + | +note: required by a bound in `Foo::b` + --> $DIR/trait-where-clause-const.rs:15:24 + | +LL | fn b() where Self: ~const Bar; + | ^^^^^^ required by this bound in `Foo::b` error[E0277]: the trait bound `T: ~const Bar` is not satisfied - --> $DIR/trait-where-clause-const.rs:23:5 + --> $DIR/trait-where-clause-const.rs:23:12 | LL | T::c::<T>(); - | ^^^^^^^^^^^ + | ^ + | +note: required by a bound in `Foo::c` + --> $DIR/trait-where-clause-const.rs:16:13 + | +LL | fn c<T: ~const Bar>(); + | ^^^^^^ required by this bound in `Foo::c` error: aborting due to 2 previous errors diff --git a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr index d04143fc464..bda6a029cc2 100644 --- a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr +++ b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr @@ -10,19 +10,19 @@ error[E0277]: the trait bound `T: const Trait` is not satisfied --> $DIR/unsatisfied-const-trait-bound.rs:29:37 | LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {} - | ^^^^^^^^^ + | ^ error[E0277]: the trait bound `T: const Trait` is not satisfied --> $DIR/unsatisfied-const-trait-bound.rs:33:50 | LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {} - | ^^^^^^^^^ + | ^ error[E0277]: the trait bound `Ty: const Trait` is not satisfied - --> $DIR/unsatisfied-const-trait-bound.rs:22:5 + --> $DIR/unsatisfied-const-trait-bound.rs:22:15 | LL | require::<Ty>(); - | ^^^^^^^^^^^^^^^ + | ^^ | note: required by a bound in `require` --> $DIR/unsatisfied-const-trait-bound.rs:8:15 diff --git a/tests/ui/traits/cycle-generic-bound.rs b/tests/ui/traits/cycle-generic-bound.rs index dec51ef35bc..0fb0f74a6ea 100644 --- a/tests/ui/traits/cycle-generic-bound.rs +++ b/tests/ui/traits/cycle-generic-bound.rs @@ -1,7 +1,6 @@ //@ check-pass // Regression test for #15477. This test just needs to compile. -//@ pretty-expanded FIXME #23616 trait Chromosome<X: Chromosome<i32>> { } diff --git a/tests/ui/traits/cycle-type-trait.rs b/tests/ui/traits/cycle-type-trait.rs index f1125c9274a..3a6cd2eccc2 100644 --- a/tests/ui/traits/cycle-type-trait.rs +++ b/tests/ui/traits/cycle-type-trait.rs @@ -3,7 +3,6 @@ // Test a case where a supertrait references a type that references // the original trait. This poses no problem at the moment. -//@ pretty-expanded FIXME #23616 trait Chromosome: Get<Struct<i32>> { } diff --git a/tests/ui/traits/default-method/mut.rs b/tests/ui/traits/default-method/mut.rs index fd8b788035f..1130ca0b4be 100644 --- a/tests/ui/traits/default-method/mut.rs +++ b/tests/ui/traits/default-method/mut.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(unused_assignments)] -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr index 03a4017b3d7..38e692521ca 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr @@ -23,29 +23,29 @@ LL | struct Struct {} | ---------------- not a trait error: function not found in this trait - --> $DIR/rustc_must_implement_one_of_misuse.rs:8:34 + --> $DIR/rustc_must_implement_one_of_misuse.rs:3:31 | LL | #[rustc_must_implement_one_of(a, b)] - | ^ - -error: the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args - --> $DIR/rustc_must_implement_one_of_misuse.rs:14:1 - | -LL | #[rustc_must_implement_one_of(a)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^ error: function not found in this trait - --> $DIR/rustc_must_implement_one_of_misuse.rs:3:31 + --> $DIR/rustc_must_implement_one_of_misuse.rs:3:34 | LL | #[rustc_must_implement_one_of(a, b)] - | ^ + | ^ error: function not found in this trait - --> $DIR/rustc_must_implement_one_of_misuse.rs:3:34 + --> $DIR/rustc_must_implement_one_of_misuse.rs:8:34 | LL | #[rustc_must_implement_one_of(a, b)] | ^ +error: the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args + --> $DIR/rustc_must_implement_one_of_misuse.rs:14:1 + | +LL | #[rustc_must_implement_one_of(a)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: not a function --> $DIR/rustc_must_implement_one_of_misuse.rs:26:5 | diff --git a/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs b/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs index a08407683d8..85c70a21f68 100644 --- a/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs +++ b/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs @@ -1,5 +1,6 @@ fn function<T: PartialEq>() { foo == 2; //~ ERROR cannot find value `foo` in this scope [E0425] + //~^ ERROR mismatched types } fn main() {} diff --git a/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.stderr b/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.stderr index 2da731dcc4b..8010c0842ba 100644 --- a/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.stderr +++ b/tests/ui/traits/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.stderr @@ -4,6 +4,18 @@ error[E0425]: cannot find value `foo` in this scope LL | foo == 2; | ^^^ not found in this scope -error: aborting due to 1 previous error +error[E0308]: mismatched types + --> $DIR/dont-match-error-ty-with-calller-supplied-obligation-issue-121941.rs:2:12 + | +LL | fn function<T: PartialEq>() { + | - expected this type parameter +LL | foo == 2; + | ^ expected type parameter `T`, found integer + | + = note: expected type parameter `T` + found type `{integer}` + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0425`. +Some errors have detailed explanations: E0308, E0425. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/traits/early-vtbl-resolution.rs b/tests/ui/traits/early-vtbl-resolution.rs index f2dd2b8a660..bf3cc04cdc2 100644 --- a/tests/ui/traits/early-vtbl-resolution.rs +++ b/tests/ui/traits/early-vtbl-resolution.rs @@ -2,7 +2,6 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 trait thing<A> { fn foo(&self) -> Option<A>; diff --git a/tests/ui/traits/false-ambiguity-where-clause-builtin-bound.rs b/tests/ui/traits/false-ambiguity-where-clause-builtin-bound.rs index b41d719d0ec..ab9d10d14fd 100644 --- a/tests/ui/traits/false-ambiguity-where-clause-builtin-bound.rs +++ b/tests/ui/traits/false-ambiguity-where-clause-builtin-bound.rs @@ -3,7 +3,6 @@ // between the builtin rules for Sized and the where clause. Issue // #20959. -//@ pretty-expanded FIXME #23616 fn foo<K>(x: Option<K>) where Option<K> : Sized diff --git a/tests/ui/traits/impl-2.rs b/tests/ui/traits/impl-2.rs index 6cc702800e3..c6f60a9081c 100644 --- a/tests/ui/traits/impl-2.rs +++ b/tests/ui/traits/impl-2.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_snake_case)] -//@ pretty-expanded FIXME #23616 pub mod Foo { pub trait Trait { diff --git a/tests/ui/traits/impl-implicit-trait.rs b/tests/ui/traits/impl-implicit-trait.rs index 03c1ec8a53b..ff62858dcc2 100644 --- a/tests/ui/traits/impl-implicit-trait.rs +++ b/tests/ui/traits/impl-implicit-trait.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -//@ pretty-expanded FIXME #23616 enum option_<T> { none_, diff --git a/tests/ui/traits/inheritance/num.rs b/tests/ui/traits/inheritance/num.rs index 339ff04ff53..58564147a29 100644 --- a/tests/ui/traits/inheritance/num.rs +++ b/tests/ui/traits/inheritance/num.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 pub trait NumExt: PartialEq + PartialOrd {} diff --git a/tests/ui/traits/inheritance/num0.rs b/tests/ui/traits/inheritance/num0.rs index a2ebc5c62d7..a170388b494 100644 --- a/tests/ui/traits/inheritance/num0.rs +++ b/tests/ui/traits/inheritance/num0.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] // Extending Num and using inherited static methods -//@ pretty-expanded FIXME #23616 pub trait NumCast: Sized { fn from(i: i32) -> Option<Self>; diff --git a/tests/ui/traits/inheritance/num1.rs b/tests/ui/traits/inheritance/num1.rs index 9fa2cde6d22..d02cff70842 100644 --- a/tests/ui/traits/inheritance/num1.rs +++ b/tests/ui/traits/inheritance/num1.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub trait NumCast: Sized { fn from(i: i32) -> Option<Self>; diff --git a/tests/ui/traits/inheritance/num5.rs b/tests/ui/traits/inheritance/num5.rs index b38fb441cff..8ac4c86c392 100644 --- a/tests/ui/traits/inheritance/num5.rs +++ b/tests/ui/traits/inheritance/num5.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub trait NumCast: Sized { fn from(i: i32) -> Option<Self>; diff --git a/tests/ui/traits/issue-22019.rs b/tests/ui/traits/issue-22019.rs index 120f611ccb6..191c345e2d1 100644 --- a/tests/ui/traits/issue-22019.rs +++ b/tests/ui/traits/issue-22019.rs @@ -3,7 +3,6 @@ // distinct scopes to be compared (`'g` and `'h`). The only important // thing is that compilation succeeds here. -//@ pretty-expanded FIXME #23616 #![allow(missing_copy_implementations)] #![allow(unused_variables)] diff --git a/tests/ui/traits/issue-22110.rs b/tests/ui/traits/issue-22110.rs index b0b584bd49d..f16f5328ad3 100644 --- a/tests/ui/traits/issue-22110.rs +++ b/tests/ui/traits/issue-22110.rs @@ -3,7 +3,6 @@ // and the blanket impl. The only important thing is that compilation // succeeds here. Issue #22110. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/traits/issue-22655.rs b/tests/ui/traits/issue-22655.rs index aaf1b05b6e5..dfba8011a1e 100644 --- a/tests/ui/traits/issue-22655.rs +++ b/tests/ui/traits/issue-22655.rs @@ -3,7 +3,6 @@ // Regression test for issue #22655: This test should not lead to // infinite recursion. -//@ pretty-expanded FIXME #23616 unsafe impl<T: Send + ?Sized> Send for Unique<T> { } diff --git a/tests/ui/traits/issue-23003.rs b/tests/ui/traits/issue-23003.rs index cb05a5dfb6b..93c5bfe32ce 100644 --- a/tests/ui/traits/issue-23003.rs +++ b/tests/ui/traits/issue-23003.rs @@ -4,7 +4,6 @@ // Async>::Cancel` be WF. This normalizes to `Receipt<Complete>` // again, leading to an infinite cycle. Issue #23003. -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] #![allow(unused_variables)] diff --git a/tests/ui/traits/issue-32963.rs b/tests/ui/traits/issue-32963.rs index 56a68f3a231..4c4cd91d72e 100644 --- a/tests/ui/traits/issue-32963.rs +++ b/tests/ui/traits/issue-32963.rs @@ -7,5 +7,4 @@ fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() } fn main() { size_of_copy::<dyn Misc + Copy>(); //~^ ERROR only auto traits can be used as additional traits in a trait object - //~| ERROR the trait bound `dyn Misc: Copy` is not satisfied } diff --git a/tests/ui/traits/issue-32963.stderr b/tests/ui/traits/issue-32963.stderr index bad45e54d64..1c70d0aaa0a 100644 --- a/tests/ui/traits/issue-32963.stderr +++ b/tests/ui/traits/issue-32963.stderr @@ -9,19 +9,6 @@ LL | size_of_copy::<dyn Misc + Copy>(); = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Misc + Copy {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> -error[E0277]: the trait bound `dyn Misc: Copy` is not satisfied - --> $DIR/issue-32963.rs:8:20 - | -LL | size_of_copy::<dyn Misc + Copy>(); - | ^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `dyn Misc` - | -note: required by a bound in `size_of_copy` - --> $DIR/issue-32963.rs:5:20 - | -LL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() } - | ^^^^ required by this bound in `size_of_copy` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0225, E0277. -For more information about an error, try `rustc --explain E0225`. +For more information about this error, try `rustc --explain E0225`. diff --git a/tests/ui/traits/issue-78372.rs b/tests/ui/traits/issue-78372.rs index 82b13cc0b62..f03baf2ceca 100644 --- a/tests/ui/traits/issue-78372.rs +++ b/tests/ui/traits/issue-78372.rs @@ -10,5 +10,4 @@ trait X<T> { } trait Marker {} impl Marker for dyn Foo {} -//~^ ERROR cannot be made into an object fn main() {} diff --git a/tests/ui/traits/issue-78372.stderr b/tests/ui/traits/issue-78372.stderr index 4cc2c59fd8d..86234d15a5d 100644 --- a/tests/ui/traits/issue-78372.stderr +++ b/tests/ui/traits/issue-78372.stderr @@ -55,24 +55,6 @@ LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} = help: add `#![feature(dispatch_from_dyn)]` 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[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/issue-78372.rs:12:17 - | -LL | fn foo(self: Smaht<Self, T>); - | -------------- help: consider changing method `foo`'s `self` parameter to be `&self`: `&Self` -... -LL | impl Marker for dyn Foo {} - | ^^^^^^^ `Foo` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/issue-78372.rs:9:18 - | -LL | trait Foo: X<u32> {} - | --- this trait cannot be made into an object... -LL | trait X<T> { -LL | fn foo(self: Smaht<Self, T>); - | ^^^^^^^^^^^^^^ ...because method `foo`'s `self` parameter cannot be dispatched on - error[E0307]: invalid `self` parameter type: `Smaht<Self, T>` --> $DIR/issue-78372.rs:9:18 | @@ -88,7 +70,7 @@ error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors -Some errors have detailed explanations: E0038, E0307, E0378, E0412, E0658. -For more information about an error, try `rustc --explain E0038`. +Some errors have detailed explanations: E0307, E0378, E0412, E0658. +For more information about an error, try `rustc --explain E0307`. diff --git a/tests/ui/traits/monomorphized-callees-with-ty-params-3314.rs b/tests/ui/traits/monomorphized-callees-with-ty-params-3314.rs index 35d6dddfa30..9d33ec8c172 100644 --- a/tests/ui/traits/monomorphized-callees-with-ty-params-3314.rs +++ b/tests/ui/traits/monomorphized-callees-with-ty-params-3314.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 trait Serializer { } diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs index 1260cca5106..cbd591eec96 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs @@ -14,13 +14,7 @@ fn main() { fn weird0() -> impl Sized + !Sized {} //~^ ERROR the trait bound `(): !Sized` is not satisfied -//~| ERROR the trait bound `(): !Sized` is not satisfied -//~| ERROR the trait bound `(): !Sized` is not satisfied fn weird1() -> impl !Sized + Sized {} //~^ ERROR the trait bound `(): !Sized` is not satisfied -//~| ERROR the trait bound `(): !Sized` is not satisfied -//~| ERROR the trait bound `(): !Sized` is not satisfied fn weird2() -> impl !Sized {} //~^ ERROR the trait bound `(): !Sized` is not satisfied -//~| ERROR the trait bound `(): !Sized` is not satisfied -//~| ERROR the trait bound `(): !Sized` is not satisfied diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr index 4ec578a3b7b..3dad6d534fd 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr @@ -5,53 +5,17 @@ LL | fn weird0() -> impl Sized + !Sized {} | ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:15:36 - | -LL | fn weird0() -> impl Sized + !Sized {} - | ^^ the trait bound `(): !Sized` is not satisfied - -error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:15:1 - | -LL | fn weird0() -> impl Sized + !Sized {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied - -error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:19:16 + --> $DIR/opaque-type-unsatisfied-bound.rs:17:16 | LL | fn weird1() -> impl !Sized + Sized {} | ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:19:36 - | -LL | fn weird1() -> impl !Sized + Sized {} - | ^^ the trait bound `(): !Sized` is not satisfied - -error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:19:1 - | -LL | fn weird1() -> impl !Sized + Sized {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied - -error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:23:16 + --> $DIR/opaque-type-unsatisfied-bound.rs:19:16 | LL | fn weird2() -> impl !Sized {} | ^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied -error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:23:28 - | -LL | fn weird2() -> impl !Sized {} - | ^^ the trait bound `(): !Sized` is not satisfied - -error[E0277]: the trait bound `(): !Sized` is not satisfied - --> $DIR/opaque-type-unsatisfied-bound.rs:23:1 - | -LL | fn weird2() -> impl !Sized {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied - error[E0277]: the trait bound `impl !Trait: Trait` is not satisfied --> $DIR/opaque-type-unsatisfied-bound.rs:12:13 | @@ -66,6 +30,6 @@ note: required by a bound in `consume` LL | fn consume(_: impl Trait) {} | ^^^^^ required by this bound in `consume` -error: aborting due to 10 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs index c6826578658..39422914afc 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs @@ -4,7 +4,5 @@ fn produce() -> impl !Fn<(u32,)> {} //~^ ERROR the trait bound `(): !Fn(u32)` is not satisfied -//~| ERROR the trait bound `(): !Fn(u32)` is not satisfied -//~| ERROR the trait bound `(): !Fn(u32)` is not satisfied fn main() {} diff --git a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr index f81f0a23ac3..760e5aa62f2 100644 --- a/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr +++ b/tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr @@ -4,18 +4,6 @@ error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied LL | fn produce() -> impl !Fn<(u32,)> {} | ^^^^^^^^^^^^^^^^ the trait bound `(): !Fn(u32)` is not satisfied -error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied - --> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:34 - | -LL | fn produce() -> impl !Fn<(u32,)> {} - | ^^ the trait bound `(): !Fn(u32)` is not satisfied - -error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied - --> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:1 - | -LL | fn produce() -> impl !Fn<(u32,)> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Fn(u32)` is not satisfied - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/next-solver/alias-bound-unsound.rs b/tests/ui/traits/next-solver/alias-bound-unsound.rs index 272e5db3b7a..0236826c3ed 100644 --- a/tests/ui/traits/next-solver/alias-bound-unsound.rs +++ b/tests/ui/traits/next-solver/alias-bound-unsound.rs @@ -28,5 +28,6 @@ fn main() { //~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _` //~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _` //~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _` + //~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _` println!("{x}"); } diff --git a/tests/ui/traits/next-solver/alias-bound-unsound.stderr b/tests/ui/traits/next-solver/alias-bound-unsound.stderr index e5cf5b6bc3d..7e3737d120b 100644 --- a/tests/ui/traits/next-solver/alias-bound-unsound.stderr +++ b/tests/ui/traits/next-solver/alias-bound-unsound.stderr @@ -24,6 +24,14 @@ error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _` LL | drop(<() as Foo>::copy_me(&x)); | ^^^^^^^^^^^^^^^^^^^^^^^^ +error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _` + --> $DIR/alias-bound-unsound.rs:24:10 + | +LL | drop(<() as Foo>::copy_me(&x)); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0275]: overflow evaluating the requirement `&<() as Foo>::Item well-formed` --> $DIR/alias-bound-unsound.rs:24:31 | @@ -50,6 +58,6 @@ error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _` LL | drop(<() as Foo>::copy_me(&x)); | ^^ -error: aborting due to 7 previous errors +error: aborting due to 8 previous errors For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/traits/next-solver/destruct.rs b/tests/ui/traits/next-solver/destruct.rs index f595cb30db8..fd14132124c 100644 --- a/tests/ui/traits/next-solver/destruct.rs +++ b/tests/ui/traits/next-solver/destruct.rs @@ -1,7 +1,7 @@ //@ compile-flags: -Znext-solver //@ check-pass -#![feature(const_trait_impl)] +#![feature(const_trait_impl, const_destruct)] fn foo(_: impl std::marker::Destruct) {} diff --git a/tests/ui/traits/next-solver/issue-118950-root-region.rs b/tests/ui/traits/next-solver/issue-118950-root-region.rs index e1bd234a275..8fe53d6773b 100644 --- a/tests/ui/traits/next-solver/issue-118950-root-region.rs +++ b/tests/ui/traits/next-solver/issue-118950-root-region.rs @@ -18,6 +18,6 @@ impl<T> Overlap<T> for T {} impl<T> Overlap<for<'a> fn(Assoc<'a, T>)> for T where Missing: Overlap<T> {} //~^ ERROR cannot find type `Missing` in this scope -//~| ERROR the trait bound `for<'a> *const T: ToUnit<'a>` is not satisfied +//~| ERROR the trait bound `T: Overlap<for<'a> fn(Assoc<'a, T>)>` is not satisfied fn main() {} diff --git a/tests/ui/traits/next-solver/issue-118950-root-region.stderr b/tests/ui/traits/next-solver/issue-118950-root-region.stderr index f6545c6ebf9..09162970d33 100644 --- a/tests/ui/traits/next-solver/issue-118950-root-region.stderr +++ b/tests/ui/traits/next-solver/issue-118950-root-region.stderr @@ -26,17 +26,16 @@ LL | trait ToUnit<'a> { | ^^^^^^^^^^^^^^^^ WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc), .. } -error[E0277]: the trait bound `for<'a> *const T: ToUnit<'a>` is not satisfied - --> $DIR/issue-118950-root-region.rs:19:17 +error[E0277]: the trait bound `T: Overlap<for<'a> fn(Assoc<'a, T>)>` is not satisfied + --> $DIR/issue-118950-root-region.rs:19:47 | LL | impl<T> Overlap<for<'a> fn(Assoc<'a, T>)> for T where Missing: Overlap<T> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `*const T` + | ^ the trait `Overlap<for<'a> fn(Assoc<'a, T>)>` is not implemented for `T` | -help: this trait has no implementations, consider adding one - --> $DIR/issue-118950-root-region.rs:8:1 +help: consider further restricting type parameter `T` | -LL | trait ToUnit<'a> { - | ^^^^^^^^^^^^^^^^ +LL | impl<T> Overlap<for<'a> fn(Assoc<'a, T>)> for T where Missing: Overlap<T>, T: Overlap<for<'a> fn(Assoc<'a, T>)> {} + | ++++++++++++++++++++++++++++++++++++++ error: aborting due to 3 previous errors; 1 warning emitted diff --git a/tests/ui/traits/next-solver/non-wf-ret.rs b/tests/ui/traits/next-solver/non-wf-ret.rs new file mode 100644 index 00000000000..c54d61c895d --- /dev/null +++ b/tests/ui/traits/next-solver/non-wf-ret.rs @@ -0,0 +1,47 @@ +//@ check-pass +//@ compile-flags: -Znext-solver + +use std::ops::Deref; + +pub struct List<T> { + skel: [T], +} + +impl<'a, T: Copy> IntoIterator for &'a List<T> { + type Item = T; + type IntoIter = std::iter::Copied<<&'a [T] as IntoIterator>::IntoIter>; + + fn into_iter(self) -> Self::IntoIter { + todo!() + } +} + +impl<T> Deref for List<T> { + type Target = [T]; + + fn deref(&self) -> &[T] { + todo!() + } +} + +impl<T> List<T> { + fn iter(&self) -> <&Self as IntoIterator>::IntoIter + where + T: Copy, + { + todo!() + } +} + +fn test<Q>(t: &List<Q>) { + // Checking that `<&List<Q> as IntoIterator>::IntoIter` is WF + // will disqualify the inherent method, since normalizing it + // requires `Q: Copy` which does not hold. and allow us to fall + // through to the deref'd `<[Q]>::iter` method which works. + // + // In the old solver, the same behavior is achieved by just + // eagerly normalizing the return type. + t.iter(); +} + +fn main() {} diff --git a/tests/ui/traits/next-solver/normalization-shadowing/alias-bound-shadowed-by-env.rs b/tests/ui/traits/next-solver/normalization-shadowing/alias-bound-shadowed-by-env.rs new file mode 100644 index 00000000000..c0b169abcd5 --- /dev/null +++ b/tests/ui/traits/next-solver/normalization-shadowing/alias-bound-shadowed-by-env.rs @@ -0,0 +1,19 @@ +//@ compile-flags: -Znext-solver +//@ check-pass + +trait Super { + type Assoc; +} +trait Bound { + type Assoc: Super<Assoc = u32>; +} +trait Trait: Super {} + +// Elaborating the environment results in a `T::Assoc: Super` where-bound. +// This where-bound must not prevent normalization via the `Super<Assoc = u32>` +// item bound. +fn heck<T: Bound<Assoc: Trait>>(x: <T::Assoc as Super>::Assoc) -> u32 { + x +} + +fn main() {} diff --git a/tests/ui/traits/next-solver/env-shadows-impls/ambig-env-no-shadow.rs b/tests/ui/traits/next-solver/normalization-shadowing/ambig-env-no-shadow.rs index 362f911c144..362f911c144 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/ambig-env-no-shadow.rs +++ b/tests/ui/traits/next-solver/normalization-shadowing/ambig-env-no-shadow.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-1.rs b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-1.rs index ce2d6304875..ce2d6304875 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-1.rs +++ b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-1.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-2.rs b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-2.rs index 20329f467db..20329f467db 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-2.rs +++ b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-2.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-3.rs b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-3.rs index da6f2908ab1..da6f2908ab1 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-3.rs +++ b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-3.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.rs b/tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.rs index e66d1c485f8..e66d1c485f8 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.rs +++ b/tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.stderr b/tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.stderr index 36d281e11dd..36d281e11dd 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.stderr +++ b/tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.stderr diff --git a/tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.rs b/tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.rs index d11150ca55a..d11150ca55a 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.rs +++ b/tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.stderr b/tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.stderr index 0c72fc25dca..0c72fc25dca 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.stderr +++ b/tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.stderr diff --git a/tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs b/tests/ui/traits/next-solver/normalization-shadowing/param-env-impl-conflict.rs index 1b9e9866cd6..1b9e9866cd6 100644 --- a/tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs +++ b/tests/ui/traits/next-solver/normalization-shadowing/param-env-impl-conflict.rs diff --git a/tests/ui/traits/next-solver/normalize-in-implied_outlives_bounds.rs b/tests/ui/traits/next-solver/normalize-in-implied_outlives_bounds.rs new file mode 100644 index 00000000000..1dca19d28e9 --- /dev/null +++ b/tests/ui/traits/next-solver/normalize-in-implied_outlives_bounds.rs @@ -0,0 +1,46 @@ +//@ check-pass +//@ compile-flags: -Znext-solver + +// Minimized example from `rustc_type_ir` that demonstrates a missing deep normalization +// in the new solver when computing the implies outlives bounds of an impl. + +use std::marker::PhantomData; +use std::ops::Deref; + +pub struct SearchGraph<D: Delegate, X = <D as Delegate>::Cx> { + d: PhantomData<D>, + x: PhantomData<X>, +} + +pub trait Delegate { + type Cx; +} + +struct SearchGraphDelegate<D: SolverDelegate> { + _marker: PhantomData<D>, +} + +impl<D> Delegate for SearchGraphDelegate<D> +where + D: SolverDelegate, +{ + type Cx = D::Interner; +} + +pub trait SolverDelegate { + type Interner; +} + +struct EvalCtxt<'a, D, I> +where + D: SolverDelegate<Interner = I>, +{ + search_graph: &'a SearchGraph<SearchGraphDelegate<D>>, +} + +impl<'a, D, I> EvalCtxt<'a, D, <D as SolverDelegate>::Interner> +where + D: SolverDelegate<Interner = I> +{} + +fn main() {} diff --git a/tests/ui/traits/next-solver/dont-remap-tait-substs.rs b/tests/ui/traits/next-solver/opaques/dont-remap-tait-substs.rs index 904bc179495..904bc179495 100644 --- a/tests/ui/traits/next-solver/dont-remap-tait-substs.rs +++ b/tests/ui/traits/next-solver/opaques/dont-remap-tait-substs.rs diff --git a/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.is_send.stderr b/tests/ui/traits/next-solver/opaques/dont-type_of-tait-in-defining-scope.is_send.stderr index 158fefd1538..158fefd1538 100644 --- a/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.is_send.stderr +++ b/tests/ui/traits/next-solver/opaques/dont-type_of-tait-in-defining-scope.is_send.stderr diff --git a/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.not_send.stderr b/tests/ui/traits/next-solver/opaques/dont-type_of-tait-in-defining-scope.not_send.stderr index 158fefd1538..158fefd1538 100644 --- a/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.not_send.stderr +++ b/tests/ui/traits/next-solver/opaques/dont-type_of-tait-in-defining-scope.not_send.stderr diff --git a/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs b/tests/ui/traits/next-solver/opaques/dont-type_of-tait-in-defining-scope.rs index 10b746cc989..10b746cc989 100644 --- a/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs +++ b/tests/ui/traits/next-solver/opaques/dont-type_of-tait-in-defining-scope.rs diff --git a/tests/ui/traits/next-solver/opaques/no-define-in-wf-check.current.stderr b/tests/ui/traits/next-solver/opaques/no-define-in-wf-check.current.stderr new file mode 100644 index 00000000000..9a28dc093c1 --- /dev/null +++ b/tests/ui/traits/next-solver/opaques/no-define-in-wf-check.current.stderr @@ -0,0 +1,34 @@ +error: unconstrained opaque type + --> $DIR/no-define-in-wf-check.rs:19:18 + | +LL | type Tait1 = impl Sized; + | ^^^^^^^^^^ + | + = note: `Tait1` must be used in combination with a concrete type within the same module + +error: unconstrained opaque type + --> $DIR/no-define-in-wf-check.rs:27:18 + | +LL | type Tait1 = impl Sized; + | ^^^^^^^^^^ + | + = note: `Tait1` must be used in combination with a concrete type within the same module + +error: unconstrained opaque type + --> $DIR/no-define-in-wf-check.rs:36:18 + | +LL | type Tait1 = impl Sized; + | ^^^^^^^^^^ + | + = note: `Tait1` must be used in combination with a concrete type within the same module + +error: unconstrained opaque type + --> $DIR/no-define-in-wf-check.rs:47:18 + | +LL | type Tait1 = impl Sized; + | ^^^^^^^^^^ + | + = note: `Tait1` must be used in combination with a concrete type within the same module + +error: aborting due to 4 previous errors + diff --git a/tests/ui/traits/next-solver/opaques/no-define-in-wf-check.rs b/tests/ui/traits/next-solver/opaques/no-define-in-wf-check.rs new file mode 100644 index 00000000000..dd6df097da1 --- /dev/null +++ b/tests/ui/traits/next-solver/opaques/no-define-in-wf-check.rs @@ -0,0 +1,66 @@ +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] check-pass + +// Regression test for trait-system-refactor-initiative#106. We previously +// tried to define other opaques while checking that opaques are well-formed. +// +// This resulted in undesirable ambiguity + +#![feature(type_alias_impl_trait)] + +mod ex0 { + fn foo() -> (impl Sized, impl Sized) { + ((), ()) + } +} +mod ex1 { + type Tait1 = impl Sized; + //[current]~^ ERROR unconstrained opaque type + fn foo(x: Tait1) -> impl Sized { + let () = x; + } +} + +mod ex2 { + type Tait1 = impl Sized; + //[current]~^ ERROR unconstrained opaque type + type Tait2 = impl Sized; + fn foo(x: Tait1) -> Tait2 { + let () = x; + } +} + +mod ex3 { + type Tait1 = impl Sized; + //[current]~^ ERROR unconstrained opaque type + trait Something<T> {} + impl<T, U> Something<U> for T {} + type Tait2 = impl Something<Tait1>; + fn foo(x: Tait1) -> Tait2 { + let () = x; + } +} + +mod ex4 { + type Tait1 = impl Sized; + //[current]~^ ERROR unconstrained opaque type + trait Trait<U> { + type Assoc; + } + + impl<T, U> Trait<U> for T { + type Assoc = T; + } + + // ambiguity when checking that `Tait2` is wf + // + // ambiguity proving `(): Trait<Tait1>`. + type Tait2 = impl Trait<(), Assoc = impl Trait<Tait1>>; + fn foo(x: Tait1) -> Tait2 { + let () = x; + } +} + +fn main() {} diff --git a/tests/ui/traits/next-solver/select-alias-bound-as-param.rs b/tests/ui/traits/next-solver/opaques/select-alias-bound-as-param.rs index fd40ef1f872..fd40ef1f872 100644 --- a/tests/ui/traits/next-solver/select-alias-bound-as-param.rs +++ b/tests/ui/traits/next-solver/opaques/select-alias-bound-as-param.rs diff --git a/tests/ui/traits/next-solver/structurally-normalize-in-borrowck-field-projection.rs b/tests/ui/traits/next-solver/structurally-normalize-in-borrowck-field-projection.rs new file mode 100644 index 00000000000..d2d68128fde --- /dev/null +++ b/tests/ui/traits/next-solver/structurally-normalize-in-borrowck-field-projection.rs @@ -0,0 +1,32 @@ +//@ check-pass +//@ compile-flags: -Znext-solver + +trait Interner: Sized { + type Value; +} + +enum Kind<I: Interner> { + Value(I::Value), +} + +struct Intern; + +impl Interner for Intern { + type Value = Wrap<u32>; +} + +struct Wrap<T>(T); + +type KindAlias = Kind<Intern>; + +trait PrettyPrinter: Sized { + fn hello(c: KindAlias) { + match c { + KindAlias::Value(Wrap(v)) => { + println!("{v:?}"); + } + } + } +} + +fn main() {} diff --git a/tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs b/tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs new file mode 100644 index 00000000000..d47f705a8ab --- /dev/null +++ b/tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs @@ -0,0 +1,20 @@ +//@ check-pass +//@ compile-flags: -Znext-solver + +trait Mirror { + type Assoc; +} +impl<T> Mirror for T { + type Assoc = T; +} + +struct Place { + field: <&'static [u8] as Mirror>::Assoc, +} + +fn main() { + let local = Place { field: &[] }; + let z = || { + let y = &local.field[0]; + }; +} diff --git a/tests/ui/traits/next-solver/typeck/resolve-before-checking-never.rs b/tests/ui/traits/next-solver/typeck/resolve-before-checking-never.rs new file mode 100644 index 00000000000..6df1fd5d4ba --- /dev/null +++ b/tests/ui/traits/next-solver/typeck/resolve-before-checking-never.rs @@ -0,0 +1,20 @@ +//@ check-pass +//@ compile-flags: -Znext-solver + +#![feature(never_type)] + +trait Mirror { + type Assoc; +} +impl<T> Mirror for T { + type Assoc = T; +} + +fn diverge() -> <! as Mirror>::Assoc { todo!() } + +fn main() { + let close = || { + diverge(); + }; + let x: u32 = close(); +} diff --git a/tests/ui/traits/next-solver/typeck/structurally-resolve-in-probe_adt.rs b/tests/ui/traits/next-solver/typeck/structurally-resolve-in-probe_adt.rs new file mode 100644 index 00000000000..23915808279 --- /dev/null +++ b/tests/ui/traits/next-solver/typeck/structurally-resolve-in-probe_adt.rs @@ -0,0 +1,15 @@ +//@ check-pass +//@ compile-flags: -Znext-solver + +trait Mirror { + type Assoc; +} +impl<T> Mirror for T { + type Assoc = T; +} + +type Foo<T> = <Option<T> as Mirror>::Assoc; + +fn main() { + let x = Foo::<i32>::None; +} diff --git a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs index 3af299e5b11..4aadd45c49c 100644 --- a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs +++ b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs @@ -10,6 +10,7 @@ fn w<'a, T: 'a, F: Fn(&'a T)>() { let b: &dyn FromResidual = &(); //~^ ERROR: the trait `FromResidual` cannot be made into an object //~| ERROR: the trait `FromResidual` cannot be made into an object + //~| ERROR: the trait `FromResidual` cannot be made into an object } fn main() {} diff --git a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr index 960802e2f8f..c67a8c05379 100644 --- a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr +++ b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr @@ -7,6 +7,29 @@ LL | let b: &dyn FromResidual = &(); = note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause error[E0038]: the trait `FromResidual` cannot be made into an object + --> $DIR/canonicalize-fresh-infer-vars-issue-103626.rs:10:32 + | +LL | let b: &dyn FromResidual = &(); + | ^^^ `FromResidual` cannot be made into an object + | +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> + --> $DIR/canonicalize-fresh-infer-vars-issue-103626.rs:2:8 + | +LL | trait FromResidual<R = <Self as Try>::Residual> { + | ------------ this trait cannot be made into an object... +LL | fn from_residual(residual: R) -> Self; + | ^^^^^^^^^^^^^ ...because associated function `from_residual` has no `self` parameter + = note: required for the cast from `&()` to `&dyn FromResidual<{type error}>` +help: consider turning `from_residual` into a method by giving it a `&self` argument + | +LL | fn from_residual(&self, residual: R) -> Self; + | ++++++ +help: alternatively, consider constraining `from_residual` so it does not apply to trait objects + | +LL | fn from_residual(residual: R) -> Self where Self: Sized; + | +++++++++++++++++ + +error[E0038]: the trait `FromResidual` cannot be made into an object --> $DIR/canonicalize-fresh-infer-vars-issue-103626.rs:10:12 | LL | let b: &dyn FromResidual = &(); @@ -28,6 +51,6 @@ help: alternatively, consider constraining `from_residual` so it does not apply LL | fn from_residual(residual: R) -> Self where Self: Sized; | +++++++++++++++++ -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/traits/parameterized-with-bounds.rs b/tests/ui/traits/parameterized-with-bounds.rs index 2de9bf3d04c..54e2d6e096d 100644 --- a/tests/ui/traits/parameterized-with-bounds.rs +++ b/tests/ui/traits/parameterized-with-bounds.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/tests/ui/traits/resolve-impl-before-constrain-check.rs b/tests/ui/traits/resolve-impl-before-constrain-check.rs new file mode 100644 index 00000000000..87f9c241e40 --- /dev/null +++ b/tests/ui/traits/resolve-impl-before-constrain-check.rs @@ -0,0 +1,20 @@ +// Need a different module so we try to build the mir for `test` +// before analyzing `mod foo`. + +mod foo { + pub trait Callable { + fn call(); + } + + impl<V: ?Sized> Callable for () { + //~^ ERROR the type parameter `V` is not constrained by the impl trait, self type, or predicates + fn call() {} + } +} +use foo::*; + +fn test() -> impl Sized { + <() as Callable>::call() +} + +fn main() {} diff --git a/tests/ui/traits/resolve-impl-before-constrain-check.stderr b/tests/ui/traits/resolve-impl-before-constrain-check.stderr new file mode 100644 index 00000000000..e8e569ba625 --- /dev/null +++ b/tests/ui/traits/resolve-impl-before-constrain-check.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `V` is not constrained by the impl trait, self type, or predicates + --> $DIR/resolve-impl-before-constrain-check.rs:9:10 + | +LL | impl<V: ?Sized> Callable for () { + | ^ unconstrained type parameter + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/tests/ui/traits/solver-cycles/100347-recursive-enum-cow-slice.rs b/tests/ui/traits/solver-cycles/100347-recursive-enum-cow-slice.rs new file mode 100644 index 00000000000..26ae42b3e08 --- /dev/null +++ b/tests/ui/traits/solver-cycles/100347-recursive-enum-cow-slice.rs @@ -0,0 +1,11 @@ +//@ check-pass + +use std::borrow::Cow; + +#[derive(Clone)] +enum Test<'a> { + Int(u8), + Array(Cow<'a, [Test<'a>]>), +} + +fn main() {} diff --git a/tests/ui/traits/solver-cycles/107481-self-referential-struct-cow-as-last-field.rs b/tests/ui/traits/solver-cycles/107481-self-referential-struct-cow-as-last-field.rs new file mode 100644 index 00000000000..f953eb1c0f7 --- /dev/null +++ b/tests/ui/traits/solver-cycles/107481-self-referential-struct-cow-as-last-field.rs @@ -0,0 +1,19 @@ +// Regression test for #107481 + +//@ check-pass + +use std::{borrow::Cow, collections::HashMap}; + +#[derive(Clone)] +struct Foo<'a>(Cow<'a, [Self]>); + +#[derive(Clone)] +struct Bar<'a>(Cow<'a, HashMap<String, Self>>); + +#[derive(Clone)] +struct Baz<'a>(Cow<'a, Vec<Self>>); + +#[derive(Clone)] +struct Qux<'a>(Cow<'a, Box<Self>>); + +fn main() {} diff --git a/tests/ui/traits/solver-cycles/129541-recursive-enum-and-array-impl.rs b/tests/ui/traits/solver-cycles/129541-recursive-enum-and-array-impl.rs new file mode 100644 index 00000000000..197207dfb4b --- /dev/null +++ b/tests/ui/traits/solver-cycles/129541-recursive-enum-and-array-impl.rs @@ -0,0 +1,22 @@ +// Regression test for #129541 +//~^ ERROR cycle detected when computing layout of `<[Hello] as Normalize>::Assoc` [E0391] + +trait Bound {} +trait Normalize { + type Assoc; +} + +impl<T: Bound> Normalize for T { + type Assoc = T; +} + +impl<T: Bound> Normalize for [T] { + type Assoc = T; +} + +impl Bound for Hello {} +enum Hello { + Variant(<[Hello] as Normalize>::Assoc), +} + +fn main() {} diff --git a/tests/ui/traits/solver-cycles/129541-recursive-enum-and-array-impl.stderr b/tests/ui/traits/solver-cycles/129541-recursive-enum-and-array-impl.stderr new file mode 100644 index 00000000000..50dcea0bfac --- /dev/null +++ b/tests/ui/traits/solver-cycles/129541-recursive-enum-and-array-impl.stderr @@ -0,0 +1,10 @@ +error[E0391]: cycle detected when computing layout of `<[Hello] as Normalize>::Assoc` + | + = note: ...which requires computing layout of `Hello`... + = note: ...which again requires computing layout of `<[Hello] as Normalize>::Assoc`, completing the cycle + = note: cycle used when computing layout of `Hello` + = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/tests/ui/traits/solver-cycles/129541-recursive-struct-and-array-impl.rs b/tests/ui/traits/solver-cycles/129541-recursive-struct-and-array-impl.rs new file mode 100644 index 00000000000..defb39aae06 --- /dev/null +++ b/tests/ui/traits/solver-cycles/129541-recursive-struct-and-array-impl.rs @@ -0,0 +1,23 @@ +// Regression test for #129541 + +//@ check-pass + +trait Bound {} +trait Normalize { + type Assoc; +} + +impl<T: Bound> Normalize for T { + type Assoc = T; +} + +impl<T: Bound> Normalize for [T] { + type Assoc = T; +} + +impl Bound for Hello {} +struct Hello { + a: <[Hello] as Normalize>::Assoc, +} + +fn main() {} diff --git a/tests/ui/traits/solver-cycles/129541-recursive-struct.rs b/tests/ui/traits/solver-cycles/129541-recursive-struct.rs new file mode 100644 index 00000000000..d4339dd54d6 --- /dev/null +++ b/tests/ui/traits/solver-cycles/129541-recursive-struct.rs @@ -0,0 +1,19 @@ +// Regression test for #129541 + +//@ check-pass + +trait Bound {} +trait Normalize { + type Assoc; +} + +impl<T: Bound> Normalize for [T] { + type Assoc = T; +} + +impl Bound for Hello {} +struct Hello { + a: <[Hello] as Normalize>::Assoc, +} + +fn main() {} diff --git a/tests/ui/traits/span-bug-issue-121414.rs b/tests/ui/traits/span-bug-issue-121414.rs index ec38d8c2de6..2f4ad34f0c8 100644 --- a/tests/ui/traits/span-bug-issue-121414.rs +++ b/tests/ui/traits/span-bug-issue-121414.rs @@ -6,8 +6,7 @@ impl<'a> Bar for Foo<'f> { //~ ERROR undeclared lifetime type Type = u32; } -fn test() //~ ERROR the trait bound `for<'a> Foo<'a>: Bar` is not satisfied - //~| ERROR the trait bound `for<'a> Foo<'a>: Bar` is not satisfied +fn test() where for<'a> <Foo<'a> as Bar>::Type: Sized, { diff --git a/tests/ui/traits/span-bug-issue-121414.stderr b/tests/ui/traits/span-bug-issue-121414.stderr index e2ef6672cd5..744806a3415 100644 --- a/tests/ui/traits/span-bug-issue-121414.stderr +++ b/tests/ui/traits/span-bug-issue-121414.stderr @@ -6,22 +6,6 @@ LL | impl<'a> Bar for Foo<'f> { | | | help: consider introducing lifetime `'f` here: `'f,` -error[E0277]: the trait bound `for<'a> Foo<'a>: Bar` is not satisfied - --> $DIR/span-bug-issue-121414.rs:9:1 - | -LL | / fn test() -LL | | -LL | | where -LL | | for<'a> <Foo<'a> as Bar>::Type: Sized, - | |__________________________________________^ the trait `for<'a> Bar` is not implemented for `Foo<'a>` - -error[E0277]: the trait bound `for<'a> Foo<'a>: Bar` is not satisfied - --> $DIR/span-bug-issue-121414.rs:9:4 - | -LL | fn test() - | ^^^^ the trait `for<'a> Bar` is not implemented for `Foo<'a>` - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0261, E0277. -For more information about an error, try `rustc --explain E0261`. +For more information about this error, try `rustc --explain E0261`. diff --git a/tests/ui/traits/syntax-polarity.rs b/tests/ui/traits/syntax-polarity.rs index 80ad40bad80..c6506e916ed 100644 --- a/tests/ui/traits/syntax-polarity.rs +++ b/tests/ui/traits/syntax-polarity.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 #![feature(negative_impls)] diff --git a/tests/ui/traits/use-before-def.rs b/tests/ui/traits/use-before-def.rs index fb7e540db18..2c7c6b19d67 100644 --- a/tests/ui/traits/use-before-def.rs +++ b/tests/ui/traits/use-before-def.rs @@ -3,7 +3,6 @@ // Issue #1761 -//@ pretty-expanded FIXME #23616 impl foo for isize { fn foo(&self) -> isize { 10 } } trait foo { fn foo(&self) -> isize; } diff --git a/tests/ui/traits/where-clause-vs-impl.rs b/tests/ui/traits/where-clause-vs-impl.rs index 074c27036c2..639347b3bc3 100644 --- a/tests/ui/traits/where-clause-vs-impl.rs +++ b/tests/ui/traits/where-clause-vs-impl.rs @@ -6,7 +6,6 @@ // // Issue #18453. -//@ pretty-expanded FIXME #23616 use std::rc::Rc; diff --git a/tests/ui/transmutability/uninhabited.rs b/tests/ui/transmutability/uninhabited.rs index 74f7a1a2e89..274104ffb39 100644 --- a/tests/ui/transmutability/uninhabited.rs +++ b/tests/ui/transmutability/uninhabited.rs @@ -91,3 +91,19 @@ fn distant_void() { assert::is_maybe_transmutable::<DistantVoid, &'static Void>(); assert::is_maybe_transmutable::<u128, DistantVoid>(); //~ ERROR: cannot be safely transmuted } + +fn issue_126267() { + pub enum ApiError {} + pub struct TokioError { + b: bool, + } + pub enum Error { + Api { source: ApiError }, // this variant is uninhabited + Ethereum, + Tokio { source: TokioError }, + } + + struct Src; + type Dst = Error; + assert::is_maybe_transmutable::<Src, Dst>(); //~ERROR: cannot be safely transmuted +} diff --git a/tests/ui/transmutability/uninhabited.stderr b/tests/ui/transmutability/uninhabited.stderr index 3fa02f0867c..f112d2fbe44 100644 --- a/tests/ui/transmutability/uninhabited.stderr +++ b/tests/ui/transmutability/uninhabited.stderr @@ -110,7 +110,29 @@ LL | | } LL | | }> | |__________^ required by this bound in `is_maybe_transmutable` -error: aborting due to 7 previous errors +error[E0277]: `Src` cannot be safely transmuted into `issue_126267::Error` + --> $DIR/uninhabited.rs:108:42 + | +LL | assert::is_maybe_transmutable::<Src, Dst>(); + | ^^^ the size of `Src` is smaller than the size of `issue_126267::Error` + | +note: required by a bound in `is_maybe_transmutable` + --> $DIR/uninhabited.rs:10:14 + | +LL | pub fn is_maybe_transmutable<Src, Dst>() + | --------------------- required by a bound in this function +LL | where +LL | Dst: TransmuteFrom<Src, { + | ______________^ +LL | | Assume { +LL | | alignment: true, +LL | | lifetimes: true, +... | +LL | | } +LL | | }> + | |__________^ required by this bound in `is_maybe_transmutable` + +error: aborting due to 8 previous errors Some errors have detailed explanations: E0080, E0277. For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/transmute-non-immediate-to-immediate.rs b/tests/ui/transmute-non-immediate-to-immediate.rs index f5ddf0cfa33..d99bbcc600f 100644 --- a/tests/ui/transmute-non-immediate-to-immediate.rs +++ b/tests/ui/transmute-non-immediate-to-immediate.rs @@ -2,7 +2,6 @@ // Issue #7988 // Transmuting non-immediate type to immediate type -//@ pretty-expanded FIXME #23616 pub fn main() { unsafe { diff --git a/tests/ui/type-alias-impl-trait/bad-tait-no-substs.rs b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.rs new file mode 100644 index 00000000000..18cfb1c1f93 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.rs @@ -0,0 +1,21 @@ +// regression test for #127353 + +#![feature(type_alias_impl_trait)] +trait Trait<T> {} +type Alias<'a, U> = impl Trait<U>; +//~^ ERROR unconstrained opaque type + +pub enum UninhabitedVariants { + Tuple(Alias), + //~^ ERROR missing lifetime specifier + //~| ERROR missing generics + //~| ERROR non-defining opaque type use in defining scope +} + +fn uwu(x: UninhabitedVariants) { + //~^ ERROR item does not constrain + match x {} + //~^ ERROR non-exhaustive patterns +} + +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr new file mode 100644 index 00000000000..cf366c55ea8 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr @@ -0,0 +1,86 @@ +error[E0106]: missing lifetime specifier + --> $DIR/bad-tait-no-substs.rs:9:11 + | +LL | Tuple(Alias), + | ^^^^^ expected named lifetime parameter + | +help: consider introducing a named lifetime parameter + | +LL ~ pub enum UninhabitedVariants<'a> { +LL ~ Tuple(Alias<'a>), + | + +error[E0107]: missing generics for type alias `Alias` + --> $DIR/bad-tait-no-substs.rs:9:11 + | +LL | Tuple(Alias), + | ^^^^^ expected 1 generic argument + | +note: type alias defined here, with 1 generic parameter: `U` + --> $DIR/bad-tait-no-substs.rs:5:6 + | +LL | type Alias<'a, U> = impl Trait<U>; + | ^^^^^ - +help: add missing generic argument + | +LL | Tuple(Alias<U>), + | +++ + +error[E0792]: non-defining opaque type use in defining scope + --> $DIR/bad-tait-no-substs.rs:9:11 + | +LL | Tuple(Alias), + | ^^^^^ argument `'_` is not a generic parameter + | +note: for this opaque type + --> $DIR/bad-tait-no-substs.rs:5:21 + | +LL | type Alias<'a, U> = impl Trait<U>; + | ^^^^^^^^^^^^^ + +error: item does not constrain `Alias::{opaque#0}`, but has it in its signature + --> $DIR/bad-tait-no-substs.rs:15:4 + | +LL | fn uwu(x: UninhabitedVariants) { + | ^^^ + | + = note: consider moving the opaque type's declaration and defining uses into a separate module +note: this opaque type is in the signature + --> $DIR/bad-tait-no-substs.rs:5:21 + | +LL | type Alias<'a, U> = impl Trait<U>; + | ^^^^^^^^^^^^^ + +error: unconstrained opaque type + --> $DIR/bad-tait-no-substs.rs:5:21 + | +LL | type Alias<'a, U> = impl Trait<U>; + | ^^^^^^^^^^^^^ + | + = note: `Alias` must be used in combination with a concrete type within the same module + +error[E0004]: non-exhaustive patterns: `UninhabitedVariants::Tuple(_)` not covered + --> $DIR/bad-tait-no-substs.rs:17:11 + | +LL | match x {} + | ^ pattern `UninhabitedVariants::Tuple(_)` not covered + | +note: `UninhabitedVariants` defined here + --> $DIR/bad-tait-no-substs.rs:8:10 + | +LL | pub enum UninhabitedVariants { + | ^^^^^^^^^^^^^^^^^^^ +LL | Tuple(Alias), + | ----- not covered + = note: the matched value is of type `UninhabitedVariants` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ match x { +LL + UninhabitedVariants::Tuple(_) => todo!(), +LL + } + | + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0004, E0106, E0107, E0792. +For more information about an error, try `rustc --explain E0004`. diff --git a/tests/ui/type-alias-impl-trait/bad-transmute-itiat.rs b/tests/ui/type-alias-impl-trait/bad-transmute-itiat.rs new file mode 100644 index 00000000000..8314b28eeac --- /dev/null +++ b/tests/ui/type-alias-impl-trait/bad-transmute-itiat.rs @@ -0,0 +1,22 @@ +// regression test for rust-lang/rust#125758 + +#![feature(impl_trait_in_assoc_type)] + +trait Trait { + type Assoc2; +} + +struct Bar; +impl Trait for Bar { + type Assoc2 = impl std::fmt::Debug; + //~^ ERROR unconstrained opaque type +} + +struct Foo { + field: <Bar as Trait>::Assoc2, +} + +static BAR: u8 = 42; +static FOO2: &Foo = unsafe { std::mem::transmute(&BAR) }; + +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/bad-transmute-itiat.stderr b/tests/ui/type-alias-impl-trait/bad-transmute-itiat.stderr new file mode 100644 index 00000000000..6cbf6c83ff4 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/bad-transmute-itiat.stderr @@ -0,0 +1,10 @@ +error: unconstrained opaque type + --> $DIR/bad-transmute-itiat.rs:11:19 + | +LL | type Assoc2 = impl std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: `Assoc2` must be used in combination with a concrete type within the same impl + +error: aborting due to 1 previous error + diff --git a/tests/crashes/130956.rs b/tests/ui/type-alias-impl-trait/drop-analysis-on-unconstrained-tait.rs index ebb986d123f..4332f1264a8 100644 --- a/tests/crashes/130956.rs +++ b/tests/ui/type-alias-impl-trait/drop-analysis-on-unconstrained-tait.rs @@ -1,8 +1,11 @@ -//@ known-bug: #130956 +// Regression test for #130956 + +#![feature(type_alias_impl_trait)] mod impl_trait_mod { use super::*; pub type OpaqueBlock = impl Trait; + //~^ ERROR unconstrained opaque type pub type OpaqueIf = impl Trait; pub struct BlockWrapper(OpaqueBlock); diff --git a/tests/ui/type-alias-impl-trait/drop-analysis-on-unconstrained-tait.stderr b/tests/ui/type-alias-impl-trait/drop-analysis-on-unconstrained-tait.stderr new file mode 100644 index 00000000000..8e5838d5ddf --- /dev/null +++ b/tests/ui/type-alias-impl-trait/drop-analysis-on-unconstrained-tait.stderr @@ -0,0 +1,10 @@ +error: unconstrained opaque type + --> $DIR/drop-analysis-on-unconstrained-tait.rs:7:28 + | +LL | pub type OpaqueBlock = impl Trait; + | ^^^^^^^^^^ + | + = note: `OpaqueBlock` must be used in combination with a concrete type within the same module + +error: aborting due to 1 previous error + diff --git a/tests/ui/type-alias-impl-trait/in-where-clause.rs b/tests/ui/type-alias-impl-trait/in-where-clause.rs index a089fdc9075..065af57a864 100644 --- a/tests/ui/type-alias-impl-trait/in-where-clause.rs +++ b/tests/ui/type-alias-impl-trait/in-where-clause.rs @@ -1,4 +1,4 @@ -//! We evaluate `1 + 2` with `Reveal::All` during typeck, causing +//! We evaluate `1 + 2` with `TypingMode::PostAnalysis` during typeck, causing //! us to get the concrete type of `Bar` while computing it. //! This again requires type checking `foo`. #![feature(type_alias_impl_trait)] diff --git a/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs b/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs index 9901c8fe25d..c52dbd32539 100644 --- a/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs +++ b/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs @@ -1,7 +1,7 @@ //@ compile-flags: -Zvalidate-mir //@ check-pass -// Check that we don't cause cycle errors when validating pre-`Reveal::All` MIR +// Check that we don't cause cycle errors when validating pre-`RevealOpaques` MIR // that assigns opaques through normalized projections. #![feature(impl_trait_in_assoc_type)] diff --git a/tests/ui/type-alias/issue-14933.rs b/tests/ui/type-alias/issue-14933.rs index ddad6071017..198a25e8964 100644 --- a/tests/ui/type-alias/issue-14933.rs +++ b/tests/ui/type-alias/issue-14933.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 pub type BigRat<T = isize> = T; diff --git a/tests/ui/type-param-constraints.rs b/tests/ui/type-param-constraints.rs index a5c36af63fa..83d81c0d833 100644 --- a/tests/ui/type-param-constraints.rs +++ b/tests/ui/type-param-constraints.rs @@ -2,7 +2,6 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn p_foo<T>(_pinned: T) { } fn s_foo<T>(_shared: T) { } diff --git a/tests/ui/type-param.rs b/tests/ui/type-param.rs index fdb56feab82..e7cf0e5446b 100644 --- a/tests/ui/type-param.rs +++ b/tests/ui/type-param.rs @@ -4,7 +4,6 @@ #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 type lteq<T> = extern "C" fn(T) -> bool; diff --git a/tests/ui/type-ptr.rs b/tests/ui/type-ptr.rs index 8f3868fc609..5c8ed344ab3 100644 --- a/tests/ui/type-ptr.rs +++ b/tests/ui/type-ptr.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 fn f(a: *const isize) -> *const isize { return a; } diff --git a/tests/ui/type-use-i1-versus-i8.rs b/tests/ui/type-use-i1-versus-i8.rs index 916a77d9934..4eb25329223 100644 --- a/tests/ui/type-use-i1-versus-i8.rs +++ b/tests/ui/type-use-i1-versus-i8.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 use std::ptr; diff --git a/tests/ui/type/issue-7607-2.rs b/tests/ui/type/issue-7607-2.rs index 654f26bf298..ebc4fe1c2d3 100644 --- a/tests/ui/type/issue-7607-2.rs +++ b/tests/ui/type/issue-7607-2.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code)] -//@ pretty-expanded FIXME #23616 pub mod a { pub struct Foo { a: usize } diff --git a/tests/ui/type/type-dependent-def-issue-49241.stderr b/tests/ui/type/type-dependent-def-issue-49241.stderr index cf372dc5968..4e55618e5cb 100644 --- a/tests/ui/type/type-dependent-def-issue-49241.stderr +++ b/tests/ui/type/type-dependent-def-issue-49241.stderr @@ -9,6 +9,12 @@ help: consider using `let` instead of `const` LL | let l: usize = v.count(); | ~~~ +note: erroneous constant encountered + --> $DIR/type-dependent-def-issue-49241.rs:4:18 + | +LL | let s: [u32; l] = v.into_iter().collect(); + | ^ + error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0435`. diff --git a/tests/ui/typeck/ufcs-type-params.rs b/tests/ui/typeck/ufcs-type-params.rs index ef8b983b3e9..5a6db4620fc 100644 --- a/tests/ui/typeck/ufcs-type-params.rs +++ b/tests/ui/typeck/ufcs-type-params.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 trait Foo<T> { fn get(&self) -> T; diff --git a/tests/ui/typeck/unify-return-ty.rs b/tests/ui/typeck/unify-return-ty.rs index 849b72e63e5..d33a1674e08 100644 --- a/tests/ui/typeck/unify-return-ty.rs +++ b/tests/ui/typeck/unify-return-ty.rs @@ -3,7 +3,6 @@ // unified with the type *T, and so the type variable // in that type gets resolved. -//@ pretty-expanded FIXME #23616 use std::mem; diff --git a/tests/ui/unboxed-closures/issue-18661.rs b/tests/ui/unboxed-closures/issue-18661.rs index 44b4c499352..dc965809ea1 100644 --- a/tests/ui/unboxed-closures/issue-18661.rs +++ b/tests/ui/unboxed-closures/issue-18661.rs @@ -2,7 +2,6 @@ // Test that param substitutions from the correct environment are // used when codegenning unboxed closure calls. -//@ pretty-expanded FIXME #23616 pub fn inside<F: Fn()>(c: F) { c(); diff --git a/tests/ui/unboxed-closures/unboxed-closures-direct-sugary-call.rs b/tests/ui/unboxed-closures/unboxed-closures-direct-sugary-call.rs index 632bffbea18..265e8e49f0d 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-direct-sugary-call.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-direct-sugary-call.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_mut)] -//@ pretty-expanded FIXME #23616 fn main() { let mut unboxed = || {}; diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs b/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs index c7c50b7b50e..8c27c4151ac 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-bound.rs @@ -2,7 +2,6 @@ // Test that we are able to infer that the type of `x` is `isize` based // on the expected type from the object. -//@ pretty-expanded FIXME #23616 pub trait ToPrimitive { fn to_int(&self) {} diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs b/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs index a54048d2518..10f21908902 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-from-expected-object-type.rs @@ -2,7 +2,6 @@ // Test that we are able to infer that the type of `x` is `isize` based // on the expected type from the object. -//@ pretty-expanded FIXME #23616 pub trait ToPrimitive { fn to_int(&self) {} diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs b/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs index 8c7b1c7534b..d3a6ff91a94 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-infer-arg-types-w-bound-regs-from-expected-bound.rs @@ -2,7 +2,6 @@ // Test that we are able to infer that the type of `x` is `isize` based // on the expected type from the object. -//@ pretty-expanded FIXME #23616 pub trait ToPrimitive { fn to_int(&self) {} diff --git a/tests/ui/unboxed-closures/unboxed-closures-move-mutable.rs b/tests/ui/unboxed-closures/unboxed-closures-move-mutable.rs index d883053d276..f27461808c3 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-move-mutable.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-move-mutable.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 #![deny(unused_mut)] #![allow(unused_must_use)] diff --git a/tests/ui/unboxed-closures/unboxed-closures-move-mutable.stderr b/tests/ui/unboxed-closures/unboxed-closures-move-mutable.stderr index 5c06f4e621c..813e2eea568 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-move-mutable.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-move-mutable.stderr @@ -1,5 +1,5 @@ warning: unused variable: `x` - --> $DIR/unboxed-closures-move-mutable.rs:17:17 + --> $DIR/unboxed-closures-move-mutable.rs:16:17 | LL | move || x += 1; | ^ @@ -8,7 +8,7 @@ LL | move || x += 1; = note: `#[warn(unused_variables)]` on by default warning: unused variable: `x` - --> $DIR/unboxed-closures-move-mutable.rs:21:17 + --> $DIR/unboxed-closures-move-mutable.rs:20:17 | LL | move || x += 1; | ^ diff --git a/tests/ui/unboxed-closures/unboxed-closures-prelude.rs b/tests/ui/unboxed-closures/unboxed-closures-prelude.rs index ca0ca66c035..ae90a51c488 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-prelude.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-prelude.rs @@ -1,7 +1,6 @@ //@ run-pass // Tests that the re-exports of `FnOnce` et al from the prelude work. -//@ pretty-expanded FIXME #23616 fn main() { let task: Box<dyn Fn(isize) -> isize> = Box::new(|x| x); diff --git a/tests/ui/unboxed-closures/unboxed-closures-static-call-fn-once.rs b/tests/ui/unboxed-closures/unboxed-closures-static-call-fn-once.rs index 6103dbd9959..c63594dc878 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-static-call-fn-once.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-static-call-fn-once.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { let onetime = |x| x; diff --git a/tests/ui/unboxed-closures/unboxed-closures-zero-args.rs b/tests/ui/unboxed-closures/unboxed-closures-zero-args.rs index 81fe12afccf..c808189b658 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-zero-args.rs +++ b/tests/ui/unboxed-closures/unboxed-closures-zero-args.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_mut)] -//@ pretty-expanded FIXME #23616 fn main() { let mut zero = || {}; diff --git a/tests/ui/underscore-imports/auxiliary/duplicate.rs b/tests/ui/underscore-imports/auxiliary/duplicate.rs index 61613d24b9e..b346522b721 100644 --- a/tests/ui/underscore-imports/auxiliary/duplicate.rs +++ b/tests/ui/underscore-imports/auxiliary/duplicate.rs @@ -1,8 +1,3 @@ -//@ force-host -//@ no-prefer-dynamic - -#![crate_type = "proc-macro"] - extern crate proc_macro; use proc_macro::*; diff --git a/tests/ui/underscore-imports/duplicate.rs b/tests/ui/underscore-imports/duplicate.rs index 4afad77ee4f..125ccdf52b0 100644 --- a/tests/ui/underscore-imports/duplicate.rs +++ b/tests/ui/underscore-imports/duplicate.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ aux-build:duplicate.rs +//@ proc-macro: duplicate.rs extern crate duplicate; diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr index 50f33607c06..0e87f14aa14 100644 --- a/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr +++ b/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr @@ -5,7 +5,7 @@ LL | let Foo::D(_y, _z) = x; | ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Foo` defined here --> $DIR/uninhabited-irrefutable.rs:19:6 | diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.min_exhaustive_patterns.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.min_exhaustive_patterns.stderr index bc1a9fa4191..67527ce1ac4 100644 --- a/tests/ui/uninhabited/uninhabited-irrefutable.min_exhaustive_patterns.stderr +++ b/tests/ui/uninhabited/uninhabited-irrefutable.min_exhaustive_patterns.stderr @@ -5,7 +5,7 @@ LL | let Foo::D(_y, _z) = x; | ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Foo` defined here --> $DIR/uninhabited-irrefutable.rs:20:6 | diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr index 50f33607c06..0e87f14aa14 100644 --- a/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr +++ b/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr @@ -5,7 +5,7 @@ LL | let Foo::D(_y, _z) = x; | ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Foo` defined here --> $DIR/uninhabited-irrefutable.rs:19:6 | diff --git a/tests/ui/uninit-empty-types.rs b/tests/ui/uninit-empty-types.rs index a6c11c4999a..82474d873b7 100644 --- a/tests/ui/uninit-empty-types.rs +++ b/tests/ui/uninit-empty-types.rs @@ -1,7 +1,6 @@ //@ build-pass // Test the uninit() construct returning various empty types. -//@ pretty-expanded FIXME #23616 use std::mem::MaybeUninit; diff --git a/tests/ui/unit.rs b/tests/ui/unit.rs index 98ac164b1d4..04404fc3f5e 100644 --- a/tests/ui/unit.rs +++ b/tests/ui/unit.rs @@ -2,7 +2,6 @@ #![allow(unused_assignments)] #![allow(unknown_lints)] -//@ pretty-expanded FIXME #23616 #![allow(unused_variables)] #![allow(dead_assignment)] diff --git a/tests/ui/unnamed_argument_mode.rs b/tests/ui/unnamed_argument_mode.rs index ba6f84c4dde..2014e0d23d8 100644 --- a/tests/ui/unnamed_argument_mode.rs +++ b/tests/ui/unnamed_argument_mode.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn good(_a: &isize) { } diff --git a/tests/ui/unpretty/expanded-exhaustive.rs b/tests/ui/unpretty/expanded-exhaustive.rs index 799e8071d02..891021e8766 100644 --- a/tests/ui/unpretty/expanded-exhaustive.rs +++ b/tests/ui/unpretty/expanded-exhaustive.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Zunpretty=expanded -Zunstable-options +//@ compile-flags: -Zunpretty=expanded //@ edition:2024 //@ check-pass diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout index d8384951e12..007626e2c44 100644 --- a/tests/ui/unpretty/expanded-exhaustive.stdout +++ b/tests/ui/unpretty/expanded-exhaustive.stdout @@ -1,5 +1,5 @@ #![feature(prelude_import)] -//@ compile-flags: -Zunpretty=expanded -Zunstable-options +//@ compile-flags: -Zunpretty=expanded //@ edition:2024 //@ check-pass diff --git a/tests/ui/unsafe-fields-crate.rs b/tests/ui/unsafe-fields-crate.rs new file mode 100644 index 00000000000..cfb9ad6b544 --- /dev/null +++ b/tests/ui/unsafe-fields-crate.rs @@ -0,0 +1,62 @@ +//@ compile-flags: --crate-type=lib +//@ aux-build: unsafe-fields-crate-dep.rs + +extern crate unsafe_fields_crate_dep; + +use unsafe_fields_crate_dep::WithUnsafeField; + +fn new_without_unsafe() -> WithUnsafeField { + WithUnsafeField { + //~^ ERROR + unsafe_field: 0, + safe_field: 0, + } +} + +fn operate_on_safe_field(s: &mut WithUnsafeField) { + s.safe_field = 2; + &s.safe_field; + s.safe_field; +} + +fn set_unsafe_field(s: &mut WithUnsafeField) { + unsafe { + s.unsafe_field = 2; + } +} + +fn read_unsafe_field(s: &WithUnsafeField) -> u32 { + unsafe { s.unsafe_field } +} + +fn ref_unsafe_field(s: &WithUnsafeField) -> &u32 { + unsafe { &s.unsafe_field } +} + +fn destructure(s: &WithUnsafeField) { + unsafe { + let WithUnsafeField { safe_field, unsafe_field } = s; + } +} + +fn set_unsafe_field_without_unsafe(s: &mut WithUnsafeField) { + s.unsafe_field = 2; + //~^ ERROR +} + +fn read_unsafe_field_without_unsafe(s: &WithUnsafeField) -> u32 { + s.unsafe_field + //~^ ERROR +} + +fn ref_unsafe_field_without_unsafe(s: &WithUnsafeField) -> &u32 { + &s.unsafe_field + //~^ ERROR +} + +fn destructure_without_unsafe(s: &WithUnsafeField) { + let WithUnsafeField { safe_field, unsafe_field } = s; + //~^ ERROR + + let WithUnsafeField { safe_field, .. } = s; +} diff --git a/tests/ui/unsafe-fields-crate.stderr b/tests/ui/unsafe-fields-crate.stderr new file mode 100644 index 00000000000..778c26e0a43 --- /dev/null +++ b/tests/ui/unsafe-fields-crate.stderr @@ -0,0 +1,47 @@ +error[E0133]: initializing type with an unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields-crate.rs:9:5 + | +LL | / WithUnsafeField { +LL | | +LL | | unsafe_field: 0, +LL | | safe_field: 0, +LL | | } + | |_____^ initialization of struct with unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields-crate.rs:43:5 + | +LL | s.unsafe_field = 2; + | ^^^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields-crate.rs:48:5 + | +LL | s.unsafe_field + | ^^^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields-crate.rs:53:6 + | +LL | &s.unsafe_field + | ^^^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields-crate.rs:58:39 + | +LL | let WithUnsafeField { safe_field, unsafe_field } = s; + | ^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe-fields-parse.rs b/tests/ui/unsafe-fields-parse.rs new file mode 100644 index 00000000000..67277731293 --- /dev/null +++ b/tests/ui/unsafe-fields-parse.rs @@ -0,0 +1,10 @@ +//@ compile-flags: --crate-type=lib +#![allow(incomplete_features)] +#![feature(unsafe_fields)] + +// Parse errors even *with* unsafe_fields, which would make the compiler early-exit otherwise. +enum A { + TupleLike(unsafe u32), //~ ERROR +} + +struct B(unsafe u32); //~ ERROR diff --git a/tests/ui/unsafe-fields-parse.stderr b/tests/ui/unsafe-fields-parse.stderr new file mode 100644 index 00000000000..5a45ab03ffe --- /dev/null +++ b/tests/ui/unsafe-fields-parse.stderr @@ -0,0 +1,18 @@ +error: expected type, found keyword `unsafe` + --> $DIR/unsafe-fields-parse.rs:7:15 + | +LL | enum A { + | - while parsing this enum +LL | TupleLike(unsafe u32), + | ^^^^^^ expected type + | + = help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` + +error: expected type, found keyword `unsafe` + --> $DIR/unsafe-fields-parse.rs:10:10 + | +LL | struct B(unsafe u32); + | ^^^^^^ expected type + +error: aborting due to 2 previous errors + diff --git a/tests/ui/unsafe-fields.rs b/tests/ui/unsafe-fields.rs new file mode 100644 index 00000000000..637471582d7 --- /dev/null +++ b/tests/ui/unsafe-fields.rs @@ -0,0 +1,109 @@ +//@ compile-flags: --crate-type=lib +#![allow(incomplete_features)] +#![feature(unsafe_fields)] + +struct WithUnsafeField { + unsafe unsafe_field: u32, + safe_field: u32, +} + +enum A { + WithUnsafeField { unsafe unsafe_field: u32, safe_field: u32 }, +} + +fn f(a: A) { + let A::WithUnsafeField { unsafe_field, safe_field } = a; + //~^ ERROR +} + +struct WithInvalidUnsafeField { + unsafe unsafe_noncopy_field: Vec<u32>, //~ ERROR +} + +struct WithManuallyDropUnsafeField { + unsafe unsafe_noncopy_field: std::mem::ManuallyDrop<Vec<u32>>, +} + +union WithUnsafeFieldUnion { + unsafe unsafe_field: u32, + safe_field: u32, +} + +impl WithUnsafeField { + fn new() -> WithUnsafeField { + unsafe { + WithUnsafeField { + unsafe_field: 0, + safe_field: 0, + } + } + } + + fn new_without_unsafe() -> WithUnsafeField { + WithUnsafeField { //~ ERROR + unsafe_field: 0, + safe_field: 0, + } + } + + fn operate_on_safe_field(&mut self) { + self.safe_field = 2; + &self.safe_field; + self.safe_field; + } + + fn set_unsafe_field(&mut self) { + unsafe { + self.unsafe_field = 2; + } + } + + fn read_unsafe_field(&self) -> u32 { + unsafe { + self.unsafe_field + } + } + + fn ref_unsafe_field(&self) -> &u32 { + unsafe { + &self.unsafe_field + } + } + + fn destructure(&self) { + unsafe { + let Self { safe_field, unsafe_field } = self; + } + } + + fn set_unsafe_field_without_unsafe(&mut self) { + self.unsafe_field = 2; + //~^ ERROR + } + + fn read_unsafe_field_without_unsafe(&self) -> u32 { + self.unsafe_field + //~^ ERROR + } + + fn ref_unsafe_field_without_unsafe(&self) -> &u32 { + &self.unsafe_field + //~^ ERROR + } + + fn destructure_without_unsafe(&self) { + let Self { safe_field, unsafe_field } = self; + //~^ ERROR + + let WithUnsafeField { safe_field, .. } = self; + } + + fn offset_of(&self) -> usize { + std::mem::offset_of!(WithUnsafeField, unsafe_field) + } + + fn raw_const(&self) -> *const u32 { + &raw const self.unsafe_field + //~^ ERROR + } +} diff --git a/tests/ui/unsafe-fields.stderr b/tests/ui/unsafe-fields.stderr new file mode 100644 index 00000000000..a1c5d2b44cd --- /dev/null +++ b/tests/ui/unsafe-fields.stderr @@ -0,0 +1,75 @@ +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be unsafe + --> $DIR/unsafe-fields.rs:20:5 + | +LL | unsafe unsafe_noncopy_field: Vec<u32>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: unsafe fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` +help: wrap the field type in `ManuallyDrop<...>` + | +LL | unsafe unsafe_noncopy_field: std::mem::ManuallyDrop<Vec<u32>>, + | +++++++++++++++++++++++ + + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields.rs:15:30 + | +LL | let A::WithUnsafeField { unsafe_field, safe_field } = a; + | ^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: initializing type with an unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields.rs:43:9 + | +LL | / WithUnsafeField { +LL | | unsafe_field: 0, +LL | | safe_field: 0, +LL | | } + | |_________^ initialization of struct with unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields.rs:80:9 + | +LL | self.unsafe_field = 2; + | ^^^^^^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields.rs:85:9 + | +LL | self.unsafe_field + | ^^^^^^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields.rs:90:10 + | +LL | &self.unsafe_field + | ^^^^^^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields.rs:95:32 + | +LL | let Self { safe_field, unsafe_field } = self; + | ^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error[E0133]: use of unsafe field is unsafe and requires unsafe block + --> $DIR/unsafe-fields.rs:106:20 + | +LL | &raw const self.unsafe_field + | ^^^^^^^^^^^^^^^^^ use of unsafe field + | + = note: unsafe fields may carry library invariants + +error: aborting due to 8 previous errors + +Some errors have detailed explanations: E0133, E0740. +For more information about an error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs index f12c38939dd..2fb73d3a1fa 100644 --- a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs +++ b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ check-pass #![crate_type = "lib"] #![deny(unused_unsafe)] 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 fe12dd72d9e..321d0ca2936 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 @@ -1,5 +1,5 @@ warning[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block - --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:10:5 + --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:9:5 | LL | unsf(); | ^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | unsf(); = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668> = 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:9:1 + --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:8:1 | LL | unsafe fn foo() { | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/unsafe/new-unsafe-pointers.rs b/tests/ui/unsafe/new-unsafe-pointers.rs index 39566cda90a..07c54ae9692 100644 --- a/tests/ui/unsafe/new-unsafe-pointers.rs +++ b/tests/ui/unsafe/new-unsafe-pointers.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 fn main() { let _a: *const isize = 3 as *const isize; diff --git a/tests/ui/unsafe/unsafe-fn-called-from-unsafe-blk.rs b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-blk.rs index d9f244bc4d2..d45f5c523c2 100644 --- a/tests/ui/unsafe/unsafe-fn-called-from-unsafe-blk.rs +++ b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-blk.rs @@ -4,7 +4,6 @@ // // See also: ui/unsafe/unsafe-fn-called-from-safe.rs -//@ pretty-expanded FIXME #23616 unsafe fn f() { return; } diff --git a/tests/ui/unsafe/unsafe-fn-called-from-unsafe-fn.rs b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-fn.rs index bb7715b7b5c..168c60dfc84 100644 --- a/tests/ui/unsafe/unsafe-fn-called-from-unsafe-fn.rs +++ b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-fn.rs @@ -4,7 +4,6 @@ // // See also: ui/unsafe/unsafe-fn-called-from-safe.rs -//@ pretty-expanded FIXME #23616 unsafe fn f() { return; } diff --git a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.rs b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.rs index 06a46b9812d..261427d1eab 100644 --- a/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.rs +++ b/tests/ui/unsafe/unsafe_op_in_unsafe_fn/edition_2024_default.rs @@ -1,5 +1,4 @@ //@ edition: 2024 -//@ compile-flags: -Zunstable-options //@ check-pass // Tests that `unsafe_op_in_unsafe_fn` is warn-by-default in edition 2024 and that the 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 05f36ab47cb..d91b76e7937 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 @@ -1,5 +1,5 @@ warning[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block - --> $DIR/edition_2024_default.rs:13:5 + --> $DIR/edition_2024_default.rs:12:5 | LL | unsf(); | ^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | unsf(); = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668> = 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:12:1 + --> $DIR/edition_2024_default.rs:11:1 | LL | unsafe fn foo() { | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/unused-move-capture.rs b/tests/ui/unused-move-capture.rs index c295f8d7914..5f42bcbe280 100644 --- a/tests/ui/unused-move-capture.rs +++ b/tests/ui/unused-move-capture.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 pub fn main() { let _x: Box<_> = Box::new(1); diff --git a/tests/ui/unused-move.rs b/tests/ui/unused-move.rs index 87398652e93..3d5eff2c48d 100644 --- a/tests/ui/unused-move.rs +++ b/tests/ui/unused-move.rs @@ -3,7 +3,6 @@ // Issue Name: Unused move causes a crash // Abstract: zero-fill to block after drop -//@ pretty-expanded FIXME #23616 #![allow(path_statements)] diff --git a/tests/ui/use-import-export.rs b/tests/ui/use-import-export.rs index f784194c505..d948ffc1520 100644 --- a/tests/ui/use-import-export.rs +++ b/tests/ui/use-import-export.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ pretty-expanded FIXME #23616 mod foo { pub fn x() -> isize { return 1; } diff --git a/tests/ui/use/use.rs b/tests/ui/use/use.rs index 826a049f2bb..db031500a4a 100644 --- a/tests/ui/use/use.rs +++ b/tests/ui/use/use.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(stable_features)] -//@ pretty-expanded FIXME #23616 #![allow(unused_imports)] #![feature(start, no_core, core)] diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs index 53363319ba0..a95e10b7265 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs @@ -1,11 +1,6 @@ trait Trait<const N: Trait = bar> { //~^ ERROR cannot find value `bar` in this scope //~| ERROR cycle detected when computing type of `Trait::N` - //~| ERROR the trait `Trait` cannot be made into an object - //~| ERROR the trait `Trait` cannot be made into an object - //~| ERROR the trait `Trait` cannot be made into an object - //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] - //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! fn fnc<const N: Trait = u32>(&self) -> Trait { @@ -13,9 +8,6 @@ trait Trait<const N: Trait = bar> { //~| ERROR expected value, found builtin type `u32` //~| ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions //~| ERROR associated item referring to unboxed trait object for its own trait - //~| ERROR the trait `Trait` cannot be made into an object - //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] - //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr index fefb788fac7..339f7b2cc82 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr @@ -1,5 +1,5 @@ error[E0403]: the name `N` is already used for a generic parameter in this item's generic parameters - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:18 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:18 | LL | trait Trait<const N: Trait = bar> { | - first use of `N` @@ -14,13 +14,13 @@ LL | trait Trait<const N: Trait = bar> { | ^^^ not found in this scope error[E0423]: expected value, found builtin type `u32` - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:29 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:29 | LL | fn fnc<const N: Trait = u32>(&self) -> Trait { | ^^^ not a value error[E0425]: cannot find value `bar` in this scope - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:23:9 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:15:9 | LL | bar | ^^^ not found in this scope @@ -53,27 +53,8 @@ LL | trait Trait<const N: Trait = bar> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:12 - | -LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^^^^^^^^^^^^^^^^^^ - warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21 - | -LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^^^ - | - = 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> -help: if this is a dyn-compatible trait, use `dyn` - | -LL | fn fnc<const N: dyn Trait = u32>(&self) -> Trait { - | +++ - -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:44 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44 | LL | fn fnc<const N: Trait = u32>(&self) -> Trait { | ^^^^^ @@ -85,114 +66,40 @@ help: if this is a dyn-compatible trait, use `dyn` LL | fn fnc<const N: Trait = u32>(&self) -> dyn Trait { | +++ -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 - | -LL | trait Trait<const N: Trait = 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: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: if this is a dyn-compatible trait, use `dyn` - | -LL | trait Trait<const N: dyn Trait = bar> { - | +++ - -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 - | -LL | trait Trait<const N: Trait = bar> { - | ^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8 - | -LL | trait Trait<const N: Trait = bar> { - | ----- this trait cannot be made into an object... -... -LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^ ...because method `fnc` has generic type parameters - = help: consider moving `fnc` to another trait - -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:13 - | -LL | trait Trait<const N: Trait = bar> { - | ^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8 - | -LL | trait Trait<const N: Trait = bar> { - | ----- this trait cannot be made into an object... -... -LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^ ...because method `fnc` has generic type parameters - = help: consider moving `fnc` to another trait - -error: associated item referring to unboxed trait object for its own trait - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:44 +error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:12 | -LL | trait Trait<const N: Trait = bar> { - | ----- in this trait -... LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^^^ - | -help: you might have meant to use `Self` to refer to the implementing type - | -LL | fn fnc<const N: Trait = u32>(&self) -> Self { - | ~~~~ + | ^^^^^^^^^^^^^^^^^^^^ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:21 | LL | fn fnc<const N: Trait = u32>(&self) -> Trait { | ^^^^^ | = 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: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is a dyn-compatible trait, use `dyn` | LL | fn fnc<const N: dyn Trait = u32>(&self) -> Trait { | +++ -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21 - | -LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8 +error: associated item referring to unboxed trait object for its own trait + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44 | LL | trait Trait<const N: Trait = bar> { - | ----- this trait cannot be made into an object... + | ----- in this trait ... LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^ ...because method `fnc` has generic type parameters - = help: consider moving `fnc` to another trait - -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:13 - | -LL | trait Trait<const N: Trait = bar> { - | ^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object + | ^^^^^ | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8 +help: you might have meant to use `Self` to refer to the implementing type | -LL | trait Trait<const N: Trait = bar> { - | ----- this trait cannot be made into an object... -... -LL | fn fnc<const N: Trait = u32>(&self) -> Trait { - | ^^^ ...because method `fnc` has generic type parameters - = help: consider moving `fnc` to another trait - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +LL | fn fnc<const N: Trait = u32>(&self) -> Self { + | ~~~~ -error: aborting due to 11 previous errors; 5 warnings emitted +error: aborting due to 7 previous errors; 3 warnings emitted -Some errors have detailed explanations: E0038, E0391, E0403, E0423, E0425. -For more information about an error, try `rustc --explain E0038`. +Some errors have detailed explanations: E0391, E0403, E0423, E0425. +For more information about an error, try `rustc --explain E0391`. diff --git a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs index e6d4e2ee01a..0be5127dcc4 100644 --- a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs +++ b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs @@ -14,5 +14,4 @@ impl Trait for Ref {} //~ ERROR: implicit elided lifetime not allowed here extern "C" { pub fn repro(_: Wrapper<Ref>); - //~^ ERROR the trait bound `Ref<'_>: Trait` is not satisfied } diff --git a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr index 59b55b2732d..0af4ab022e1 100644 --- a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr +++ b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr @@ -9,19 +9,6 @@ help: indicate the anonymous lifetime LL | impl Trait for Ref<'_> {} | ++++ -error[E0277]: the trait bound `Ref<'_>: Trait` is not satisfied - --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:21 - | -LL | pub fn repro(_: Wrapper<Ref>); - | ^^^^^^^^^^^^ the trait `Trait` is not implemented for `Ref<'_>` - | -note: required by a bound in `Wrapper` - --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:8:23 - | -LL | pub struct Wrapper<T: Trait>(T); - | ^^^^^ required by this bound in `Wrapper` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0277, E0726. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0726`. diff --git a/tests/ui/where-clauses/where-clause-bounds-inconsistency.rs b/tests/ui/where-clauses/where-clause-bounds-inconsistency.rs index be003cbf585..cf9c661582e 100644 --- a/tests/ui/where-clauses/where-clause-bounds-inconsistency.rs +++ b/tests/ui/where-clauses/where-clause-bounds-inconsistency.rs @@ -1,5 +1,4 @@ //@ check-pass -//@ pretty-expanded FIXME #23616 trait Bound { fn dummy(&self) { } diff --git a/tests/ui/where-clauses/where-clause-early-bound-lifetimes.rs b/tests/ui/where-clauses/where-clause-early-bound-lifetimes.rs index 67088a9818e..153fa8a5715 100644 --- a/tests/ui/where-clauses/where-clause-early-bound-lifetimes.rs +++ b/tests/ui/where-clauses/where-clause-early-bound-lifetimes.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(non_upper_case_globals)] -//@ pretty-expanded FIXME #23616 trait TheTrait { fn dummy(&self) { } } //~ WARN method `dummy` is never used diff --git a/tests/ui/where-clauses/where-clause-early-bound-lifetimes.stderr b/tests/ui/where-clauses/where-clause-early-bound-lifetimes.stderr index a9fe11ea6b3..34ed8bd2146 100644 --- a/tests/ui/where-clauses/where-clause-early-bound-lifetimes.stderr +++ b/tests/ui/where-clauses/where-clause-early-bound-lifetimes.stderr @@ -1,5 +1,5 @@ warning: method `dummy` is never used - --> $DIR/where-clause-early-bound-lifetimes.rs:6:21 + --> $DIR/where-clause-early-bound-lifetimes.rs:5:21 | LL | trait TheTrait { fn dummy(&self) { } } | -------- ^^^^^ diff --git a/tests/ui/where-clauses/where-clause-method-substituion-rpass.rs b/tests/ui/where-clauses/where-clause-method-substituion-rpass.rs index ba409182809..da75ed796c0 100644 --- a/tests/ui/where-clauses/where-clause-method-substituion-rpass.rs +++ b/tests/ui/where-clauses/where-clause-method-substituion-rpass.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 trait Foo<T> { fn dummy(&self, arg: T) { } } //~ WARN method `dummy` is never used diff --git a/tests/ui/where-clauses/where-clause-method-substituion-rpass.stderr b/tests/ui/where-clauses/where-clause-method-substituion-rpass.stderr index 0d09cb9de3f..9a8faf7a64e 100644 --- a/tests/ui/where-clauses/where-clause-method-substituion-rpass.stderr +++ b/tests/ui/where-clauses/where-clause-method-substituion-rpass.stderr @@ -1,5 +1,5 @@ warning: method `dummy` is never used - --> $DIR/where-clause-method-substituion-rpass.rs:5:19 + --> $DIR/where-clause-method-substituion-rpass.rs:4:19 | LL | trait Foo<T> { fn dummy(&self, arg: T) { } } | --- ^^^^^ diff --git a/tests/ui/where-clauses/where-clause-region-outlives.rs b/tests/ui/where-clauses/where-clause-region-outlives.rs index db61638ca2d..47a6d468204 100644 --- a/tests/ui/where-clauses/where-clause-region-outlives.rs +++ b/tests/ui/where-clauses/where-clause-region-outlives.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 struct A<'a, 'b> where 'a : 'b { x: &'a isize, y: &'b isize } diff --git a/tests/ui/where-clauses/where-clauses-lifetimes.rs b/tests/ui/where-clauses/where-clauses-lifetimes.rs index 8e8c73a3925..63ab9bafa23 100644 --- a/tests/ui/where-clauses/where-clauses-lifetimes.rs +++ b/tests/ui/where-clauses/where-clauses-lifetimes.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(unused_mut)] #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 fn foo<'a, I>(mut it: I) where I: Iterator<Item=&'a isize> {} diff --git a/tests/ui/where-clauses/where-clauses-unboxed-closures.rs b/tests/ui/where-clauses/where-clauses-unboxed-closures.rs index c2ef65ab0a6..5961a516457 100644 --- a/tests/ui/where-clauses/where-clauses-unboxed-closures.rs +++ b/tests/ui/where-clauses/where-clauses-unboxed-closures.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(unused_variables)] -//@ pretty-expanded FIXME #23616 struct Bencher; |
