about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-12-12 17:40:51 +0100
committerLukas Wirth <lukastw97@gmail.com>2024-12-12 17:43:27 +0100
commit88457c06843e57bc1bb73594ed9ca5fbf8c4747d (patch)
tree680c5e394531e833fd3e54450df5f0710f1ba44d /src/tools/rust-analyzer
parent648a00936b56a3fa08993018c00248adaa66da42 (diff)
downloadrust-88457c06843e57bc1bb73594ed9ca5fbf8c4747d.tar.gz
rust-88457c06843e57bc1bb73594ed9ca5fbf8c4747d.zip
internal: Implement `naked_asm!` builtin
Diffstat (limited to 'src/tools/rust-analyzer')
-rw-r--r--src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs3
-rw-r--r--src/tools/rust-analyzer/crates/hir/src/semantics.rs1
-rw-r--r--src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs b/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs
index 4894c7a9311..b76db2e0052 100644
--- a/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs
+++ b/src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs
@@ -74,7 +74,7 @@ impl BuiltinFnLikeExpander {
     }
 
     pub fn is_asm(&self) -> bool {
-        matches!(self, Self::Asm | Self::GlobalAsm)
+        matches!(self, Self::Asm | Self::GlobalAsm | Self::NakedAsm)
     }
 }
 
@@ -122,6 +122,7 @@ register_builtin! {
     (stringify, Stringify) => stringify_expand,
     (asm, Asm) => asm_expand,
     (global_asm, GlobalAsm) => asm_expand,
+    (naked_asm, NakedAsm) => asm_expand,
     (cfg, Cfg) => cfg_expand,
     (core_panic, CorePanic) => panic_expand,
     (std_panic, StdPanic) => panic_expand,
diff --git a/src/tools/rust-analyzer/crates/hir/src/semantics.rs b/src/tools/rust-analyzer/crates/hir/src/semantics.rs
index f9d3f9d07e6..602b085f00c 100644
--- a/src/tools/rust-analyzer/crates/hir/src/semantics.rs
+++ b/src/tools/rust-analyzer/crates/hir/src/semantics.rs
@@ -434,6 +434,7 @@ impl<'db> SemanticsImpl<'db> {
                     | BuiltinFnLikeExpander::ModulePath
                     | BuiltinFnLikeExpander::Asm
                     | BuiltinFnLikeExpander::GlobalAsm
+                    | BuiltinFnLikeExpander::NakedAsm
                     | BuiltinFnLikeExpander::LogSyntax
                     | BuiltinFnLikeExpander::TraceMacros
                     | BuiltinFnLikeExpander::FormatArgs
diff --git a/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs b/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs
index 1120d3c7d60..c15751e7c68 100644
--- a/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs
+++ b/src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs
@@ -307,6 +307,7 @@ define_symbols! {
     module_path,
     mul_assign,
     mul,
+    naked_asm,
     ne,
     neg,
     Neg,