From 6e3a0154005e24bb5de47101c845d99d22bedd76 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Mon, 1 Dec 2025 22:03:53 +0100 Subject: [PATCH] UI test changes --- .../unsafe/double-unsafe-attributes.stderr | 12 +-- .../unsafe/proc-unsafe-attributes.stderr | 80 +++++++++---------- tests/ui/ffi-attrs/ffi_const.stderr | 22 ++--- tests/ui/ffi-attrs/ffi_pure.stderr | 22 ++--- 4 files changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr index 0825cf794083..8ab945e0f182 100644 --- a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr @@ -9,6 +9,12 @@ help: escape `unsafe` to use it as an identifier LL | #[unsafe(r#unsafe(no_mangle))] | ++ +error: cannot find attribute `r#unsafe` in this scope + --> $DIR/double-unsafe-attributes.rs:1:10 + | +LL | #[unsafe(unsafe(no_mangle))] + | ^^^^^^ + error: `r#unsafe` is not an unsafe attribute --> $DIR/double-unsafe-attributes.rs:1:3 | @@ -17,11 +23,5 @@ LL | #[unsafe(unsafe(no_mangle))] | = note: extraneous unsafe is not allowed in attributes -error: cannot find attribute `r#unsafe` in this scope - --> $DIR/double-unsafe-attributes.rs:1:10 - | -LL | #[unsafe(unsafe(no_mangle))] - | ^^^^^^ - error: aborting due to 3 previous errors diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr index 94edb263a6af..4527cf676f78 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr @@ -12,46 +12,6 @@ LL | #[unsafe(allow(unsafe(dead_code)))] | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: `proc_macro` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:1:3 - | -LL | #[unsafe(proc_macro)] - | ^^^^^^ this is not an unsafe attribute - | - = note: extraneous unsafe is not allowed in attributes - -error: `proc_macro_derive` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:7:3 - | -LL | #[unsafe(proc_macro_derive(Foo))] - | ^^^^^^ this is not an unsafe attribute - | - = note: extraneous unsafe is not allowed in attributes - -error: `proc_macro_attribute` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:18:3 - | -LL | #[unsafe(proc_macro_attribute)] - | ^^^^^^ this is not an unsafe attribute - | - = note: extraneous unsafe is not allowed in attributes - -error: `allow` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:23:3 - | -LL | #[unsafe(allow(dead_code))] - | ^^^^^^ this is not an unsafe attribute - | - = note: extraneous unsafe is not allowed in attributes - -error: `allow` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:27:3 - | -LL | #[unsafe(allow(unsafe(dead_code)))] - | ^^^^^^ this is not an unsafe attribute - | - = note: extraneous unsafe is not allowed in attributes - error: expected identifier, found keyword `unsafe` --> $DIR/proc-unsafe-attributes.rs:27:16 | @@ -103,6 +63,22 @@ LL | #[unsafe(allow(unsafe(dead_code)))] | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +error: `proc_macro` is not an unsafe attribute + --> $DIR/proc-unsafe-attributes.rs:1:3 + | +LL | #[unsafe(proc_macro)] + | ^^^^^^ this is not an unsafe attribute + | + = note: extraneous unsafe is not allowed in attributes + +error: `proc_macro_derive` is not an unsafe attribute + --> $DIR/proc-unsafe-attributes.rs:7:3 + | +LL | #[unsafe(proc_macro_derive(Foo))] + | ^^^^^^ this is not an unsafe attribute + | + = note: extraneous unsafe is not allowed in attributes + error: expected identifier, found keyword `unsafe` --> $DIR/proc-unsafe-attributes.rs:12:21 | @@ -132,6 +108,30 @@ LL - #[proc_macro_derive(unsafe(Foo))] LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | +error: `proc_macro_attribute` is not an unsafe attribute + --> $DIR/proc-unsafe-attributes.rs:18:3 + | +LL | #[unsafe(proc_macro_attribute)] + | ^^^^^^ this is not an unsafe attribute + | + = note: extraneous unsafe is not allowed in attributes + +error: `allow` is not an unsafe attribute + --> $DIR/proc-unsafe-attributes.rs:23:3 + | +LL | #[unsafe(allow(dead_code))] + | ^^^^^^ this is not an unsafe attribute + | + = note: extraneous unsafe is not allowed in attributes + +error: `allow` is not an unsafe attribute + --> $DIR/proc-unsafe-attributes.rs:27:3 + | +LL | #[unsafe(allow(unsafe(dead_code)))] + | ^^^^^^ this is not an unsafe attribute + | + = note: extraneous unsafe is not allowed in attributes + error[E0452]: malformed lint attribute input --> $DIR/proc-unsafe-attributes.rs:27:16 | diff --git a/tests/ui/ffi-attrs/ffi_const.stderr b/tests/ui/ffi-attrs/ffi_const.stderr index f3be92543183..af54486e433c 100644 --- a/tests/ui/ffi-attrs/ffi_const.stderr +++ b/tests/ui/ffi-attrs/ffi_const.stderr @@ -1,14 +1,3 @@ -error: unsafe attribute used without unsafe - --> $DIR/ffi_const.rs:16:7 - | -LL | #[ffi_const] - | ^^^^^^^^^ usage of unsafe attribute - | -help: wrap the attribute in `unsafe(...)` - | -LL | #[unsafe(ffi_const)] - | +++++++ + - error: `#[ffi_const]` attribute cannot be used on functions --> $DIR/ffi_const.rs:4:1 | @@ -33,5 +22,16 @@ LL | #[unsafe(ffi_const)] | = help: `#[ffi_const]` can only be applied to foreign functions +error: unsafe attribute used without unsafe + --> $DIR/ffi_const.rs:16:7 + | +LL | #[ffi_const] + | ^^^^^^^^^ usage of unsafe attribute + | +help: wrap the attribute in `unsafe(...)` + | +LL | #[unsafe(ffi_const)] + | +++++++ + + error: aborting due to 4 previous errors diff --git a/tests/ui/ffi-attrs/ffi_pure.stderr b/tests/ui/ffi-attrs/ffi_pure.stderr index da1eae975ac2..11e9199b40f4 100644 --- a/tests/ui/ffi-attrs/ffi_pure.stderr +++ b/tests/ui/ffi-attrs/ffi_pure.stderr @@ -1,14 +1,3 @@ -error: unsafe attribute used without unsafe - --> $DIR/ffi_pure.rs:16:7 - | -LL | #[ffi_pure] - | ^^^^^^^^ usage of unsafe attribute - | -help: wrap the attribute in `unsafe(...)` - | -LL | #[unsafe(ffi_pure)] - | +++++++ + - error: `#[ffi_pure]` attribute cannot be used on functions --> $DIR/ffi_pure.rs:4:1 | @@ -33,5 +22,16 @@ LL | #[unsafe(ffi_pure)] | = help: `#[ffi_pure]` can only be applied to foreign functions +error: unsafe attribute used without unsafe + --> $DIR/ffi_pure.rs:16:7 + | +LL | #[ffi_pure] + | ^^^^^^^^ usage of unsafe attribute + | +help: wrap the attribute in `unsafe(...)` + | +LL | #[unsafe(ffi_pure)] + | +++++++ + + error: aborting due to 4 previous errors