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

Reorder diagnostics API #120765

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Reorder diagnostics API #120765

merged 2 commits into from
Feb 12, 2024

Commits on Feb 11, 2024

  1. Reorder the diagnostic API methods.

    The current order is almost perfectly random. This commit puts them into
    a predictable order in their own impl block, going from the highest
    level (`Block`) to the lowest (`Expect`). Within each level this is the
    order:
    
    - struct_err, err
    - struct_span_err, span_err
    - create_err, emit_err
    
    The first one in each pair creates a diagnostic, the second one creates
    *and* emits a diagnostic. Not every method is present for every level.
    
    The diff is messy, but other than moving methods around, the only thing
    it does is create the new `impl DiagCtxt` block with its own comment.
    nnethercote committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    c35983a View commit details
    Browse the repository at this point in the history
  2. Fix inconsistencies in the diagnostic API methods.

    - Remove low-value comments about functionality that is obvious.
    
    - Add missing `track_caller` attributes -- every method should have one.
    
    - Adjust `rustc_lint_diagnostic` attributes. Every method involving a
      `impl Into<DiagnosticMessage>` or `impl Into<SubdiangnosticMessage>`
      argument should have one, except for those producing bugs, which
      aren't user-facing.
    nnethercote committed Feb 11, 2024
    Configuration menu
    Copy the full SHA
    b7b6ebc View commit details
    Browse the repository at this point in the history