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

Minimize can_begin_literal_maybe_minus usage #126708

Merged

Commits on Jun 19, 2024

  1. Inline can_begin_literal_maybe_minus call into two places.

    It's clearer this way, because the `Interpolated` cases in
    `can_begin_const_arg` and `is_pat_range_end_start` are more permissive
    than the `Interpolated` cases in `can_begin_literal_maybe_minus`.
    nnethercote committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    7d9a92b View commit details
    Browse the repository at this point in the history
  2. Introduce can_begin_string_literal.

    We currently use `can_begin_literal_maybe_minus` in a couple of places
    where only string literals are allowed. This commit introduces a
    more specific function, which makes things clearer. It doesn't change
    behaviour because the two functions affected (`is_unsafe_foreign_mod`
    and `check_keyword_case`) are always followed by a call to `parse_abi`,
    which checks again for a string literal.
    nnethercote committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    c6f7827 View commit details
    Browse the repository at this point in the history