From 54e6583f5383fa080a730424edcc9bc376ba02a7 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 26 Oct 2021 20:52:38 +0200 Subject: [PATCH] Add dummy impls for `trace_macros` and `log_syntax` --- crates/hir_expand/src/builtin_fn_macro.rs | 18 ++++++++++++ crates/hir_expand/src/name.rs | 36 ++++++++++++----------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/crates/hir_expand/src/builtin_fn_macro.rs b/crates/hir_expand/src/builtin_fn_macro.rs index 4b801eb2a15..7d45ba00d68 100644 --- a/crates/hir_expand/src/builtin_fn_macro.rs +++ b/crates/hir_expand/src/builtin_fn_macro.rs @@ -113,6 +113,8 @@ pub fn find_builtin_macro( (cfg, Cfg) => cfg_expand, (core_panic, CorePanic) => panic_expand, (std_panic, StdPanic) => panic_expand, + (log_syntax, LogSyntax) => log_syntax_expand, + (trace_macros, TraceMacros) => trace_macros_expand, EAGER: (compile_error, CompileError) => compile_error_expand, @@ -148,6 +150,22 @@ fn line_expand( ExpandResult::ok(expanded) } +fn log_syntax_expand( + _db: &dyn AstDatabase, + _id: MacroCallId, + _tt: &tt::Subtree, +) -> ExpandResult { + ExpandResult::ok(quote! {}) +} + +fn trace_macros_expand( + _db: &dyn AstDatabase, + _id: MacroCallId, + _tt: &tt::Subtree, +) -> ExpandResult { + ExpandResult::ok(quote! {}) +} + fn stringify_expand( _db: &dyn AstDatabase, _id: MacroCallId, diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs index 2962b02e51b..5022642b0c7 100644 --- a/crates/hir_expand/src/name.rs +++ b/crates/hir_expand/src/name.rs @@ -226,28 +226,30 @@ macro_rules! known_names { len, is_empty, // Builtin macros - file, - column, - const_format_args, - compile_error, - line, - module_path, + asm, assert, - core_panic, - std_panic, - stringify, - concat, + column, + compile_error, concat_idents, - include, + concat, + const_format_args, + core_panic, + env, + file, + format_args_nl, + format_args, + global_asm, include_bytes, include_str, - format_args, - format_args_nl, - env, - option_env, + include, + line, llvm_asm, - asm, - global_asm, + log_syntax, + module_path, + option_env, + std_panic, + stringify, + trace_macros, // Builtin derives Copy, Clone,