mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 17:28:09 +00:00
Expand global_asm!
to nothing
This commit is contained in:
parent
19fc1f333f
commit
ae84a71e4a
2 changed files with 11 additions and 0 deletions
|
@ -110,6 +110,7 @@ register_builtin! {
|
||||||
(format_args_nl, FormatArgsNl) => format_args_expand,
|
(format_args_nl, FormatArgsNl) => format_args_expand,
|
||||||
(llvm_asm, LlvmAsm) => asm_expand,
|
(llvm_asm, LlvmAsm) => asm_expand,
|
||||||
(asm, Asm) => asm_expand,
|
(asm, Asm) => asm_expand,
|
||||||
|
(global_asm, GlobalAsm) => global_asm_expand,
|
||||||
(cfg, Cfg) => cfg_expand,
|
(cfg, Cfg) => cfg_expand,
|
||||||
(core_panic, CorePanic) => panic_expand,
|
(core_panic, CorePanic) => panic_expand,
|
||||||
(std_panic, StdPanic) => panic_expand,
|
(std_panic, StdPanic) => panic_expand,
|
||||||
|
@ -274,6 +275,15 @@ fn asm_expand(
|
||||||
ExpandResult::ok(expanded)
|
ExpandResult::ok(expanded)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn global_asm_expand(
|
||||||
|
_db: &dyn AstDatabase,
|
||||||
|
_id: LazyMacroId,
|
||||||
|
_tt: &tt::Subtree,
|
||||||
|
) -> ExpandResult<tt::Subtree> {
|
||||||
|
// Expand to nothing (at item-level)
|
||||||
|
ExpandResult::ok(quote! {})
|
||||||
|
}
|
||||||
|
|
||||||
fn cfg_expand(
|
fn cfg_expand(
|
||||||
db: &dyn AstDatabase,
|
db: &dyn AstDatabase,
|
||||||
id: LazyMacroId,
|
id: LazyMacroId,
|
||||||
|
|
|
@ -221,6 +221,7 @@ pub mod known {
|
||||||
option_env,
|
option_env,
|
||||||
llvm_asm,
|
llvm_asm,
|
||||||
asm,
|
asm,
|
||||||
|
global_asm,
|
||||||
// Builtin derives
|
// Builtin derives
|
||||||
Copy,
|
Copy,
|
||||||
Clone,
|
Clone,
|
||||||
|
|
Loading…
Reference in a new issue