From 1bdb757fed95d6ec70430bc542603cbc1a0f75c7 Mon Sep 17 00:00:00 2001 From: r0cky Date: Thu, 29 Feb 2024 14:00:08 +0800 Subject: [PATCH] Remove unused diagnostic struct --- compiler/rustc_builtin_macros/src/errors.rs | 21 ----------- compiler/rustc_hir_analysis/src/errors.rs | 7 ---- compiler/rustc_parse/src/errors.rs | 8 ----- compiler/rustc_resolve/src/errors.rs | 39 --------------------- 4 files changed, 75 deletions(-) diff --git a/compiler/rustc_builtin_macros/src/errors.rs b/compiler/rustc_builtin_macros/src/errors.rs index f304a37be854b..765879ef72f75 100644 --- a/compiler/rustc_builtin_macros/src/errors.rs +++ b/compiler/rustc_builtin_macros/src/errors.rs @@ -136,27 +136,6 @@ pub(crate) struct BenchSig { pub(crate) span: Span, } -#[derive(Diagnostic)] -#[diag(builtin_macros_test_arg_non_lifetime)] -pub(crate) struct TestArgNonLifetime { - #[primary_span] - pub(crate) span: Span, -} - -#[derive(Diagnostic)] -#[diag(builtin_macros_should_panic)] -pub(crate) struct ShouldPanic { - #[primary_span] - pub(crate) span: Span, -} - -#[derive(Diagnostic)] -#[diag(builtin_macros_test_args)] -pub(crate) struct TestArgs { - #[primary_span] - pub(crate) span: Span, -} - #[derive(Diagnostic)] #[diag(builtin_macros_alloc_must_statics)] pub(crate) struct AllocMustStatics { diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index d217d16ed8421..4b6cd9f706b69 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -1005,13 +1005,6 @@ pub(crate) struct StaticSpecialize { pub span: Span, } -#[derive(Diagnostic)] -#[diag(hir_analysis_missing_tilde_const)] -pub(crate) struct MissingTildeConst { - #[primary_span] - pub span: Span, -} - #[derive(Diagnostic)] pub(crate) enum DropImplPolarity { #[diag(hir_analysis_drop_impl_negative)] diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 2c76e55a46d69..52c79c5e63559 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -557,14 +557,6 @@ pub(crate) struct CatchAfterTry { pub span: Span, } -#[derive(Diagnostic)] -#[diag(parse_gen_fn)] -#[help] -pub(crate) struct GenFn { - #[primary_span] - pub span: Span, -} - #[derive(Diagnostic)] #[diag(parse_comma_after_base_struct)] #[note] diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs index adc4cd911a79e..6f23f53199664 100644 --- a/compiler/rustc_resolve/src/errors.rs +++ b/compiler/rustc_resolve/src/errors.rs @@ -7,32 +7,6 @@ use rustc_span::{ use crate::{late::PatternSource, Res}; -#[derive(Diagnostic)] -#[diag(resolve_parent_module_reset_for_binding, code = E0637)] -pub(crate) struct ParentModuleResetForBinding; - -#[derive(Diagnostic)] -#[diag(resolve_ampersand_used_without_explicit_lifetime_name, code = E0637)] -#[note] -pub(crate) struct AmpersandUsedWithoutExplicitLifetimeName(#[primary_span] pub(crate) Span); - -#[derive(Diagnostic)] -#[diag(resolve_underscore_lifetime_name_cannot_be_used_here, code = E0637)] -#[note] -pub(crate) struct UnderscoreLifetimeNameCannotBeUsedHere(#[primary_span] pub(crate) Span); - -#[derive(Diagnostic)] -#[diag(resolve_crate_may_not_be_imported)] -pub(crate) struct CrateMayNotBeImported(#[primary_span] pub(crate) Span); - -#[derive(Diagnostic)] -#[diag(resolve_crate_root_imports_must_be_named_explicitly)] -pub(crate) struct CrateRootNamesMustBeNamedExplicitly(#[primary_span] pub(crate) Span); - -#[derive(Diagnostic)] -#[diag(resolve_crate_root_imports_must_be_named_explicitly)] -pub(crate) struct ResolutionError(#[primary_span] pub(crate) Span); - #[derive(Diagnostic)] #[diag(resolve_generic_params_from_outer_item, code = E0401)] pub(crate) struct GenericParamsFromOuterItem { @@ -467,19 +441,6 @@ pub(crate) struct UnreachableLabelSubLabelUnreachable { pub(crate) ident_span: Span, } -#[derive(Diagnostic)] -#[diag(resolve_trait_impl_mismatch)] -pub(crate) struct TraitImplMismatch { - #[primary_span] - #[label] - pub(crate) span: Span, - pub(crate) name: Symbol, - pub(crate) kind: String, - #[label(resolve_label_trait_item)] - pub(crate) trait_item_span: Span, - pub(crate) trait_path: String, -} - #[derive(Diagnostic)] #[diag(resolve_invalid_asm_sym)] #[help]