@@ -74,7 +74,6 @@ use std::process::ExitCode;
7474
7575use rustc_errors:: DiagCtxtHandle ;
7676use rustc_hir:: def_id:: LOCAL_CRATE ;
77- use rustc_hir:: lints:: DelayedLint ;
7877use rustc_interface:: interface;
7978use rustc_middle:: ty:: TyCtxt ;
8079use rustc_session:: config:: { ErrorOutputType , RustcOptGroup , make_crate_type_option} ;
@@ -772,19 +771,6 @@ fn run_merge_finalize(opt: config::RenderOptions) -> Result<(), error::Error> {
772771 Ok ( ( ) )
773772}
774773
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-
788774fn main_args ( early_dcx : & mut EarlyDiagCtxt , at_args : & [ String ] ) {
789775 // Throw away the first argument, the name of the binary.
790776 // In case of at_args being empty, as might be the case by
@@ -923,21 +909,7 @@ fn main_args(early_dcx: &mut EarlyDiagCtxt, at_args: &[String]) {
923909 for owner_id in tcx. hir_crate_items ( ( ) ) . delayed_lint_items ( ) {
924910 if let Some ( delayed_lints) = tcx. opt_ast_lowering_delayed_lints ( owner_id) {
925911 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- }
912+ rustc_hir_analysis:: emit_delayed_lint ( lint, tcx) ;
941913 }
942914 }
943915 }
0 commit comments