diff options
Diffstat (limited to 'tests')
149 files changed, 1048 insertions, 436 deletions
diff --git a/tests/assembly/asm/global_asm.rs b/tests/assembly/asm/global_asm.rs index 0b361a7ed96..36f017cf9d6 100644 --- a/tests/assembly/asm/global_asm.rs +++ b/tests/assembly/asm/global_asm.rs @@ -25,9 +25,9 @@ global_asm!("movl ${}, %ecx", const 5, options(att_syntax)); global_asm!("call {}", sym my_func); // CHECK: lea rax, [rip + MY_STATIC] global_asm!("lea rax, [rip + {}]", sym MY_STATIC); -// CHECK: call _RNvCsiubXh4Yz005_10global_asm6foobar +// CHECK: call _RNvCsddMtV7nAi4C_10global_asm6foobar global_asm!("call {}", sym foobar); -// CHECK: _RNvCsiubXh4Yz005_10global_asm6foobar: +// CHECK: _RNvCsddMtV7nAi4C_10global_asm6foobar: fn foobar() { loop {} } diff --git a/tests/codegen/abi-main-signature-16bit-c-int.rs b/tests/codegen/abi-main-signature-16bit-c-int.rs index 4ed491dfb2b..3548cc06a5b 100644 --- a/tests/codegen/abi-main-signature-16bit-c-int.rs +++ b/tests/codegen/abi-main-signature-16bit-c-int.rs @@ -17,7 +17,6 @@ // ignore-wasm32 // ignore-x86 // ignore-x86_64 -// ignore-xcore fn main() { } diff --git a/tests/codegen/consts.rs b/tests/codegen/consts.rs index 8a135039c06..fc2badc417c 100644 --- a/tests/codegen/consts.rs +++ b/tests/codegen/consts.rs @@ -9,7 +9,7 @@ // CHECK: @STATIC = {{.*}}, align 4 // This checks the constants from inline_enum_const -// CHECK: @alloc_701ed935fbda2002838d0a2cbbc171e5 = {{.*}}, align 2 +// CHECK: @alloc_af1f8e8e6f4b341431a1d405e652df2d = {{.*}}, align 2 // This checks the constants from {low,high}_align_const, they share the same // constant, but the alignment differs, so the higher one should be used diff --git a/tests/codegen/debug-limited.rs b/tests/codegen/debug-limited.rs new file mode 100644 index 00000000000..48d676887fd --- /dev/null +++ b/tests/codegen/debug-limited.rs @@ -0,0 +1,27 @@ +// Verify that the limited debuginfo option emits llvm's FullDebugInfo, but no type info. +// +// compile-flags: -C debuginfo=limited + +#[repr(C)] +struct StructType { + a: i64, + b: i32, +} + +extern "C" { + fn creator() -> *mut StructType; + fn save(p: *const StructType); +} + +fn main() { + unsafe { + let value: &mut StructType = &mut *creator(); + value.a = 7; + save(value as *const StructType) + } +} + +// CHECK: !DICompileUnit +// CHECK: emissionKind: FullDebug +// CHECK: !DILocation +// CHECK-NOT: !DIBasicType diff --git a/tests/codegen/debug-line-directives-only.rs b/tests/codegen/debug-line-directives-only.rs new file mode 100644 index 00000000000..750bdd49de0 --- /dev/null +++ b/tests/codegen/debug-line-directives-only.rs @@ -0,0 +1,27 @@ +// Verify that the only debuginfo generated are the line directives. +// +// compile-flags: -C debuginfo=line-directives-only + +#[repr(C)] +struct StructType { + a: i64, + b: i32, +} + +extern "C" { + fn creator() -> *mut StructType; + fn save(p: *const StructType); +} + +fn main() { + unsafe { + let value: &mut StructType = &mut *creator(); + value.a = 7; + save(value as *const StructType) + } +} + +// CHECK: !DICompileUnit +// CHECK: emissionKind: DebugDirectivesOnly +// CHECK: !DILocation +// CHECK-NOT: !DIBasicType diff --git a/tests/codegen/debug-line-tables-only.rs b/tests/codegen/debug-line-tables-only.rs new file mode 100644 index 00000000000..3ed165a6f69 --- /dev/null +++ b/tests/codegen/debug-line-tables-only.rs @@ -0,0 +1,27 @@ +// Verify that the only debuginfo generated are the line tables. +// +// compile-flags: -C debuginfo=line-tables-only + +#[repr(C)] +struct StructType { + a: i64, + b: i32, +} + +extern "C" { + fn creator() -> *mut StructType; + fn save(p: *const StructType); +} + +fn main() { + unsafe { + let value: &mut StructType = &mut *creator(); + value.a = 7; + save(value as *const StructType) + } +} + +// CHECK: !DICompileUnit +// CHECK: emissionKind: LineTablesOnly +// CHECK: !DILocation +// CHECK-NOT: !DIBasicType diff --git a/tests/codegen/global_asm.rs b/tests/codegen/global_asm.rs index fab84868fdf..9912b1e75bf 100644 --- a/tests/codegen/global_asm.rs +++ b/tests/codegen/global_asm.rs @@ -1,39 +1,20 @@ // ignore-aarch64 -// ignore-aarch64_be // ignore-arm -// ignore-armeb // ignore-avr -// ignore-bpfel -// ignore-bpfeb +// ignore-bpf +// ignore-bpf // ignore-hexagon // ignore-mips // ignore-mips64 // ignore-msp430 // ignore-powerpc64 -// ignore-powerpc64le // ignore-powerpc -// ignore-r600 -// ignore-amdgcn // ignore-sparc -// ignore-sparcv9 -// ignore-sparcel +// ignore-sparc64 // ignore-s390x -// ignore-tce // ignore-thumb -// ignore-thumbeb -// ignore-xcore -// ignore-nvptx // ignore-nvptx64 -// ignore-le32 -// ignore-le64 -// ignore-amdil -// ignore-amdil64 -// ignore-hsail -// ignore-hsail64 -// ignore-spir -// ignore-spir64 -// ignore-kalimba -// ignore-shave +// ignore-spirv // ignore-wasm32 // ignore-wasm64 // ignore-emscripten diff --git a/tests/codegen/global_asm_include.rs b/tests/codegen/global_asm_include.rs index 02ee916458f..b68c5ad3b9d 100644 --- a/tests/codegen/global_asm_include.rs +++ b/tests/codegen/global_asm_include.rs @@ -1,39 +1,20 @@ // ignore-aarch64 -// ignore-aarch64_be // ignore-arm -// ignore-armeb // ignore-avr -// ignore-bpfel -// ignore-bpfeb +// ignore-bpf +// ignore-bpf // ignore-hexagon // ignore-mips // ignore-mips64 // ignore-msp430 // ignore-powerpc64 -// ignore-powerpc64le // ignore-powerpc -// ignore-r600 -// ignore-amdgcn // ignore-sparc -// ignore-sparcv9 -// ignore-sparcel +// ignore-sparc64 // ignore-s390x -// ignore-tce // ignore-thumb -// ignore-thumbeb -// ignore-xcore -// ignore-nvptx // ignore-nvptx64 -// ignore-le32 -// ignore-le64 -// ignore-amdil -// ignore-amdil64 -// ignore-hsail -// ignore-hsail64 -// ignore-spir -// ignore-spir64 -// ignore-kalimba -// ignore-shave +// ignore-spirv // ignore-wasm32 // ignore-wasm64 // ignore-emscripten diff --git a/tests/codegen/global_asm_x2.rs b/tests/codegen/global_asm_x2.rs index bdcf0ea843c..d87e02befb9 100644 --- a/tests/codegen/global_asm_x2.rs +++ b/tests/codegen/global_asm_x2.rs @@ -1,39 +1,20 @@ // ignore-aarch64 -// ignore-aarch64_be // ignore-arm -// ignore-armeb // ignore-avr -// ignore-bpfel -// ignore-bpfeb +// ignore-bpf +// ignore-bpf // ignore-hexagon // ignore-mips // ignore-mips64 // ignore-msp430 // ignore-powerpc64 -// ignore-powerpc64le // ignore-powerpc -// ignore-r600 -// ignore-amdgcn // ignore-sparc -// ignore-sparcv9 -// ignore-sparcel +// ignore-sparc64 // ignore-s390x -// ignore-tce // ignore-thumb -// ignore-thumbeb -// ignore-xcore -// ignore-nvptx // ignore-nvptx64 -// ignore-le32 -// ignore-le64 -// ignore-amdil -// ignore-amdil64 -// ignore-hsail -// ignore-hsail64 -// ignore-spir -// ignore-spir64 -// ignore-kalimba -// ignore-shave +// ignore-spirv // ignore-wasm32 // ignore-wasm64 // ignore-emscripten diff --git a/tests/codegen/intrinsics/transmute.rs b/tests/codegen/intrinsics/transmute.rs index cefcf9ed9ca..7ad0e62213c 100644 --- a/tests/codegen/intrinsics/transmute.rs +++ b/tests/codegen/intrinsics/transmute.rs @@ -6,6 +6,7 @@ #![feature(core_intrinsics)] #![feature(custom_mir)] #![feature(inline_const)] +#![allow(unreachable_code)] use std::mem::transmute; @@ -24,6 +25,9 @@ pub struct Scalar64(i64); #[repr(C, align(4))] pub struct Aggregate64(u16, u8, i8, f32); +#[repr(C)] +pub struct Aggregate8(u8); + // CHECK-LABEL: @check_bigger_size( #[no_mangle] #[custom_mir(dialect = "runtime", phase = "initial")] @@ -76,23 +80,80 @@ pub unsafe fn check_from_uninhabited(x: BigNever) -> u16 { } } +// CHECK-LABEL: @check_intermediate_passthrough( +#[no_mangle] +pub unsafe fn check_intermediate_passthrough(x: u32) -> i32 { + // CHECK: start + // CHECK: %[[TMP:.+]] = add i32 1, %x + // CHECK: %[[RET:.+]] = add i32 %[[TMP]], 1 + // CHECK: ret i32 %[[RET]] + unsafe { + transmute::<u32, i32>(1 + x) + 1 + } +} + +// CHECK-LABEL: @check_nop_pair( +#[no_mangle] +pub unsafe fn check_nop_pair(x: (u8, i8)) -> (i8, u8) { + // CHECK-NOT: alloca + // CHECK: %0 = insertvalue { i8, i8 } poison, i8 %x.0, 0 + // CHECK: %1 = insertvalue { i8, i8 } %0, i8 %x.1, 1 + // CHECK: ret { i8, i8 } %1 + unsafe { + transmute(x) + } +} + // CHECK-LABEL: @check_to_newtype( #[no_mangle] pub unsafe fn check_to_newtype(x: u64) -> Scalar64 { - // CHECK: %0 = alloca i64 - // CHECK: store i64 %x, ptr %0 - // CHECK: %1 = load i64, ptr %0 - // CHECK: ret i64 %1 + // CHECK-NOT: alloca + // CHECK: ret i64 %x transmute(x) } // CHECK-LABEL: @check_from_newtype( #[no_mangle] pub unsafe fn check_from_newtype(x: Scalar64) -> u64 { - // CHECK: %0 = alloca i64 - // CHECK: store i64 %x, ptr %0 - // CHECK: %1 = load i64, ptr %0 - // CHECK: ret i64 %1 + // CHECK-NOT: alloca + // CHECK: ret i64 %x + transmute(x) +} + +// CHECK-LABEL: @check_aggregate_to_bool( +#[no_mangle] +pub unsafe fn check_aggregate_to_bool(x: Aggregate8) -> bool { + // CHECK: %x = alloca %Aggregate8, align 1 + // CHECK: %[[BYTE:.+]] = load i8, ptr %x, align 1 + // CHECK: %[[BOOL:.+]] = trunc i8 %[[BYTE]] to i1 + // CHECK: ret i1 %[[BOOL]] + transmute(x) +} + +// CHECK-LABEL: @check_aggregate_from_bool( +#[no_mangle] +pub unsafe fn check_aggregate_from_bool(x: bool) -> Aggregate8 { + // CHECK: %0 = alloca %Aggregate8, align 1 + // CHECK: %[[BYTE:.+]] = zext i1 %x to i8 + // CHECK: store i8 %[[BYTE]], ptr %0, align 1 + transmute(x) +} + +// CHECK-LABEL: @check_byte_to_bool( +#[no_mangle] +pub unsafe fn check_byte_to_bool(x: u8) -> bool { + // CHECK-NOT: alloca + // CHECK: %0 = trunc i8 %x to i1 + // CHECK: ret i1 %0 + transmute(x) +} + +// CHECK-LABEL: @check_byte_from_bool( +#[no_mangle] +pub unsafe fn check_byte_from_bool(x: bool) -> u8 { + // CHECK-NOT: alloca + // CHECK: %0 = zext i1 %x to i8 + // CHECK: ret i8 %0 transmute(x) } @@ -122,20 +183,18 @@ pub unsafe fn check_from_pair(x: Option<i32>) -> u64 { // CHECK-LABEL: @check_to_float( #[no_mangle] pub unsafe fn check_to_float(x: u32) -> f32 { - // CHECK: %0 = alloca float - // CHECK: store i32 %x, ptr %0 - // CHECK: %1 = load float, ptr %0 - // CHECK: ret float %1 + // CHECK-NOT: alloca + // CHECK: %0 = bitcast i32 %x to float + // CHECK: ret float %0 transmute(x) } // CHECK-LABEL: @check_from_float( #[no_mangle] pub unsafe fn check_from_float(x: f32) -> u32 { - // CHECK: %0 = alloca i32 - // CHECK: store float %x, ptr %0 - // CHECK: %1 = load i32, ptr %0 - // CHECK: ret i32 %1 + // CHECK-NOT: alloca + // CHECK: %0 = bitcast float %x to i32 + // CHECK: ret i32 %0 transmute(x) } @@ -144,19 +203,15 @@ pub unsafe fn check_from_float(x: f32) -> u32 { pub unsafe fn check_to_bytes(x: u32) -> [u8; 4] { // CHECK: %0 = alloca [4 x i8], align 1 // CHECK: store i32 %x, ptr %0, align 1 - // CHECK: %1 = load i32, ptr %0, align 1 - // CHECK: ret i32 %1 transmute(x) } // CHECK-LABEL: @check_from_bytes( #[no_mangle] pub unsafe fn check_from_bytes(x: [u8; 4]) -> u32 { - // CHECK: %1 = alloca i32, align 4 // CHECK: %x = alloca [4 x i8], align 1 - // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %1, ptr align 1 %x, i64 4, i1 false) - // CHECK: %3 = load i32, ptr %1, align 4 - // CHECK: ret i32 %3 + // CHECK: %[[VAL:.+]] = load i32, ptr %x, align 1 + // CHECK: ret i32 %[[VAL]] transmute(x) } @@ -173,7 +228,9 @@ pub unsafe fn check_to_aggregate(x: u64) -> Aggregate64 { // CHECK-LABEL: @check_from_aggregate( #[no_mangle] pub unsafe fn check_from_aggregate(x: Aggregate64) -> u64 { - // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %{{[0-9]+}}, ptr align 4 %x, i64 8, i1 false) + // CHECK: %x = alloca %Aggregate64, align 4 + // CHECK: %[[VAL:.+]] = load i64, ptr %x, align 4 + // CHECK: ret i64 %[[VAL]] transmute(x) } @@ -194,3 +251,53 @@ pub unsafe fn check_long_array_more_aligned(x: [u8; 100]) -> [u32; 25] { // CHECK-NEXT: ret void transmute(x) } + +// CHECK-LABEL: @check_pair_with_bool( +#[no_mangle] +pub unsafe fn check_pair_with_bool(x: (u8, bool)) -> (bool, i8) { + // CHECK-NOT: alloca + // CHECK: trunc i8 %x.0 to i1 + // CHECK: zext i1 %x.1 to i8 + transmute(x) +} + +// CHECK-LABEL: @check_float_to_pointer( +#[no_mangle] +pub unsafe fn check_float_to_pointer(x: f64) -> *const () { + // CHECK-NOT: alloca + // CHECK: %0 = bitcast double %x to i64 + // CHECK: %1 = inttoptr i64 %0 to ptr + // CHECK: ret ptr %1 + transmute(x) +} + +// CHECK-LABEL: @check_float_from_pointer( +#[no_mangle] +pub unsafe fn check_float_from_pointer(x: *const ()) -> f64 { + // CHECK-NOT: alloca + // CHECK: %0 = ptrtoint ptr %x to i64 + // CHECK: %1 = bitcast i64 %0 to double + // CHECK: ret double %1 + transmute(x) +} + +// CHECK-LABEL: @check_array_to_pair( +#[no_mangle] +pub unsafe fn check_array_to_pair(x: [u8; 16]) -> (i64, u64) { + // CHECK-NOT: alloca + // CHECK: %[[FST:.+]] = load i64, ptr %{{.+}}, align 1, !noundef ! + // CHECK: %[[SND:.+]] = load i64, ptr %{{.+}}, align 1, !noundef ! + // CHECK: %[[PAIR0:.+]] = insertvalue { i64, i64 } poison, i64 %[[FST]], 0 + // CHECK: %[[PAIR01:.+]] = insertvalue { i64, i64 } %[[PAIR0]], i64 %[[SND]], 1 + // CHECK: ret { i64, i64 } %[[PAIR01]] + transmute(x) +} + +// CHECK-LABEL: @check_pair_to_array( +#[no_mangle] +pub unsafe fn check_pair_to_array(x: (i64, u64)) -> [u8; 16] { + // CHECK-NOT: alloca + // CHECK: store i64 %x.0, ptr %{{.+}}, align 1 + // CHECK: store i64 %x.1, ptr %{{.+}}, align 1 + transmute(x) +} diff --git a/tests/codegen/issues/issue-37945.rs b/tests/codegen/issues/issue-37945.rs index 19e7e8b1f6e..4f386d335c7 100644 --- a/tests/codegen/issues/issue-37945.rs +++ b/tests/codegen/issues/issue-37945.rs @@ -1,9 +1,5 @@ // compile-flags: -O -Zmerge-functions=disabled -// ignore-x86 -// ignore-arm -// ignore-emscripten -// ignore-gnux32 -// ignore 32-bit platforms (LLVM has a bug with them) +// ignore-32bit LLVM has a bug with them // ignore-debug // Check that LLVM understands that `Iter` pointer is not null. Issue #37945. diff --git a/tests/codegen/remap_path_prefix/main.rs b/tests/codegen/remap_path_prefix/main.rs index 85523d053b5..f1e1dd69b96 100644 --- a/tests/codegen/remap_path_prefix/main.rs +++ b/tests/codegen/remap_path_prefix/main.rs @@ -12,7 +12,7 @@ mod aux_mod; include!("aux_mod.rs"); // Here we check that the expansion of the file!() macro is mapped. -// CHECK: @alloc_af9d0c7bc6ca3c31bb051d2862714536 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }> +// CHECK: @alloc_5761061597a97f66e13ef2ff92712c4b = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }> pub static FILE_PATH: &'static str = file!(); fn main() { diff --git a/tests/codegen/repr-transparent-aggregates-2.rs b/tests/codegen/repr-transparent-aggregates-2.rs index df7e88f08c7..e9fa5143b18 100644 --- a/tests/codegen/repr-transparent-aggregates-2.rs +++ b/tests/codegen/repr-transparent-aggregates-2.rs @@ -6,7 +6,6 @@ // ignore-mips64 // ignore-powerpc // ignore-powerpc64 -// ignore-powerpc64le // ignore-riscv64 see codegen/riscv-abi // ignore-s390x // ignore-sparc diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs index 7c77398dfcc..fd488a14bd3 100644 --- a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs +++ b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs @@ -4,7 +4,8 @@ #![crate_type = "lib"] #![allow(non_camel_case_types)] -#![feature(repr_simd, platform_intrinsics, min_const_generics)] +#![feature(repr_simd, platform_intrinsics)] +#![feature(inline_const)] #[repr(simd)] #[derive(Copy, Clone)] @@ -18,23 +19,65 @@ pub struct T([f32; 4]); #[derive(Copy, Clone)] pub struct U(f32, f32, f32, f32); +// CHECK-LABEL: @array_align( +#[no_mangle] +pub fn array_align() -> usize { + // CHECK: ret [[USIZE:i[0-9]+]] [[ARRAY_ALIGN:[0-9]+]] + const { std::mem::align_of::<f32>() } +} + +// CHECK-LABEL: @vector_align( +#[no_mangle] +pub fn vector_align() -> usize { + // CHECK: ret [[USIZE]] [[VECTOR_ALIGN:[0-9]+]] + const { std::mem::align_of::<U>() } +} + // CHECK-LABEL: @build_array_s #[no_mangle] pub fn build_array_s(x: [f32; 4]) -> S<4> { - // CHECK: call void @llvm.memcpy.{{.+}}({{.*}}, i{{[0-9]+}} 16, i1 false) + // CHECK: call void @llvm.memcpy.{{.+}}({{.*}} align [[VECTOR_ALIGN]] {{.*}} align [[ARRAY_ALIGN]] {{.*}}, [[USIZE]] 16, i1 false) S::<4>(x) } +// CHECK-LABEL: @build_array_transmute_s +#[no_mangle] +pub fn build_array_transmute_s(x: [f32; 4]) -> S<4> { + // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]] + // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %0|.+>\* %.+}}, align [[VECTOR_ALIGN]] + unsafe { std::mem::transmute(x) } +} + // CHECK-LABEL: @build_array_t #[no_mangle] pub fn build_array_t(x: [f32; 4]) -> T { - // CHECK: call void @llvm.memcpy.{{.+}}({{.*}}, i{{[0-9]+}} 16, i1 false) + // CHECK: call void @llvm.memcpy.{{.+}}({{.*}} align [[VECTOR_ALIGN]] {{.*}} align [[ARRAY_ALIGN]] {{.*}}, [[USIZE]] 16, i1 false) T(x) } +// CHECK-LABEL: @build_array_transmute_t +#[no_mangle] +pub fn build_array_transmute_t(x: [f32; 4]) -> T { + // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]] + // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %0|.+>\* %.+}}, align [[VECTOR_ALIGN]] + unsafe { std::mem::transmute(x) } +} + // CHECK-LABEL: @build_array_u #[no_mangle] pub fn build_array_u(x: [f32; 4]) -> U { - // CHECK: call void @llvm.memcpy.{{.+}}({{.*}}, i{{[0-9]+}} 16, i1 false) + // CHECK: store float %a, {{.+}}, align [[VECTOR_ALIGN]] + // CHECK: store float %b, {{.+}}, align [[ARRAY_ALIGN]] + // CHECK: store float %c, {{.+}}, align + // CHECK: store float %d, {{.+}}, align [[ARRAY_ALIGN]] + let [a, b, c, d] = x; + U(a, b, c, d) +} + +// CHECK-LABEL: @build_array_transmute_u +#[no_mangle] +pub fn build_array_transmute_u(x: [f32; 4]) -> U { + // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]] + // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %0|.+>\* %.+}}, align [[VECTOR_ALIGN]] unsafe { std::mem::transmute(x) } } diff --git a/tests/codegen/transmute-scalar.rs b/tests/codegen/transmute-scalar.rs index 4d7a80bfbe5..af2cef472ec 100644 --- a/tests/codegen/transmute-scalar.rs +++ b/tests/codegen/transmute-scalar.rs @@ -5,63 +5,53 @@ // With opaque ptrs in LLVM, `transmute` can load/store any `alloca` as any type, // without needing to pointercast, and SRoA will turn that into a `bitcast`. -// As such, there's no longer special-casing in `transmute` to attempt to -// generate `bitcast` ourselves, as that just made the IR longer. +// Thus memory-to-memory transmutes don't need to generate them ourselves. -// FIXME: That said, `bitcast`s could still be a valuable addition if they could -// be done in `rvalue_creates_operand`, and thus avoid the `alloca`s entirely. +// However, `bitcast`s and `ptrtoint`s and `inttoptr`s are still worth doing when +// that allows us to avoid the `alloca`s entirely; see `rvalue_creates_operand`. // CHECK-LABEL: define{{.*}}i32 @f32_to_bits(float noundef %x) -// CHECK: store float %{{.*}}, ptr %0 -// CHECK-NEXT: %[[RES:.*]] = load i32, ptr %0 -// CHECK: ret i32 %[[RES]] +// CHECK: %0 = bitcast float %x to i32 +// CHECK-NEXT: ret i32 %0 #[no_mangle] pub fn f32_to_bits(x: f32) -> u32 { unsafe { std::mem::transmute(x) } } // CHECK-LABEL: define{{.*}}i8 @bool_to_byte(i1 noundef zeroext %b) -// CHECK: %1 = zext i1 %b to i8 -// CHECK-NEXT: store i8 %1, {{.*}} %0 -// CHECK-NEXT: %2 = load i8, {{.*}} %0 -// CHECK: ret i8 %2 +// CHECK: %0 = zext i1 %b to i8 +// CHECK-NEXT: ret i8 %0 #[no_mangle] pub fn bool_to_byte(b: bool) -> u8 { unsafe { std::mem::transmute(b) } } // CHECK-LABEL: define{{.*}}noundef zeroext i1 @byte_to_bool(i8 noundef %byte) -// CHECK: store i8 %byte, ptr %0 -// CHECK-NEXT: %1 = load i8, {{.*}} %0 -// CHECK-NEXT: %2 = trunc i8 %1 to i1 -// CHECK: ret i1 %2 +// CHECK: %0 = trunc i8 %byte to i1 +// CHECK-NEXT: ret i1 %0 #[no_mangle] pub unsafe fn byte_to_bool(byte: u8) -> bool { std::mem::transmute(byte) } -// CHECK-LABEL: define{{.*}}{{i8\*|ptr}} @ptr_to_ptr({{i16\*|ptr}} noundef %p) -// CHECK: store {{i8\*|ptr}} %{{.*}}, {{.*}} %0 -// CHECK-NEXT: %[[RES:.*]] = load {{i8\*|ptr}}, {{.*}} %0 -// CHECK: ret {{i8\*|ptr}} %[[RES]] +// CHECK-LABEL: define{{.*}}ptr @ptr_to_ptr(ptr noundef %p) +// CHECK: ret ptr %p #[no_mangle] pub fn ptr_to_ptr(p: *mut u16) -> *mut u8 { unsafe { std::mem::transmute(p) } } -// CHECK: define{{.*}}[[USIZE:i[0-9]+]] @ptr_to_int({{i16\*|ptr}} noundef %p) -// CHECK: store {{i16\*|ptr}} %p, {{.*}} -// CHECK-NEXT: %[[RES:.*]] = load [[USIZE]], {{.*}} %0 -// CHECK: ret [[USIZE]] %[[RES]] +// CHECK: define{{.*}}[[USIZE:i[0-9]+]] @ptr_to_int(ptr noundef %p) +// CHECK: %0 = ptrtoint ptr %p to [[USIZE]] +// CHECK-NEXT: ret [[USIZE]] %0 #[no_mangle] pub fn ptr_to_int(p: *mut u16) -> usize { unsafe { std::mem::transmute(p) } } -// CHECK: define{{.*}}{{i16\*|ptr}} @int_to_ptr([[USIZE]] noundef %i) -// CHECK: store [[USIZE]] %i, {{.*}} -// CHECK-NEXT: %[[RES:.*]] = load {{i16\*|ptr}}, {{.*}} %0 -// CHECK: ret {{i16\*|ptr}} %[[RES]] +// CHECK: define{{.*}}ptr @int_to_ptr([[USIZE]] noundef %i) +// CHECK: %0 = inttoptr [[USIZE]] %i to ptr +// CHECK-NEXT: ret ptr %0 #[no_mangle] pub fn int_to_ptr(i: usize) -> *mut u16 { unsafe { std::mem::transmute(i) } diff --git a/tests/codegen/vec-in-place.rs b/tests/codegen/vec-in-place.rs index 9992604221b..d68067ceb19 100644 --- a/tests/codegen/vec-in-place.rs +++ b/tests/codegen/vec-in-place.rs @@ -1,11 +1,13 @@ // ignore-debug: the debug assertions get in the way // compile-flags: -O -Z merge-functions=disabled +// min-llvm-version: 16 #![crate_type = "lib"] // Ensure that trivial casts of vec elements are O(1) pub struct Wrapper<T>(T); +// previously repr(C) caused the optimization to fail #[repr(C)] pub struct Foo { a: u64, @@ -14,9 +16,8 @@ pub struct Foo { d: u64, } -// Going from an aggregate struct to another type currently requires Copy to -// enable the TrustedRandomAccess specialization. Without it optimizations do not yet -// reliably recognize the loops as noop for repr(C) or non-Copy structs. +// implementing Copy exercises the TrustedRandomAccess specialization inside the in-place +// specialization #[derive(Copy, Clone)] pub struct Bar { a: u64, @@ -25,6 +26,14 @@ pub struct Bar { d: u64, } +// this exercises the try-fold codepath +pub struct Baz { + a: u64, + b: u64, + c: u64, + d: u64, +} + // CHECK-LABEL: @vec_iterator_cast_primitive #[no_mangle] pub fn vec_iterator_cast_primitive(vec: Vec<i8>) -> Vec<u8> { @@ -52,18 +61,29 @@ pub fn vec_iterator_cast_unwrap(vec: Vec<Wrapper<u8>>) -> Vec<u8> { // CHECK-LABEL: @vec_iterator_cast_aggregate #[no_mangle] pub fn vec_iterator_cast_aggregate(vec: Vec<[u64; 4]>) -> Vec<Foo> { - // FIXME These checks should be the same as other functions. - // CHECK-NOT: @__rust_alloc - // CHECK-NOT: @__rust_alloc + // CHECK-NOT: loop + // CHECK-NOT: call vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect() } -// CHECK-LABEL: @vec_iterator_cast_deaggregate +// CHECK-LABEL: @vec_iterator_cast_deaggregate_tra #[no_mangle] -pub fn vec_iterator_cast_deaggregate(vec: Vec<Bar>) -> Vec<[u64; 4]> { - // FIXME These checks should be the same as other functions. - // CHECK-NOT: @__rust_alloc - // CHECK-NOT: @__rust_alloc +pub fn vec_iterator_cast_deaggregate_tra(vec: Vec<Bar>) -> Vec<[u64; 4]> { + // CHECK-NOT: loop + // CHECK-NOT: call + + // Safety: For the purpose of this test we assume that Bar layout matches [u64; 4]. + // This currently is not guaranteed for repr(Rust) types, but it happens to work here and + // the UCG may add additional guarantees for homogenous types in the future that would make this + // correct. + vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect() +} + +// CHECK-LABEL: @vec_iterator_cast_deaggregate_fold +#[no_mangle] +pub fn vec_iterator_cast_deaggregate_fold(vec: Vec<Baz>) -> Vec<[u64; 4]> { + // CHECK-NOT: loop + // CHECK-NOT: call // Safety: For the purpose of this test we assume that Bar layout matches [u64; 4]. // This currently is not guaranteed for repr(Rust) types, but it happens to work here and diff --git a/tests/codegen/virtual-function-elimination.rs b/tests/codegen/virtual-function-elimination.rs index 30e5cd0584d..f22176a024f 100644 --- a/tests/codegen/virtual-function-elimination.rs +++ b/tests/codegen/virtual-function-elimination.rs @@ -82,7 +82,7 @@ fn taking_u(u: &dyn U) -> i32 { } pub fn taking_v(v: &dyn V) -> i32 { - // CHECK: @llvm.type.checked.load({{.*}}, i32 24, metadata !"NtCsfRpWlKdQPZn_28virtual_function_elimination1V") + // CHECK: @llvm.type.checked.load({{.*}}, i32 24, metadata !"NtCs64ITQYi9761_28virtual_function_elimination1V") v.public_function() } @@ -97,5 +97,5 @@ pub fn main() { // CHECK: ![[TYPE0]] = !{i64 0, !"[[MANGLED_TYPE0]]"} // CHECK: ![[VCALL_VIS0]] = !{i64 2} // CHECK: ![[TYPE1]] = !{i64 0, !"[[MANGLED_TYPE1]]"} -// CHECK: ![[TYPE2]] = !{i64 0, !"NtCsfRpWlKdQPZn_28virtual_function_elimination1V"} +// CHECK: ![[TYPE2]] = !{i64 0, !"NtCs64ITQYi9761_28virtual_function_elimination1V"} // CHECK: ![[VCALL_VIS2]] = !{i64 1} diff --git a/tests/debuginfo/function-names.rs b/tests/debuginfo/function-names.rs index 2227de3b377..d9aa03fee62 100644 --- a/tests/debuginfo/function-names.rs +++ b/tests/debuginfo/function-names.rs @@ -37,7 +37,7 @@ // Const generic parameter // gdb-command:info functions -q function_names::const_generic_fn.* // gdb-check:[...]static fn function_names::const_generic_fn_bool<false>(); -// gdb-check:[...]static fn function_names::const_generic_fn_non_int<{CONST#6348c650c7b26618}>(); +// gdb-check:[...]static fn function_names::const_generic_fn_non_int<{CONST#ad91263f6d2dd96e}>(); // gdb-check:[...]static fn function_names::const_generic_fn_signed_int<-7>(); // gdb-check:[...]static fn function_names::const_generic_fn_unsigned_int<14>(); @@ -76,9 +76,9 @@ // Const generic parameter // cdb-command:x a!function_names::const_generic_fn* // cdb-check:[...] a!function_names::const_generic_fn_bool<false> (void) +// cdb-check:[...] a!function_names::const_generic_fn_non_int<CONST$ad91263f6d2dd96e> (void) // cdb-check:[...] a!function_names::const_generic_fn_unsigned_int<14> (void) // cdb-check:[...] a!function_names::const_generic_fn_signed_int<-7> (void) -// cdb-check:[...] a!function_names::const_generic_fn_non_int<CONST$6348c650c7b26618> (void) #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir index 5f8b2f9312b..b1d34a1962e 100644 --- a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir @@ -1,36 +1,36 @@ // MIR for `address_of_reborrow` after SimplifyCfg-initial | User Type Annotations -| 0: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:7:5: 7:18, inferred_ty: *const [i32; 10] -| 1: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:9:5: 9:25, inferred_ty: *const dyn std::marker::Send -| 2: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10] -| 3: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10] -| 4: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10] -| 5: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10] -| 6: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send -| 7: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send -| 8: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32] -| 9: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32] -| 10: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:18:5: 18:18, inferred_ty: *const [i32; 10] -| 11: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:20:5: 20:25, inferred_ty: *const dyn std::marker::Send -| 12: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10] -| 13: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10] -| 14: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10] -| 15: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10] -| 16: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send -| 17: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send -| 18: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32] -| 19: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32] -| 20: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*mut ^0) }, span: $DIR/address_of.rs:28:5: 28:16, inferred_ty: *mut [i32; 10] -| 21: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*mut dyn std::marker::Send) }, span: $DIR/address_of.rs:30:5: 30:23, inferred_ty: *mut dyn std::marker::Send -| 22: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*mut ^0) }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10] -| 23: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*mut ^0) }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10] -| 24: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32; 10]) }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10] -| 25: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32; 10]) }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10] -| 26: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*mut dyn std::marker::Send) }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send -| 27: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*mut dyn std::marker::Send) }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send -| 28: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32]) }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32] -| 29: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32]) }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32] +| 0: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:7:5: 7:18, inferred_ty: *const [i32; 10] +| 1: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:9:5: 9:25, inferred_ty: *const dyn std::marker::Send +| 2: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10] +| 3: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10] +| 4: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10] +| 5: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10] +| 6: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send +| 7: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send +| 8: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32] +| 9: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32] +| 10: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:18:5: 18:18, inferred_ty: *const [i32; 10] +| 11: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:20:5: 20:25, inferred_ty: *const dyn std::marker::Send +| 12: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10] +| 13: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10] +| 14: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10] +| 15: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10] +| 16: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send +| 17: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send +| 18: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32] +| 19: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32] +| 20: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:28:5: 28:16, inferred_ty: *mut [i32; 10] +| 21: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:30:5: 30:23, inferred_ty: *mut dyn std::marker::Send +| 22: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10] +| 23: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10] +| 24: user_ty: Canonical { value: Ty(*mut [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10] +| 25: user_ty: Canonical { value: Ty(*mut [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10] +| 26: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send +| 27: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send +| 28: user_ty: Canonical { value: Ty(*mut [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32] +| 29: user_ty: Canonical { value: Ty(*mut [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32] | fn address_of_reborrow() -> () { let mut _0: (); // return place in scope 0 at $DIR/address_of.rs:+0:26: +0:26 diff --git a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir index f20b534259a..6d1c7bd18dc 100644 --- a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir @@ -1,8 +1,8 @@ // MIR for `main` after SimplifyCfg-initial | User Type Annotations -| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<std::boxed::Box<u32>>) }, span: $DIR/basic_assignment.rs:20:17: 20:33, inferred_ty: std::option::Option<std::boxed::Box<u32>> -| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<std::boxed::Box<u32>>) }, span: $DIR/basic_assignment.rs:20:17: 20:33, inferred_ty: std::option::Option<std::boxed::Box<u32>> +| 0: user_ty: Canonical { value: Ty(std::option::Option<std::boxed::Box<u32>>), max_universe: U0, variables: [] }, span: $DIR/basic_assignment.rs:20:17: 20:33, inferred_ty: std::option::Option<std::boxed::Box<u32>> +| 1: user_ty: Canonical { value: Ty(std::option::Option<std::boxed::Box<u32>>), max_universe: U0, variables: [] }, span: $DIR/basic_assignment.rs:20:17: 20:33, inferred_ty: std::option::Option<std::boxed::Box<u32>> | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/basic_assignment.rs:+0:11: +0:11 diff --git a/tests/mir-opt/building/issue_101867.main.built.after.mir b/tests/mir-opt/building/issue_101867.main.built.after.mir index 628a33f1020..44c25ce673b 100644 --- a/tests/mir-opt/building/issue_101867.main.built.after.mir +++ b/tests/mir-opt/building/issue_101867.main.built.after.mir @@ -1,8 +1,8 @@ // MIR for `main` after built | User Type Annotations -| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<u8>) }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8> -| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<u8>) }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8> +| 0: user_ty: Canonical { value: Ty(std::option::Option<u8>), max_universe: U0, variables: [] }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8> +| 1: user_ty: Canonical { value: Ty(std::option::Option<u8>), max_universe: U0, variables: [] }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8> | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/issue_101867.rs:+0:11: +0:11 diff --git a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir index 41eb00363bd..7a6944dee03 100644 --- a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir +++ b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir @@ -1,10 +1,10 @@ // MIR for `main` after built | User Type Annotations -| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test -| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test -| 2: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: Ty(&&&&*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test -| 3: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: Ty(&&&&*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test +| 0: user_ty: Canonical { value: Ty(*mut Test), max_universe: U0, variables: [] }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test +| 1: user_ty: Canonical { value: Ty(*mut Test), max_universe: U0, variables: [] }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test +| 2: user_ty: Canonical { value: Ty(&&&&*mut Test), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test +| 3: user_ty: Canonical { value: Ty(&&&&*mut Test), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/receiver_ptr_mutability.rs:+0:11: +0:11 diff --git a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir index fff8d017127..1d2f99cbe68 100644 --- a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir @@ -23,7 +23,7 @@ fn foo(_1: T, _2: i32) -> i32 { StorageLive(_3); // scope 0 at $DIR/inline_closure.rs:+1:9: +1:10 _3 = [closure@foo::<T>::{closure#0}]; // scope 0 at $DIR/inline_closure.rs:+1:13: +1:24 // closure - // + def_id: DefId(0:6 ~ inline_closure[92ba]::foo::{closure#0}) + // + def_id: DefId(0:6 ~ inline_closure[8f32]::foo::{closure#0}) // + substs: [ // T, // i8, diff --git a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir index dab2043064f..80274bb7e7e 100644 --- a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir @@ -26,7 +26,7 @@ fn foo(_1: T, _2: &i32) -> i32 { StorageLive(_3); // scope 0 at $DIR/inline_closure_borrows_arg.rs:+1:9: +1:10 _3 = [closure@foo::<T>::{closure#0}]; // scope 0 at $DIR/inline_closure_borrows_arg.rs:+1:13: +4:6 // closure - // + def_id: DefId(0:6 ~ inline_closure_borrows_arg[96e9]::foo::{closure#0}) + // + def_id: DefId(0:6 ~ inline_closure_borrows_arg[f89f]::foo::{closure#0}) // + substs: [ // T, // i8, diff --git a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir index 84fd051e0a3..b36711f82f4 100644 --- a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir @@ -32,7 +32,7 @@ fn foo(_1: T, _2: i32) -> (i32, T) { _5 = &_1; // scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24 _3 = [closure@foo::<T>::{closure#0}] { q: move _4, t: move _5 }; // scope 0 at $DIR/inline_closure_captures.rs:+1:13: +1:24 // closure - // + def_id: DefId(0:6 ~ inline_closure_captures[8bc0]::foo::{closure#0}) + // + def_id: DefId(0:6 ~ inline_closure_captures[63a5]::foo::{closure#0}) // + substs: [ // T, // i8, diff --git a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff index 52debab4dd1..04de3e61e5f 100644 --- a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff +++ b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff @@ -6,21 +6,18 @@ let _1: (); // in scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 + scope 1 (inlined <C as Call>::call) { // at $DIR/inline_cycle_generic.rs:9:5: 9:24 + scope 2 (inlined <B<A> as Call>::call) { // at $DIR/inline_cycle_generic.rs:38:9: 38:31 -+ scope 3 (inlined <A as Call>::call) { // at $DIR/inline_cycle_generic.rs:31:9: 31:28 -+ scope 4 (inlined <B<C> as Call>::call) { // at $DIR/inline_cycle_generic.rs:23:9: 23:31 -+ } -+ } + } + } bb0: { StorageLive(_1); // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 - _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 -+ _1 = <C as Call>::call() -> bb1; // scope 4 at $DIR/inline_cycle_generic.rs:31:9: 31:28 ++ _1 = <A as Call>::call() -> bb1; // scope 2 at $DIR/inline_cycle_generic.rs:31:9: 31:28 // mir::Constant - // + span: $DIR/inline_cycle_generic.rs:9:5: 9:22 +- // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) } + // + span: $DIR/inline_cycle_generic.rs:31:9: 31:26 - // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) } ++ // + literal: Const { ty: fn() {<A as Call>::call}, val: Value(<ZST>) } } bb1: { diff --git a/tests/mir-opt/inline/inline_generator.main.Inline.diff b/tests/mir-opt/inline/inline_generator.main.Inline.diff index 01f5052b652..c3ca2d7d42c 100644 --- a/tests/mir-opt/inline/inline_generator.main.Inline.diff +++ b/tests/mir-opt/inline/inline_generator.main.Inline.diff @@ -44,7 +44,7 @@ - bb1: { + _4 = [generator@$DIR/inline_generator.rs:15:5: 15:8 (#0)]; // scope 2 at $DIR/inline_generator.rs:15:5: 15:41 + // generator -+ // + def_id: DefId(0:7 ~ inline_generator[ea31]::g::{closure#0}) ++ // + def_id: DefId(0:7 ~ inline_generator[e37e]::g::{closure#0}) + // + substs: [ + // bool, + // i32, diff --git a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir index a98c294cacb..1da3c8bb797 100644 --- a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir +++ b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir @@ -21,7 +21,7 @@ fn main() -> () { StorageLive(_1); // scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:9: +1:10 _1 = [closure@$DIR/issue_76997_inline_scopes_parenting.rs:5:13: 5:16]; // scope 0 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:13: +1:33 // closure - // + def_id: DefId(0:4 ~ issue_76997_inline_scopes_parenting[bc59]::main::{closure#0}) + // + def_id: DefId(0:4 ~ issue_76997_inline_scopes_parenting[5cd2]::main::{closure#0}) // + substs: [ // i8, // extern "rust-call" fn(((),)), diff --git a/tests/mir-opt/issue_72181_1.main.built.after.mir b/tests/mir-opt/issue_72181_1.main.built.after.mir index 2172f3aa9e2..e1d896cbcfb 100644 --- a/tests/mir-opt/issue_72181_1.main.built.after.mir +++ b/tests/mir-opt/issue_72181_1.main.built.after.mir @@ -1,8 +1,8 @@ // MIR for `main` after built | User Type Annotations -| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(Void) }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void -| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(Void) }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void +| 0: user_ty: Canonical { value: Ty(Void), max_universe: U0, variables: [] }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void +| 1: user_ty: Canonical { value: Ty(Void), max_universe: U0, variables: [] }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/issue_72181_1.rs:+0:11: +0:11 diff --git a/tests/mir-opt/issue_99325.main.built.after.mir b/tests/mir-opt/issue_99325.main.built.after.mir index 3e035c18db8..2324f53566c 100644 --- a/tests/mir-opt/issue_99325.main.built.after.mir +++ b/tests/mir-opt/issue_99325.main.built.after.mir @@ -1,8 +1,8 @@ // MIR for `main` after built | User Type Annotations -| 0: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Value(Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)])) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} -| 1: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Unevaluated(UnevaluatedConst { def: WithOptConstParam { did: DefId(0:8 ~ issue_99325[8f58]::main::{constant#1}), const_param_did: Some(DefId(0:4 ~ issue_99325[8f58]::function_with_bytes::BYTES)) }, substs: [] }) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Value(Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)])) }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Unevaluated(UnevaluatedConst { def: WithOptConstParam { did: DefId(0:8 ~ issue_99325[22bb]::main::{constant#1}), const_param_did: Some(DefId(0:4 ~ issue_99325[22bb]::function_with_bytes::BYTES)) }, substs: [] }) }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/issue_99325.rs:+0:15: +0:15 diff --git a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir index d7b6d64b6b7..2eb2a0980ce 100644 --- a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir @@ -108,7 +108,7 @@ fn main() -> () { StorageLive(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6 _14 = [closure@main::{closure#0}]; // scope 1 at $DIR/retag.rs:+11:31: +14:6 // closure - // + def_id: DefId(0:14 ~ retag[4622]::main::{closure#0}) + // + def_id: DefId(0:14 ~ retag[7654]::main::{closure#0}) // + substs: [ // i8, // for<'a> extern "rust-call" fn((&'a i32,)) -> &'a i32, diff --git a/tests/run-make/static-pie/Makefile b/tests/run-make/static-pie/Makefile index 19c041d9428..8379730cc3d 100644 --- a/tests/run-make/static-pie/Makefile +++ b/tests/run-make/static-pie/Makefile @@ -2,7 +2,7 @@ include ../tools.mk # only-x86_64 # only-linux -# ignore-gnux32 +# ignore-32bit # How to manually run this # $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie diff --git a/tests/run-make/use-extern-for-plugins/Makefile b/tests/run-make/use-extern-for-plugins/Makefile index 6ae53afad20..b8ec7e8dcda 100644 --- a/tests/run-make/use-extern-for-plugins/Makefile +++ b/tests/run-make/use-extern-for-plugins/Makefile @@ -2,7 +2,7 @@ include ../tools.mk # ignore-freebsd # ignore-openbsd -# ignore-sunos +# ignore-solaris HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //') ifeq ($(findstring i686,$(HOST)),i686) diff --git a/tests/run-make/valid-print-requests/valid-print-requests.stderr b/tests/run-make/valid-print-requests/valid-print-requests.stderr index 5191e467648..bea6ce067f6 100644 --- a/tests/run-make/valid-print-requests/valid-print-requests.stderr +++ b/tests/run-make/valid-print-requests/valid-print-requests.stderr @@ -1,2 +1,2 @@ -error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `link-args`, `split-debuginfo` +error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `all-target-specs-json`, `link-args`, `split-debuginfo` diff --git a/tests/rustdoc-gui/huge-logo.goml b/tests/rustdoc-gui/huge-logo.goml index 01f06771c15..69459bd3e23 100644 --- a/tests/rustdoc-gui/huge-logo.goml +++ b/tests/rustdoc-gui/huge-logo.goml @@ -18,4 +18,6 @@ size: (1280, 1024) assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60}) size: (400, 600) -assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 35}) +// 43 because 35px + 8px of margin +assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"}) +assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 43}) diff --git a/tests/rustdoc-gui/source-code-page-code-scroll.goml b/tests/rustdoc-gui/source-code-page-code-scroll.goml new file mode 100644 index 00000000000..42f1da749e9 --- /dev/null +++ b/tests/rustdoc-gui/source-code-page-code-scroll.goml @@ -0,0 +1,8 @@ +// Checks that the scrollbar is visible on the page rather than the code block. +goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" +size: (800, 1000) +// "scrollWidth" should be superior than "clientWidth". +assert-property: ("body", {"scrollWidth": 1047, "clientWidth": 800}) + +// Both properties should be equal (ie, no scroll on the code block). +assert-property: (".example-wrap .rust", {"scrollWidth": 933, "clientWidth": 933}) diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml index 7c35119e695..ea6ff12328c 100644 --- a/tests/rustdoc-gui/source-code-page.goml +++ b/tests/rustdoc-gui/source-code-page.goml @@ -216,3 +216,8 @@ call-function: ("check-sidebar-dir-entry", { "x": 0, "y": |source_sidebar_title_y| + |source_sidebar_title_height| + 6, }) + +// Now we check that the logo has a bottom margin so it's not stuck to the search input. +assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"}) +store-property: (logo_height, ".sub-logo-container", "clientHeight") +assert-position: (".search-form", {"y": |logo_height| + 8}) diff --git a/tests/rustdoc-ui/c-help.stdout b/tests/rustdoc-ui/c-help.stdout index 75b2e2a2a43..0bd2d73efee 100644 --- a/tests/rustdoc-ui/c-help.stdout +++ b/tests/rustdoc-ui/c-help.stdout @@ -3,7 +3,7 @@ -C codegen-units=val -- divide crate into N units to optimize in parallel -C control-flow-guard=val -- use Windows Control Flow Guard (default: no) -C debug-assertions=val -- explicitly enable the `cfg(debug_assertions)` directive - -C debuginfo=val -- debug info emission level (0 = no debug info, 1 = line tables only, 2 = full debug info with variable and type information; default: 0) + -C debuginfo=val -- debug info emission level (0-2, none, line-directives-only, line-tables-only, limited, or full; default: 0) -C default-linker-libraries=val -- allow the linker to link its default libraries (default: no) -C embed-bitcode=val -- emit bitcode in rlibs (default: yes) -C extra-filename=val -- extra data to put in each output filename diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr index 084aefc97c8..ed89fa8391d 100644 --- a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr +++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr @@ -33,21 +33,6 @@ help: to link to the associated type, prefix with `type@` LL | /// [`type@Self::IDENT2`] | +++++ -error: `Self::IDENT2` is both an associated constant and an associated type - --> $DIR/issue-108653-associated-items.rs:30:7 - | -LL | /// [`Self::IDENT2`] - | ^^^^^^^^^^^^ ambiguous link - | -help: to link to the associated constant, prefix with `const@` - | -LL | /// [`const@Self::IDENT2`] - | ++++++ -help: to link to the associated type, prefix with `type@` - | -LL | /// [`type@Self::IDENT2`] - | +++++ - error: `Self::IDENT` is both an associated function and a variant --> $DIR/issue-108653-associated-items.rs:16:7 | @@ -63,5 +48,20 @@ help: to link to the variant, prefix with `type@` LL | /// [`type@Self::IDENT`] | +++++ +error: `Self::IDENT2` is both an associated constant and an associated type + --> $DIR/issue-108653-associated-items.rs:30:7 + | +LL | /// [`Self::IDENT2`] + | ^^^^^^^^^^^^ ambiguous link + | +help: to link to the associated constant, prefix with `const@` + | +LL | /// [`const@Self::IDENT2`] + | ++++++ +help: to link to the associated type, prefix with `type@` + | +LL | /// [`type@Self::IDENT2`] + | +++++ + error: aborting due to 4 previous errors diff --git a/tests/rustdoc/async-fn-opaque-item.rs b/tests/rustdoc/async-fn-opaque-item.rs new file mode 100644 index 00000000000..a73e84f3fdc --- /dev/null +++ b/tests/rustdoc/async-fn-opaque-item.rs @@ -0,0 +1,15 @@ +// compile-flags: --document-private-items --crate-type=lib +// edition: 2021 + +// Issue 109931 -- test against accidentally documenting the `impl Future` +// that comes from an async fn desugaring. + +// Check that we don't document an unnamed opaque type +// @!has async_fn_opaque_item/opaque..html + +// Checking there is only a "Functions" header and no "Opaque types". +// @has async_fn_opaque_item/index.html +// @count - '//*[@class="small-section-header"]' 1 +// @has - '//*[@class="small-section-header"]' 'Functions' + +pub async fn test() {} diff --git a/tests/rustdoc/generic-associated-types/issue-109488.rs b/tests/rustdoc/generic-associated-types/issue-109488.rs new file mode 100644 index 00000000000..99ae8a6c36c --- /dev/null +++ b/tests/rustdoc/generic-associated-types/issue-109488.rs @@ -0,0 +1,18 @@ +// Make sure that we escape the arguments of the GAT projection even if we fail to compute +// the href of the corresponding trait (in this case it is private). +// Further, test that we also linkify the GAT arguments. + +// @has 'issue_109488/type.A.html' +// @has - '//pre[@class="rust item-decl"]' '<S as Tr>::P<Option<i32>>' +// @has - '//pre[@class="rust item-decl"]//a[@class="enum"]/@href' '{{channel}}/core/option/enum.Option.html' +pub type A = <S as Tr>::P<Option<i32>>; + +/*private*/ trait Tr { + type P<T>; +} + +pub struct S; + +impl Tr for S { + type P<T> = (); +} diff --git a/tests/rustdoc/issue-25001.rs b/tests/rustdoc/issue-25001.rs index c97b35adaf2..268fae59496 100644 --- a/tests/rustdoc/issue-25001.rs +++ b/tests/rustdoc/issue-25001.rs @@ -21,14 +21,14 @@ impl Foo<u32> { } impl<T> Bar for Foo<T> { - // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' 'type Item = T' + // @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' 'type Item = T' type Item=T; // @has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)' fn quux(self) {} } impl<'a, T> Bar for &'a Foo<T> { - // @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' "type Item = &'a T" + // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item = &'a T" type Item=&'a T; // @has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)' diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/stable-mir/crate-info.rs index 99b653f20b6..03dab235040 100644 --- a/tests/ui-fulldeps/stable-mir/crate-info.rs +++ b/tests/ui-fulldeps/stable-mir/crate-info.rs @@ -1,7 +1,7 @@ // run-pass // Test that users are able to use stable mir APIs to retrieve information of the current crate -// ignore-stage-1 +// ignore-stage1 // ignore-cross-compile // ignore-remote // edition: 2021 diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs index a455eef42ea..039507d5104 100644 --- a/tests/ui/abi/stack-probes-lto.rs +++ b/tests/ui/abi/stack-probes-lto.rs @@ -9,7 +9,6 @@ // ignore-emscripten no processes // ignore-sgx no processes // ignore-musl FIXME #31506 -// ignore-pretty // ignore-fuchsia no exception handler registered for segfault // compile-flags: -C lto // no-prefer-dynamic diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs index 75aa25906aa..2f9a1d1c76e 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs @@ -10,11 +10,13 @@ trait Trait { fn foo<T: Trait<method(i32): Send>>() {} //~^ ERROR argument types not allowed with return type notation +//~| ERROR associated type bounds are unstable fn bar<T: Trait<method(..) -> (): Send>>() {} //~^ ERROR return type not allowed with return type notation fn baz<T: Trait<method(): Send>>() {} //~^ ERROR return type notation arguments must be elided with `..` +//~| ERROR associated type bounds are unstable fn main() {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr index 5b075a0fa29..b354a6805d6 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr @@ -1,9 +1,27 @@ error: return type not allowed with return type notation - --> $DIR/bad-inputs-and-output.rs:14:28 + --> $DIR/bad-inputs-and-output.rs:15:28 | LL | fn bar<T: Trait<method(..) -> (): Send>>() {} | ^^^^^ help: remove the return type +error[E0658]: associated type bounds are unstable + --> $DIR/bad-inputs-and-output.rs:11:17 + | +LL | fn foo<T: Trait<method(i32): Send>>() {} + | ^^^^^^^^^^^^^^^^^ + | + = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information + = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable + +error[E0658]: associated type bounds are unstable + --> $DIR/bad-inputs-and-output.rs:18:17 + | +LL | fn baz<T: Trait<method(): Send>>() {} + | ^^^^^^^^^^^^^^ + | + = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information + = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable + warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/bad-inputs-and-output.rs:3:12 | @@ -28,10 +46,11 @@ LL | fn foo<T: Trait<method(i32): Send>>() {} | ^^^^^ help: remove the input types: `(..)` error: return type notation arguments must be elided with `..` - --> $DIR/bad-inputs-and-output.rs:17:23 + --> $DIR/bad-inputs-and-output.rs:18:23 | LL | fn baz<T: Trait<method(): Send>>() {} | ^^ help: add `..`: `(..)` -error: aborting due to 3 previous errors; 2 warnings emitted +error: aborting due to 5 previous errors; 2 warnings emitted +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs new file mode 100644 index 00000000000..9129f37e0c6 --- /dev/null +++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs @@ -0,0 +1,11 @@ +// edition: 2021 +// compile-flags: -Zunpretty=expanded + +trait Trait { + async fn method() {} +} + +fn foo<T: Trait<method(i32): Send>>() {} +//~^ ERROR associated type bounds are unstable + +fn main() {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr new file mode 100644 index 00000000000..77e015b4160 --- /dev/null +++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr @@ -0,0 +1,12 @@ +error[E0658]: associated type bounds are unstable + --> $DIR/unpretty-parenthesized.rs:8:17 + | +LL | fn foo<T: Trait<method(i32): Send>>() {} + | ^^^^^^^^^^^^^^^^^ + | + = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information + = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout new file mode 100644 index 00000000000..b3dea8f6eca --- /dev/null +++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout @@ -0,0 +1,15 @@ +#![feature(prelude_import)] +#[prelude_import] +use std::prelude::rust_2021::*; +#[macro_use] +extern crate std; +// edition: 2021 +// compile-flags: -Zunpretty=expanded + +trait Trait { + async fn method() {} +} + +fn foo<T: Trait<method(i32) : Send>>() {} + +fn main() {} diff --git a/tests/ui/async-await/missed-capture-issue-107414.rs b/tests/ui/async-await/missed-capture-issue-107414.rs new file mode 100644 index 00000000000..0ab4f5ade98 --- /dev/null +++ b/tests/ui/async-await/missed-capture-issue-107414.rs @@ -0,0 +1,24 @@ +// check-pass +// edition:2018 + +fn main() {} + +struct StructA {} +struct StructB {} + +impl StructA { + fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool { + true + } +} + +async fn get_struct_a_async() -> StructA { + StructA {} +} + +async fn ice() { + match Some(StructB {}) { + Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {} + _ => {} + } +} diff --git a/tests/ui/attributes/issue-105594-invalid-attr-validation.rs b/tests/ui/attributes/issue-105594-invalid-attr-validation.rs index 6c68e6b046f..096ce97ab04 100644 --- a/tests/ui/attributes/issue-105594-invalid-attr-validation.rs +++ b/tests/ui/attributes/issue-105594-invalid-attr-validation.rs @@ -1,7 +1,7 @@ // This checks that the attribute validation ICE in issue #105594 doesn't // recur. // -// ignore-thumbv8m.base +// ignore-thumbv8m.base-none-eabi #![feature(cmse_nonsecure_entry)] fn main() {} diff --git a/tests/ui/binding/optional_comma_in_match_arm.rs b/tests/ui/binding/optional_comma_in_match_arm.rs index fc268bf2a45..71e2f07bb6b 100644 --- a/tests/ui/binding/optional_comma_in_match_arm.rs +++ b/tests/ui/binding/optional_comma_in_match_arm.rs @@ -1,6 +1,5 @@ // run-pass #![allow(unused_unsafe)] -// ignore-pretty issue #37199 #![allow(while_true)] fn main() { diff --git a/tests/ui/borrowck/borrowck-pat-enum.rs b/tests/ui/borrowck/borrowck-pat-enum.rs index 7f9c5544d0b..6e51a2b2e02 100644 --- a/tests/ui/borrowck/borrowck-pat-enum.rs +++ b/tests/ui/borrowck/borrowck-pat-enum.rs @@ -1,6 +1,5 @@ // run-pass #![allow(dead_code)] -// ignore-pretty issue #37199 fn match_ref(v: Option<isize>) -> isize { match v { diff --git a/tests/ui/command/command-exec.rs b/tests/ui/command/command-exec.rs index 032dad1840d..edc33446d79 100644 --- a/tests/ui/command/command-exec.rs +++ b/tests/ui/command/command-exec.rs @@ -2,7 +2,6 @@ #![allow(stable_features)] // ignore-windows - this is a unix-specific test -// ignore-pretty issue #37199 // ignore-emscripten no processes // ignore-sgx no processes // ignore-fuchsia no execvp syscall provided diff --git a/tests/ui/const_prop/issue-86351.rs b/tests/ui/const_prop/issue-86351.rs new file mode 100644 index 00000000000..b5f1e7f7449 --- /dev/null +++ b/tests/ui/const_prop/issue-86351.rs @@ -0,0 +1,22 @@ +// compile-flags: --crate-type=lib -Zmir-opt-level=2 +// build-pass +// ^-- Must be build-pass, because check-pass will not run const prop. + +pub trait TestTrait { + type MyType; + fn func() -> Option<Self> + where + Self: Sized; +} + +impl<T> dyn TestTrait<MyType = T> +where + Self: Sized, +{ + pub fn other_func() -> Option<Self> { + match Self::func() { + Some(me) => Some(me), + None => None, + } + } +} diff --git a/tests/ui/const_prop/unreachable-bounds.rs b/tests/ui/const_prop/unreachable-bounds.rs new file mode 100644 index 00000000000..8cf98e154ea --- /dev/null +++ b/tests/ui/const_prop/unreachable-bounds.rs @@ -0,0 +1,6 @@ +// Use `build-pass` to ensure const-prop lint runs. +// build-pass + +fn main() { + [()][if false { 1 } else { return }] +} diff --git a/tests/ui/const_prop/unreachable-overflow.rs b/tests/ui/const_prop/unreachable-overflow.rs new file mode 100644 index 00000000000..2875135424d --- /dev/null +++ b/tests/ui/const_prop/unreachable-overflow.rs @@ -0,0 +1,10 @@ +// Use `build-pass` to ensure const-prop lint runs. +// build-pass + +fn main() { + let x = 2u32; + let y = 3u32; + if y <= x { + dbg!(x - y); + } +} diff --git a/tests/ui/consts/miri_unleashed/tls.stderr b/tests/ui/consts/miri_unleashed/tls.stderr index 7aaeadd0403..ec24527d6c0 100644 --- a/tests/ui/consts/miri_unleashed/tls.stderr +++ b/tests/ui/consts/miri_unleashed/tls.stderr @@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer --> $DIR/tls.rs:11:25 | LL | unsafe { let _val = A; } - | ^ cannot access thread local static (DefId(0:4 ~ tls[78b0]::A)) + | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A)) error[E0080]: could not evaluate static initializer --> $DIR/tls.rs:18:26 | LL | unsafe { let _val = &A; } - | ^ cannot access thread local static (DefId(0:4 ~ tls[78b0]::A)) + | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A)) warning: skipping const checks | diff --git a/tests/ui/dyn-star/const-and-static.rs b/tests/ui/dyn-star/const-and-static.rs new file mode 100644 index 00000000000..551b072abfa --- /dev/null +++ b/tests/ui/dyn-star/const-and-static.rs @@ -0,0 +1,10 @@ +// check-pass + +#![feature(dyn_star)] +//~^ WARN the feature `dyn_star` is incomplete + +const C: dyn* Send + Sync = &(); + +static S: dyn* Send + Sync = &(); + +fn main() {} diff --git a/tests/ui/dyn-star/const-and-static.stderr b/tests/ui/dyn-star/const-and-static.stderr new file mode 100644 index 00000000000..df8f42fb0f5 --- /dev/null +++ b/tests/ui/dyn-star/const-and-static.stderr @@ -0,0 +1,11 @@ +warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-and-static.rs:3:12 + | +LL | #![feature(dyn_star)] + | ^^^^^^^^ + | + = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs b/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs new file mode 100644 index 00000000000..eec7da044c0 --- /dev/null +++ b/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs @@ -0,0 +1,10 @@ +// check-pass +trait MyCmp { + fn cmp(&self) {} +} +impl MyCmp for f32 {} + +fn main() { + // Ensure that `impl<F: FnPtr> Ord for F` is never considered for int and float infer vars. + 0.0.cmp(); +} diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr index 7d0a201699b..429b202f603 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr +++ b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr @@ -10,7 +10,7 @@ note: generator is not `Send` as this value is used across a yield --> $DIR/generator-print-verbose-1.rs:38:9 | LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send` + | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send` LL | yield; | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later LL | }; @@ -37,17 +37,17 @@ note: required because it's used within this generator | LL | || { | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])` +note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])` --> $DIR/generator-print-verbose-1.rs:44:30 | LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])` +note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` --> $DIR/generator-print-verbose-1.rs:50:34 | LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()` + = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`, `()` note: required because it's used within this generator --> $DIR/generator-print-verbose-1.rs:55:20 | diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr index c045b1441c1..01a30fd2f4e 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr +++ b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr @@ -10,7 +10,7 @@ note: generator is not `Send` as this value is used across a yield --> $DIR/generator-print-verbose-1.rs:38:9 | LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send` + | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send` LL | yield; | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later note: required by a bound in `require_send` @@ -33,17 +33,17 @@ note: required because it's used within this generator | LL | || { | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])` +note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])` --> $DIR/generator-print-verbose-1.rs:44:30 | LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])` +note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` --> $DIR/generator-print-verbose-1.rs:50:34 | LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])` + = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` note: required because it's used within this generator --> $DIR/generator-print-verbose-1.rs:55:20 | diff --git a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr index 7d0a201699b..429b202f603 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr +++ b/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr @@ -10,7 +10,7 @@ note: generator is not `Send` as this value is used across a yield --> $DIR/generator-print-verbose-1.rs:38:9 | LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send` + | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send` LL | yield; | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later LL | }; @@ -37,17 +37,17 @@ note: required because it's used within this generator | LL | || { | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])` +note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])` --> $DIR/generator-print-verbose-1.rs:44:30 | LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])` +note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` --> $DIR/generator-print-verbose-1.rs:50:34 | LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()` + = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`, `()` note: required because it's used within this generator --> $DIR/generator-print-verbose-1.rs:55:20 | diff --git a/tests/ui/hygiene/arguments.rs b/tests/ui/hygiene/arguments.rs index f0f732f4c6f..ab58301d468 100644 --- a/tests/ui/hygiene/arguments.rs +++ b/tests/ui/hygiene/arguments.rs @@ -1,5 +1,3 @@ -// ignore-pretty pretty-printing is unhygienic - #![feature(decl_macro)] macro m($t:ty, $e:expr) { diff --git a/tests/ui/hygiene/arguments.stderr b/tests/ui/hygiene/arguments.stderr index d072086e086..714178375f2 100644 --- a/tests/ui/hygiene/arguments.stderr +++ b/tests/ui/hygiene/arguments.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `S` in this scope - --> $DIR/arguments.rs:16:8 + --> $DIR/arguments.rs:14:8 | LL | m!(S, S); | ^ not found in this scope diff --git a/tests/ui/hygiene/assoc_item_ctxt.rs b/tests/ui/hygiene/assoc_item_ctxt.rs index 65593d1d560..f09f81a5d52 100644 --- a/tests/ui/hygiene/assoc_item_ctxt.rs +++ b/tests/ui/hygiene/assoc_item_ctxt.rs @@ -1,5 +1,3 @@ -// ignore-pretty pretty-printing is unhygienic - #![feature(decl_macro)] #![allow(unused)] diff --git a/tests/ui/hygiene/assoc_item_ctxt.stderr b/tests/ui/hygiene/assoc_item_ctxt.stderr index d65716ec2ce..effa9e8d655 100644 --- a/tests/ui/hygiene/assoc_item_ctxt.stderr +++ b/tests/ui/hygiene/assoc_item_ctxt.stderr @@ -1,5 +1,5 @@ error[E0407]: method `method` is not a member of trait `Tr` - --> $DIR/assoc_item_ctxt.rs:35:13 + --> $DIR/assoc_item_ctxt.rs:33:13 | LL | fn method() {} | ^^^------^^^^^ @@ -13,7 +13,7 @@ LL | mac_trait_impl!(); = note: this error originates in the macro `mac_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0046]: not all trait items implemented, missing: `method` - --> $DIR/assoc_item_ctxt.rs:34:9 + --> $DIR/assoc_item_ctxt.rs:32:9 | LL | fn method(); | ------------ `method` from trait diff --git a/tests/ui/hygiene/assoc_ty_bindings.rs b/tests/ui/hygiene/assoc_ty_bindings.rs index 0567beab9b9..a7861274932 100644 --- a/tests/ui/hygiene/assoc_ty_bindings.rs +++ b/tests/ui/hygiene/assoc_ty_bindings.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro, associated_type_defaults)] diff --git a/tests/ui/hygiene/auxiliary/legacy_interaction.rs b/tests/ui/hygiene/auxiliary/legacy_interaction.rs index 90d5243b74b..3293e346dad 100644 --- a/tests/ui/hygiene/auxiliary/legacy_interaction.rs +++ b/tests/ui/hygiene/auxiliary/legacy_interaction.rs @@ -1,5 +1,3 @@ -// ignore-pretty pretty-printing is unhygienic - #[macro_export] macro_rules! m { () => { diff --git a/tests/ui/hygiene/fields.rs b/tests/ui/hygiene/fields.rs index 7a417b46fcc..86b3d8151d0 100644 --- a/tests/ui/hygiene/fields.rs +++ b/tests/ui/hygiene/fields.rs @@ -1,5 +1,3 @@ -// ignore-pretty pretty-printing is unhygienic - #![feature(decl_macro)] mod foo { diff --git a/tests/ui/hygiene/fields.stderr b/tests/ui/hygiene/fields.stderr index 978120b1f10..99252c4b752 100644 --- a/tests/ui/hygiene/fields.stderr +++ b/tests/ui/hygiene/fields.stderr @@ -1,5 +1,5 @@ error: type `foo::S` is private - --> $DIR/fields.rs:15:17 + --> $DIR/fields.rs:13:17 | LL | let s = S { x: 0 }; | ^^^^^^^^^^ private type @@ -10,7 +10,7 @@ LL | let s = foo::m!(S, x); = note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info) error: type `foo::S` is private - --> $DIR/fields.rs:16:17 + --> $DIR/fields.rs:14:17 | LL | let _ = s.x; | ^ private type @@ -21,7 +21,7 @@ LL | let s = foo::m!(S, x); = note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info) error: type `T` is private - --> $DIR/fields.rs:18:17 + --> $DIR/fields.rs:16:17 | LL | let t = T(0); | ^^^^ private type @@ -32,7 +32,7 @@ LL | let s = foo::m!(S, x); = note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info) error: type `T` is private - --> $DIR/fields.rs:19:17 + --> $DIR/fields.rs:17:17 | LL | let _ = t.0; | ^ private type diff --git a/tests/ui/hygiene/generic_params.rs b/tests/ui/hygiene/generic_params.rs index 3b6216c3e63..b42152955f7 100644 --- a/tests/ui/hygiene/generic_params.rs +++ b/tests/ui/hygiene/generic_params.rs @@ -1,7 +1,6 @@ // Ensure that generic parameters always have modern hygiene. // check-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro, rustc_attrs)] diff --git a/tests/ui/hygiene/impl_items.rs b/tests/ui/hygiene/impl_items.rs index ddb25c06b1b..51088e3693d 100644 --- a/tests/ui/hygiene/impl_items.rs +++ b/tests/ui/hygiene/impl_items.rs @@ -1,5 +1,3 @@ -// ignore-pretty pretty-printing is unhygienic - #![feature(decl_macro)] mod foo { diff --git a/tests/ui/hygiene/impl_items.stderr b/tests/ui/hygiene/impl_items.stderr index 46a2500386e..32ba3741a59 100644 --- a/tests/ui/hygiene/impl_items.stderr +++ b/tests/ui/hygiene/impl_items.stderr @@ -1,5 +1,5 @@ error: type `for<'a> fn(&'a foo::S) {foo::S::f}` is private - --> $DIR/impl_items.rs:12:23 + --> $DIR/impl_items.rs:10:23 | LL | let _: () = S.f(); | ^ private type diff --git a/tests/ui/hygiene/intercrate.rs b/tests/ui/hygiene/intercrate.rs index d9b5b789e4a..2de62f6aff7 100644 --- a/tests/ui/hygiene/intercrate.rs +++ b/tests/ui/hygiene/intercrate.rs @@ -1,5 +1,3 @@ -// ignore-pretty pretty-printing is unhygienic - // aux-build:intercrate.rs #![feature(decl_macro)] diff --git a/tests/ui/hygiene/intercrate.stderr b/tests/ui/hygiene/intercrate.stderr index 91358b279e2..f108617fba6 100644 --- a/tests/ui/hygiene/intercrate.stderr +++ b/tests/ui/hygiene/intercrate.stderr @@ -1,5 +1,5 @@ error: type `fn() -> u32 {foo::bar::f}` is private - --> $DIR/intercrate.rs:10:16 + --> $DIR/intercrate.rs:8:16 | LL | assert_eq!(intercrate::foo::m!(), 1); | ^^^^^^^^^^^^^^^^^^^^^ private type diff --git a/tests/ui/hygiene/issue-47311.rs b/tests/ui/hygiene/issue-47311.rs index 5c2379a8aba..3f1b7397301 100644 --- a/tests/ui/hygiene/issue-47311.rs +++ b/tests/ui/hygiene/issue-47311.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro)] #![allow(unused)] diff --git a/tests/ui/hygiene/issue-47312.rs b/tests/ui/hygiene/issue-47312.rs index bbcb3a7f393..c8b5c36767c 100644 --- a/tests/ui/hygiene/issue-47312.rs +++ b/tests/ui/hygiene/issue-47312.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro)] #![allow(unused)] diff --git a/tests/ui/hygiene/items.rs b/tests/ui/hygiene/items.rs index 1c625a9728c..a7ed749f526 100644 --- a/tests/ui/hygiene/items.rs +++ b/tests/ui/hygiene/items.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro)] diff --git a/tests/ui/hygiene/legacy_interaction.rs b/tests/ui/hygiene/legacy_interaction.rs index 52008eed515..4d150baf5d4 100644 --- a/tests/ui/hygiene/legacy_interaction.rs +++ b/tests/ui/hygiene/legacy_interaction.rs @@ -1,6 +1,5 @@ // check-pass #![allow(dead_code)] -// ignore-pretty pretty-printing is unhygienic // aux-build:legacy_interaction.rs diff --git a/tests/ui/hygiene/lexical.rs b/tests/ui/hygiene/lexical.rs index 3d25c720989..81de974c203 100644 --- a/tests/ui/hygiene/lexical.rs +++ b/tests/ui/hygiene/lexical.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro)] diff --git a/tests/ui/hygiene/specialization.rs b/tests/ui/hygiene/specialization.rs index 656aa880ad1..b8c4c1b0d58 100644 --- a/tests/ui/hygiene/specialization.rs +++ b/tests/ui/hygiene/specialization.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro)] diff --git a/tests/ui/hygiene/trait_items-2.rs b/tests/ui/hygiene/trait_items-2.rs index 39edfc37d69..cd9122656cd 100644 --- a/tests/ui/hygiene/trait_items-2.rs +++ b/tests/ui/hygiene/trait_items-2.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-pretty pretty-printing is unhygienic #![feature(decl_macro)] diff --git a/tests/ui/hygiene/wrap_unhygienic_example.rs b/tests/ui/hygiene/wrap_unhygienic_example.rs index 50c6b35ab18..f6b48156888 100644 --- a/tests/ui/hygiene/wrap_unhygienic_example.rs +++ b/tests/ui/hygiene/wrap_unhygienic_example.rs @@ -1,5 +1,4 @@ // check-pass -// ignore-pretty pretty-printing is unhygienic // aux-build:my_crate.rs // aux-build:unhygienic_example.rs diff --git a/tests/ui/hygiene/xcrate.rs b/tests/ui/hygiene/xcrate.rs index 6981ce3f687..6366bebb52f 100644 --- a/tests/ui/hygiene/xcrate.rs +++ b/tests/ui/hygiene/xcrate.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty pretty-printing is unhygienic // aux-build:xcrate.rs diff --git a/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs b/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs index da2acf6c9f7..d369f1e71d0 100644 --- a/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs +++ b/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs @@ -3,7 +3,6 @@ #![allow(unused_imports)] #![allow(non_snake_case)] -// ignore-pretty issue #37195 #[path = "issue-26873-multifile/mod.rs"] mod multifile; diff --git a/tests/ui/inference/issue-80409.rs b/tests/ui/inference/issue-80409.rs new file mode 100644 index 00000000000..80cad6dfc46 --- /dev/null +++ b/tests/ui/inference/issue-80409.rs @@ -0,0 +1,36 @@ +// check-pass + +#![allow(unreachable_code, unused)] + +use std::marker::PhantomData; + +struct FsmBuilder<TFsm> { + _fsm: PhantomData<TFsm>, +} + +impl<TFsm> FsmBuilder<TFsm> { + fn state(&mut self) -> FsmStateBuilder<TFsm> { + todo!() + } +} + +struct FsmStateBuilder<TFsm> { + _state: PhantomData<TFsm>, +} + +impl<TFsm> FsmStateBuilder<TFsm> { + fn on_entry<TAction: Fn(&mut StateContext<'_, TFsm>)>(&self, _action: TAction) {} +} + +trait Fsm { + type Context; +} + +struct StateContext<'a, TFsm: Fsm> { + context: &'a mut TFsm::Context, +} + +fn main() { + let mut builder: FsmBuilder<usize> = todo!(); + builder.state().on_entry(|_| {}); +} diff --git a/tests/ui/issues/issue-11709.rs b/tests/ui/issues/issue-11709.rs index cb5e3dff3b3..58424f9e4c5 100644 --- a/tests/ui/issues/issue-11709.rs +++ b/tests/ui/issues/issue-11709.rs @@ -1,6 +1,5 @@ // run-pass #![allow(dead_code)] -// ignore-pretty issue #37199 // Don't panic on blocks without results // There are several tests in this run-pass that raised diff --git a/tests/ui/issues/issue-28839.rs b/tests/ui/issues/issue-28839.rs index 73be87a0c1e..c086f412a28 100644 --- a/tests/ui/issues/issue-28839.rs +++ b/tests/ui/issues/issue-28839.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37199 pub struct Foo; diff --git a/tests/ui/issues/issue-38190.rs b/tests/ui/issues/issue-38190.rs index cfa0420c80d..3bb4c7b980c 100644 --- a/tests/ui/issues/issue-38190.rs +++ b/tests/ui/issues/issue-38190.rs @@ -1,6 +1,5 @@ // run-pass // aux-build:issue-38190.rs -// ignore-pretty issue #37195 #[macro_use] extern crate issue_38190; diff --git a/tests/ui/issues/issue-9129.rs b/tests/ui/issues/issue-9129.rs index 04110b3ae89..5d623ed540f 100644 --- a/tests/ui/issues/issue-9129.rs +++ b/tests/ui/issues/issue-9129.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -// ignore-pretty unreported pub trait bomb { fn boom(&self, _: Ident); } pub struct S; diff --git a/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs index 802be7f5afb..9ba01540aaf 100644 --- a/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs +++ b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs @@ -6,7 +6,6 @@ // N.B., this file needs CRLF line endings. The .gitattributes file in // this directory should enforce it. -// ignore-pretty issue #37195 /// Doc comment that ends in CRLF pub fn foo() {} diff --git a/tests/ui/lifetimes/issue-93911.rs b/tests/ui/lifetimes/issue-93911.rs new file mode 100644 index 00000000000..b7ccac1ee52 --- /dev/null +++ b/tests/ui/lifetimes/issue-93911.rs @@ -0,0 +1,18 @@ +// check-pass +// edition:2021 + +#![allow(dead_code)] + +struct Foo<'a>(&'a u32); + +impl<'a> Foo<'a> { + async fn foo() { + struct Bar<'b>(&'b u32); + + impl<'b> Bar<'b> { + async fn bar() {} + } + } +} + +fn main() {} diff --git a/tests/ui/lint/lint-temporary-cstring-as-ptr.rs b/tests/ui/lint/lint-temporary-cstring-as-ptr.rs index 7aa4f2e1e00..fab792f1284 100644 --- a/tests/ui/lint/lint-temporary-cstring-as-ptr.rs +++ b/tests/ui/lint/lint-temporary-cstring-as-ptr.rs @@ -3,7 +3,15 @@ use std::ffi::CString; +macro_rules! mymacro { + () => { + let s = CString::new("some text").unwrap().as_ptr(); + //~^ ERROR getting the inner pointer of a temporary `CString` + } +} + fn main() { let s = CString::new("some text").unwrap().as_ptr(); //~^ ERROR getting the inner pointer of a temporary `CString` + mymacro!(); } diff --git a/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr b/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr index 79ef57dd1a3..4e5c8aa0693 100644 --- a/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr +++ b/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr @@ -1,5 +1,5 @@ error: getting the inner pointer of a temporary `CString` - --> $DIR/lint-temporary-cstring-as-ptr.rs:7:48 + --> $DIR/lint-temporary-cstring-as-ptr.rs:14:48 | LL | let s = CString::new("some text").unwrap().as_ptr(); | ---------------------------------- ^^^^^^ this pointer will be invalid @@ -14,5 +14,20 @@ note: the lint level is defined here LL | #![deny(temporary_cstring_as_ptr)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: getting the inner pointer of a temporary `CString` + --> $DIR/lint-temporary-cstring-as-ptr.rs:8:52 + | +LL | let s = CString::new("some text").unwrap().as_ptr(); + | ---------------------------------- ^^^^^^ this pointer will be invalid + | | + | this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime +... +LL | mymacro!(); + | ---------- in this macro invocation + | + = note: pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned + = help: for more information, see https://doc.rust-lang.org/reference/destructors.html + = note: this error originates in the macro `mymacro` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 2 previous errors diff --git a/tests/ui/lint/use-redundant/issue-92904.rs b/tests/ui/lint/use-redundant/issue-92904.rs new file mode 100644 index 00000000000..511d9d263cf --- /dev/null +++ b/tests/ui/lint/use-redundant/issue-92904.rs @@ -0,0 +1,17 @@ +// check-pass + +pub struct Foo(bar::Bar); + +pub mod bar { + pub struct Foo(pub Bar); + pub struct Bar(pub char); +} + +pub fn warning() -> Foo { + use bar::*; + #[deny(unused_imports)] + use self::Foo; // no error + Foo(Bar('a')) +} + +fn main() {} diff --git a/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs b/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs new file mode 100644 index 00000000000..6b1e018d2dc --- /dev/null +++ b/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs @@ -0,0 +1,16 @@ +// check-pass +#![warn(unused_imports)] + +pub mod bar { + pub struct Foo(pub Bar); + pub struct Bar(pub char); +} + +use bar::*; + +pub fn warning() -> Foo { + use bar::Foo; //~ WARNING imported redundantly + Foo(Bar('a')) +} + +fn main() {} diff --git a/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr b/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr new file mode 100644 index 00000000000..2c3b3345270 --- /dev/null +++ b/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr @@ -0,0 +1,17 @@ +warning: the item `Foo` is imported redundantly + --> $DIR/use-redundant-glob-parent.rs:12:9 + | +LL | use bar::*; + | ------ the item `Foo` is already imported here +... +LL | use bar::Foo; + | ^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/use-redundant-glob-parent.rs:2:9 + | +LL | #![warn(unused_imports)] + | ^^^^^^^^^^^^^^ + +warning: 1 warning emitted + diff --git a/tests/ui/lint/use-redundant/use-redundant-glob.rs b/tests/ui/lint/use-redundant/use-redundant-glob.rs new file mode 100644 index 00000000000..bd9e51b6f59 --- /dev/null +++ b/tests/ui/lint/use-redundant/use-redundant-glob.rs @@ -0,0 +1,15 @@ +// check-pass +#![warn(unused_imports)] + +pub mod bar { + pub struct Foo(pub Bar); + pub struct Bar(pub char); +} + +pub fn warning() -> bar::Foo { + use bar::*; + use bar::Foo; //~ WARNING imported redundantly + Foo(Bar('a')) +} + +fn main() {} diff --git a/tests/ui/lint/use-redundant/use-redundant-glob.stderr b/tests/ui/lint/use-redundant/use-redundant-glob.stderr new file mode 100644 index 00000000000..d3b406d82b6 --- /dev/null +++ b/tests/ui/lint/use-redundant/use-redundant-glob.stderr @@ -0,0 +1,16 @@ +warning: the item `Foo` is imported redundantly + --> $DIR/use-redundant-glob.rs:11:9 + | +LL | use bar::*; + | ------ the item `Foo` is already imported here +LL | use bar::Foo; + | ^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/use-redundant-glob.rs:2:9 + | +LL | #![warn(unused_imports)] + | ^^^^^^^^^^^^^^ + +warning: 1 warning emitted + diff --git a/tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.rs b/tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.rs new file mode 100644 index 00000000000..0fb60840f8a --- /dev/null +++ b/tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.rs @@ -0,0 +1,21 @@ +// check-pass +#![allow(nonstandard_style)] + +pub mod bar { + pub struct Foo { pub bar: Bar } + pub struct Bar(pub char); +} + +pub mod x { + use crate::bar; + pub const Foo: bar::Bar = bar::Bar('a'); +} + +pub fn warning() -> bar::Foo { + #![deny(unused_imports)] // no error + use bar::*; + use x::Foo; + Foo { bar: Foo } +} + +fn main() {} diff --git a/tests/ui/lint/use-redundant/use-redundant-not-parent.rs b/tests/ui/lint/use-redundant/use-redundant-not-parent.rs new file mode 100644 index 00000000000..c97a3d34163 --- /dev/null +++ b/tests/ui/lint/use-redundant/use-redundant-not-parent.rs @@ -0,0 +1,19 @@ +// check-pass + +pub mod bar { + pub struct Foo(pub Bar); + pub struct Bar(pub char); +} + +pub mod x { + pub struct Foo(pub crate::bar::Bar); +} + +pub fn warning() -> x::Foo { + use bar::*; + #[deny(unused_imports)] + use x::Foo; // no error + Foo(Bar('a')) +} + +fn main() {} diff --git a/tests/ui/lint/use-redundant.rs b/tests/ui/lint/use-redundant/use-redundant.rs index 53315dcf638..53315dcf638 100644 --- a/tests/ui/lint/use-redundant.rs +++ b/tests/ui/lint/use-redundant/use-redundant.rs diff --git a/tests/ui/lint/use-redundant.stderr b/tests/ui/lint/use-redundant/use-redundant.stderr index c861a1956e1..c861a1956e1 100644 --- a/tests/ui/lint/use-redundant.stderr +++ b/tests/ui/lint/use-redundant/use-redundant.stderr diff --git a/tests/ui/macros/issue-40469.rs b/tests/ui/macros/issue-40469.rs index 25e08ef85e9..9b22aaef289 100644 --- a/tests/ui/macros/issue-40469.rs +++ b/tests/ui/macros/issue-40469.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 #![allow(dead_code)] diff --git a/tests/ui/macros/macro-comma-support-rpass.rs b/tests/ui/macros/macro-comma-support-rpass.rs index 25b8c3cc62e..cb019792e65 100644 --- a/tests/ui/macros/macro-comma-support-rpass.rs +++ b/tests/ui/macros/macro-comma-support-rpass.rs @@ -8,7 +8,6 @@ // implementations for some macro_rules! macros as an implementation // detail. -// ignore-pretty issue #37195 // compile-flags: --test -C debug_assertions=yes // revisions: std core diff --git a/tests/ui/macros/macro-include-items.rs b/tests/ui/macros/macro-include-items.rs index 332bf59c944..ad6f04009b6 100644 --- a/tests/ui/macros/macro-include-items.rs +++ b/tests/ui/macros/macro-include-items.rs @@ -1,7 +1,6 @@ // run-pass #![allow(non_camel_case_types)] -// ignore-pretty issue #37195 fn bar() {} diff --git a/tests/ui/macros/syntax-extension-source-utils.rs b/tests/ui/macros/syntax-extension-source-utils.rs index 7e46260d516..f41faddddf6 100644 --- a/tests/ui/macros/syntax-extension-source-utils.rs +++ b/tests/ui/macros/syntax-extension-source-utils.rs @@ -1,7 +1,6 @@ // run-pass #![allow(stable_features)] -// ignore-pretty issue #37195 pub mod m1 { pub mod m2 { @@ -14,9 +13,9 @@ pub mod m1 { macro_rules! indirect_line { () => ( line!() ) } pub fn main() { - assert_eq!(line!(), 17); + assert_eq!(line!(), 16); assert_eq!(column!(), 16); - assert_eq!(indirect_line!(), 19); + assert_eq!(indirect_line!(), 18); assert!((file!().ends_with("syntax-extension-source-utils.rs"))); assert_eq!(stringify!((2*3) + 5).to_string(), "(2 * 3) + 5".to_string()); assert!(include!("syntax-extension-source-utils-files/includeme.\ @@ -33,5 +32,5 @@ pub fn main() { // The Windows tests are wrapped in an extra module for some reason assert!((m1::m2::where_am_i().ends_with("m1::m2"))); - assert_eq!((36, "(2 * 3) + 5"), (line!(), stringify!((2*3) + 5))); + assert_eq!((35, "(2 * 3) + 5"), (line!(), stringify!((2*3) + 5))); } diff --git a/tests/ui/mir/issue-109743.rs b/tests/ui/mir/issue-109743.rs new file mode 100644 index 00000000000..73f3405e3ad --- /dev/null +++ b/tests/ui/mir/issue-109743.rs @@ -0,0 +1,51 @@ +// build-pass +// compile-flags: --crate-type=lib + +use std::marker::PhantomData; + +pub trait StreamOnce { + type Token; +} + +impl StreamOnce for &str { + type Token = (); +} + +pub trait Parser<Input: StreamOnce> { + type PartialState: Default; + fn parse_mode(&self, _state: &Self::PartialState) {} + fn parse_mode_impl() {} +} + +pub fn parse_bool<'a>() -> impl Parser<&'a str> { + pub struct TokensCmp<C, Input> + where + Input: StreamOnce, + { + _cmp: C, + _marker: PhantomData<Input>, + } + + impl<Input, C> Parser<Input> for TokensCmp<C, Input> + where + C: FnMut(Input::Token), + Input: StreamOnce, + { + type PartialState = (); + } + + TokensCmp { _cmp: |_| (), _marker: PhantomData } +} + +pub struct ParseBool; + +impl<'a> Parser<&'a str> for ParseBool +where + &'a str: StreamOnce, +{ + type PartialState = (); + + fn parse_mode_impl() { + parse_bool().parse_mode(&Default::default()) + } +} diff --git a/tests/ui/modules/mod_dir_implicit.rs b/tests/ui/modules/mod_dir_implicit.rs index d6ea6a98bda..7eac90f4d9b 100644 --- a/tests/ui/modules/mod_dir_implicit.rs +++ b/tests/ui/modules/mod_dir_implicit.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 mod mod_dir_implicit_aux; diff --git a/tests/ui/modules/mod_dir_path.rs b/tests/ui/modules/mod_dir_path.rs index 70f592d0c0e..72db8e44be3 100644 --- a/tests/ui/modules/mod_dir_path.rs +++ b/tests/ui/modules/mod_dir_path.rs @@ -1,6 +1,5 @@ // run-pass #![allow(unused_macros)] -// ignore-pretty issue #37195 mod mod_dir_simple { #[path = "test.rs"] diff --git a/tests/ui/modules/mod_dir_path2.rs b/tests/ui/modules/mod_dir_path2.rs index c3e3e1d639e..b4f8f1c8454 100644 --- a/tests/ui/modules/mod_dir_path2.rs +++ b/tests/ui/modules/mod_dir_path2.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 #[path = "mod_dir_simple"] mod pancakes { diff --git a/tests/ui/modules/mod_dir_path3.rs b/tests/ui/modules/mod_dir_path3.rs index fed70c1bc98..56980c01049 100644 --- a/tests/ui/modules/mod_dir_path3.rs +++ b/tests/ui/modules/mod_dir_path3.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 #[path = "mod_dir_simple"] mod pancakes { diff --git a/tests/ui/modules/mod_dir_path_multi.rs b/tests/ui/modules/mod_dir_path_multi.rs index 2b805141a63..1c111294a33 100644 --- a/tests/ui/modules/mod_dir_path_multi.rs +++ b/tests/ui/modules/mod_dir_path_multi.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 #[path = "mod_dir_simple"] mod biscuits { diff --git a/tests/ui/modules/mod_dir_recursive.rs b/tests/ui/modules/mod_dir_recursive.rs index b109d13d164..56f26139828 100644 --- a/tests/ui/modules/mod_dir_recursive.rs +++ b/tests/ui/modules/mod_dir_recursive.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 // Testing that the parser for each file tracks its modules // and paths independently. The load_another_mod module should diff --git a/tests/ui/modules/mod_dir_simple.rs b/tests/ui/modules/mod_dir_simple.rs index 1d92c968a8f..56f15b1d610 100644 --- a/tests/ui/modules/mod_dir_simple.rs +++ b/tests/ui/modules/mod_dir_simple.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 mod mod_dir_simple { pub mod test; diff --git a/tests/ui/modules/mod_file.rs b/tests/ui/modules/mod_file.rs index 0ca52889e5c..7b56b99eb3a 100644 --- a/tests/ui/modules/mod_file.rs +++ b/tests/ui/modules/mod_file.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 // Testing that a plain .rs file can load modules from other source files diff --git a/tests/ui/modules/mod_file_with_path_attr.rs b/tests/ui/modules/mod_file_with_path_attr.rs index 48e253eadae..e739366954e 100644 --- a/tests/ui/modules/mod_file_with_path_attr.rs +++ b/tests/ui/modules/mod_file_with_path_attr.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty issue #37195 // Testing that a plain .rs file can load modules from other source files diff --git a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr index 7fcb68252cf..da4b9595c0e 100644 --- a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr +++ b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr @@ -1,16 +1,16 @@ -error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds +error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds --> $DIR/impl-trait-captures.rs:11:5 | LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> { | -- ------------ opaque type defined here | | - | hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_)) T` captures the anonymous lifetime defined here + | hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) T` captures the anonymous lifetime defined here LL | x | ^ | -help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))` lifetime bound +help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound | -LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_)) { +LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) { | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ error: aborting due to previous error diff --git a/tests/ui/non_modrs_mods/non_modrs_mods.rs b/tests/ui/non_modrs_mods/non_modrs_mods.rs index f664b0166d8..b3fa390087f 100644 --- a/tests/ui/non_modrs_mods/non_modrs_mods.rs +++ b/tests/ui/non_modrs_mods/non_modrs_mods.rs @@ -1,6 +1,5 @@ // run-pass // -// ignore-pretty issue #37195 pub mod modrs_mod; pub mod foors_mod; #[path = "some_crazy_attr_mod_dir/arbitrary_name.rs"] diff --git a/tests/ui/parser/issues/issue-48508.rs b/tests/ui/parser/issues/issue-48508.rs index 37d04c5d65f..1e7db9df814 100644 --- a/tests/ui/parser/issues/issue-48508.rs +++ b/tests/ui/parser/issues/issue-48508.rs @@ -7,7 +7,6 @@ // issue-48508-aux.rs // compile-flags:-g -// ignore-pretty issue #37195 // ignore-asmjs wasm2js does not support source maps yet #![allow(uncommon_codepoints)] diff --git a/tests/ui/privacy/effective_visibilities.rs b/tests/ui/privacy/effective_visibilities.rs index 3e9eef46230..e9ac9316087 100644 --- a/tests/ui/privacy/effective_visibilities.rs +++ b/tests/ui/privacy/effective_visibilities.rs @@ -18,13 +18,13 @@ mod outer { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub } #[rustc_effective_visibility] - struct PrivStruct; //~ ERROR Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self) - //~| ERROR Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self) + struct PrivStruct; //~ ERROR not in the table + //~| ERROR not in the table #[rustc_effective_visibility] pub union PubUnion { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub #[rustc_effective_visibility] - a: u8, //~ ERROR Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self) + a: u8, //~ ERROR not in the table #[rustc_effective_visibility] pub b: u8, //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub } diff --git a/tests/ui/privacy/effective_visibilities.stderr b/tests/ui/privacy/effective_visibilities.stderr index 2618fc427e9..f74f812e1a0 100644 --- a/tests/ui/privacy/effective_visibilities.stderr +++ b/tests/ui/privacy/effective_visibilities.stderr @@ -34,13 +34,13 @@ error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImpl LL | pub trait PubTrait { | ^^^^^^^^^^^^^^^^^^ -error: Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self) +error: not in the table --> $DIR/effective_visibilities.rs:21:9 | LL | struct PrivStruct; | ^^^^^^^^^^^^^^^^^ -error: Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self) +error: not in the table --> $DIR/effective_visibilities.rs:21:9 | LL | struct PrivStruct; @@ -52,7 +52,7 @@ error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImpl LL | pub union PubUnion { | ^^^^^^^^^^^^^^^^^^ -error: Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self) +error: not in the table --> $DIR/effective_visibilities.rs:27:13 | LL | a: u8, diff --git a/tests/ui/proc-macro/span-api-tests.rs b/tests/ui/proc-macro/span-api-tests.rs index 3f04ba866b7..7493f9cdb3d 100644 --- a/tests/ui/proc-macro/span-api-tests.rs +++ b/tests/ui/proc-macro/span-api-tests.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty // aux-build:span-api-tests.rs // aux-build:span-test-macros.rs // compile-flags: -Ztranslate-remapped-path-to-local-path=yes diff --git a/tests/ui/resolve/tool-import.rs b/tests/ui/resolve/tool-import.rs new file mode 100644 index 00000000000..971993332f5 --- /dev/null +++ b/tests/ui/resolve/tool-import.rs @@ -0,0 +1,8 @@ +// edition: 2018 + +use clippy::time::Instant; +//~^ `clippy` is a tool module + +fn main() { + Instant::now(); +} diff --git a/tests/ui/resolve/tool-import.stderr b/tests/ui/resolve/tool-import.stderr new file mode 100644 index 00000000000..d3bdfc93d49 --- /dev/null +++ b/tests/ui/resolve/tool-import.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve: `clippy` is a tool module, not a module + --> $DIR/tool-import.rs:3:5 + | +LL | use clippy::time::Instant; + | ^^^^^^ `clippy` is a tool module, not a module + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs index 7ef1d635d9c..3482af74752 100644 --- a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs +++ b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs @@ -194,6 +194,14 @@ fn main() { let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit; //~^ refutable pattern in local binding + // Check that matching on a reference results in a correctly spanned diagnostic + #[deny(non_exhaustive_omitted_patterns)] + match &non_enum { + NonExhaustiveEnum::Unit => {} + NonExhaustiveEnum::Tuple(_) => {} + _ => {} + } + //~^^ some variants are not matched explicitly } #[deny(non_exhaustive_omitted_patterns)] diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr index 4cdda732a91..923394474b2 100644 --- a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr +++ b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr @@ -198,6 +198,20 @@ help: you might want to use `let else` to handle the variant that isn't matched LL | let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit else { todo!() }; | ++++++++++++++++ -error: aborting due to 9 previous errors; 6 warnings emitted +error: some variants are not matched explicitly + --> $DIR/omitted-patterns.rs:202:9 + | +LL | _ => {} + | ^ pattern `NonExhaustiveEnum::Struct { .. }` not covered + | + = help: ensure that all variants are matched explicitly by adding the suggested match arms + = note: the matched value is of type `NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found +note: the lint level is defined here + --> $DIR/omitted-patterns.rs:198:12 + | +LL | #[deny(non_exhaustive_omitted_patterns)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 10 previous errors; 6 warnings emitted For more information about this error, try `rustc --explain E0005`. diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs index 8b5466b6cfa..5d233b38dbe 100644 --- a/tests/ui/runtime/backtrace-debuginfo.rs +++ b/tests/ui/runtime/backtrace-debuginfo.rs @@ -9,7 +9,6 @@ // compile-flags:-g -Copt-level=0 -Cllvm-args=-enable-tail-merge=0 // compile-flags:-Cforce-frame-pointers=yes // compile-flags:-Cstrip=none -// ignore-pretty issue #37195 // ignore-emscripten spawning processes is not supported // ignore-sgx no processes // ignore-fuchsia Backtrace not symbolized, trace different line alignment diff --git a/tests/ui/stats/hir-stats.stderr b/tests/ui/stats/hir-stats.stderr index ee62d8f2d25..d723ff538a8 100644 --- a/tests/ui/stats/hir-stats.stderr +++ b/tests/ui/stats/hir-stats.stderr @@ -15,45 +15,45 @@ ast-stats-1 Arm 96 ( 1.5%) 2 48 ast-stats-1 ForeignItem 96 ( 1.5%) 1 96 ast-stats-1 - Fn 96 ( 1.5%) 1 ast-stats-1 FnDecl 120 ( 1.8%) 5 24 -ast-stats-1 FieldDef 160 ( 2.4%) 2 80 -ast-stats-1 Stmt 160 ( 2.4%) 5 32 +ast-stats-1 FieldDef 160 ( 2.5%) 2 80 +ast-stats-1 Stmt 160 ( 2.5%) 5 32 ast-stats-1 - Local 32 ( 0.5%) 1 ast-stats-1 - MacCall 32 ( 0.5%) 1 ast-stats-1 - Expr 96 ( 1.5%) 3 -ast-stats-1 Param 160 ( 2.4%) 4 40 -ast-stats-1 Block 192 ( 2.9%) 6 32 +ast-stats-1 Param 160 ( 2.5%) 4 40 +ast-stats-1 Block 192 ( 3.0%) 6 32 ast-stats-1 Variant 208 ( 3.2%) 2 104 -ast-stats-1 GenericBound 224 ( 3.4%) 4 56 -ast-stats-1 - Trait 224 ( 3.4%) 4 -ast-stats-1 AssocItem 416 ( 6.3%) 4 104 -ast-stats-1 - Type 208 ( 3.2%) 2 -ast-stats-1 - Fn 208 ( 3.2%) 2 -ast-stats-1 GenericParam 480 ( 7.3%) 5 96 -ast-stats-1 Pat 504 ( 7.7%) 7 72 +ast-stats-1 GenericBound 224 ( 3.5%) 4 56 +ast-stats-1 - Trait 224 ( 3.5%) 4 +ast-stats-1 AssocItem 352 ( 5.4%) 4 88 +ast-stats-1 - Type 176 ( 2.7%) 2 +ast-stats-1 - Fn 176 ( 2.7%) 2 +ast-stats-1 GenericParam 480 ( 7.4%) 5 96 +ast-stats-1 Pat 504 ( 7.8%) 7 72 ast-stats-1 - Struct 72 ( 1.1%) 1 ast-stats-1 - Wild 72 ( 1.1%) 1 ast-stats-1 - Ident 360 ( 5.5%) 5 -ast-stats-1 Expr 576 ( 8.8%) 8 72 +ast-stats-1 Expr 576 ( 8.9%) 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 PathSegment 720 (11.0%) 30 24 -ast-stats-1 Ty 896 (13.7%) 14 64 +ast-stats-1 PathSegment 720 (11.1%) 30 24 +ast-stats-1 Ty 896 (13.8%) 14 64 ast-stats-1 - Ptr 64 ( 1.0%) 1 ast-stats-1 - Ref 64 ( 1.0%) 1 ast-stats-1 - ImplicitSelf 128 ( 2.0%) 2 -ast-stats-1 - Path 640 ( 9.8%) 10 -ast-stats-1 Item 1_224 (18.7%) 9 136 +ast-stats-1 - Path 640 ( 9.9%) 10 +ast-stats-1 Item 1_224 (18.9%) 9 136 ast-stats-1 - Trait 136 ( 2.1%) 1 ast-stats-1 - Enum 136 ( 2.1%) 1 ast-stats-1 - ForeignMod 136 ( 2.1%) 1 ast-stats-1 - Impl 136 ( 2.1%) 1 ast-stats-1 - Fn 272 ( 4.2%) 2 -ast-stats-1 - Use 408 ( 6.2%) 3 +ast-stats-1 - Use 408 ( 6.3%) 3 ast-stats-1 ---------------------------------------------------------------- -ast-stats-1 Total 6_552 +ast-stats-1 Total 6_488 ast-stats-1 ast-stats-2 POST EXPANSION AST STATS ast-stats-2 Name Accumulated Size Count Item Size @@ -65,32 +65,32 @@ 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 Local 72 ( 1.0%) 1 72 -ast-stats-2 Arm 96 ( 1.3%) 2 48 -ast-stats-2 ForeignItem 96 ( 1.3%) 1 96 -ast-stats-2 - Fn 96 ( 1.3%) 1 +ast-stats-2 Arm 96 ( 1.4%) 2 48 +ast-stats-2 ForeignItem 96 ( 1.4%) 1 96 +ast-stats-2 - Fn 96 ( 1.4%) 1 ast-stats-2 InlineAsm 120 ( 1.7%) 1 120 ast-stats-2 FnDecl 120 ( 1.7%) 5 24 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 Stmt 160 ( 2.2%) 5 32 -ast-stats-2 - Local 32 ( 0.4%) 1 -ast-stats-2 - Semi 32 ( 0.4%) 1 -ast-stats-2 - Expr 96 ( 1.3%) 3 -ast-stats-2 Param 160 ( 2.2%) 4 40 +ast-stats-2 - DocComment 32 ( 0.5%) 1 +ast-stats-2 - Normal 96 ( 1.4%) 3 +ast-stats-2 FieldDef 160 ( 2.3%) 2 80 +ast-stats-2 Stmt 160 ( 2.3%) 5 32 +ast-stats-2 - Local 32 ( 0.5%) 1 +ast-stats-2 - Semi 32 ( 0.5%) 1 +ast-stats-2 - Expr 96 ( 1.4%) 3 +ast-stats-2 Param 160 ( 2.3%) 4 40 ast-stats-2 Block 192 ( 2.7%) 6 32 ast-stats-2 Variant 208 ( 2.9%) 2 104 -ast-stats-2 GenericBound 224 ( 3.1%) 4 56 -ast-stats-2 - Trait 224 ( 3.1%) 4 -ast-stats-2 AssocItem 416 ( 5.8%) 4 104 -ast-stats-2 - Type 208 ( 2.9%) 2 -ast-stats-2 - Fn 208 ( 2.9%) 2 -ast-stats-2 GenericParam 480 ( 6.7%) 5 96 -ast-stats-2 Pat 504 ( 7.0%) 7 72 +ast-stats-2 GenericBound 224 ( 3.2%) 4 56 +ast-stats-2 - Trait 224 ( 3.2%) 4 +ast-stats-2 AssocItem 352 ( 5.0%) 4 88 +ast-stats-2 - Type 176 ( 2.5%) 2 +ast-stats-2 - Fn 176 ( 2.5%) 2 +ast-stats-2 GenericParam 480 ( 6.8%) 5 96 +ast-stats-2 Pat 504 ( 7.1%) 7 72 ast-stats-2 - Struct 72 ( 1.0%) 1 ast-stats-2 - Wild 72 ( 1.0%) 1 -ast-stats-2 - Ident 360 ( 5.0%) 5 +ast-stats-2 - Ident 360 ( 5.1%) 5 ast-stats-2 Expr 648 ( 9.1%) 9 72 ast-stats-2 - Path 72 ( 1.0%) 1 ast-stats-2 - Match 72 ( 1.0%) 1 @@ -98,22 +98,22 @@ 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 792 (11.1%) 33 24 -ast-stats-2 Ty 896 (12.5%) 14 64 +ast-stats-2 PathSegment 792 (11.2%) 33 24 +ast-stats-2 Ty 896 (12.6%) 14 64 ast-stats-2 - Ptr 64 ( 0.9%) 1 ast-stats-2 - Ref 64 ( 0.9%) 1 ast-stats-2 - ImplicitSelf 128 ( 1.8%) 2 -ast-stats-2 - Path 640 ( 8.9%) 10 -ast-stats-2 Item 1_496 (20.9%) 11 136 +ast-stats-2 - Path 640 ( 9.0%) 10 +ast-stats-2 Item 1_496 (21.1%) 11 136 ast-stats-2 - Trait 136 ( 1.9%) 1 ast-stats-2 - Enum 136 ( 1.9%) 1 ast-stats-2 - ExternCrate 136 ( 1.9%) 1 ast-stats-2 - ForeignMod 136 ( 1.9%) 1 ast-stats-2 - Impl 136 ( 1.9%) 1 ast-stats-2 - Fn 272 ( 3.8%) 2 -ast-stats-2 - Use 544 ( 7.6%) 4 +ast-stats-2 - Use 544 ( 7.7%) 4 ast-stats-2 ---------------------------------------------------------------- -ast-stats-2 Total 7_152 +ast-stats-2 Total 7_088 ast-stats-2 hir-stats HIR STATS hir-stats Name Accumulated Size Count Item Size diff --git a/tests/ui/symbol-names/basic.legacy.stderr b/tests/ui/symbol-names/basic.legacy.stderr index fe490a6000d..c1cbefac828 100644 --- a/tests/ui/symbol-names/basic.legacy.stderr +++ b/tests/ui/symbol-names/basic.legacy.stderr @@ -1,10 +1,10 @@ -error: symbol-name(_ZN5basic4main17he9f658e438f1cac0E) +error: symbol-name(_ZN5basic4main17h6fc0c8d27b1a289fE) --> $DIR/basic.rs:8:1 | LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(basic::main::he9f658e438f1cac0) +error: demangling(basic::main::h6fc0c8d27b1a289f) --> $DIR/basic.rs:8:1 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/basic.v0.stderr b/tests/ui/symbol-names/basic.v0.stderr index 1f02781364e..17c6d0ce704 100644 --- a/tests/ui/symbol-names/basic.v0.stderr +++ b/tests/ui/symbol-names/basic.v0.stderr @@ -4,7 +4,7 @@ error: symbol-name(_RNvCsCRATE_HASH_5basic4main) LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(basic[b751b4a00e2291d9]::main) +error: demangling(basic[a90d658f4748b9d1]::main) --> $DIR/basic.rs:8:1 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/foreign-types.stderr b/tests/ui/symbol-names/foreign-types.stderr index d6ee388ddf8..9c8633742b2 100644 --- a/tests/ui/symbol-names/foreign-types.stderr +++ b/tests/ui/symbol-names/foreign-types.stderr @@ -4,7 +4,7 @@ error: symbol-name(_RMCsCRATE_HASH_13foreign_typesINtB<REF>_5CheckNvB<REF>_11For LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<foreign_types[49eeeb51f120b431]::Check<foreign_types[49eeeb51f120b431]::ForeignType>>) +error: demangling(<foreign_types[fcdd87e190ad88e3]::Check<foreign_types[fcdd87e190ad88e3]::ForeignType>>) --> $DIR/foreign-types.rs:13:1 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/impl1.v0.stderr b/tests/ui/symbol-names/impl1.v0.stderr index 33caad71f52..a7cc5fc8ed2 100644 --- a/tests/ui/symbol-names/impl1.v0.stderr +++ b/tests/ui/symbol-names/impl1.v0.stderr @@ -4,7 +4,7 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_5impl13fooNtB<REF>_3Foo3bar) LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<impl1[2c09c4f1c7c8e90c]::foo::Foo>::bar) +error: demangling(<impl1[d5591eb39db23cbb]::foo::Foo>::bar) --> $DIR/impl1.rs:14:9 | LL | #[rustc_symbol_name] @@ -28,7 +28,7 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_5impl13barNtNtB<REF>_3foo3Foo3baz) LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<impl1[2c09c4f1c7c8e90c]::foo::Foo>::baz) +error: demangling(<impl1[d5591eb39db23cbb]::foo::Foo>::baz) --> $DIR/impl1.rs:32:9 | LL | #[rustc_symbol_name] @@ -52,7 +52,7 @@ error: symbol-name(_RNvXNCNvCsCRATE_HASH_5impl14mains_0ARDNtB<REF>_3Foop5AssocFG LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<[&dyn impl1[2c09c4f1c7c8e90c]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[2c09c4f1c7c8e90c]::AutoTrait; 3usize] as impl1[2c09c4f1c7c8e90c]::main::{closure#1}::Bar>::method) +error: demangling(<[&dyn impl1[d5591eb39db23cbb]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[d5591eb39db23cbb]::AutoTrait; 3usize] as impl1[d5591eb39db23cbb]::main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:62:13 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/issue-60925.legacy.stderr b/tests/ui/symbol-names/issue-60925.legacy.stderr index 29b42f48d80..7dd68e6e3a8 100644 --- a/tests/ui/symbol-names/issue-60925.legacy.stderr +++ b/tests/ui/symbol-names/issue-60925.legacy.stderr @@ -1,10 +1,10 @@ -error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h13209029be24b923E) +error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17hab58a402db4ebf3aE) --> $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::h13209029be24b923) +error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::hab58a402db4ebf3a) --> $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/issue-60925.v0.stderr b/tests/ui/symbol-names/issue-60925.v0.stderr index 408c957c6a1..77449becc84 100644 --- a/tests/ui/symbol-names/issue-60925.v0.stderr +++ b/tests/ui/symbol-names/issue-60925.v0.stderr @@ -4,7 +4,7 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_11issue_609253fooINtB<REF>_3FooNtNtB<REF> LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<issue_60925[775bc577f14ef671]::foo::Foo<issue_60925[775bc577f14ef671]::llvm::Foo>>::foo) +error: demangling(<issue_60925[294a1bee3c0c9a2f]::foo::Foo<issue_60925[294a1bee3c0c9a2f]::llvm::Foo>>::foo) --> $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/issue-75326.v0.stderr b/tests/ui/symbol-names/issue-75326.v0.stderr index 3d7803a0c3b..fb742f5e449 100644 --- a/tests/ui/symbol-names/issue-75326.v0.stderr +++ b/tests/ui/symbol-names/issue-75326.v0.stderr @@ -4,7 +4,7 @@ error: symbol-name(_RNvXINICsCRATE_HASH_11issue_75326s_0pppEINtB<REF>_3FooppENtB LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<issue_75326[e8e253d78520f2a2]::Foo<_, _> as issue_75326[e8e253d78520f2a2]::Iterator2>::next) +error: demangling(<issue_75326[189ebc60e18860d7]::Foo<_, _> as issue_75326[189ebc60e18860d7]::Iterator2>::next) --> $DIR/issue-75326.rs:41:5 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/trait-objects.v0.stderr b/tests/ui/symbol-names/trait-objects.v0.stderr index 47192ce5b83..84f2bce66be 100644 --- a/tests/ui/symbol-names/trait-objects.v0.stderr +++ b/tests/ui/symbol-names/trait-objects.v0.stderr @@ -4,7 +4,7 @@ error: symbol-name(_RNvXCsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4cor LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> as trait_objects[7260a56bea9f357b]::Bar>::method) +error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> as trait_objects[3c073c57f94bedc2]::Bar>::method) --> $DIR/trait-objects.rs:15:5 | LL | #[rustc_symbol_name] @@ -22,7 +22,7 @@ error: symbol-name(_RNvXs_CsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4c LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[7260a56bea9f357b]::Foo>::method) +error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[3c073c57f94bedc2]::Foo>::method) --> $DIR/trait-objects.rs:27:5 | LL | #[rustc_symbol_name] @@ -40,7 +40,7 @@ error: symbol-name(_RNvXs0_CsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4 LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[7260a56bea9f357b]::Baz>::method) +error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[3c073c57f94bedc2]::Baz>::method) --> $DIR/trait-objects.rs:39:5 | LL | #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/x86-stdcall.rs b/tests/ui/symbol-names/x86-stdcall.rs index 9948488c0e9..43c086dc6bc 100644 --- a/tests/ui/symbol-names/x86-stdcall.rs +++ b/tests/ui/symbol-names/x86-stdcall.rs @@ -1,5 +1,7 @@ // build-pass -// only-x86-windows +// only-x86 +// only-windows +// ignore-gnu - vectorcall is not supported by GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89485 #![crate_type = "cdylib"] #![feature(abi_vectorcall)] diff --git a/tests/ui/target-feature/gate.rs b/tests/ui/target-feature/gate.rs index 2382c98f8f1..2eea087c705 100644 --- a/tests/ui/target-feature/gate.rs +++ b/tests/ui/target-feature/gate.rs @@ -6,7 +6,6 @@ // ignore-mips64 // ignore-powerpc // ignore-powerpc64 -// ignore-powerpc64le // ignore-riscv64 // ignore-sparc // ignore-sparc64 diff --git a/tests/ui/target-feature/gate.stderr b/tests/ui/target-feature/gate.stderr index ee542b60a26..2d6abcc0a01 100644 --- a/tests/ui/target-feature/gate.stderr +++ b/tests/ui/target-feature/gate.stderr @@ -1,5 +1,5 @@ error[E0658]: the target feature `avx512bw` is currently unstable - --> $DIR/gate.rs:32:18 + --> $DIR/gate.rs:31:18 | LL | #[target_feature(enable = "avx512bw")] | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs index 0c400d7bf97..b59ed076f93 100644 --- a/tests/ui/target-feature/invalid-attribute.rs +++ b/tests/ui/target-feature/invalid-attribute.rs @@ -6,7 +6,6 @@ // ignore-mips64 // ignore-powerpc // ignore-powerpc64 -// ignore-powerpc64le // ignore-riscv64 // ignore-s390x // ignore-sparc diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr index 6d37d0917bc..c36392d430f 100644 --- a/tests/ui/target-feature/invalid-attribute.stderr +++ b/tests/ui/target-feature/invalid-attribute.stderr @@ -1,11 +1,11 @@ error: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:32:1 + --> $DIR/invalid-attribute.rs:31:1 | LL | #[target_feature = "+sse2"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[target_feature(enable = "name")]` error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:17:1 + --> $DIR/invalid-attribute.rs:16:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | extern crate alloc; | ------------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:22:1 + --> $DIR/invalid-attribute.rs:21:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | use alloc::alloc::alloc; | ------------------------ not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:27:1 + --> $DIR/invalid-attribute.rs:26:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -32,7 +32,7 @@ LL | extern "Rust" {} | ---------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:49:1 + --> $DIR/invalid-attribute.rs:48:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ LL | mod another {} | -------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:54:1 + --> $DIR/invalid-attribute.rs:53:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -50,7 +50,7 @@ LL | const FOO: usize = 7; | --------------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:59:1 + --> $DIR/invalid-attribute.rs:58:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ LL | struct Foo; | ----------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:64:1 + --> $DIR/invalid-attribute.rs:63:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -68,7 +68,7 @@ LL | enum Bar {} | ----------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:69:1 + --> $DIR/invalid-attribute.rs:68:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -81,7 +81,7 @@ LL | | } | |_- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:77:1 + --> $DIR/invalid-attribute.rs:76:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -90,7 +90,7 @@ LL | type Uwu = (); | -------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:82:1 + --> $DIR/invalid-attribute.rs:81:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -99,7 +99,7 @@ LL | trait Baz {} | ------------ not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:92:1 + --> $DIR/invalid-attribute.rs:91:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -108,7 +108,7 @@ LL | static A: () = (); | ------------------ not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:97:1 + --> $DIR/invalid-attribute.rs:96:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -117,7 +117,7 @@ LL | impl Quux for u8 {} | ------------------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:102:1 + --> $DIR/invalid-attribute.rs:101:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -126,7 +126,7 @@ LL | impl Foo {} | ----------- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:120:5 + --> $DIR/invalid-attribute.rs:119:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -138,7 +138,7 @@ LL | | } | |_____- not a function definition error: attribute should be applied to a function definition - --> $DIR/invalid-attribute.rs:128:5 + --> $DIR/invalid-attribute.rs:127:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -147,25 +147,25 @@ LL | || {}; | ----- not a function definition error: the feature named `foo` is not valid for this target - --> $DIR/invalid-attribute.rs:34:18 + --> $DIR/invalid-attribute.rs:33:18 | LL | #[target_feature(enable = "foo")] | ^^^^^^^^^^^^^^ `foo` is not valid for this target error: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:37:18 + --> $DIR/invalid-attribute.rs:36:18 | LL | #[target_feature(bar)] | ^^^ help: must be of the form: `enable = ".."` error: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:39:18 + --> $DIR/invalid-attribute.rs:38:18 | LL | #[target_feature(disable = "baz")] | ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."` error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions - --> $DIR/invalid-attribute.rs:43:1 + --> $DIR/invalid-attribute.rs:42:1 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -177,13 +177,13 @@ LL | fn bar() {} = help: add `#![feature(target_feature_11)]` to the crate attributes to enable error: cannot use `#[inline(always)]` with `#[target_feature]` - --> $DIR/invalid-attribute.rs:87:1 + --> $DIR/invalid-attribute.rs:86:1 | LL | #[inline(always)] | ^^^^^^^^^^^^^^^^^ error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions - --> $DIR/invalid-attribute.rs:112:5 + --> $DIR/invalid-attribute.rs:111:5 | LL | #[target_feature(enable = "sse2")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/thir-print/thir-flat.stdout b/tests/ui/thir-print/thir-flat.stdout index 910c0da2737..9d467f73d09 100644 --- a/tests/ui/thir-print/thir-flat.stdout +++ b/tests/ui/thir-print/thir-flat.stdout @@ -1,4 +1,4 @@ -DefId(0:3 ~ thir_flat[45a6]::main): +DefId(0:3 ~ thir_flat[7b97]::main): Thir { body_type: Fn( ([]; c_variadic: false)->(), @@ -30,7 +30,7 @@ Thir { kind: Scope { region_scope: Node(2), lint_level: Explicit( - HirId(DefId(0:3 ~ thir_flat[45a6]::main).2), + HirId(DefId(0:3 ~ thir_flat[7b97]::main).2), ), value: e0, }, diff --git a/tests/ui/thir-print/thir-tree-match.stdout b/tests/ui/thir-print/thir-tree-match.stdout index d6174ec262a..eea04c0951d 100644 --- a/tests/ui/thir-print/thir-tree-match.stdout +++ b/tests/ui/thir-print/thir-tree-match.stdout @@ -1,10 +1,10 @@ -DefId(0:16 ~ thir_tree_match[3c9a]::has_match): +DefId(0:16 ~ thir_tree_match[fcf8]::has_match): params: [ Param { ty: Foo ty_span: Some($DIR/thir-tree-match.rs:15:19: 15:22 (#0)) self_kind: None - hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).1)) + hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).1)) param: Some( Pat: { ty: Foo @@ -14,7 +14,7 @@ params: [ mutability: Not name: "foo" mode: ByValue - var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).2)) + var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).2)) ty: Foo is_primary: true subpattern: None @@ -41,7 +41,7 @@ body: kind: Scope { region_scope: Node(26) - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).26)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).26)) value: Expr { ty: bool @@ -63,7 +63,7 @@ body: kind: Scope { region_scope: Node(3) - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).3)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).3)) value: Expr { ty: bool @@ -79,7 +79,7 @@ body: kind: Scope { region_scope: Node(4) - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).4)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).4)) value: Expr { ty: Foo @@ -87,7 +87,7 @@ body: span: $DIR/thir-tree-match.rs:16:11: 16:14 (#0) kind: VarRef { - id: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).2)) + id: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).2)) } } } @@ -102,10 +102,10 @@ body: Variant { adt_def: AdtDef { - did: DefId(0:10 ~ thir_tree_match[3c9a]::Foo) - variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[3c9a]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[3c9a]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[3c9a]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[3c9a])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[3c9a]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[3c9a]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }] + 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])) }], flags: NO_VARIANT_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: [], flags: NO_VARIANT_FLAGS }] flags: IS_ENUM - repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 11573694388057581 } + repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 } substs: [] variant_index: 0 subpatterns: [ @@ -116,10 +116,10 @@ body: Variant { adt_def: AdtDef { - did: DefId(0:3 ~ thir_tree_match[3c9a]::Bar) - variants: [VariantDef { def_id: DefId(0:4 ~ thir_tree_match[3c9a]::Bar::First), ctor: Some((Const, DefId(0:5 ~ thir_tree_match[3c9a]::Bar::First::{constructor#0}))), name: "First", discr: Relative(0), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:6 ~ thir_tree_match[3c9a]::Bar::Second), ctor: Some((Const, DefId(0:7 ~ thir_tree_match[3c9a]::Bar::Second::{constructor#0}))), name: "Second", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:8 ~ thir_tree_match[3c9a]::Bar::Third), ctor: Some((Const, DefId(0:9 ~ thir_tree_match[3c9a]::Bar::Third::{constructor#0}))), name: "Third", discr: Relative(2), fields: [], flags: NO_VARIANT_FLAGS }] + did: DefId(0:3 ~ thir_tree_match[fcf8]::Bar) + variants: [VariantDef { def_id: DefId(0:4 ~ thir_tree_match[fcf8]::Bar::First), ctor: Some((Const, DefId(0:5 ~ thir_tree_match[fcf8]::Bar::First::{constructor#0}))), name: "First", discr: Relative(0), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:6 ~ thir_tree_match[fcf8]::Bar::Second), ctor: Some((Const, DefId(0:7 ~ thir_tree_match[fcf8]::Bar::Second::{constructor#0}))), name: "Second", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:8 ~ thir_tree_match[fcf8]::Bar::Third), ctor: Some((Const, DefId(0:9 ~ thir_tree_match[fcf8]::Bar::Third::{constructor#0}))), name: "Third", discr: Relative(2), fields: [], flags: NO_VARIANT_FLAGS }] flags: IS_ENUM - repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3125160937860410723 } + repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 10333377570083945360 } substs: [] variant_index: 0 subpatterns: [] @@ -148,7 +148,7 @@ body: kind: Scope { region_scope: Node(13) - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).13)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).13)) value: Expr { ty: bool @@ -162,7 +162,7 @@ body: } } } - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).12)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).12)) scope: Node(12) span: $DIR/thir-tree-match.rs:17:9: 17:40 (#0) } @@ -175,10 +175,10 @@ body: Variant { adt_def: AdtDef { - did: DefId(0:10 ~ thir_tree_match[3c9a]::Foo) - variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[3c9a]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[3c9a]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[3c9a]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[3c9a])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[3c9a]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[3c9a]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }] + 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])) }], flags: NO_VARIANT_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: [], flags: NO_VARIANT_FLAGS }] flags: IS_ENUM - repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 11573694388057581 } + repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 } substs: [] variant_index: 0 subpatterns: [ @@ -211,7 +211,7 @@ body: kind: Scope { region_scope: Node(19) - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).19)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).19)) value: Expr { ty: bool @@ -225,7 +225,7 @@ body: } } } - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).18)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).18)) scope: Node(18) span: $DIR/thir-tree-match.rs:18:9: 18:32 (#0) } @@ -238,10 +238,10 @@ body: Variant { adt_def: AdtDef { - did: DefId(0:10 ~ thir_tree_match[3c9a]::Foo) - variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[3c9a]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[3c9a]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[3c9a]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[3c9a])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[3c9a]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[3c9a]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }] + 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])) }], flags: NO_VARIANT_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: [], flags: NO_VARIANT_FLAGS }] flags: IS_ENUM - repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 11573694388057581 } + repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 } substs: [] variant_index: 1 subpatterns: [] @@ -266,7 +266,7 @@ body: kind: Scope { region_scope: Node(24) - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).24)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).24)) value: Expr { ty: bool @@ -280,7 +280,7 @@ body: } } } - lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).23)) + lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).23)) scope: Node(23) span: $DIR/thir-tree-match.rs:19:9: 19:28 (#0) } @@ -297,7 +297,7 @@ body: } -DefId(0:17 ~ thir_tree_match[3c9a]::main): +DefId(0:17 ~ thir_tree_match[fcf8]::main): params: [ ] body: @@ -317,7 +317,7 @@ body: kind: Scope { region_scope: Node(2) - lint_level: Explicit(HirId(DefId(0:17 ~ thir_tree_match[3c9a]::main).2)) + lint_level: Explicit(HirId(DefId(0:17 ~ thir_tree_match[fcf8]::main).2)) value: Expr { ty: () diff --git a/tests/ui/thir-print/thir-tree.stdout b/tests/ui/thir-print/thir-tree.stdout index 0a35d9fb78c..1b478dbef99 100644 --- a/tests/ui/thir-print/thir-tree.stdout +++ b/tests/ui/thir-print/thir-tree.stdout @@ -1,4 +1,4 @@ -DefId(0:3 ~ thir_tree[8f1d]::main): +DefId(0:3 ~ thir_tree[7aaa]::main): params: [ ] body: @@ -18,7 +18,7 @@ body: kind: Scope { region_scope: Node(2) - lint_level: Explicit(HirId(DefId(0:3 ~ thir_tree[8f1d]::main).2)) + lint_level: Explicit(HirId(DefId(0:3 ~ thir_tree[7aaa]::main).2)) value: Expr { ty: () diff --git a/tests/ui/traits/dyn-trait.rs b/tests/ui/traits/dyn-trait.rs index e1c1a8de55a..10e69105ced 100644 --- a/tests/ui/traits/dyn-trait.rs +++ b/tests/ui/traits/dyn-trait.rs @@ -1,5 +1,4 @@ // run-pass -// ignore-pretty `dyn ::foo` parses differently in the current edition use std::fmt::Display; diff --git a/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr b/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr index f4c7acd5c58..ce409f627be 100644 --- a/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr +++ b/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b))> fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b) }) ()): Foo` is not satisfied +error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ()): Foo` is not satisfied --> $DIR/higher-ranked-fn-type.rs:20:5 | LL | called() - | ^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b))> Foo` is not implemented for `fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b) }) ())` + | ^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> Foo` is not implemented for `fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ())` | note: required by a bound in `called` --> $DIR/higher-ranked-fn-type.rs:12:25 |
