Unnamed repository; edit this file 'description' to name the repository.
Merge #10642
10642: minor: Add dummy impls for `trace_macros` and `log_syntax` r=Veykril a=Veykril Both of these are macros for debugging macros and as such don't really need an implementation for us. Closes https://github.com/rust-analyzer/rust-analyzer/issues/2212 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
bors[bot] 2021-10-27
parent a3830df · parent 54e6583 · commit dd43f3f
-rw-r--r--crates/hir_expand/src/builtin_fn_macro.rs18
-rw-r--r--crates/hir_expand/src/name.rs34
2 files changed, 36 insertions, 16 deletions
diff --git a/crates/hir_expand/src/builtin_fn_macro.rs b/crates/hir_expand/src/builtin_fn_macro.rs
index 4b801eb2a1..7d45ba00d6 100644
--- a/crates/hir_expand/src/builtin_fn_macro.rs
+++ b/crates/hir_expand/src/builtin_fn_macro.rs
@@ -113,6 +113,8 @@ register_builtin! {
(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<tt::Subtree> {
+ ExpandResult::ok(quote! {})
+}
+
+fn trace_macros_expand(
+ _db: &dyn AstDatabase,
+ _id: MacroCallId,
+ _tt: &tt::Subtree,
+) -> ExpandResult<tt::Subtree> {
+ 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 2962b02e51..5022642b0c 100644
--- a/crates/hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -226,28 +226,30 @@ pub mod known {
len,
is_empty,
// Builtin macros
- file,
+ asm,
+ assert,
column,
- const_format_args,
compile_error,
- line,
- module_path,
- assert,
- core_panic,
- std_panic,
- stringify,
- concat,
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,