Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move raw ident validate into validate_ident #332

Merged
merged 2 commits into from Jun 20, 2022
Merged

Move raw ident validate into validate_ident #332

merged 2 commits into from Jun 20, 2022

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Jun 20, 2022

Keep the panicks together.

Structuring it this way reveals that it isn't even possible for string to be "" or "$crate" or "{{root}}" at the location that the validation happens. I will delete those cases in a separate PR.

    error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215)
       --> src/fallback.rs:704:9
        |
    704 | /         if let "" | "_" | "super" | "self" | "Self" | "crate" | "$crate" | "{{root}}" = string {
    705 | |             panic!("`{}` cannot be a raw identifier", string);
    706 | |         }
        | |_________^
@dtolnay dtolnay merged commit 83ed7b8 into master Jun 20, 2022
@dtolnay dtolnay deleted the validate branch June 20, 2022 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant