Skip to content

Commit e4165e9

Browse files
committed
Move cfg is in expermental posistion and update fmt str.
1 parent 512a4c7 commit e4165e9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/tools/rust-analyzer/crates/proc-macro-srv/src/token_stream.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ fn debug_token_tree<S: fmt::Debug>(
581581
write!(f, "{:indent$}", "", indent = depth * 2)?;
582582
match tt {
583583
TokenTree::Group(Group { delimiter, stream, span }) => {
584+
#[cfg(bootstrap)]
584585
writeln!(
585586
f,
586587
"GROUP {}{} {:#?} {:#?} {:#?}",
@@ -598,9 +599,27 @@ fn debug_token_tree<S: fmt::Debug>(
598599
},
599600
span.open,
600601
span.close,
601-
#[cfg(bootstrap)]
602602
span.entire,
603603
)?;
604+
#[cfg(not(bootstrap))]
605+
writeln!(
606+
f,
607+
"GROUP {}{} {:#?} {:#?}",
608+
match delimiter {
609+
proc_macro::Delimiter::Parenthesis => "(",
610+
proc_macro::Delimiter::Brace => "{",
611+
proc_macro::Delimiter::Bracket => "[",
612+
proc_macro::Delimiter::None => "$",
613+
},
614+
match delimiter {
615+
proc_macro::Delimiter::Parenthesis => ")",
616+
proc_macro::Delimiter::Brace => "}",
617+
proc_macro::Delimiter::Bracket => "]",
618+
proc_macro::Delimiter::None => "$",
619+
},
620+
span.open,
621+
span.close,
622+
)?;
604623
if let Some(stream) = stream {
605624
debug_token_stream(stream, depth + 1, f)?;
606625
}

0 commit comments

Comments
 (0)