Jonathan Brouwer 4bb7bf64e0
Update uitests
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-14 18:18:42 +02:00

24 lines
530 B
Rust

//! Checks that `#[used]` cannot be used on invalid positions.
#![crate_type = "lib"]
#[used]
static FOO: u32 = 0; // OK
#[used] //~ ERROR attribute cannot be used on
fn foo() {}
#[used] //~ ERROR attribute cannot be used on
struct Foo {}
#[used] //~ ERROR attribute cannot be used on
trait Bar {}
#[used] //~ ERROR attribute cannot be used on
impl Bar for Foo {}
// Regression test for <https://github.com/rust-lang/rust/issues/126789>.
extern "C" {
#[used] //~ ERROR attribute cannot be used on
static BAR: i32;
}