Split Level::DelayedBug
in two.
The two kinds of delayed bug have quite different semantics so a stronger conceptual separation is nice. (`is_error` is a good example, because the two kinds have different behaviour.) The commit also moves the `DelayedBug` variant after `Error` in `Level`, to reflect the fact that it's weaker than `Error` -- it might trigger an error but also might not. (The pre-existing `downgrade_to_delayed_bug` function also reflects the notion that delayed bugs are lower/after normal errors.) Plus it condenses some of the comments on `Level` into a table, for easier reading, and introduces `can_be_top_or_sub` to indicate which levels can be used in top-level diagnostics vs. subdiagnostics. Finally, it renames `DiagCtxtInner::span_delayed_bugs` as `DiagCtxtInner::delayed_bugs`. The `span_` prefix is unnecessary because some delayed bugs don't have a span.
This commit is contained in:
parent
c367386832
commit
59e0bc2de7
7 changed files with 102 additions and 90 deletions
|
@ -378,7 +378,7 @@ impl From<Cow<'static, str>> for DiagnosticMessage {
|
|||
}
|
||||
}
|
||||
|
||||
/// A workaround for "good path" ICEs when formatting types in disabled lints.
|
||||
/// A workaround for good_path_delayed_bug ICEs when formatting types in disabled lints.
|
||||
///
|
||||
/// Delays formatting until `.into(): DiagnosticMessage` is used.
|
||||
pub struct DelayDm<F>(pub F);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue