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 <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-10-26 18:55:42 +00:00 committed by GitHub
commit dd43f3f2d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 17 deletions

View File

@ -113,6 +113,8 @@ register_builtin! {
(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,
(log_syntax, LogSyntax) => log_syntax_expand,
(trace_macros, TraceMacros) => trace_macros_expand,
EAGER: EAGER:
(compile_error, CompileError) => compile_error_expand, (compile_error, CompileError) => compile_error_expand,
@ -148,6 +150,22 @@ fn line_expand(
ExpandResult::ok(expanded) 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( fn stringify_expand(
_db: &dyn AstDatabase, _db: &dyn AstDatabase,
_id: MacroCallId, _id: MacroCallId,

View File

@ -226,28 +226,30 @@ pub mod known {
len, len,
is_empty, is_empty,
// Builtin macros // Builtin macros
file, asm,
column,
const_format_args,
compile_error,
line,
module_path,
assert, assert,
core_panic, column,
std_panic, compile_error,
stringify,
concat,
concat_idents, concat_idents,
include, concat,
const_format_args,
core_panic,
env,
file,
format_args_nl,
format_args,
global_asm,
include_bytes, include_bytes,
include_str, include_str,
format_args, include,
format_args_nl, line,
env,
option_env,
llvm_asm, llvm_asm,
asm, log_syntax,
global_asm, module_path,
option_env,
std_panic,
stringify,
trace_macros,
// Builtin derives // Builtin derives
Copy, Copy,
Clone, Clone,