rust/compiler/rustc_builtin_macros/src/log_syntax.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
482 B
Rust
Raw Normal View History

use rustc_ast::tokenstream::TokenStream;
use rustc_ast_pretty::pprust;
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacroExpanderResult};
2024-04-25 21:56:48 +00:00
pub(crate) fn expand_log_syntax<'cx>(
_cx: &'cx mut ExtCtxt<'_>,
sp: rustc_span::Span,
tts: TokenStream,
) -> MacroExpanderResult<'cx> {
println!("{}", pprust::tts_to_string(&tts));
// any so that `log_syntax` can be invoked as an expression and item.
ExpandResult::Ready(DummyResult::any_valid(sp))
}