Simplify future incompatible reporting.
This commit is contained in:
parent
e9a387d6cf
commit
4d1daf8683
7 changed files with 21 additions and 48 deletions
|
@ -9,7 +9,6 @@
|
|||
|
||||
use Destination::*;
|
||||
|
||||
use rustc_lint_defs::FutureBreakage;
|
||||
use rustc_span::source_map::SourceMap;
|
||||
use rustc_span::{MultiSpan, SourceFile, Span};
|
||||
|
||||
|
@ -193,7 +192,7 @@ pub trait Emitter {
|
|||
/// other formats can, and will, simply ignore it.
|
||||
fn emit_artifact_notification(&mut self, _path: &Path, _artifact_type: &str) {}
|
||||
|
||||
fn emit_future_breakage_report(&mut self, _diags: Vec<(FutureBreakage, Diagnostic)>) {}
|
||||
fn emit_future_breakage_report(&mut self, _diags: Vec<Diagnostic>) {}
|
||||
|
||||
/// Emit list of unused externs
|
||||
fn emit_unused_externs(&mut self, _lint_level: &str, _unused_externs: &[&str]) {}
|
||||
|
|
|
@ -16,7 +16,7 @@ use crate::registry::Registry;
|
|||
use crate::DiagnosticId;
|
||||
use crate::ToolMetadata;
|
||||
use crate::{CodeSuggestion, SubDiagnostic};
|
||||
use rustc_lint_defs::{Applicability, FutureBreakage};
|
||||
use rustc_lint_defs::Applicability;
|
||||
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_span::hygiene::ExpnData;
|
||||
|
@ -134,17 +134,14 @@ impl Emitter for JsonEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
fn emit_future_breakage_report(&mut self, diags: Vec<(FutureBreakage, crate::Diagnostic)>) {
|
||||
fn emit_future_breakage_report(&mut self, diags: Vec<crate::Diagnostic>) {
|
||||
let data: Vec<FutureBreakageItem> = diags
|
||||
.into_iter()
|
||||
.map(|(breakage, mut diag)| {
|
||||
.map(|mut diag| {
|
||||
if diag.level == crate::Level::Allow {
|
||||
diag.level = crate::Level::Warning;
|
||||
}
|
||||
FutureBreakageItem {
|
||||
future_breakage_date: breakage.date,
|
||||
diagnostic: Diagnostic::from_errors_diagnostic(&diag, self),
|
||||
}
|
||||
FutureBreakageItem { diagnostic: Diagnostic::from_errors_diagnostic(&diag, self) }
|
||||
})
|
||||
.collect();
|
||||
let report = FutureIncompatReport { future_incompat_report: data };
|
||||
|
@ -326,7 +323,6 @@ struct ArtifactNotification<'a> {
|
|||
|
||||
#[derive(Encodable)]
|
||||
struct FutureBreakageItem {
|
||||
future_breakage_date: Option<&'static str>,
|
||||
diagnostic: Diagnostic,
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
|
|||
use rustc_data_structures::stable_hasher::StableHasher;
|
||||
use rustc_data_structures::sync::{self, Lock, Lrc};
|
||||
use rustc_data_structures::AtomicRef;
|
||||
use rustc_lint_defs::FutureBreakage;
|
||||
pub use rustc_lint_defs::{pluralize, Applicability};
|
||||
use rustc_serialize::json::Json;
|
||||
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
||||
|
@ -790,7 +789,7 @@ impl Handler {
|
|||
self.inner.borrow_mut().emit_artifact_notification(path, artifact_type)
|
||||
}
|
||||
|
||||
pub fn emit_future_breakage_report(&self, diags: Vec<(FutureBreakage, Diagnostic)>) {
|
||||
pub fn emit_future_breakage_report(&self, diags: Vec<Diagnostic>) {
|
||||
self.inner.borrow_mut().emitter.emit_future_breakage_report(diags)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue