Remove unnecessary predefined symbol clones

Now that they're const it's no longer needed.

Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
This commit is contained in:
Chayim Refael Friedman 2025-04-21 03:10:13 +03:00
parent 9477e46bec
commit 0f325c7ff8
55 changed files with 312 additions and 361 deletions

View file

@ -80,7 +80,7 @@ impl<'t> Bindings<'t> {
| MetaVarKind::Expr(_)
| MetaVarKind::Ident => {
builder.push(tt::Leaf::Ident(tt::Ident {
sym: sym::missing.clone(),
sym: sym::missing,
span,
is_raw: tt::IdentIsRaw::No,
}));
@ -93,7 +93,7 @@ impl<'t> Bindings<'t> {
spacing: tt::Spacing::Joint,
}),
tt::Leaf::Ident(tt::Ident {
sym: sym::missing.clone(),
sym: sym::missing,
span,
is_raw: tt::IdentIsRaw::No,
}),
@ -101,7 +101,7 @@ impl<'t> Bindings<'t> {
}
MetaVarKind::Literal => {
builder.push(tt::Leaf::Ident(tt::Ident {
sym: sym::missing.clone(),
sym: sym::missing,
span,
is_raw: tt::IdentIsRaw::No,
}));

View file

@ -228,7 +228,7 @@ fn next_op(
tt::Leaf::Ident(ident) if ident.sym == sym::crate_ => {
// We simply produce identifier `$crate` here. And it will be resolved when lowering ast to Path.
Op::Ident(tt::Ident {
sym: sym::dollar_crate.clone(),
sym: sym::dollar_crate,
span: ident.span,
is_raw: tt::IdentIsRaw::No,
})