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

Improve codegen diagnostic handling #121129

Merged
merged 3 commits into from
Feb 22, 2024
Merged

Commits on Feb 22, 2024

  1. Overhaul Diagnostic args.

    First, introduce a typedef `DiagnosticArgMap`.
    
    Second, make the `args` field public, and remove the `args` getter and
    `replace_args` setter. These were necessary previously because the getter
    had a `#[allow(rustc::potential_query_instability)]` attribute, but that
    was removed in rust-lang#120931 when the args were changed from `FxHashMap` to
    `FxIndexMap`. (All the other `Diagnostic` fields are public.)
    nnethercote committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    b38ed1a View commit details
    Browse the repository at this point in the history
  2. Overhaul rustc_codegen_ssa::back::write::Diagnostic.

    - Make it more closely match `rustc_errors::Diagnostic`, by making the
      field names match, and adding `children`, which requires adding
      `rustc_codegen_ssa::back::write::Subdiagnostic`.
    - Check that we aren't missing important info when converting
      diagnostics.
    - Add better comments.
    - Tweak `rustc_errors::Diagnostic::replace_args` so that we don't need
      to do any cloning when converting diagnostics.
    nnethercote committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    ad5d7f4 View commit details
    Browse the repository at this point in the history
  3. Remove SharedEmitterMessage::AbortIfErrors.

    It's always paired wth `SharedEmitterMessage::Diagnostic`, so the two
    can be merged.
    nnethercote committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    6efffd7 View commit details
    Browse the repository at this point in the history