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

Cleanup error handlers: round 5 #119538

Merged
merged 10 commits into from
Jan 5, 2024
Merged

Commits on Jan 3, 2024

  1. Rename some Diagnostic setters.

    `Diagnostic` has 40 methods that return `&mut Self` and could be
    considered setters. Four of them have a `set_` prefix. This doesn't seem
    necessary for a type that implements the builder pattern. This commit
    removes the `set_` prefixes on those four methods.
    nnethercote committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    505c137 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5fe5d5d View commit details
    Browse the repository at this point in the history
  3. Remove forward for downgrade_to_delayed_bug.

    It's not used, and doesn't quite fit the general pattern.
    
    Also, `Diagnostic::downgrade_to_delayed_bug` doesn't need to return
    `&mut Self` for the same reason.
    nnethercote committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    096b844 View commit details
    Browse the repository at this point in the history
  4. Fix up forward! decls.

    - Move comments onto corresponding `Diagnostic` methods.
    - Make formatting more consistent.
    nnethercote committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    caefa55 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b4a6239 View commit details
    Browse the repository at this point in the history
  6. Remove unused DiagnosticBuilder::struct_almost_fatal.

    `create_almost_fatal` and `emit_almost_fatal` are always used instead.
    nnethercote committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    1e92223 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Avoid some rustc_errors:: qualifiers.

    These are misleading, because the mixture of `Level` and
    `rustc_errors::Level` makes it look like there are two different types
    involved.
    nnethercote committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    9560c58 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4d35981 View commit details
    Browse the repository at this point in the history
  3. Inline and remove StringReader::struct_fatal_span_char.

    It has a single call site.
    nnethercote committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    8e6bca6 View commit details
    Browse the repository at this point in the history
  4. Remove is_lint field from Level::Error.

    Because it's redundant w.r.t. `Diagnostic::is_lint`, which is present
    for every diagnostic level.
    
    `struct_lint_level_impl` was the only place that set the `Error` field
    to `true`, and it's also the only place that calls
    `Diagnostic::is_lint()` to set the `is_lint` field.
    nnethercote committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    8388112 View commit details
    Browse the repository at this point in the history