Skip to content

Commit ae84a71

Browse files
Expand global_asm! to nothing
1 parent 19fc1f3 commit ae84a71

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

crates/hir_expand/src/builtin_macro.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ register_builtin! {
110110
(format_args_nl, FormatArgsNl) => format_args_expand,
111111
(llvm_asm, LlvmAsm) => asm_expand,
112112
(asm, Asm) => asm_expand,
113+
(global_asm, GlobalAsm) => global_asm_expand,
113114
(cfg, Cfg) => cfg_expand,
114115
(core_panic, CorePanic) => panic_expand,
115116
(std_panic, StdPanic) => panic_expand,
@@ -274,6 +275,15 @@ fn asm_expand(
274275
ExpandResult::ok(expanded)
275276
}
276277

278+
fn global_asm_expand(
279+
_db: &dyn AstDatabase,
280+
_id: LazyMacroId,
281+
_tt: &tt::Subtree,
282+
) -> ExpandResult<tt::Subtree> {
283+
// Expand to nothing (at item-level)
284+
ExpandResult::ok(quote! {})
285+
}
286+
277287
fn cfg_expand(
278288
db: &dyn AstDatabase,
279289
id: LazyMacroId,

crates/hir_expand/src/name.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ pub mod known {
221221
option_env,
222222
llvm_asm,
223223
asm,
224+
global_asm,
224225
// Builtin derives
225226
Copy,
226227
Clone,

0 commit comments

Comments
 (0)