Rollup merge of #125316 - nnethercote:tweak-Spacing, r=petrochenkov

Tweak `Spacing` use

Some clean-up precursors to #125174.

r? ``@petrochenkov``
This commit is contained in:
Matthias Krüger 2024-05-23 07:41:18 +02:00 committed by GitHub
commit 3c79f0cd69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 75 additions and 31 deletions

View file

@ -153,7 +153,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
fn build_panic(&self, expr_str: &str, panic_path: Path) -> P<Expr> {
let escaped_expr_str = escape_to_fmt(expr_str);
let initial = [
TokenTree::token_joint_hidden(
TokenTree::token_joint(
token::Literal(token::Lit {
kind: token::LitKind::Str,
symbol: Symbol::intern(&if self.fmt_string.is_empty() {
@ -172,7 +172,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
];
let captures = self.capture_decls.iter().flat_map(|cap| {
[
TokenTree::token_joint_hidden(
TokenTree::token_joint(
token::Ident(cap.ident.name, IdentIsRaw::No),
cap.ident.span,
),