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

rustc_expand cleanups #124607

Merged
merged 14 commits into from
May 3, 2024
Merged

rustc_expand cleanups #124607

merged 14 commits into from
May 3, 2024

Commits on May 2, 2024

  1. rustc_expand: clean up attributes.

    Sort them, and remove the unused ones (`lint_reasons` and
    `proc_macro_span`).
    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    aabb90d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d817856 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7c6d363 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3f05589 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    189a8a6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e809df6 View commit details
    Browse the repository at this point in the history
  7. Inline and remove three DummyResult methods.

    They each have a single call site.
    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    d7f5319 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c9c964f View commit details
    Browse the repository at this point in the history
  9. Remove unnecessary pubs.

    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    79c4d02 View commit details
    Browse the repository at this point in the history
  10. Tweak fully_expand_fragment loop.

    Control flow never gets past the end of the `ExpandResult::Retry` match
    arm, due to the `span_bug` and the `continue`. Therefore, the code after
    the match can only be reached from the `ExpandResult::Ready` arm.
    
    This commit moves that code after the match into the
    `ExpandResult::Ready` arm, avoiding the need for the `continue` in the
    `ExpandResult::Retry` arm.
    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    3b69781 View commit details
    Browse the repository at this point in the history
  11. Replace a hard-to-read line.

    Too clever by half, IMO.
    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    1c15b6a View commit details
    Browse the repository at this point in the history
  12. Introduce Invocation::span_mut.

    Alongside the existing `Invocation::span`.
    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    ae7e328 View commit details
    Browse the repository at this point in the history
  13. Type annotate repeats.

    Because the type is not obvious, and this clarifies things.
    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    5ac017e View commit details
    Browse the repository at this point in the history
  14. Refactor Frame.

    It is currently an enum and the `tts` and `idx` fields are repeated
    across the two variants.
    
    This commit splits it into a struct `Frame` and an enum `FrameKind`, to
    factor out the duplication. The commit also renames `Frame::new` as
    `Frame::new_delimited` and adds `Frame::new_sequence`. I.e. both
    variants now have a constructor.
    nnethercote committed May 2, 2024
    Configuration menu
    Copy the full SHA
    3a3a15d View commit details
    Browse the repository at this point in the history