1
Fork 0

Implement rustc side of report-future-incompat

This commit is contained in:
Aaron Hill 2020-08-13 15:41:52 -04:00
parent ffe52882ed
commit 23018a55d9
No known key found for this signature in database
GPG key ID: B4087E510E98B164
22 changed files with 332 additions and 114 deletions

View file

@ -72,6 +72,7 @@ fn annotation_type_for_level(level: Level) -> AnnotationType {
Level::Help => AnnotationType::Help,
// FIXME(#59346): Not sure how to map these two levels
Level::Cancelled | Level::FailureNote => AnnotationType::Error,
Level::Allow => panic!("Should not call with Allow"),
}
}
@ -143,7 +144,8 @@ impl AnnotateSnippetEmitterWriter {
title: Some(Annotation {
label: Some(&message),
id: code.as_ref().map(|c| match c {
DiagnosticId::Error(val) | DiagnosticId::Lint(val) => val.as_str(),
DiagnosticId::Error(val)
| DiagnosticId::Lint { name: val, has_future_breakage: _ } => val.as_str(),
}),
annotation_type: annotation_type_for_level(*level),
}),