mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +00:00
Differentiate between asm!(), global_asm!() and naked_asm!(), and make only asm!() unsafe
This commit is contained in:
parent
edb804a100
commit
bd8087e86e
16 changed files with 198 additions and 16 deletions
|
|
@ -21,6 +21,8 @@ mod ok {
|
|||
#[test]
|
||||
fn asm_expr() { run_and_expect_no_errors("test_data/parser/inline/ok/asm_expr.rs"); }
|
||||
#[test]
|
||||
fn asm_kinds() { run_and_expect_no_errors("test_data/parser/inline/ok/asm_kinds.rs"); }
|
||||
#[test]
|
||||
fn asm_label() { run_and_expect_no_errors("test_data/parser/inline/ok/asm_label.rs"); }
|
||||
#[test]
|
||||
fn assoc_const_eq() {
|
||||
|
|
|
|||
49
crates/parser/test_data/parser/inline/ok/asm_kinds.rast
Normal file
49
crates/parser/test_data/parser/inline/ok/asm_kinds.rast
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
SOURCE_FILE
|
||||
FN
|
||||
FN_KW "fn"
|
||||
WHITESPACE " "
|
||||
NAME
|
||||
IDENT "foo"
|
||||
PARAM_LIST
|
||||
L_PAREN "("
|
||||
R_PAREN ")"
|
||||
WHITESPACE " "
|
||||
BLOCK_EXPR
|
||||
STMT_LIST
|
||||
L_CURLY "{"
|
||||
WHITESPACE "\n "
|
||||
EXPR_STMT
|
||||
ASM_EXPR
|
||||
BUILTIN_KW "builtin"
|
||||
POUND "#"
|
||||
ASM_KW "asm"
|
||||
L_PAREN "("
|
||||
LITERAL
|
||||
STRING "\"\""
|
||||
R_PAREN ")"
|
||||
SEMICOLON ";"
|
||||
WHITESPACE "\n "
|
||||
EXPR_STMT
|
||||
ASM_EXPR
|
||||
BUILTIN_KW "builtin"
|
||||
POUND "#"
|
||||
GLOBAL_ASM_KW "global_asm"
|
||||
L_PAREN "("
|
||||
LITERAL
|
||||
STRING "\"\""
|
||||
R_PAREN ")"
|
||||
SEMICOLON ";"
|
||||
WHITESPACE "\n "
|
||||
EXPR_STMT
|
||||
ASM_EXPR
|
||||
BUILTIN_KW "builtin"
|
||||
POUND "#"
|
||||
NAKED_ASM_KW "naked_asm"
|
||||
L_PAREN "("
|
||||
LITERAL
|
||||
STRING "\"\""
|
||||
R_PAREN ")"
|
||||
SEMICOLON ";"
|
||||
WHITESPACE "\n"
|
||||
R_CURLY "}"
|
||||
WHITESPACE "\n"
|
||||
5
crates/parser/test_data/parser/inline/ok/asm_kinds.rs
Normal file
5
crates/parser/test_data/parser/inline/ok/asm_kinds.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
fn foo() {
|
||||
builtin#asm("");
|
||||
builtin#global_asm("");
|
||||
builtin#naked_asm("");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue