diff options
Diffstat (limited to 'tests')
68 files changed, 464 insertions, 482 deletions
diff --git a/tests/codegen/align-fn.rs b/tests/codegen/align-fn.rs index fd572910c28..cbc24e2ae2e 100644 --- a/tests/codegen/align-fn.rs +++ b/tests/codegen/align-fn.rs @@ -3,11 +3,13 @@ //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) #![crate_type = "lib"] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] // CHECK: align 16 #[unsafe(no_mangle)] -#[align(16)] +#[rustc_align(16)] pub fn fn_align() {} pub struct A; @@ -15,12 +17,12 @@ pub struct A; impl A { // CHECK: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] pub fn method_align(self) {} // CHECK: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] pub fn associated_fn() {} } @@ -29,18 +31,18 @@ trait T: Sized { fn trait_method(self) {} - #[align(8)] + #[rustc_align(8)] fn trait_method_inherit_low(self); - #[align(32)] + #[rustc_align(32)] fn trait_method_inherit_high(self); - #[align(32)] + #[rustc_align(32)] fn trait_method_inherit_default(self) {} - #[align(4)] - #[align(128)] - #[align(8)] + #[rustc_align(4)] + #[rustc_align(128)] + #[rustc_align(8)] fn inherit_highest(self) {} } @@ -48,27 +50,27 @@ impl T for A { // CHECK-LABEL: trait_fn // CHECK-SAME: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_fn() {} // CHECK-LABEL: trait_method // CHECK-SAME: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_method(self) {} // The prototype's align is ignored because the align here is higher. // CHECK-LABEL: trait_method_inherit_low // CHECK-SAME: align 16 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_method_inherit_low(self) {} // The prototype's align is used because it is higher. // CHECK-LABEL: trait_method_inherit_high // CHECK-SAME: align 32 #[unsafe(no_mangle)] - #[align(16)] + #[rustc_align(16)] fn trait_method_inherit_high(self) {} // The prototype's align inherited. @@ -81,8 +83,8 @@ impl T for A { // CHECK-LABEL: inherit_highest // CHECK-SAME: align 128 #[unsafe(no_mangle)] - #[align(32)] - #[align(64)] + #[rustc_align(32)] + #[rustc_align(64)] fn inherit_highest(self) {} } @@ -90,7 +92,7 @@ trait HasDefaultImpl: Sized { // CHECK-LABEL: inherit_from_default_method // CHECK-LABEL: inherit_from_default_method // CHECK-SAME: align 32 - #[align(32)] + #[rustc_align(32)] fn inherit_from_default_method(self) {} } @@ -101,35 +103,35 @@ impl HasDefaultImpl for InstantiateDefaultMethods {} // CHECK-LABEL: align_specified_twice_1 // CHECK-SAME: align 64 #[unsafe(no_mangle)] -#[align(32)] -#[align(64)] +#[rustc_align(32)] +#[rustc_align(64)] pub fn align_specified_twice_1() {} // CHECK-LABEL: align_specified_twice_2 // CHECK-SAME: align 128 #[unsafe(no_mangle)] -#[align(128)] -#[align(32)] +#[rustc_align(128)] +#[rustc_align(32)] pub fn align_specified_twice_2() {} // CHECK-LABEL: align_specified_twice_3 // CHECK-SAME: align 256 #[unsafe(no_mangle)] -#[align(32)] -#[align(256)] +#[rustc_align(32)] +#[rustc_align(256)] pub fn align_specified_twice_3() {} const _: () = { // CHECK-LABEL: align_unmangled // CHECK-SAME: align 256 #[unsafe(no_mangle)] - #[align(32)] - #[align(256)] + #[rustc_align(32)] + #[rustc_align(256)] extern "C" fn align_unmangled() {} }; unsafe extern "C" { - #[align(256)] + #[rustc_align(256)] fn align_unmangled(); } @@ -137,5 +139,5 @@ unsafe extern "C" { // CHECK-LABEL: async_align // CHECK-SAME: align 64 #[unsafe(no_mangle)] -#[align(64)] +#[rustc_align(64)] pub async fn async_align() {} diff --git a/tests/codegen/gpu_offload/gpu_host.rs b/tests/codegen/gpu_offload/gpu_host.rs new file mode 100644 index 00000000000..513e27426bc --- /dev/null +++ b/tests/codegen/gpu_offload/gpu_host.rs @@ -0,0 +1,80 @@ +//@ compile-flags: -Zoffload=Enable -Zunstable-options -C opt-level=3 -Clto=fat +//@ no-prefer-dynamic +//@ needs-enzyme + +// This test is verifying that we generate __tgt_target_data_*_mapper before and after a call to the +// kernel_1. Better documentation to what each global or variable means is available in the gpu +// offlaod code, or the LLVM offload documentation. This code does not launch any GPU kernels yet, +// and will be rewritten once a proper offload frontend has landed. +// +// We currently only handle memory transfer for specific calls to functions named `kernel_{num}`, +// when inside of a function called main. This, too, is a temporary workaround for not having a +// frontend. + +#![no_main] + +#[unsafe(no_mangle)] +fn main() { + let mut x = [3.0; 256]; + kernel_1(&mut x); + core::hint::black_box(&x); +} + +// CHECK: %struct.__tgt_offload_entry = type { i64, i16, i16, i32, ptr, ptr, i64, i64, ptr } +// CHECK: %struct.__tgt_kernel_arguments = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, [3 x i32], [3 x i32], i32 } +// CHECK: %struct.ident_t = type { i32, i32, i32, i32, ptr } +// CHECK: %struct.__tgt_bin_desc = type { i32, ptr, ptr, ptr } + +// CHECK: @.offload_sizes.1 = private unnamed_addr constant [1 x i64] [i64 1024] +// CHECK: @.offload_maptypes.1 = private unnamed_addr constant [1 x i64] [i64 3] +// CHECK: @.kernel_1.region_id = weak unnamed_addr constant i8 0 +// CHECK: @.offloading.entry_name.1 = internal unnamed_addr constant [9 x i8] c"kernel_1\00", section ".llvm.rodata.offloading", align 1 +// CHECK: @.offloading.entry.kernel_1 = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @.kernel_1.region_id, ptr @.offloading.entry_name.1, i64 0, i64 0, ptr null }, section ".omp_offloading_entries", align 1 +// CHECK: @my_struct_global2 = external global %struct.__tgt_kernel_arguments +// CHECK: @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 +// CHECK: @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @0 }, align 8 + +// CHECK: Function Attrs: +// CHECK-NEXT: define{{( dso_local)?}} void @main() +// CHECK-NEXT: start: +// CHECK-NEXT: %0 = alloca [8 x i8], align 8 +// CHECK-NEXT: %x = alloca [1024 x i8], align 16 +// CHECK-NEXT: %EmptyDesc = alloca %struct.__tgt_bin_desc, align 8 +// CHECK-NEXT: %.offload_baseptrs = alloca [1 x ptr], align 8 +// CHECK-NEXT: %.offload_ptrs = alloca [1 x ptr], align 8 +// CHECK-NEXT: %.offload_sizes = alloca [1 x i64], align 8 +// CHECK-NEXT: %x.addr = alloca ptr, align 8 +// CHECK-NEXT: store ptr %x, ptr %x.addr, align 8 +// CHECK-NEXT: %1 = load ptr, ptr %x.addr, align 8 +// CHECK-NEXT: %2 = getelementptr inbounds float, ptr %1, i32 0 +// CHECK: call void @llvm.memset.p0.i64(ptr align 8 %EmptyDesc, i8 0, i64 32, i1 false) +// CHECK-NEXT: call void @__tgt_register_lib(ptr %EmptyDesc) +// CHECK-NEXT: call void @__tgt_init_all_rtls() +// CHECK-NEXT: %3 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 +// CHECK-NEXT: store ptr %1, ptr %3, align 8 +// CHECK-NEXT: %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 +// CHECK-NEXT: store ptr %2, ptr %4, align 8 +// CHECK-NEXT: %5 = getelementptr inbounds [1 x i64], ptr %.offload_sizes, i32 0, i32 0 +// CHECK-NEXT: store i64 1024, ptr %5, align 8 +// CHECK-NEXT: %6 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 +// CHECK-NEXT: %7 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 +// CHECK-NEXT: %8 = getelementptr inbounds [1 x i64], ptr %.offload_sizes, i32 0, i32 0 +// CHECK-NEXT: call void @__tgt_target_data_begin_mapper(ptr @1, i64 -1, i32 1, ptr %6, ptr %7, ptr %8, ptr @.offload_maptypes.1, ptr null, ptr null) +// CHECK-NEXT: call void @kernel_1(ptr noalias noundef nonnull align 4 dereferenceable(1024) %x) +// CHECK-NEXT: %9 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 +// CHECK-NEXT: %10 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 +// CHECK-NEXT: %11 = getelementptr inbounds [1 x i64], ptr %.offload_sizes, i32 0, i32 0 +// CHECK-NEXT: call void @__tgt_target_data_end_mapper(ptr @1, i64 -1, i32 1, ptr %9, ptr %10, ptr %11, ptr @.offload_maptypes.1, ptr null, ptr null) +// CHECK-NEXT: call void @__tgt_unregister_lib(ptr %EmptyDesc) +// CHECK: store ptr %x, ptr %0, align 8 +// CHECK-NEXT: call void asm sideeffect "", "r,~{memory}"(ptr nonnull %0) +// CHECK: ret void +// CHECK-NEXT: } + +#[unsafe(no_mangle)] +#[inline(never)] +pub fn kernel_1(x: &mut [f32; 256]) { + for i in 0..256 { + x[i] = 21.0; + } +} diff --git a/tests/codegen/min-function-alignment.rs b/tests/codegen/min-function-alignment.rs index 6a3843b0f4f..ea5f957e81f 100644 --- a/tests/codegen/min-function-alignment.rs +++ b/tests/codegen/min-function-alignment.rs @@ -5,6 +5,8 @@ //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) #![crate_type = "lib"] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] // Functions without explicit alignment use the global minimum. @@ -21,7 +23,7 @@ pub fn no_explicit_align() {} // align16: align 16 // align1024: align 1024 #[no_mangle] -#[align(8)] +#[rustc_align(8)] pub fn lower_align() {} // the higher value of min-function-alignment and the align attribute wins out @@ -30,7 +32,7 @@ pub fn lower_align() {} // align16: align 32 // align1024: align 1024 #[no_mangle] -#[align(32)] +#[rustc_align(32)] pub fn higher_align() {} // cold functions follow the same rules as other functions diff --git a/tests/codegen/naked-fn/aligned.rs b/tests/codegen/naked-fn/aligned.rs index 2648b0213ca..d7281c4219a 100644 --- a/tests/codegen/naked-fn/aligned.rs +++ b/tests/codegen/naked-fn/aligned.rs @@ -4,12 +4,15 @@ //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) #![crate_type = "lib"] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] + use std::arch::naked_asm; // CHECK: .balign 16 // CHECK-LABEL: naked_empty: -#[align(16)] +#[rustc_align(16)] #[no_mangle] #[unsafe(naked)] pub extern "C" fn naked_empty() { diff --git a/tests/codegen/naked-fn/min-function-alignment.rs b/tests/codegen/naked-fn/min-function-alignment.rs index 4ebaacd3eff..406e9334fa5 100644 --- a/tests/codegen/naked-fn/min-function-alignment.rs +++ b/tests/codegen/naked-fn/min-function-alignment.rs @@ -3,6 +3,8 @@ //@ ignore-arm no "ret" mnemonic //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] #![crate_type = "lib"] @@ -17,7 +19,7 @@ pub extern "C" fn naked_no_explicit_align() { // CHECK: .balign 16 #[no_mangle] -#[align(8)] +#[rustc_align(8)] #[unsafe(naked)] pub extern "C" fn naked_lower_align() { core::arch::naked_asm!("ret") @@ -25,7 +27,7 @@ pub extern "C" fn naked_lower_align() { // CHECK: .balign 32 #[no_mangle] -#[align(32)] +#[rustc_align(32)] #[unsafe(naked)] pub extern "C" fn naked_higher_align() { core::arch::naked_asm!("ret") diff --git a/tests/ui-fulldeps/stable-mir/check_abi.rs b/tests/ui-fulldeps/rustc_public/check_abi.rs index fc2227d147d..57c8377ea36 100644 --- a/tests/ui-fulldeps/stable-mir/check_abi.rs +++ b/tests/ui-fulldeps/rustc_public/check_abi.rs @@ -167,7 +167,7 @@ impl MirVisitor for AdtDefVisitor { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "alloc_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_allocation.rs b/tests/ui-fulldeps/rustc_public/check_allocation.rs index 83845a9aa42..70e4ee3fe34 100644 --- a/tests/ui-fulldeps/stable-mir/check_allocation.rs +++ b/tests/ui-fulldeps/rustc_public/check_allocation.rs @@ -202,7 +202,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "alloc_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_assoc_items.rs b/tests/ui-fulldeps/rustc_public/check_assoc_items.rs index 1557991f8ca..1557991f8ca 100644 --- a/tests/ui-fulldeps/stable-mir/check_assoc_items.rs +++ b/tests/ui-fulldeps/rustc_public/check_assoc_items.rs diff --git a/tests/ui-fulldeps/stable-mir/check_attribute.rs b/tests/ui-fulldeps/rustc_public/check_attribute.rs index d8807872ec4..0c34ac4dfe9 100644 --- a/tests/ui-fulldeps/stable-mir/check_attribute.rs +++ b/tests/ui-fulldeps/rustc_public/check_attribute.rs @@ -52,7 +52,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "attribute_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_binop.rs b/tests/ui-fulldeps/rustc_public/check_binop.rs index aa089a5d125..35be6f973cc 100644 --- a/tests/ui-fulldeps/stable-mir/check_binop.rs +++ b/tests/ui-fulldeps/rustc_public/check_binop.rs @@ -76,7 +76,7 @@ impl<'a> MirVisitor for Visitor<'a> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "binop_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_coroutine_body.rs b/tests/ui-fulldeps/rustc_public/check_coroutine_body.rs index 725b538b0fe..725b538b0fe 100644 --- a/tests/ui-fulldeps/stable-mir/check_coroutine_body.rs +++ b/tests/ui-fulldeps/rustc_public/check_coroutine_body.rs diff --git a/tests/ui-fulldeps/stable-mir/check_crate_defs.rs b/tests/ui-fulldeps/rustc_public/check_crate_defs.rs index 27d5b0bc238..3ca8b66e58d 100644 --- a/tests/ui-fulldeps/stable-mir/check_crate_defs.rs +++ b/tests/ui-fulldeps/rustc_public/check_crate_defs.rs @@ -79,7 +79,7 @@ fn contains<T: CrateDef + std::fmt::Debug>(items: &[T], expected: &[&str]) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "crate_definitions.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_def_ty.rs b/tests/ui-fulldeps/rustc_public/check_def_ty.rs index b5954352dc0..176a9d79ef1 100644 --- a/tests/ui-fulldeps/stable-mir/check_def_ty.rs +++ b/tests/ui-fulldeps/rustc_public/check_def_ty.rs @@ -70,7 +70,7 @@ fn check_fn_def(ty: Ty) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "defs_ty_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_defs.rs b/tests/ui-fulldeps/rustc_public/check_defs.rs index 5e45f19cac8..0c45859a132 100644 --- a/tests/ui-fulldeps/stable-mir/check_defs.rs +++ b/tests/ui-fulldeps/rustc_public/check_defs.rs @@ -106,7 +106,7 @@ fn get_instances(body: mir::Body) -> Vec<Instance> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "defs_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_foreign.rs b/tests/ui-fulldeps/rustc_public/check_foreign.rs index 9aee067f41b..78b62594c61 100644 --- a/tests/ui-fulldeps/stable-mir/check_foreign.rs +++ b/tests/ui-fulldeps/rustc_public/check_foreign.rs @@ -52,7 +52,7 @@ fn test_foreign() -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "foreign_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_instance.rs b/tests/ui-fulldeps/rustc_public/check_instance.rs index 18971076043..fd7523963fa 100644 --- a/tests/ui-fulldeps/stable-mir/check_instance.rs +++ b/tests/ui-fulldeps/rustc_public/check_instance.rs @@ -81,7 +81,7 @@ fn test_body(body: mir::Body) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "instance_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_intrinsics.rs b/tests/ui-fulldeps/rustc_public/check_intrinsics.rs index 854ac77956e..f722f0bbd71 100644 --- a/tests/ui-fulldeps/stable-mir/check_intrinsics.rs +++ b/tests/ui-fulldeps/rustc_public/check_intrinsics.rs @@ -110,7 +110,7 @@ impl<'a> MirVisitor for CallsVisitor<'a> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "binop_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_item_kind.rs b/tests/ui-fulldeps/rustc_public/check_item_kind.rs index 58e740bdaef..b759628f1a4 100644 --- a/tests/ui-fulldeps/stable-mir/check_item_kind.rs +++ b/tests/ui-fulldeps/rustc_public/check_item_kind.rs @@ -41,7 +41,7 @@ fn test_item_kind() -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "item_kind_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_normalization.rs b/tests/ui-fulldeps/rustc_public/check_normalization.rs index aa6a257dac6..db9d3031600 100644 --- a/tests/ui-fulldeps/stable-mir/check_normalization.rs +++ b/tests/ui-fulldeps/rustc_public/check_normalization.rs @@ -55,7 +55,7 @@ fn check_ty(ty: Ty) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "normalization_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_trait_queries.rs b/tests/ui-fulldeps/rustc_public/check_trait_queries.rs index a6c37883643..0dd13044fcc 100644 --- a/tests/ui-fulldeps/stable-mir/check_trait_queries.rs +++ b/tests/ui-fulldeps/rustc_public/check_trait_queries.rs @@ -67,7 +67,7 @@ fn assert_impl(impl_names: &HashSet<String>, target: &str) { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "trait_queries.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_transform.rs b/tests/ui-fulldeps/rustc_public/check_transform.rs index 3209fcf9ede..b30d98c3b26 100644 --- a/tests/ui-fulldeps/stable-mir/check_transform.rs +++ b/tests/ui-fulldeps/rustc_public/check_transform.rs @@ -115,7 +115,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "transform_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_ty_fold.rs b/tests/ui-fulldeps/rustc_public/check_ty_fold.rs index 07ef0d2bb50..93cd3049344 100644 --- a/tests/ui-fulldeps/stable-mir/check_ty_fold.rs +++ b/tests/ui-fulldeps/rustc_public/check_ty_fold.rs @@ -73,7 +73,7 @@ impl<'a> MirVisitor for PlaceVisitor<'a> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "ty_fold_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/check_variant.rs b/tests/ui-fulldeps/rustc_public/check_variant.rs index ebe76bd89d5..9ed16f2357c 100644 --- a/tests/ui-fulldeps/stable-mir/check_variant.rs +++ b/tests/ui-fulldeps/rustc_public/check_variant.rs @@ -120,7 +120,7 @@ fn check_statement_is_aggregate_assign( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "defs_ty_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/closure-generic-body.rs b/tests/ui-fulldeps/rustc_public/closure-generic-body.rs index e5f910fbda1..e5f910fbda1 100644 --- a/tests/ui-fulldeps/stable-mir/closure-generic-body.rs +++ b/tests/ui-fulldeps/rustc_public/closure-generic-body.rs diff --git a/tests/ui-fulldeps/stable-mir/closure_body.rs b/tests/ui-fulldeps/rustc_public/closure_body.rs index f5f9f23ad12..f5f9f23ad12 100644 --- a/tests/ui-fulldeps/stable-mir/closure_body.rs +++ b/tests/ui-fulldeps/rustc_public/closure_body.rs diff --git a/tests/ui-fulldeps/stable-mir/compilation-result.rs b/tests/ui-fulldeps/rustc_public/compilation-result.rs index ed013375c71..d33e602e819 100644 --- a/tests/ui-fulldeps/stable-mir/compilation-result.rs +++ b/tests/ui-fulldeps/rustc_public/compilation-result.rs @@ -20,7 +20,7 @@ use std::io::Write; /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "input_compilation_result_test.rs"; diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/rustc_public/crate-info.rs index 4f46dff9b82..19082d7394a 100644 --- a/tests/ui-fulldeps/stable-mir/crate-info.rs +++ b/tests/ui-fulldeps/rustc_public/crate-info.rs @@ -189,7 +189,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/projections.rs b/tests/ui-fulldeps/rustc_public/projections.rs index 3b360cd2fcf..e0213b4253c 100644 --- a/tests/ui-fulldeps/stable-mir/projections.rs +++ b/tests/ui-fulldeps/rustc_public/projections.rs @@ -141,7 +141,7 @@ fn get_item<'a>( /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/smir_internal.rs b/tests/ui-fulldeps/rustc_public/smir_internal.rs index dd70cfe5f5e..b74bdfe4eb1 100644 --- a/tests/ui-fulldeps/stable-mir/smir_internal.rs +++ b/tests/ui-fulldeps/rustc_public/smir_internal.rs @@ -34,7 +34,7 @@ fn test_translation(tcx: TyCtxt<'_>) -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "internal_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/smir_serde.rs b/tests/ui-fulldeps/rustc_public/smir_serde.rs index 31642c6cb94..972bc5efe20 100644 --- a/tests/ui-fulldeps/stable-mir/smir_serde.rs +++ b/tests/ui-fulldeps/rustc_public/smir_serde.rs @@ -41,7 +41,7 @@ fn serialize_to_json(_tcx: TyCtxt<'_>) -> ControlFlow<()> { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "internal_input.rs"; diff --git a/tests/ui-fulldeps/stable-mir/smir_visitor.rs b/tests/ui-fulldeps/rustc_public/smir_visitor.rs index 66787e2927b..9438f46a59b 100644 --- a/tests/ui-fulldeps/stable-mir/smir_visitor.rs +++ b/tests/ui-fulldeps/rustc_public/smir_visitor.rs @@ -177,7 +177,7 @@ impl mir::MutMirVisitor for TestMutVisitor { /// This test will generate and analyze a dummy crate using the stable mir. /// For that, it will first write the dummy crate into a file. -/// Then it will create a `StableMir` using custom arguments and then +/// Then it will create a `RustcPublic` using custom arguments and then /// it will run the compiler. fn main() { let path = "sim_visitor_input.rs"; diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.rs b/tests/ui/asm/naked-with-invalid-repr-attr.rs index bfbbf29a69e..4620d007e4e 100644 --- a/tests/ui/asm/naked-with-invalid-repr-attr.rs +++ b/tests/ui/asm/naked-with-invalid-repr-attr.rs @@ -1,5 +1,9 @@ //@ needs-asm-support + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] + #![crate_type = "lib"] use std::arch::naked_asm; @@ -21,7 +25,7 @@ extern "C" fn example2() { #[repr(C)] //~^ ERROR attribute should be applied to a struct, enum, or union [E0517] -#[align(16)] +#[rustc_align(16)] #[unsafe(naked)] extern "C" fn example3() { //~^ NOTE not a struct, enum, or union diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.stderr b/tests/ui/asm/naked-with-invalid-repr-attr.stderr index 4eb4a4e5a04..8530495be66 100644 --- a/tests/ui/asm/naked-with-invalid-repr-attr.stderr +++ b/tests/ui/asm/naked-with-invalid-repr-attr.stderr @@ -1,5 +1,5 @@ error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:6:8 + --> $DIR/naked-with-invalid-repr-attr.rs:10:8 | LL | #[repr(C)] | ^ @@ -11,7 +11,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:14:8 + --> $DIR/naked-with-invalid-repr-attr.rs:18:8 | LL | #[repr(transparent)] | ^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:22:8 + --> $DIR/naked-with-invalid-repr-attr.rs:26:8 | LL | #[repr(C)] | ^ @@ -35,7 +35,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/naked-with-invalid-repr-attr.rs:32:8 + --> $DIR/naked-with-invalid-repr-attr.rs:36:8 | LL | #[repr(C, packed)] | ^ @@ -48,7 +48,7 @@ LL | | } | |_- not a struct, enum, or union error[E0517]: attribute should be applied to a struct or union - --> $DIR/naked-with-invalid-repr-attr.rs:32:11 + --> $DIR/naked-with-invalid-repr-attr.rs:36:11 | LL | #[repr(C, packed)] | ^^^^^^ @@ -61,7 +61,7 @@ LL | | } | |_- not a struct or union error[E0517]: attribute should be applied to an enum - --> $DIR/naked-with-invalid-repr-attr.rs:42:8 + --> $DIR/naked-with-invalid-repr-attr.rs:46:8 | LL | #[repr(u8)] | ^^ diff --git a/tests/ui/attributes/fn-align-dyn.rs b/tests/ui/attributes/fn-align-dyn.rs index 8ba4d5e2897..3778c75a2ca 100644 --- a/tests/ui/attributes/fn-align-dyn.rs +++ b/tests/ui/attributes/fn-align-dyn.rs @@ -1,12 +1,15 @@ //@ run-pass //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] trait Test { - #[align(4096)] + #[rustc_align(4096)] fn foo(&self); - #[align(4096)] + #[rustc_align(4096)] fn foo1(&self); } diff --git a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs new file mode 100644 index 00000000000..536d6ff43fb --- /dev/null +++ b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs @@ -0,0 +1,19 @@ +// Anti-regression test to demonstrate that at least we mitigated breakage from adding a new +// `#[align]` built-in attribute. +// +// See https://github.com/rust-lang/rust/issues/143834. + +//@ check-pass + +// Needs edition >= 2018 macro use behavior. +//@ edition: 2018 + +macro_rules! align { + () => { + /* .. */ + }; +} + +pub(crate) use align; + +fn main() {} diff --git a/tests/ui/attributes/malformed-attrs.rs b/tests/ui/attributes/malformed-attrs.rs index 5026687b97b..d4c6ecaa189 100644 --- a/tests/ui/attributes/malformed-attrs.rs +++ b/tests/ui/attributes/malformed-attrs.rs @@ -3,6 +3,7 @@ #![feature(rustc_attrs)] #![feature(rustc_allow_const_fn_unstable)] #![feature(allow_internal_unstable)] +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity #![feature(fn_align)] #![feature(optimize_attribute)] #![feature(dropck_eyepatch)] @@ -53,7 +54,7 @@ #[inline = 5] //~^ ERROR valid forms for the attribute are //~| WARN this was previously accepted by the compiler -#[align] +#[rustc_align] //~^ ERROR malformed #[optimize] //~^ ERROR malformed diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index 0d0c338d302..de53af851a3 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `cfg` attribute input - --> $DIR/malformed-attrs.rs:102:1 + --> $DIR/malformed-attrs.rs:103:1 | LL | #[cfg] | ^^^^^^ @@ -8,7 +8,7 @@ LL | #[cfg] | help: must be of the form: `#[cfg(predicate)]` error: malformed `cfg_attr` attribute input - --> $DIR/malformed-attrs.rs:104:1 + --> $DIR/malformed-attrs.rs:105:1 | LL | #[cfg_attr] | ^^^^^^^^^^^ @@ -20,67 +20,67 @@ LL | #[cfg_attr(condition, attribute, other_attribute, ...)] | ++++++++++++++++++++++++++++++++++++++++++++ error[E0463]: can't find crate for `wloop` - --> $DIR/malformed-attrs.rs:211:1 + --> $DIR/malformed-attrs.rs:212:1 | LL | extern crate wloop; | ^^^^^^^^^^^^^^^^^^^ can't find crate error: malformed `windows_subsystem` attribute input - --> $DIR/malformed-attrs.rs:29:1 + --> $DIR/malformed-attrs.rs:30:1 | LL | #![windows_subsystem] | ^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![windows_subsystem = "windows|console"]` error: malformed `crate_name` attribute input - --> $DIR/malformed-attrs.rs:74:1 + --> $DIR/malformed-attrs.rs:75:1 | LL | #[crate_name] | ^^^^^^^^^^^^^ help: must be of the form: `#[crate_name = "name"]` error: malformed `no_sanitize` attribute input - --> $DIR/malformed-attrs.rs:92:1 + --> $DIR/malformed-attrs.rs:93:1 | LL | #[no_sanitize] | ^^^^^^^^^^^^^^ help: must be of the form: `#[no_sanitize(address, kcfi, memory, thread)]` error: malformed `proc_macro` attribute input - --> $DIR/malformed-attrs.rs:99:1 + --> $DIR/malformed-attrs.rs:100:1 | LL | #[proc_macro = 18] | ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro]` error: malformed `instruction_set` attribute input - --> $DIR/malformed-attrs.rs:106:1 + --> $DIR/malformed-attrs.rs:107:1 | LL | #[instruction_set] | ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[instruction_set(set)]` error: malformed `patchable_function_entry` attribute input - --> $DIR/malformed-attrs.rs:108:1 + --> $DIR/malformed-attrs.rs:109:1 | LL | #[patchable_function_entry] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]` error: malformed `coroutine` attribute input - --> $DIR/malformed-attrs.rs:111:5 + --> $DIR/malformed-attrs.rs:112:5 | LL | #[coroutine = 63] || {} | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[coroutine]` error: malformed `proc_macro_attribute` attribute input - --> $DIR/malformed-attrs.rs:116:1 + --> $DIR/malformed-attrs.rs:117:1 | LL | #[proc_macro_attribute = 19] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_attribute]` error: malformed `proc_macro_derive` attribute input - --> $DIR/malformed-attrs.rs:123:1 + --> $DIR/malformed-attrs.rs:124:1 | LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[proc_macro_derive(TraitName, /*opt*/ attributes(name1, name2, ...))]` error: malformed `must_not_suspend` attribute input - --> $DIR/malformed-attrs.rs:132:1 + --> $DIR/malformed-attrs.rs:133:1 | LL | #[must_not_suspend()] | ^^^^^^^^^^^^^^^^^^^^^ @@ -95,67 +95,67 @@ LL + #[must_not_suspend] | error: malformed `cfi_encoding` attribute input - --> $DIR/malformed-attrs.rs:134:1 + --> $DIR/malformed-attrs.rs:135:1 | LL | #[cfi_encoding] | ^^^^^^^^^^^^^^^ help: must be of the form: `#[cfi_encoding = "encoding"]` error: malformed `linkage` attribute input - --> $DIR/malformed-attrs.rs:173:5 + --> $DIR/malformed-attrs.rs:174:5 | LL | #[linkage] | ^^^^^^^^^^ help: must be of the form: `#[linkage = "external|internal|..."]` error: malformed `allow` attribute input - --> $DIR/malformed-attrs.rs:178:1 + --> $DIR/malformed-attrs.rs:179:1 | LL | #[allow] | ^^^^^^^^ help: must be of the form: `#[allow(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `expect` attribute input - --> $DIR/malformed-attrs.rs:180:1 + --> $DIR/malformed-attrs.rs:181:1 | LL | #[expect] | ^^^^^^^^^ help: must be of the form: `#[expect(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `warn` attribute input - --> $DIR/malformed-attrs.rs:182:1 + --> $DIR/malformed-attrs.rs:183:1 | LL | #[warn] | ^^^^^^^ help: must be of the form: `#[warn(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `deny` attribute input - --> $DIR/malformed-attrs.rs:184:1 + --> $DIR/malformed-attrs.rs:185:1 | LL | #[deny] | ^^^^^^^ help: must be of the form: `#[deny(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `forbid` attribute input - --> $DIR/malformed-attrs.rs:186:1 + --> $DIR/malformed-attrs.rs:187:1 | LL | #[forbid] | ^^^^^^^^^ help: must be of the form: `#[forbid(lint1, lint2, ..., /*opt*/ reason = "...")]` error: malformed `debugger_visualizer` attribute input - --> $DIR/malformed-attrs.rs:188:1 + --> $DIR/malformed-attrs.rs:189:1 | LL | #[debugger_visualizer] | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[debugger_visualizer(natvis_file = "...", gdb_script_file = "...")]` error: malformed `thread_local` attribute input - --> $DIR/malformed-attrs.rs:203:1 + --> $DIR/malformed-attrs.rs:204:1 | LL | #[thread_local()] | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[thread_local]` error: malformed `no_link` attribute input - --> $DIR/malformed-attrs.rs:207:1 + --> $DIR/malformed-attrs.rs:208:1 | LL | #[no_link()] | ^^^^^^^^^^^^ help: must be of the form: `#[no_link]` error: malformed `macro_use` attribute input - --> $DIR/malformed-attrs.rs:209:1 + --> $DIR/malformed-attrs.rs:210:1 | LL | #[macro_use = 1] | ^^^^^^^^^^^^^^^^ @@ -170,7 +170,7 @@ LL + #[macro_use] | error: malformed `macro_export` attribute input - --> $DIR/malformed-attrs.rs:214:1 + --> $DIR/malformed-attrs.rs:215:1 | LL | #[macro_export = 18] | ^^^^^^^^^^^^^^^^^^^^ @@ -185,31 +185,31 @@ LL + #[macro_export] | error: malformed `allow_internal_unsafe` attribute input - --> $DIR/malformed-attrs.rs:216:1 + --> $DIR/malformed-attrs.rs:217:1 | LL | #[allow_internal_unsafe = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[allow_internal_unsafe]` error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/malformed-attrs.rs:99:1 + --> $DIR/malformed-attrs.rs:100:1 | LL | #[proc_macro = 18] | ^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/malformed-attrs.rs:116:1 + --> $DIR/malformed-attrs.rs:117:1 | LL | #[proc_macro_attribute = 19] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/malformed-attrs.rs:123:1 + --> $DIR/malformed-attrs.rs:124:1 | LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint - --> $DIR/malformed-attrs.rs:216:1 + --> $DIR/malformed-attrs.rs:217:1 | LL | #[allow_internal_unsafe = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -218,7 +218,7 @@ LL | #[allow_internal_unsafe = 1] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: valid forms for the attribute are `#[doc(hidden|inline|...)]` and `#[doc = "string"]` - --> $DIR/malformed-attrs.rs:43:1 + --> $DIR/malformed-attrs.rs:44:1 | LL | #[doc] | ^^^^^^ @@ -228,7 +228,7 @@ LL | #[doc] = note: `#[deny(ill_formed_attribute_input)]` on by default error: valid forms for the attribute are `#[doc(hidden|inline|...)]` and `#[doc = "string"]` - --> $DIR/malformed-attrs.rs:76:1 + --> $DIR/malformed-attrs.rs:77:1 | LL | #[doc] | ^^^^^^ @@ -237,7 +237,7 @@ LL | #[doc] = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated")]` - --> $DIR/malformed-attrs.rs:83:1 + --> $DIR/malformed-attrs.rs:84:1 | LL | #[link] | ^^^^^^^ @@ -246,7 +246,7 @@ LL | #[link] = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> error: invalid argument - --> $DIR/malformed-attrs.rs:188:1 + --> $DIR/malformed-attrs.rs:189:1 | LL | #[debugger_visualizer] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -256,7 +256,7 @@ LL | #[debugger_visualizer] = note: expected: `gdb_script_file = "..."` error[E0565]: malformed `omit_gdb_pretty_printer_section` attribute input - --> $DIR/malformed-attrs.rs:26:1 + --> $DIR/malformed-attrs.rs:27:1 | LL | #![omit_gdb_pretty_printer_section = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^ @@ -265,25 +265,25 @@ LL | #![omit_gdb_pretty_printer_section = 1] | help: must be of the form: `#[omit_gdb_pretty_printer_section]` error[E0539]: malformed `export_name` attribute input - --> $DIR/malformed-attrs.rs:32:1 + --> $DIR/malformed-attrs.rs:33:1 | LL | #[unsafe(export_name)] | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]` error: `rustc_allow_const_fn_unstable` expects a list of feature names - --> $DIR/malformed-attrs.rs:34:1 + --> $DIR/malformed-attrs.rs:35:1 | LL | #[rustc_allow_const_fn_unstable] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `allow_internal_unstable` expects a list of feature names - --> $DIR/malformed-attrs.rs:37:1 + --> $DIR/malformed-attrs.rs:38:1 | LL | #[allow_internal_unstable] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `rustc_confusables` attribute input - --> $DIR/malformed-attrs.rs:39:1 + --> $DIR/malformed-attrs.rs:40:1 | LL | #[rustc_confusables] | ^^^^^^^^^^^^^^^^^^^^ @@ -292,7 +292,7 @@ LL | #[rustc_confusables] | help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]` error[E0539]: malformed `deprecated` attribute input - --> $DIR/malformed-attrs.rs:41:1 + --> $DIR/malformed-attrs.rs:42:1 | LL | #[deprecated = 5] | ^^^^^^^^^^^^^^^-^ @@ -312,13 +312,13 @@ LL + #[deprecated] | error[E0539]: malformed `rustc_macro_transparency` attribute input - --> $DIR/malformed-attrs.rs:46:1 + --> $DIR/malformed-attrs.rs:47:1 | LL | #[rustc_macro_transparency] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_macro_transparency = "transparent|semitransparent|opaque"]` error[E0539]: malformed `repr` attribute input - --> $DIR/malformed-attrs.rs:48:1 + --> $DIR/malformed-attrs.rs:49:1 | LL | #[repr] | ^^^^^^^ @@ -327,7 +327,7 @@ LL | #[repr] | help: must be of the form: `#[repr(C | Rust | align(...) | packed(...) | <integer type> | transparent)]` error[E0565]: malformed `rustc_as_ptr` attribute input - --> $DIR/malformed-attrs.rs:51:1 + --> $DIR/malformed-attrs.rs:52:1 | LL | #[rustc_as_ptr = 5] | ^^^^^^^^^^^^^^^---^ @@ -335,17 +335,17 @@ LL | #[rustc_as_ptr = 5] | | didn't expect any arguments here | help: must be of the form: `#[rustc_as_ptr]` -error[E0539]: malformed `align` attribute input - --> $DIR/malformed-attrs.rs:56:1 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/malformed-attrs.rs:57:1 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align(<alignment in bytes>)]` + | help: must be of the form: `#[rustc_align(<alignment in bytes>)]` error[E0539]: malformed `optimize` attribute input - --> $DIR/malformed-attrs.rs:58:1 + --> $DIR/malformed-attrs.rs:59:1 | LL | #[optimize] | ^^^^^^^^^^^ @@ -354,7 +354,7 @@ LL | #[optimize] | help: must be of the form: `#[optimize(size|speed|none)]` error[E0565]: malformed `cold` attribute input - --> $DIR/malformed-attrs.rs:60:1 + --> $DIR/malformed-attrs.rs:61:1 | LL | #[cold = 1] | ^^^^^^^---^ @@ -363,13 +363,13 @@ LL | #[cold = 1] | help: must be of the form: `#[cold]` error: valid forms for the attribute are `#[must_use = "reason"]` and `#[must_use]` - --> $DIR/malformed-attrs.rs:62:1 + --> $DIR/malformed-attrs.rs:63:1 | LL | #[must_use()] | ^^^^^^^^^^^^^ error[E0565]: malformed `no_mangle` attribute input - --> $DIR/malformed-attrs.rs:64:1 + --> $DIR/malformed-attrs.rs:65:1 | LL | #[no_mangle = 1] | ^^^^^^^^^^^^---^ @@ -378,7 +378,7 @@ LL | #[no_mangle = 1] | help: must be of the form: `#[no_mangle]` error[E0565]: malformed `naked` attribute input - --> $DIR/malformed-attrs.rs:66:1 + --> $DIR/malformed-attrs.rs:67:1 | LL | #[unsafe(naked())] | ^^^^^^^^^^^^^^--^^ @@ -387,7 +387,7 @@ LL | #[unsafe(naked())] | help: must be of the form: `#[naked]` error[E0565]: malformed `track_caller` attribute input - --> $DIR/malformed-attrs.rs:68:1 + --> $DIR/malformed-attrs.rs:69:1 | LL | #[track_caller()] | ^^^^^^^^^^^^^^--^ @@ -396,13 +396,13 @@ LL | #[track_caller()] | help: must be of the form: `#[track_caller]` error[E0539]: malformed `export_name` attribute input - --> $DIR/malformed-attrs.rs:70:1 + --> $DIR/malformed-attrs.rs:71:1 | LL | #[export_name()] | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]` error[E0805]: malformed `used` attribute input - --> $DIR/malformed-attrs.rs:72:1 + --> $DIR/malformed-attrs.rs:73:1 | LL | #[used()] | ^^^^^^--^ @@ -418,7 +418,7 @@ LL + #[used] | error[E0539]: malformed `target_feature` attribute input - --> $DIR/malformed-attrs.rs:79:1 + --> $DIR/malformed-attrs.rs:80:1 | LL | #[target_feature] | ^^^^^^^^^^^^^^^^^ @@ -427,7 +427,7 @@ LL | #[target_feature] | help: must be of the form: `#[target_feature(enable = "feat1, feat2")]` error[E0565]: malformed `export_stable` attribute input - --> $DIR/malformed-attrs.rs:81:1 + --> $DIR/malformed-attrs.rs:82:1 | LL | #[export_stable = 1] | ^^^^^^^^^^^^^^^^---^ @@ -436,19 +436,19 @@ LL | #[export_stable = 1] | help: must be of the form: `#[export_stable]` error[E0539]: malformed `link_name` attribute input - --> $DIR/malformed-attrs.rs:86:1 + --> $DIR/malformed-attrs.rs:87:1 | LL | #[link_name] | ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]` error[E0539]: malformed `link_section` attribute input - --> $DIR/malformed-attrs.rs:88:1 + --> $DIR/malformed-attrs.rs:89:1 | LL | #[link_section] | ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_section = "name"]` error[E0539]: malformed `coverage` attribute input - --> $DIR/malformed-attrs.rs:90:1 + --> $DIR/malformed-attrs.rs:91:1 | LL | #[coverage] | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument @@ -461,7 +461,7 @@ LL | #[coverage(on)] | ++++ error[E0565]: malformed `no_implicit_prelude` attribute input - --> $DIR/malformed-attrs.rs:97:1 + --> $DIR/malformed-attrs.rs:98:1 | LL | #[no_implicit_prelude = 23] | ^^^^^^^^^^^^^^^^^^^^^^----^ @@ -470,7 +470,7 @@ LL | #[no_implicit_prelude = 23] | help: must be of the form: `#[no_implicit_prelude]` error[E0539]: malformed `must_use` attribute input - --> $DIR/malformed-attrs.rs:119:1 + --> $DIR/malformed-attrs.rs:120:1 | LL | #[must_use = 1] | ^^^^^^^^^^^^^-^ @@ -487,7 +487,7 @@ LL + #[must_use] | error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input - --> $DIR/malformed-attrs.rs:128:1 + --> $DIR/malformed-attrs.rs:129:1 | LL | #[rustc_layout_scalar_valid_range_start] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -496,7 +496,7 @@ LL | #[rustc_layout_scalar_valid_range_start] | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]` error[E0539]: malformed `rustc_layout_scalar_valid_range_end` attribute input - --> $DIR/malformed-attrs.rs:130:1 + --> $DIR/malformed-attrs.rs:131:1 | LL | #[rustc_layout_scalar_valid_range_end] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -505,7 +505,7 @@ LL | #[rustc_layout_scalar_valid_range_end] | help: must be of the form: `#[rustc_layout_scalar_valid_range_end(end)]` error[E0565]: malformed `marker` attribute input - --> $DIR/malformed-attrs.rs:155:1 + --> $DIR/malformed-attrs.rs:156:1 | LL | #[marker = 3] | ^^^^^^^^^---^ @@ -514,7 +514,7 @@ LL | #[marker = 3] | help: must be of the form: `#[marker]` error[E0565]: malformed `fundamental` attribute input - --> $DIR/malformed-attrs.rs:157:1 + --> $DIR/malformed-attrs.rs:158:1 | LL | #[fundamental()] | ^^^^^^^^^^^^^--^ @@ -523,7 +523,7 @@ LL | #[fundamental()] | help: must be of the form: `#[fundamental]` error[E0565]: malformed `ffi_pure` attribute input - --> $DIR/malformed-attrs.rs:165:5 + --> $DIR/malformed-attrs.rs:166:5 | LL | #[unsafe(ffi_pure = 1)] | ^^^^^^^^^^^^^^^^^^---^^ @@ -532,7 +532,7 @@ LL | #[unsafe(ffi_pure = 1)] | help: must be of the form: `#[ffi_pure]` error[E0539]: malformed `link_ordinal` attribute input - --> $DIR/malformed-attrs.rs:167:5 + --> $DIR/malformed-attrs.rs:168:5 | LL | #[link_ordinal] | ^^^^^^^^^^^^^^^ @@ -541,7 +541,7 @@ LL | #[link_ordinal] | help: must be of the form: `#[link_ordinal(ordinal)]` error[E0565]: malformed `ffi_const` attribute input - --> $DIR/malformed-attrs.rs:171:5 + --> $DIR/malformed-attrs.rs:172:5 | LL | #[unsafe(ffi_const = 1)] | ^^^^^^^^^^^^^^^^^^^---^^ @@ -550,7 +550,7 @@ LL | #[unsafe(ffi_const = 1)] | help: must be of the form: `#[ffi_const]` error[E0565]: malformed `automatically_derived` attribute input - --> $DIR/malformed-attrs.rs:191:1 + --> $DIR/malformed-attrs.rs:192:1 | LL | #[automatically_derived = 18] | ^^^^^^^^^^^^^^^^^^^^^^^^----^ @@ -559,7 +559,7 @@ LL | #[automatically_derived = 18] | help: must be of the form: `#[automatically_derived]` error[E0565]: malformed `non_exhaustive` attribute input - --> $DIR/malformed-attrs.rs:197:1 + --> $DIR/malformed-attrs.rs:198:1 | LL | #[non_exhaustive = 1] | ^^^^^^^^^^^^^^^^^---^ @@ -568,7 +568,7 @@ LL | #[non_exhaustive = 1] | help: must be of the form: `#[non_exhaustive]` error[E0565]: malformed `type_const` attribute input - --> $DIR/malformed-attrs.rs:143:5 + --> $DIR/malformed-attrs.rs:144:5 | LL | #[type_const = 1] | ^^^^^^^^^^^^^---^ @@ -577,7 +577,7 @@ LL | #[type_const = 1] | help: must be of the form: `#[type_const]` error: attribute should be applied to `const fn` - --> $DIR/malformed-attrs.rs:34:1 + --> $DIR/malformed-attrs.rs:35:1 | LL | #[rustc_allow_const_fn_unstable] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -589,19 +589,19 @@ LL | | } | |_- not a `const fn` error: `#[repr(align(...))]` is not supported on function items - --> $DIR/malformed-attrs.rs:48:1 + --> $DIR/malformed-attrs.rs:49:1 | LL | #[repr] | ^^^^^^^ | -help: use `#[align(...)]` instead - --> $DIR/malformed-attrs.rs:48:1 +help: use `#[rustc_align(...)]` instead + --> $DIR/malformed-attrs.rs:49:1 | LL | #[repr] | ^^^^^^^ warning: `#[diagnostic::do_not_recommend]` does not expect any arguments - --> $DIR/malformed-attrs.rs:149:1 + --> $DIR/malformed-attrs.rs:150:1 | LL | #[diagnostic::do_not_recommend()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -609,7 +609,7 @@ LL | #[diagnostic::do_not_recommend()] = note: `#[warn(malformed_diagnostic_attributes)]` on by default warning: missing options for `on_unimplemented` attribute - --> $DIR/malformed-attrs.rs:138:1 + --> $DIR/malformed-attrs.rs:139:1 | LL | #[diagnostic::on_unimplemented] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -617,7 +617,7 @@ LL | #[diagnostic::on_unimplemented] = help: at least one of the `message`, `note` and `label` options are expected warning: malformed `on_unimplemented` attribute - --> $DIR/malformed-attrs.rs:140:1 + --> $DIR/malformed-attrs.rs:141:1 | LL | #[diagnostic::on_unimplemented = 1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here @@ -625,7 +625,7 @@ LL | #[diagnostic::on_unimplemented = 1] = help: only `message`, `note` and `label` are allowed as options error: valid forms for the attribute are `#[inline(always|never)]` and `#[inline]` - --> $DIR/malformed-attrs.rs:53:1 + --> $DIR/malformed-attrs.rs:54:1 | LL | #[inline = 5] | ^^^^^^^^^^^^^ @@ -634,7 +634,7 @@ LL | #[inline = 5] = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` - --> $DIR/malformed-attrs.rs:94:1 + --> $DIR/malformed-attrs.rs:95:1 | LL | #[ignore()] | ^^^^^^^^^^^ @@ -643,7 +643,7 @@ LL | #[ignore()] = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` - --> $DIR/malformed-attrs.rs:223:1 + --> $DIR/malformed-attrs.rs:224:1 | LL | #[ignore = 1] | ^^^^^^^^^^^^^ @@ -652,7 +652,7 @@ LL | #[ignore = 1] = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> error[E0308]: mismatched types - --> $DIR/malformed-attrs.rs:111:23 + --> $DIR/malformed-attrs.rs:112:23 | LL | fn test() { | - help: a return type might be missing here: `-> _` @@ -660,7 +660,7 @@ LL | #[coroutine = 63] || {} | ^^^^^ expected `()`, found coroutine | = note: expected unit type `()` - found coroutine `{coroutine@$DIR/malformed-attrs.rs:111:23: 111:25}` + found coroutine `{coroutine@$DIR/malformed-attrs.rs:112:23: 112:25}` error: aborting due to 75 previous errors; 3 warnings emitted diff --git a/tests/ui/attributes/malformed-fn-align.rs b/tests/ui/attributes/malformed-fn-align.rs index e06e6116842..cf143b28e54 100644 --- a/tests/ui/attributes/malformed-fn-align.rs +++ b/tests/ui/attributes/malformed-fn-align.rs @@ -1,49 +1,54 @@ +// ignore-tidy-linelength + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] #![feature(fn_align)] + #![crate_type = "lib"] trait MyTrait { - #[align] //~ ERROR malformed `align` attribute input + #[rustc_align] //~ ERROR malformed `rustc_align` attribute input fn myfun1(); - #[align(1, 2)] //~ ERROR malformed `align` attribute input + #[rustc_align(1, 2)] //~ ERROR malformed `rustc_align` attribute input fn myfun2(); } -#[align = 16] //~ ERROR malformed `align` attribute input +#[rustc_align = 16] //~ ERROR malformed `rustc_align` attribute input fn f1() {} -#[align("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer +#[rustc_align("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer fn f2() {} -#[align(0)] //~ ERROR invalid alignment value: not a power of two +#[rustc_align(0)] //~ ERROR invalid alignment value: not a power of two fn f3() {} #[repr(align(16))] //~ ERROR `#[repr(align(...))]` is not supported on function items fn f4() {} -#[align(-1)] //~ ERROR expected unsuffixed literal, found `-` +#[rustc_align(-1)] //~ ERROR expected unsuffixed literal, found `-` fn f5() {} -#[align(3)] //~ ERROR invalid alignment value: not a power of two +#[rustc_align(3)] //~ ERROR invalid alignment value: not a power of two fn f6() {} -#[align(4usize)] //~ ERROR invalid alignment value: not an unsuffixed integer [E0589] +#[rustc_align(4usize)] //~ ERROR invalid alignment value: not an unsuffixed integer [E0589] //~^ ERROR suffixed literals are not allowed in attributes fn f7() {} -#[align(16)] -#[align(3)] //~ ERROR invalid alignment value: not a power of two -#[align(16)] +#[rustc_align(16)] +#[rustc_align(3)] //~ ERROR invalid alignment value: not a power of two +#[rustc_align(16)] fn f8() {} -#[align(16)] //~ ERROR `#[align(...)]` is not supported on struct items +#[rustc_align(16)] //~ ERROR `#[rustc_align(...)]` is not supported on struct items struct S1; -#[align(32)] //~ ERROR `#[align(...)]` should be applied to a function item +#[rustc_align(32)] //~ ERROR `#[rustc_align(...)]` should be applied to a function item const FOO: i32 = 42; -#[align(32)] //~ ERROR `#[align(...)]` should be applied to a function item +#[rustc_align(32)] //~ ERROR `#[rustc_align(...)]` should be applied to a function item mod test {} -#[align(32)] //~ ERROR `#[align(...)]` should be applied to a function item +#[rustc_align(32)] //~ ERROR `#[rustc_align(...)]` should be applied to a function item use ::std::iter; diff --git a/tests/ui/attributes/malformed-fn-align.stderr b/tests/ui/attributes/malformed-fn-align.stderr index af3625b1f3b..d995a7bf070 100644 --- a/tests/ui/attributes/malformed-fn-align.stderr +++ b/tests/ui/attributes/malformed-fn-align.stderr @@ -1,119 +1,119 @@ error: expected unsuffixed literal, found `-` - --> $DIR/malformed-fn-align.rs:24:9 + --> $DIR/malformed-fn-align.rs:29:15 | -LL | #[align(-1)] - | ^ +LL | #[rustc_align(-1)] + | ^ error: suffixed literals are not allowed in attributes - --> $DIR/malformed-fn-align.rs:30:9 + --> $DIR/malformed-fn-align.rs:35:15 | -LL | #[align(4usize)] - | ^^^^^^ +LL | #[rustc_align(4usize)] + | ^^^^^^ | = help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.) -error[E0539]: malformed `align` attribute input - --> $DIR/malformed-fn-align.rs:5:5 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/malformed-fn-align.rs:10:5 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align(<alignment in bytes>)]` + | help: must be of the form: `#[rustc_align(<alignment in bytes>)]` -error[E0805]: malformed `align` attribute input - --> $DIR/malformed-fn-align.rs:8:5 +error[E0805]: malformed `rustc_align` attribute input + --> $DIR/malformed-fn-align.rs:13:5 | -LL | #[align(1, 2)] - | ^^^^^^^------^ - | | | - | | expected a single argument here - | help: must be of the form: `#[align(<alignment in bytes>)]` +LL | #[rustc_align(1, 2)] + | ^^^^^^^^^^^^^------^ + | | | + | | expected a single argument here + | help: must be of the form: `#[rustc_align(<alignment in bytes>)]` -error[E0539]: malformed `align` attribute input - --> $DIR/malformed-fn-align.rs:12:1 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/malformed-fn-align.rs:17:1 | -LL | #[align = 16] - | ^^^^^^^^^^^^^ +LL | #[rustc_align = 16] + | ^^^^^^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align(<alignment in bytes>)]` + | help: must be of the form: `#[rustc_align(<alignment in bytes>)]` error[E0589]: invalid alignment value: not an unsuffixed integer - --> $DIR/malformed-fn-align.rs:15:9 + --> $DIR/malformed-fn-align.rs:20:15 | -LL | #[align("hello")] - | ^^^^^^^ +LL | #[rustc_align("hello")] + | ^^^^^^^ error[E0589]: invalid alignment value: not a power of two - --> $DIR/malformed-fn-align.rs:18:9 + --> $DIR/malformed-fn-align.rs:23:15 | -LL | #[align(0)] - | ^ +LL | #[rustc_align(0)] + | ^ error[E0589]: invalid alignment value: not a power of two - --> $DIR/malformed-fn-align.rs:27:9 + --> $DIR/malformed-fn-align.rs:32:15 | -LL | #[align(3)] - | ^ +LL | #[rustc_align(3)] + | ^ error[E0589]: invalid alignment value: not an unsuffixed integer - --> $DIR/malformed-fn-align.rs:30:9 + --> $DIR/malformed-fn-align.rs:35:15 | -LL | #[align(4usize)] - | ^^^^^^ +LL | #[rustc_align(4usize)] + | ^^^^^^ error[E0589]: invalid alignment value: not a power of two - --> $DIR/malformed-fn-align.rs:35:9 + --> $DIR/malformed-fn-align.rs:40:15 | -LL | #[align(3)] - | ^ +LL | #[rustc_align(3)] + | ^ error: `#[repr(align(...))]` is not supported on function items - --> $DIR/malformed-fn-align.rs:21:8 + --> $DIR/malformed-fn-align.rs:26:8 | LL | #[repr(align(16))] | ^^^^^^^^^ | -help: use `#[align(...)]` instead - --> $DIR/malformed-fn-align.rs:21:8 +help: use `#[rustc_align(...)]` instead + --> $DIR/malformed-fn-align.rs:26:8 | LL | #[repr(align(16))] | ^^^^^^^^^ -error: `#[align(...)]` is not supported on struct items - --> $DIR/malformed-fn-align.rs:39:1 +error: `#[rustc_align(...)]` is not supported on struct items + --> $DIR/malformed-fn-align.rs:44:1 | -LL | #[align(16)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(16)] + | ^^^^^^^^^^^^^^^^^^ | help: use `#[repr(align(...))]` instead | -LL - #[align(16)] +LL - #[rustc_align(16)] LL + #[repr(align(16))] | -error: `#[align(...)]` should be applied to a function item - --> $DIR/malformed-fn-align.rs:42:1 +error: `#[rustc_align(...)]` should be applied to a function item + --> $DIR/malformed-fn-align.rs:47:1 | -LL | #[align(32)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(32)] + | ^^^^^^^^^^^^^^^^^^ LL | const FOO: i32 = 42; | -------------------- not a function item -error: `#[align(...)]` should be applied to a function item - --> $DIR/malformed-fn-align.rs:45:1 +error: `#[rustc_align(...)]` should be applied to a function item + --> $DIR/malformed-fn-align.rs:50:1 | -LL | #[align(32)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(32)] + | ^^^^^^^^^^^^^^^^^^ LL | mod test {} | ----------- not a function item -error: `#[align(...)]` should be applied to a function item - --> $DIR/malformed-fn-align.rs:48:1 +error: `#[rustc_align(...)]` should be applied to a function item + --> $DIR/malformed-fn-align.rs:53:1 | -LL | #[align(32)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(32)] + | ^^^^^^^^^^^^^^^^^^ LL | use ::std::iter; | ---------------- not a function item diff --git a/tests/ui/consts/const-try-feature-gate.rs b/tests/ui/consts/const-try-feature-gate.rs index 09985079e8e..4a98185a18a 100644 --- a/tests/ui/consts/const-try-feature-gate.rs +++ b/tests/ui/consts/const-try-feature-gate.rs @@ -4,6 +4,8 @@ const fn t() -> Option<()> { Some(())?; //~^ ERROR `?` is not allowed //~| ERROR `?` is not allowed + //~| ERROR `Try` is not yet stable as a const trait + //~| ERROR `FromResidual` is not yet stable as a const trait None } diff --git a/tests/ui/consts/const-try-feature-gate.stderr b/tests/ui/consts/const-try-feature-gate.stderr index 0ad19d05b38..62a4a5fba4f 100644 --- a/tests/ui/consts/const-try-feature-gate.stderr +++ b/tests/ui/consts/const-try-feature-gate.stderr @@ -1,19 +1,47 @@ -error[E0015]: `?` is not allowed on `Option<()>` in constant functions +error[E0658]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/const-try-feature-gate.rs:4:5 | LL | Some(())?; | ^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants + = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information + = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0015]: `?` is not allowed on `Option<()>` in constant functions +error: `Try` is not yet stable as a const trait + --> $DIR/const-try-feature-gate.rs:4:5 + | +LL | Some(())?; + | ^^^^^^^^^ + | +help: add `#![feature(const_try)]` to the crate attributes to enable + | +LL + #![feature(const_try)] + | + +error[E0658]: `?` is not allowed on `Option<()>` in constant functions --> $DIR/const-try-feature-gate.rs:4:5 | LL | Some(())?; | ^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants + = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information + = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: `FromResidual` is not yet stable as a const trait + --> $DIR/const-try-feature-gate.rs:4:5 + | +LL | Some(())?; + | ^^^^^^^^^ + | +help: add `#![feature(const_try)]` to the crate attributes to enable + | +LL + #![feature(const_try)] + | -error: aborting due to 2 previous errors +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/consts/const-try.rs b/tests/ui/consts/const-try.rs index e13fad78441..152400d702e 100644 --- a/tests/ui/consts/const-try.rs +++ b/tests/ui/consts/const-try.rs @@ -1,4 +1,6 @@ -//@ compile-flags: -Znext-solver +//@ check-pass +//@ revisions: current next +//@[next] compile-flags: -Znext-solver // Demonstrates what's needed to make use of `?` in const contexts. @@ -13,14 +15,12 @@ struct TryMe; struct Error; impl const FromResidual<Error> for TryMe { - //~^ ERROR const `impl` for trait `FromResidual` which is not `const` fn from_residual(residual: Error) -> Self { TryMe } } impl const Try for TryMe { - //~^ ERROR const `impl` for trait `Try` which is not `const` type Output = (); type Residual = Error; fn from_output(output: Self::Output) -> Self { @@ -33,8 +33,6 @@ impl const Try for TryMe { const fn t() -> TryMe { TryMe?; - //~^ ERROR `?` is not allowed on - //~| ERROR `?` is not allowed on TryMe } diff --git a/tests/ui/consts/const-try.stderr b/tests/ui/consts/const-try.stderr deleted file mode 100644 index 7004ea3e6db..00000000000 --- a/tests/ui/consts/const-try.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/const-try.rs:15:12 - | -LL | impl const FromResidual<Error> for TryMe { - | ^^^^^^^^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `Try` which is not `const` - --> $DIR/const-try.rs:22:12 - | -LL | impl const Try for TryMe { - | ^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/const-try.rs:35:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/const-try.rs:35:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/control-flow/try.rs b/tests/ui/consts/control-flow/try.rs index 67083e1a39b..6d762f9194e 100644 --- a/tests/ui/consts/control-flow/try.rs +++ b/tests/ui/consts/control-flow/try.rs @@ -1,11 +1,12 @@ -// The `?` operator is still not const-evaluatable because it calls `From::from` on the error -// variant. +//@ check-pass + +#![allow(dead_code)] +#![feature(const_trait_impl)] +#![feature(const_try)] const fn opt() -> Option<i32> { let x = Some(2); x?; - //~^ ERROR: `?` is not allowed - //~| ERROR: `?` is not allowed None } diff --git a/tests/ui/consts/control-flow/try.stderr b/tests/ui/consts/control-flow/try.stderr deleted file mode 100644 index 62a3e3ce6bc..00000000000 --- a/tests/ui/consts/control-flow/try.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0015]: `?` is not allowed on `Option<i32>` in constant functions - --> $DIR/try.rs:6:5 - | -LL | x?; - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option<i32>` in constant functions - --> $DIR/try.rs:6:5 - | -LL | x?; - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/try-operator.rs b/tests/ui/consts/try-operator.rs index 352dbeefa8a..59d9fcb1cbd 100644 --- a/tests/ui/consts/try-operator.rs +++ b/tests/ui/consts/try-operator.rs @@ -1,9 +1,8 @@ -//@ known-bug: #110395 +//@ run-pass #![feature(try_trait_v2)] #![feature(const_trait_impl)] #![feature(const_try)] -#![feature(const_convert)] fn main() { const fn result() -> Result<bool, ()> { diff --git a/tests/ui/consts/try-operator.stderr b/tests/ui/consts/try-operator.stderr deleted file mode 100644 index fc37039d260..00000000000 --- a/tests/ui/consts/try-operator.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0635]: unknown feature `const_convert` - --> $DIR/try-operator.rs:6:12 - | -LL | #![feature(const_convert)] - | ^^^^^^^^^^^^^ - -error[E0015]: `?` is not allowed on `Result<(), ()>` in constant functions - --> $DIR/try-operator.rs:10:9 - | -LL | Err(())?; - | ^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Result<bool, ()>` in constant functions - --> $DIR/try-operator.rs:10:9 - | -LL | Err(())?; - | ^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/try-operator.rs:18:9 - | -LL | None?; - | ^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/try-operator.rs:18:9 - | -LL | None?; - | ^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0015, E0635. -For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/feature-gates/feature-gate-fn_align.rs b/tests/ui/feature-gates/feature-gate-fn_align.rs index b6c300e5cbe..36e17c4a8dd 100644 --- a/tests/ui/feature-gates/feature-gate-fn_align.rs +++ b/tests/ui/feature-gates/feature-gate-fn_align.rs @@ -1,12 +1,16 @@ #![crate_type = "lib"] -#[align(16)] -//~^ ERROR the `#[align]` attribute is an experimental feature +// ignore-tidy-linelength + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity + +#[rustc_align(16)] +//~^ ERROR the `#[rustc_align]` attribute is an experimental feature fn requires_alignment() {} trait MyTrait { - #[align] - //~^ ERROR the `#[align]` attribute is an experimental feature - //~| ERROR malformed `align` attribute input + #[rustc_align] + //~^ ERROR the `#[rustc_align]` attribute is an experimental feature + //~| ERROR malformed `rustc_align` attribute input fn myfun(); } diff --git a/tests/ui/feature-gates/feature-gate-fn_align.stderr b/tests/ui/feature-gates/feature-gate-fn_align.stderr index 921cf08435c..6196f4f298f 100644 --- a/tests/ui/feature-gates/feature-gate-fn_align.stderr +++ b/tests/ui/feature-gates/feature-gate-fn_align.stderr @@ -1,31 +1,31 @@ -error[E0658]: the `#[align]` attribute is an experimental feature - --> $DIR/feature-gate-fn_align.rs:3:1 +error[E0658]: the `#[rustc_align]` attribute is an experimental feature + --> $DIR/feature-gate-fn_align.rs:7:1 | -LL | #[align(16)] - | ^^^^^^^^^^^^ +LL | #[rustc_align(16)] + | ^^^^^^^^^^^^^^^^^^ | = note: see issue #82232 <https://github.com/rust-lang/rust/issues/82232> for more information = help: add `#![feature(fn_align)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[align]` attribute is an experimental feature - --> $DIR/feature-gate-fn_align.rs:8:5 +error[E0658]: the `#[rustc_align]` attribute is an experimental feature + --> $DIR/feature-gate-fn_align.rs:12:5 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | = note: see issue #82232 <https://github.com/rust-lang/rust/issues/82232> for more information = help: add `#![feature(fn_align)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0539]: malformed `align` attribute input - --> $DIR/feature-gate-fn_align.rs:8:5 +error[E0539]: malformed `rustc_align` attribute input + --> $DIR/feature-gate-fn_align.rs:12:5 | -LL | #[align] - | ^^^^^^^^ +LL | #[rustc_align] + | ^^^^^^^^^^^^^^ | | | expected this to be a list - | help: must be of the form: `#[align(<alignment in bytes>)]` + | help: must be of the form: `#[rustc_align(<alignment in bytes>)]` error: aborting due to 3 previous errors diff --git a/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs new file mode 100644 index 00000000000..cdfd1327eae --- /dev/null +++ b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs @@ -0,0 +1,12 @@ +//! Regression test for <https://github.com/rust-lang/rust/issues/143413> +//! The anonymous lifetime in `c(&())` is desugared by the resolver as an extra lifetime parameter +//! at the end of the `for` binder. Verify that lowering creates the definition for that extra +//! lifetime parameter before lowering `c(&())`. + +trait D {} + +type A = dyn for<const B: c(&())> D; +//~^ ERROR cannot find type `c` in this scope +//~| ERROR only lifetime parameters can be used in this context + +fn main() {} diff --git a/tests/ui/lifetimes/elided-lifetime-in-const-param-type.stderr b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.stderr new file mode 100644 index 00000000000..c7f3c0cc0cd --- /dev/null +++ b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.stderr @@ -0,0 +1,20 @@ +error[E0412]: cannot find type `c` in this scope + --> $DIR/elided-lifetime-in-const-param-type.rs:8:27 + | +LL | type A = dyn for<const B: c(&())> D; + | ^ not found in this scope + +error[E0658]: only lifetime parameters can be used in this context + --> $DIR/elided-lifetime-in-const-param-type.rs:8:24 + | +LL | type A = dyn for<const B: c(&())> D; + | ^ + | + = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information + = help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0412, E0658. +For more information about an error, try `rustc --explain E0412`. diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed index 26c1c9015da..028f86eb0a3 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed @@ -1,5 +1,5 @@ //@ edition:2018 -//@ aux-build:../removing-extern-crate.rs +//@ aux-build: remove-extern-crate.rs //@ run-rustfix #![warn(rust_2018_idioms)] diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs index c5b629fa90b..1acf531a661 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs @@ -1,16 +1,16 @@ //@ edition:2018 -//@ aux-build:../removing-extern-crate.rs +//@ aux-build: remove-extern-crate.rs //@ run-rustfix #![warn(rust_2018_idioms)] #[cfg_attr(test, "macro_use")] //~ ERROR expected -extern crate removing_extern_crate as foo; //~ WARNING unused extern crate +extern crate remove_extern_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate mod another { #[cfg_attr(test)] //~ ERROR expected - extern crate removing_extern_crate as foo; //~ WARNING unused extern crate + extern crate remove_extern_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate } diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr index 0e834707bf9..632ecd62322 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr @@ -19,8 +19,8 @@ LL | #[cfg_attr(test)] warning: unused extern crate --> $DIR/removing-extern-crate-malformed-cfg.rs:8:1 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused +LL | extern crate remove_extern_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | note: the lint level is defined here --> $DIR/removing-extern-crate-malformed-cfg.rs:5:9 @@ -31,7 +31,7 @@ LL | #![warn(rust_2018_idioms)] help: remove the unused `extern crate` | LL - #[cfg_attr(test, "macro_use")] -LL - extern crate removing_extern_crate as foo; +LL - extern crate remove_extern_crate as foo; LL + | @@ -50,13 +50,13 @@ LL + warning: unused extern crate --> $DIR/removing-extern-crate-malformed-cfg.rs:13:5 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused +LL | extern crate remove_extern_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | help: remove the unused `extern crate` | LL - #[cfg_attr(test)] -LL - extern crate removing_extern_crate as foo; +LL - extern crate remove_extern_crate as foo; LL + | diff --git a/tests/ui/stable-mir-print/async-closure.rs b/tests/ui/rustc_public-ir-print/async-closure.rs index 80f96e09cfc..80f96e09cfc 100644 --- a/tests/ui/stable-mir-print/async-closure.rs +++ b/tests/ui/rustc_public-ir-print/async-closure.rs diff --git a/tests/ui/stable-mir-print/async-closure.stdout b/tests/ui/rustc_public-ir-print/async-closure.stdout index 31811299722..4afb15af7a9 100644 --- a/tests/ui/stable-mir-print/async-closure.stdout +++ b/tests/ui/rustc_public-ir-print/async-closure.stdout @@ -1,4 +1,4 @@ -// WARNING: This is highly experimental output it's intended for stable-mir developers only. +// WARNING: This is highly experimental output it's intended for rustc_public developers only. // If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir. fn foo() -> () { let mut _0: (); diff --git a/tests/ui/stable-mir-print/basic_function.rs b/tests/ui/rustc_public-ir-print/basic_function.rs index 21469c61f72..21469c61f72 100644 --- a/tests/ui/stable-mir-print/basic_function.rs +++ b/tests/ui/rustc_public-ir-print/basic_function.rs diff --git a/tests/ui/stable-mir-print/basic_function.stdout b/tests/ui/rustc_public-ir-print/basic_function.stdout index 319d9c1dc69..dc885e009e9 100644 --- a/tests/ui/stable-mir-print/basic_function.stdout +++ b/tests/ui/rustc_public-ir-print/basic_function.stdout @@ -1,4 +1,4 @@ -// WARNING: This is highly experimental output it's intended for stable-mir developers only. +// WARNING: This is highly experimental output it's intended for rustc_public developers only. // If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir. fn foo(_1: i32) -> i32 { let mut _0: i32; diff --git a/tests/ui/stable-mir-print/operands.rs b/tests/ui/rustc_public-ir-print/operands.rs index 484ad07cf04..484ad07cf04 100644 --- a/tests/ui/stable-mir-print/operands.rs +++ b/tests/ui/rustc_public-ir-print/operands.rs diff --git a/tests/ui/stable-mir-print/operands.stdout b/tests/ui/rustc_public-ir-print/operands.stdout index 37c5ec1a95e..a4b1c07f3a0 100644 --- a/tests/ui/stable-mir-print/operands.stdout +++ b/tests/ui/rustc_public-ir-print/operands.stdout @@ -1,4 +1,4 @@ -// WARNING: This is highly experimental output it's intended for stable-mir developers only. +// WARNING: This is highly experimental output it's intended for rustc_public developers only. // If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir. fn operands(_1: u8) -> () { let mut _0: (); diff --git a/tests/ui/traits/const-traits/hir-const-check.rs b/tests/ui/traits/const-traits/hir-const-check.rs index c485fb12184..1b6fa1afab9 100644 --- a/tests/ui/traits/const-traits/hir-const-check.rs +++ b/tests/ui/traits/const-traits/hir-const-check.rs @@ -1,8 +1,10 @@ +//@ check-pass //@ compile-flags: -Znext-solver // Regression test for #69615. #![feature(const_trait_impl)] +#![feature(const_try)] #[const_trait] pub trait MyTrait { @@ -12,8 +14,6 @@ pub trait MyTrait { impl const MyTrait for () { fn method(&self) -> Option<()> { Some(())?; - //~^ ERROR `?` is not allowed on - //~| ERROR `?` is not allowed on None } } diff --git a/tests/ui/traits/const-traits/hir-const-check.stderr b/tests/ui/traits/const-traits/hir-const-check.stderr deleted file mode 100644 index d66a7ea3144..00000000000 --- a/tests/ui/traits/const-traits/hir-const-check.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/hir-const-check.rs:14:9 - | -LL | Some(())?; - | ^^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `Option<()>` in constant functions - --> $DIR/hir-const-check.rs:14:9 - | -LL | Some(())?; - | ^^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs index 47c85980aca..af552ac0c5e 100644 --- a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs +++ b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs @@ -1,11 +1,10 @@ #![allow(incomplete_features)] -#![feature(const_trait_impl, try_trait_v2)] +#![feature(const_trait_impl, const_try, try_trait_v2)] use std::ops::FromResidual; impl<T> const FromResidual for T { - //~^ ERROR const `impl` for trait `FromResidual` which is not `const` - //~| ERROR type parameter `T` must be used as the type parameter for some local type + //~^ ERROR type parameter `T` must be used as the type parameter for some local type fn from_residual(t: T) -> _ { //~^ ERROR the placeholder `_` is not allowed t diff --git a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr index 5c5fba95f02..08fc73fe77b 100644 --- a/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr +++ b/tests/ui/traits/const-traits/ice-119717-constant-lifetime.stderr @@ -1,12 +1,3 @@ -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/ice-119717-constant-lifetime.rs:6:15 - | -LL | impl<T> const FromResidual for T { - | ^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`) --> $DIR/ice-119717-constant-lifetime.rs:6:6 | @@ -17,7 +8,7 @@ LL | impl<T> const FromResidual for T { = note: only traits defined in the current crate can be implemented for a type parameter error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated functions - --> $DIR/ice-119717-constant-lifetime.rs:9:31 + --> $DIR/ice-119717-constant-lifetime.rs:8:31 | LL | fn from_residual(t: T) -> _ { | ^ not allowed in type signatures @@ -28,7 +19,7 @@ LL - fn from_residual(t: T) -> _ { LL + fn from_residual(t: T) -> T { | -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0121, E0210. For more information about an error, try `rustc --explain E0121`. diff --git a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs index 5e368b9e6a9..bfce9dc9c73 100644 --- a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs +++ b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs @@ -6,20 +6,16 @@ struct TryMe; struct Error; impl const FromResidual<Error> for TryMe {} -//~^ ERROR const `impl` for trait `FromResidual` which is not `const` -//~| ERROR not all trait items implemented +//~^ ERROR not all trait items implemented impl const Try for TryMe { - //~^ ERROR const `impl` for trait `Try` which is not `const` - //~| ERROR not all trait items implemented + //~^ ERROR not all trait items implemented type Output = (); type Residual = Error; } const fn t() -> TryMe { TryMe?; - //~^ ERROR `?` is not allowed on - //~| ERROR `?` is not allowed on TryMe } diff --git a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr index 849d6522cd6..183203aa8ba 100644 --- a/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr +++ b/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.stderr @@ -1,12 +1,3 @@ -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/ice-126148-failed-to-normalize.rs:8:12 - | -LL | impl const FromResidual<Error> for TryMe {} - | ^^^^^^^^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0046]: not all trait items implemented, missing: `from_residual` --> $DIR/ice-126148-failed-to-normalize.rs:8:1 | @@ -15,17 +6,8 @@ LL | impl const FromResidual<Error> for TryMe {} | = help: implement the missing item: `fn from_residual(_: Error) -> Self { todo!() }` -error: const `impl` for trait `Try` which is not `const` - --> $DIR/ice-126148-failed-to-normalize.rs:12:12 - | -LL | impl const Try for TryMe { - | ^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - error[E0046]: not all trait items implemented, missing: `from_output`, `branch` - --> $DIR/ice-126148-failed-to-normalize.rs:12:1 + --> $DIR/ice-126148-failed-to-normalize.rs:11:1 | LL | impl const Try for TryMe { | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_output`, `branch` in implementation @@ -33,23 +15,6 @@ LL | impl const Try for TryMe { = help: implement the missing item: `fn from_output(_: <Self as Try>::Output) -> Self { todo!() }` = help: implement the missing item: `fn branch(self) -> ControlFlow<<Self as Try>::Residual, <Self as Try>::Output> { todo!() }` -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/ice-126148-failed-to-normalize.rs:20:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `TryMe` in constant functions - --> $DIR/ice-126148-failed-to-normalize.rs:20:5 - | -LL | TryMe?; - | ^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 6 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0015, E0046. -For more information about an error, try `rustc --explain E0015`. +For more information about this error, try `rustc --explain E0046`. diff --git a/tests/ui/traits/const-traits/trait-default-body-stability.rs b/tests/ui/traits/const-traits/trait-default-body-stability.rs index 567f1b3c284..a8157d37ce3 100644 --- a/tests/ui/traits/const-traits/trait-default-body-stability.rs +++ b/tests/ui/traits/const-traits/trait-default-body-stability.rs @@ -1,4 +1,4 @@ -//@ known-bug: #110395 +//@ check-pass //@ compile-flags: -Znext-solver #![allow(incomplete_features)] #![feature(staged_api)] diff --git a/tests/ui/traits/const-traits/trait-default-body-stability.stderr b/tests/ui/traits/const-traits/trait-default-body-stability.stderr deleted file mode 100644 index b995d6f4f3d..00000000000 --- a/tests/ui/traits/const-traits/trait-default-body-stability.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error: const `impl` for trait `Try` which is not `const` - --> $DIR/trait-default-body-stability.rs:19:12 - | -LL | impl const Try for T { - | ^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: const `impl` for trait `FromResidual` which is not `const` - --> $DIR/trait-default-body-stability.rs:34:12 - | -LL | impl const FromResidual for T { - | ^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0015]: `?` is not allowed on `T` in constant functions - --> $DIR/trait-default-body-stability.rs:46:9 - | -LL | T? - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: `?` is not allowed on `T` in constant functions - --> $DIR/trait-default-body-stability.rs:46:9 - | -LL | T? - | ^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0015`. |
