2024-08-05 19:07:32 +09:00
|
|
|
#![feature(no_sanitize)]
|
|
|
|
#![feature(stmt_expr_attributes)]
|
|
|
|
#![deny(unused_attributes)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
fn invalid() {
|
2024-07-08 15:49:50 +02:00
|
|
|
#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function
|
2024-08-05 19:07:32 +09:00
|
|
|
{
|
|
|
|
1
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2024-07-08 15:49:50 +02:00
|
|
|
#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function
|
2024-08-05 19:07:32 +09:00
|
|
|
type InvalidTy = ();
|
|
|
|
|
2024-07-08 15:49:50 +02:00
|
|
|
#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function
|
2024-08-05 19:07:32 +09:00
|
|
|
mod invalid_module {}
|
|
|
|
|
|
|
|
fn main() {
|
2024-07-08 15:49:50 +02:00
|
|
|
let _ = #[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function
|
2024-08-05 19:07:32 +09:00
|
|
|
(|| 1);
|
|
|
|
}
|
|
|
|
|
2024-07-08 15:49:50 +02:00
|
|
|
#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function
|
2024-08-05 19:07:32 +09:00
|
|
|
struct F;
|
|
|
|
|
2024-07-08 15:49:50 +02:00
|
|
|
#[no_sanitize(memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function
|
2024-08-05 19:07:32 +09:00
|
|
|
impl F {
|
|
|
|
#[no_sanitize(memory)]
|
|
|
|
fn valid(&self) {}
|
|
|
|
}
|
|
|
|
|
2024-07-08 15:49:50 +02:00
|
|
|
#[no_sanitize(address, memory)] //~ ERROR `#[no_sanitize(memory)]` should be applied to a function
|
|
|
|
static INVALID : i32 = 0;
|
|
|
|
|
2024-08-05 19:07:32 +09:00
|
|
|
#[no_sanitize(memory)]
|
|
|
|
fn valid() {}
|
2024-07-08 15:49:50 +02:00
|
|
|
|
|
|
|
#[no_sanitize(address)]
|
|
|
|
static VALID : i32 = 0;
|
2025-04-10 13:47:35 +10:00
|
|
|
|
|
|
|
#[no_sanitize("address")]
|
2025-04-10 14:33:59 +10:00
|
|
|
//~^ ERROR `#[no_sanitize(...)]` should be applied to a function
|
2025-04-10 13:47:35 +10:00
|
|
|
//~| ERROR invalid argument for `no_sanitize`
|
|
|
|
static VALID2 : i32 = 0;
|