From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/attributes/issue-105594-invalid-attr-validation.rs | 2 +- tests/ui/attributes/no-mangle-closure.rs | 11 +++++++++++ tests/ui/attributes/no-mangle-closure.stderr | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/ui/attributes/no-mangle-closure.rs create mode 100644 tests/ui/attributes/no-mangle-closure.stderr (limited to 'tests/ui/attributes') diff --git a/tests/ui/attributes/issue-105594-invalid-attr-validation.rs b/tests/ui/attributes/issue-105594-invalid-attr-validation.rs index 6c68e6b04..096ce97ab 100644 --- a/tests/ui/attributes/issue-105594-invalid-attr-validation.rs +++ b/tests/ui/attributes/issue-105594-invalid-attr-validation.rs @@ -1,7 +1,7 @@ // This checks that the attribute validation ICE in issue #105594 doesn't // recur. // -// ignore-thumbv8m.base +// ignore-thumbv8m.base-none-eabi #![feature(cmse_nonsecure_entry)] fn main() {} diff --git a/tests/ui/attributes/no-mangle-closure.rs b/tests/ui/attributes/no-mangle-closure.rs new file mode 100644 index 000000000..c76baa27f --- /dev/null +++ b/tests/ui/attributes/no-mangle-closure.rs @@ -0,0 +1,11 @@ +// Check that we do not ICE when `no_mangle` is applied to something that has no name. + +#![crate_type = "lib"] +#![feature(stmt_expr_attributes)] + +pub struct S([usize; 8]); + +pub fn outer_function(x: S, y: S) -> usize { + (#[no_mangle] || y.0[0])() + //~^ ERROR `#[no_mangle]` cannot be used on a closure as it has no name +} diff --git a/tests/ui/attributes/no-mangle-closure.stderr b/tests/ui/attributes/no-mangle-closure.stderr new file mode 100644 index 000000000..949eb7051 --- /dev/null +++ b/tests/ui/attributes/no-mangle-closure.stderr @@ -0,0 +1,8 @@ +error: `#[no_mangle]` cannot be used on a closure as it has no name + --> $DIR/no-mangle-closure.rs:9:6 + | +LL | (#[no_mangle] || y.0[0])() + | ^^^^^^^^^^^^ + +error: aborting due to previous error + -- cgit v1.2.3