mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 13:23:25 +00:00
Support RFC 2396
AKA. target_feature 1.1, or non unsafe target_feature.
This commit is contained in:
parent
2df4ecfc74
commit
791b1ebfd4
14 changed files with 132 additions and 24 deletions
|
|
@ -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
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue