File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ register_builtin! {
95
95
// format_args_nl only differs in that it adds a newline in the end,
96
96
// so we use the same stub expansion for now
97
97
( format_args_nl, FormatArgsNl ) => format_args_expand,
98
+ ( llvm_asm, LlvmAsm ) => asm_expand,
99
+ ( asm, Asm ) => asm_expand,
98
100
99
101
EAGER :
100
102
( compile_error, CompileError ) => compile_error_expand,
@@ -271,6 +273,19 @@ fn format_args_expand(
271
273
ExpandResult :: ok ( expanded)
272
274
}
273
275
276
+ fn asm_expand (
277
+ _db : & dyn AstDatabase ,
278
+ _id : LazyMacroId ,
279
+ _tt : & tt:: Subtree ,
280
+ ) -> ExpandResult < tt:: Subtree > {
281
+ // both asm and llvm_asm don't return anything, so we can expand them to nothing,
282
+ // for now
283
+ let expanded = quote ! {
284
+ ( )
285
+ } ;
286
+ ExpandResult :: ok ( expanded)
287
+ }
288
+
274
289
fn unquote_str ( lit : & tt:: Literal ) -> Option < String > {
275
290
let lit = ast:: make:: tokens:: literal ( & lit. to_string ( ) ) ;
276
291
let token = ast:: String :: cast ( lit) ?;
Original file line number Diff line number Diff line change @@ -199,6 +199,8 @@ pub mod known {
199
199
format_args_nl,
200
200
env,
201
201
option_env,
202
+ llvm_asm,
203
+ asm,
202
204
// Builtin derives
203
205
Copy ,
204
206
Clone ,
You can’t perform that action at this time.
0 commit comments