-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid panic when using quote! on raw identifiers
The `quote!` optimization added in 8d155b0 calls `Ident::new`, which does not handle identifiers containing the `r#` raw prefix, panicing if they are passed in. As `Ident::new_raw` is not stable, raw identifiers are parsed using the existing `parse` codepath, with only non-raw identifiers being passed to `Ident::new`. This mimics the logic from the `mk_ident` method created for `format_ident!`, with some small optimizations due to relaxed requirements. The previous `is_ident` optimization within `__rt::parse` has also been removed, as it is now redundant.
- Loading branch information
Showing
2 changed files
with
20 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters