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

Remove force_print_diagnostic #121014

Merged
merged 3 commits into from
Feb 14, 2024

Commits on Feb 13, 2024

  1. Make struct_span_note call struct_note.

    So it follows the same pattern as all the other `struct_span_*` methods.
    nnethercote committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    bdc6d82 View commit details
    Browse the repository at this point in the history
  2. Remove force_print_diagnostic.

    There are a couple of places where we call
    `inner.emitter.emit_diagnostic` directly rather than going through
    `inner.emit_diagnostic`, to guarantee the diagnostic is printed. This
    feels dubious to me, particularly the bypassing of `TRACK_DIAGNOSTIC`.
    
    This commit removes those.
    - In `print_error_count`, it uses `ForceWarning` instead of `Warning`.
    - It removes `DiagCtxtInner::failure_note`, because it only has three
      uses and direct use of `emit_diagnostic` is consistent with other
      similar locations.
    - It removes `force_print_diagnostic`, and adds `struct_failure_note`,
      and updates `print_query_stack` accordingly, which makes it more
      normal. That location doesn't seem to need forced printing anyway.
    nnethercote committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    c1ffb0b View commit details
    Browse the repository at this point in the history
  3. Fix DiagCtxtInner::reset_err_count.

    Several fields were not being reset. Using destructuring makes it much
    harder to miss a field.
    nnethercote committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    56b451a View commit details
    Browse the repository at this point in the history