Skip to content

Commit dd43f3f

Browse files
bors[bot]Veykril
andauthored
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 #2212 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
2 parents a3830df + 54e6583 commit dd43f3f

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

crates/hir_expand/src/builtin_fn_macro.rs

+18
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ register_builtin! {
113113
(cfg, Cfg) => cfg_expand,
114114
(core_panic, CorePanic) => panic_expand,
115115
(std_panic, StdPanic) => panic_expand,
116+
(log_syntax, LogSyntax) => log_syntax_expand,
117+
(trace_macros, TraceMacros) => trace_macros_expand,
116118

117119
EAGER:
118120
(compile_error, CompileError) => compile_error_expand,
@@ -148,6 +150,22 @@ fn line_expand(
148150
ExpandResult::ok(expanded)
149151
}
150152

153+
fn log_syntax_expand(
154+
_db: &dyn AstDatabase,
155+
_id: MacroCallId,
156+
_tt: &tt::Subtree,
157+
) -> ExpandResult<tt::Subtree> {
158+
ExpandResult::ok(quote! {})
159+
}
160+
161+
fn trace_macros_expand(
162+
_db: &dyn AstDatabase,
163+
_id: MacroCallId,
164+
_tt: &tt::Subtree,
165+
) -> ExpandResult<tt::Subtree> {
166+
ExpandResult::ok(quote! {})
167+
}
168+
151169
fn stringify_expand(
152170
_db: &dyn AstDatabase,
153171
_id: MacroCallId,

crates/hir_expand/src/name.rs

+18-16
Original file line numberDiff line numberDiff line change
@@ -226,28 +226,30 @@ pub mod known {
226226
len,
227227
is_empty,
228228
// Builtin macros
229-
file,
229+
asm,
230+
assert,
230231
column,
231-
const_format_args,
232232
compile_error,
233-
line,
234-
module_path,
235-
assert,
236-
core_panic,
237-
std_panic,
238-
stringify,
239-
concat,
240233
concat_idents,
241-
include,
234+
concat,
235+
const_format_args,
236+
core_panic,
237+
env,
238+
file,
239+
format_args_nl,
240+
format_args,
241+
global_asm,
242242
include_bytes,
243243
include_str,
244-
format_args,
245-
format_args_nl,
246-
env,
247-
option_env,
244+
include,
245+
line,
248246
llvm_asm,
249-
asm,
250-
global_asm,
247+
log_syntax,
248+
module_path,
249+
option_env,
250+
std_panic,
251+
stringify,
252+
trace_macros,
251253
// Builtin derives
252254
Copy,
253255
Clone,

0 commit comments

Comments
 (0)