@@ -20,8 +20,7 @@ use rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter;
2020use rustc_errors:: emitter:: { Emitter , EmitterWriter , HumanReadableErrorType } ;
2121use rustc_errors:: json:: JsonEmitter ;
2222use rustc_errors:: registry:: Registry ;
23- use rustc_errors:: { Diagnostic , DiagnosticBuilder , DiagnosticId , ErrorReported } ;
24- use rustc_lint_defs:: FutureBreakage ;
23+ use rustc_errors:: { DiagnosticBuilder , DiagnosticId , ErrorReported } ;
2524use rustc_macros:: HashStable_Generic ;
2625pub use rustc_span:: def_id:: StableCrateId ;
2726use rustc_span:: source_map:: { FileLoader , MultiSpan , RealFileLoader , SourceMap , Span } ;
@@ -317,23 +316,7 @@ impl Session {
317316 if diags. is_empty ( ) {
318317 return ;
319318 }
320- // If any future-breakage lints were registered, this lint store
321- // should be available
322- let lint_store = self . lint_store . get ( ) . expect ( "`lint_store` not initialized!" ) ;
323- let diags_and_breakage: Vec < ( FutureBreakage , Diagnostic ) > = diags
324- . into_iter ( )
325- . map ( |diag| {
326- let lint_name = match & diag. code {
327- Some ( DiagnosticId :: Lint { name, has_future_breakage : true , .. } ) => name,
328- _ => panic ! ( "Unexpected code in diagnostic {:?}" , diag) ,
329- } ;
330- let lint = lint_store. name_to_lint ( & lint_name) ;
331- let future_breakage =
332- lint. lint . future_incompatible . unwrap ( ) . future_breakage . unwrap ( ) ;
333- ( future_breakage, diag)
334- } )
335- . collect ( ) ;
336- self . parse_sess . span_diagnostic . emit_future_breakage_report ( diags_and_breakage) ;
319+ self . parse_sess . span_diagnostic . emit_future_breakage_report ( diags) ;
337320 }
338321
339322 pub fn local_stable_crate_id ( & self ) -> StableCrateId {
0 commit comments