@@ -772,19 +772,6 @@ fn run_merge_finalize(opt: config::RenderOptions) -> Result<(), error::Error> {
772772 Ok ( ( ) )
773773}
774774
775- struct DiagEmitter < ' tcx > {
776- hir_id : rustc_hir:: HirId ,
777- tcx : TyCtxt < ' tcx > ,
778- span : rustc_span:: Span ,
779- lint : & ' static rustc_lint:: Lint ,
780- }
781-
782- impl rustc_lint:: EmitDiag for DiagEmitter < ' _ > {
783- fn emit ( & self , diag : impl for < ' a > rustc_errors:: Diagnostic < ' a , ( ) > ) {
784- self . tcx . emit_node_span_lint ( self . lint , self . hir_id , self . span , diag) ;
785- }
786- }
787-
788775fn main_args ( early_dcx : & mut EarlyDiagCtxt , at_args : & [ String ] ) {
789776 // Throw away the first argument, the name of the binary.
790777 // In case of at_args being empty, as might be the case by
@@ -923,21 +910,7 @@ fn main_args(early_dcx: &mut EarlyDiagCtxt, at_args: &[String]) {
923910 for owner_id in tcx. hir_crate_items ( ( ) ) . delayed_lint_items ( ) {
924911 if let Some ( delayed_lints) = tcx. opt_ast_lowering_delayed_lints ( owner_id) {
925912 for lint in & delayed_lints. lints {
926- match lint {
927- DelayedLint :: AttributeParsing ( attribute_lint) => {
928- rustc_lint:: decorate_attribute_lint (
929- & DiagEmitter {
930- hir_id : attribute_lint. id ,
931- tcx,
932- span : attribute_lint. span ,
933- lint : attribute_lint. lint_id . lint ,
934- } ,
935- tcx. sess ,
936- Some ( tcx) ,
937- & attribute_lint. kind ,
938- ) ;
939- }
940- }
913+ rustc_hir_analysis:: emit_delayed_lint ( lint, tcx) ;
941914 }
942915 }
943916 }
0 commit comments