Support RFC 2396

AKA. target_feature 1.1, or non unsafe target_feature.
This commit is contained in:
Chayim Refael Friedman 2025-01-26 23:31:58 +02:00
parent 2df4ecfc74
commit 791b1ebfd4
14 changed files with 132 additions and 24 deletions

View file

@ -812,4 +812,24 @@ fn main() {
"#,
)
}
#[test]
fn target_feature() {
check_diagnostics(
r#"
#[target_feature(enable = "avx")]
fn foo() {}
#[target_feature(enable = "avx,avx2")]
fn bar() {
foo();
}
fn baz() {
foo();
// ^^^^^ 💡 error: call to unsafe function is unsafe and requires an unsafe function or block
}
"#,
);
}
}