rustc_errors: add downgrade_to_delayed_bug to Diagnostic itself.

This commit is contained in:
Eduard-Mihai Burtescu 2022-01-23 23:11:37 +00:00
parent 5bd1ec3283
commit f24ff1815f
10 changed files with 129 additions and 48 deletions

View file

@ -66,7 +66,9 @@ fn source_string(file: Lrc<SourceFile>, line: &Line) -> String {
/// Maps `Diagnostic::Level` to `snippet::AnnotationType`
fn annotation_type_for_level(level: Level) -> AnnotationType {
match level {
Level::Bug | Level::Fatal | Level::Error { .. } => AnnotationType::Error,
Level::Bug | Level::DelayedBug | Level::Fatal | Level::Error { .. } => {
AnnotationType::Error
}
Level::Warning => AnnotationType::Warning,
Level::Note => AnnotationType::Note,
Level::Help => AnnotationType::Help,