Add warn(unreachable_pub)
to rustc_hir_analysis
.
This commit is contained in:
parent
bffa2244ed
commit
5acf4e7b4b
27 changed files with 155 additions and 145 deletions
|
@ -11,15 +11,15 @@ use rustc_span::{Span, Symbol};
|
|||
|
||||
use crate::fluent_generated as fluent;
|
||||
mod pattern_types;
|
||||
pub use pattern_types::*;
|
||||
pub mod wrong_number_of_generic_args;
|
||||
pub(crate) use pattern_types::*;
|
||||
pub(crate) mod wrong_number_of_generic_args;
|
||||
|
||||
mod precise_captures;
|
||||
pub(crate) use precise_captures::*;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_ambiguous_assoc_item)]
|
||||
pub struct AmbiguousAssocItem<'a> {
|
||||
pub(crate) struct AmbiguousAssocItem<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -30,7 +30,7 @@ pub struct AmbiguousAssocItem<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_assoc_kind_mismatch)]
|
||||
pub struct AssocKindMismatch {
|
||||
pub(crate) struct AssocKindMismatch {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -52,7 +52,7 @@ pub struct AssocKindMismatch {
|
|||
hir_analysis_assoc_kind_mismatch_wrap_in_braces_sugg,
|
||||
applicability = "maybe-incorrect"
|
||||
)]
|
||||
pub struct AssocKindMismatchWrapInBracesSugg {
|
||||
pub(crate) struct AssocKindMismatchWrapInBracesSugg {
|
||||
#[suggestion_part(code = "{{ ")]
|
||||
pub lo: Span,
|
||||
#[suggestion_part(code = " }}")]
|
||||
|
@ -61,7 +61,7 @@ pub struct AssocKindMismatchWrapInBracesSugg {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_assoc_item_is_private, code = E0624)]
|
||||
pub struct AssocItemIsPrivate {
|
||||
pub(crate) struct AssocItemIsPrivate {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -73,7 +73,7 @@ pub struct AssocItemIsPrivate {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_assoc_item_not_found, code = E0220)]
|
||||
pub struct AssocItemNotFound<'a> {
|
||||
pub(crate) struct AssocItemNotFound<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub assoc_name: Ident,
|
||||
|
@ -86,7 +86,7 @@ pub struct AssocItemNotFound<'a> {
|
|||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum AssocItemNotFoundLabel<'a> {
|
||||
pub(crate) enum AssocItemNotFoundLabel<'a> {
|
||||
#[label(hir_analysis_assoc_item_not_found_label)]
|
||||
NotFound {
|
||||
#[primary_span]
|
||||
|
@ -105,7 +105,7 @@ pub enum AssocItemNotFoundLabel<'a> {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
|
||||
pub enum AssocItemNotFoundSugg<'a> {
|
||||
pub(crate) enum AssocItemNotFoundSugg<'a> {
|
||||
#[suggestion(
|
||||
hir_analysis_assoc_item_not_found_similar_sugg,
|
||||
code = "{suggested_name}",
|
||||
|
@ -162,7 +162,7 @@ pub enum AssocItemNotFoundSugg<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_unrecognized_atomic_operation, code = E0092)]
|
||||
pub struct UnrecognizedAtomicOperation<'a> {
|
||||
pub(crate) struct UnrecognizedAtomicOperation<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -171,7 +171,7 @@ pub struct UnrecognizedAtomicOperation<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_wrong_number_of_generic_arguments_to_intrinsic, code = E0094)]
|
||||
pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
|
||||
pub(crate) struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -183,7 +183,7 @@ pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_unrecognized_intrinsic_function, code = E0093)]
|
||||
#[help]
|
||||
pub struct UnrecognizedIntrinsicFunction {
|
||||
pub(crate) struct UnrecognizedIntrinsicFunction {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -192,7 +192,7 @@ pub struct UnrecognizedIntrinsicFunction {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_lifetimes_or_bounds_mismatch_on_trait, code = E0195)]
|
||||
pub struct LifetimesOrBoundsMismatchOnTrait {
|
||||
pub(crate) struct LifetimesOrBoundsMismatchOnTrait {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -208,14 +208,14 @@ pub struct LifetimesOrBoundsMismatchOnTrait {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_drop_impl_on_wrong_item, code = E0120)]
|
||||
pub struct DropImplOnWrongItem {
|
||||
pub(crate) struct DropImplOnWrongItem {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
pub enum FieldAlreadyDeclared {
|
||||
pub(crate) enum FieldAlreadyDeclared {
|
||||
#[diag(hir_analysis_field_already_declared, code = E0124)]
|
||||
NotNested {
|
||||
field_name: Symbol,
|
||||
|
@ -272,14 +272,14 @@ pub enum FieldAlreadyDeclared {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[help(hir_analysis_field_already_declared_nested_help)]
|
||||
pub struct FieldAlreadyDeclaredNestedHelp {
|
||||
pub(crate) struct FieldAlreadyDeclaredNestedHelp {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_copy_impl_on_type_with_dtor, code = E0184)]
|
||||
pub struct CopyImplOnTypeWithDtor {
|
||||
pub(crate) struct CopyImplOnTypeWithDtor {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -287,14 +287,14 @@ pub struct CopyImplOnTypeWithDtor {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_multiple_relaxed_default_bounds, code = E0203)]
|
||||
pub struct MultipleRelaxedDefaultBounds {
|
||||
pub(crate) struct MultipleRelaxedDefaultBounds {
|
||||
#[primary_span]
|
||||
pub spans: Vec<Span>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_copy_impl_on_non_adt, code = E0206)]
|
||||
pub struct CopyImplOnNonAdt {
|
||||
pub(crate) struct CopyImplOnNonAdt {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -302,7 +302,7 @@ pub struct CopyImplOnNonAdt {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_const_param_ty_impl_on_unsized)]
|
||||
pub struct ConstParamTyImplOnUnsized {
|
||||
pub(crate) struct ConstParamTyImplOnUnsized {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -310,7 +310,7 @@ pub struct ConstParamTyImplOnUnsized {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_const_param_ty_impl_on_non_adt)]
|
||||
pub struct ConstParamTyImplOnNonAdt {
|
||||
pub(crate) struct ConstParamTyImplOnNonAdt {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -318,7 +318,7 @@ pub struct ConstParamTyImplOnNonAdt {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_trait_object_declared_with_no_traits, code = E0224)]
|
||||
pub struct TraitObjectDeclaredWithNoTraits {
|
||||
pub(crate) struct TraitObjectDeclaredWithNoTraits {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[label(hir_analysis_alias_span)]
|
||||
|
@ -327,14 +327,14 @@ pub struct TraitObjectDeclaredWithNoTraits {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_ambiguous_lifetime_bound, code = E0227)]
|
||||
pub struct AmbiguousLifetimeBound {
|
||||
pub(crate) struct AmbiguousLifetimeBound {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_assoc_item_constraints_not_allowed_here, code = E0229)]
|
||||
pub struct AssocItemConstraintsNotAllowedHere {
|
||||
pub(crate) struct AssocItemConstraintsNotAllowedHere {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -383,7 +383,7 @@ pub(crate) struct EscapingBoundVarInTyOfAssocConstBinding<'tcx> {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[help(hir_analysis_parenthesized_fn_trait_expansion)]
|
||||
pub struct ParenthesizedFnTraitExpansion {
|
||||
pub(crate) struct ParenthesizedFnTraitExpansion {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
|
||||
|
@ -392,7 +392,7 @@ pub struct ParenthesizedFnTraitExpansion {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_typeof_reserved_keyword_used, code = E0516)]
|
||||
pub struct TypeofReservedKeywordUsed<'tcx> {
|
||||
pub(crate) struct TypeofReservedKeywordUsed<'tcx> {
|
||||
pub ty: Ty<'tcx>,
|
||||
#[primary_span]
|
||||
#[label]
|
||||
|
@ -403,7 +403,7 @@ pub struct TypeofReservedKeywordUsed<'tcx> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_value_of_associated_struct_already_specified, code = E0719)]
|
||||
pub struct ValueOfAssociatedStructAlreadySpecified {
|
||||
pub(crate) struct ValueOfAssociatedStructAlreadySpecified {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -416,7 +416,7 @@ pub struct ValueOfAssociatedStructAlreadySpecified {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_unconstrained_opaque_type)]
|
||||
#[note]
|
||||
pub struct UnconstrainedOpaqueType {
|
||||
pub(crate) struct UnconstrainedOpaqueType {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub name: Symbol,
|
||||
|
@ -426,7 +426,7 @@ pub struct UnconstrainedOpaqueType {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_tait_forward_compat)]
|
||||
#[note]
|
||||
pub struct TaitForwardCompat {
|
||||
pub(crate) struct TaitForwardCompat {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[note]
|
||||
|
@ -436,7 +436,7 @@ pub struct TaitForwardCompat {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_tait_forward_compat2)]
|
||||
#[note]
|
||||
pub struct TaitForwardCompat2 {
|
||||
pub(crate) struct TaitForwardCompat2 {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[note(hir_analysis_opaque)]
|
||||
|
@ -444,7 +444,7 @@ pub struct TaitForwardCompat2 {
|
|||
pub opaque_type: String,
|
||||
}
|
||||
|
||||
pub struct MissingTypeParams {
|
||||
pub(crate) struct MissingTypeParams {
|
||||
pub span: Span,
|
||||
pub def_span: Span,
|
||||
pub span_snippet: Option<String>,
|
||||
|
@ -512,7 +512,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for MissingTypeParams {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_manual_implementation, code = E0183)]
|
||||
#[help]
|
||||
pub struct ManualImplementation {
|
||||
pub(crate) struct ManualImplementation {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -521,14 +521,14 @@ pub struct ManualImplementation {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_generic_args_on_overridden_impl)]
|
||||
pub struct GenericArgsOnOverriddenImpl {
|
||||
pub(crate) struct GenericArgsOnOverriddenImpl {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_const_impl_for_non_const_trait)]
|
||||
pub struct ConstImplForNonConstTrait {
|
||||
pub(crate) struct ConstImplForNonConstTrait {
|
||||
#[primary_span]
|
||||
pub trait_ref_span: Span,
|
||||
pub trait_name: String,
|
||||
|
@ -542,7 +542,7 @@ pub struct ConstImplForNonConstTrait {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_const_bound_for_non_const_trait)]
|
||||
pub struct ConstBoundForNonConstTrait {
|
||||
pub(crate) struct ConstBoundForNonConstTrait {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub modifier: &'static str,
|
||||
|
@ -550,7 +550,7 @@ pub struct ConstBoundForNonConstTrait {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_self_in_impl_self)]
|
||||
pub struct SelfInImplSelf {
|
||||
pub(crate) struct SelfInImplSelf {
|
||||
#[primary_span]
|
||||
pub span: MultiSpan,
|
||||
#[note]
|
||||
|
@ -567,7 +567,7 @@ pub(crate) struct LinkageType {
|
|||
#[derive(Diagnostic)]
|
||||
#[help]
|
||||
#[diag(hir_analysis_auto_deref_reached_recursion_limit, code = E0055)]
|
||||
pub struct AutoDerefReachedRecursionLimit<'a> {
|
||||
pub(crate) struct AutoDerefReachedRecursionLimit<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -736,7 +736,7 @@ pub(crate) struct InvalidUnionField {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_invalid_unnamed_field_ty)]
|
||||
pub struct InvalidUnnamedFieldTy {
|
||||
pub(crate) struct InvalidUnnamedFieldTy {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
@ -894,7 +894,7 @@ pub(crate) struct SIMDFFIHighlyExperimental {
|
|||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
pub enum ImplNotMarkedDefault {
|
||||
pub(crate) enum ImplNotMarkedDefault {
|
||||
#[diag(hir_analysis_impl_not_marked_default, code = E0520)]
|
||||
#[note]
|
||||
Ok {
|
||||
|
@ -1137,7 +1137,7 @@ pub(crate) enum LateBoundInApit {
|
|||
#[derive(LintDiagnostic)]
|
||||
#[diag(hir_analysis_unused_associated_type_bounds)]
|
||||
#[note]
|
||||
pub struct UnusedAssociatedTypeBounds {
|
||||
pub(crate) struct UnusedAssociatedTypeBounds {
|
||||
#[suggestion(code = "")]
|
||||
pub span: Span,
|
||||
}
|
||||
|
@ -1162,7 +1162,7 @@ pub(crate) struct ReturnPositionImplTraitInTraitRefined<'tcx> {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_inherent_ty_outside, code = E0390)]
|
||||
#[help]
|
||||
pub struct InherentTyOutside {
|
||||
pub(crate) struct InherentTyOutside {
|
||||
#[primary_span]
|
||||
#[help(hir_analysis_span_help)]
|
||||
pub span: Span,
|
||||
|
@ -1170,7 +1170,7 @@ pub struct InherentTyOutside {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_coerce_unsized_may, code = E0378)]
|
||||
pub struct DispatchFromDynCoercion<'a> {
|
||||
pub(crate) struct DispatchFromDynCoercion<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub trait_name: &'a str,
|
||||
|
@ -1182,7 +1182,7 @@ pub struct DispatchFromDynCoercion<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_dispatch_from_dyn_repr, code = E0378)]
|
||||
pub struct DispatchFromDynRepr {
|
||||
pub(crate) struct DispatchFromDynRepr {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
@ -1190,7 +1190,7 @@ pub struct DispatchFromDynRepr {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_inherent_ty_outside_relevant, code = E0390)]
|
||||
#[help]
|
||||
pub struct InherentTyOutsideRelevant {
|
||||
pub(crate) struct InherentTyOutsideRelevant {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[help(hir_analysis_span_help)]
|
||||
|
@ -1200,7 +1200,7 @@ pub struct InherentTyOutsideRelevant {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_inherent_ty_outside_new, code = E0116)]
|
||||
#[note]
|
||||
pub struct InherentTyOutsideNew {
|
||||
pub(crate) struct InherentTyOutsideNew {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1209,7 +1209,7 @@ pub struct InherentTyOutsideNew {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_inherent_ty_outside_primitive, code = E0390)]
|
||||
#[help]
|
||||
pub struct InherentTyOutsidePrimitive {
|
||||
pub(crate) struct InherentTyOutsidePrimitive {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[help(hir_analysis_span_help)]
|
||||
|
@ -1219,7 +1219,7 @@ pub struct InherentTyOutsidePrimitive {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_inherent_primitive_ty, code = E0390)]
|
||||
#[help]
|
||||
pub struct InherentPrimitiveTy<'a> {
|
||||
pub(crate) struct InherentPrimitiveTy<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[subdiagnostic]
|
||||
|
@ -1228,14 +1228,14 @@ pub struct InherentPrimitiveTy<'a> {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[note(hir_analysis_inherent_primitive_ty_note)]
|
||||
pub struct InherentPrimitiveTyNote<'a> {
|
||||
pub(crate) struct InherentPrimitiveTyNote<'a> {
|
||||
pub subty: Ty<'a>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_inherent_dyn, code = E0785)]
|
||||
#[note]
|
||||
pub struct InherentDyn {
|
||||
pub(crate) struct InherentDyn {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1244,7 +1244,7 @@ pub struct InherentDyn {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_inherent_nominal, code = E0118)]
|
||||
#[note]
|
||||
pub struct InherentNominal {
|
||||
pub(crate) struct InherentNominal {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1253,7 +1253,7 @@ pub struct InherentNominal {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_dispatch_from_dyn_zst, code = E0378)]
|
||||
#[note]
|
||||
pub struct DispatchFromDynZST<'a> {
|
||||
pub(crate) struct DispatchFromDynZST<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub name: Symbol,
|
||||
|
@ -1262,7 +1262,7 @@ pub struct DispatchFromDynZST<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_coerce_unsized_may, code = E0378)]
|
||||
pub struct DispatchFromDynSingle<'a> {
|
||||
pub(crate) struct DispatchFromDynSingle<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub trait_name: &'a str,
|
||||
|
@ -1273,7 +1273,7 @@ pub struct DispatchFromDynSingle<'a> {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_dispatch_from_dyn_multi, code = E0378)]
|
||||
#[note]
|
||||
pub struct DispatchFromDynMulti {
|
||||
pub(crate) struct DispatchFromDynMulti {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[note(hir_analysis_coercions_note)]
|
||||
|
@ -1284,7 +1284,7 @@ pub struct DispatchFromDynMulti {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_coerce_unsized_may, code = E0376)]
|
||||
pub struct DispatchFromDynStruct<'a> {
|
||||
pub(crate) struct DispatchFromDynStruct<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub trait_name: &'a str,
|
||||
|
@ -1292,7 +1292,7 @@ pub struct DispatchFromDynStruct<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_coerce_unsized_may, code = E0377)]
|
||||
pub struct DispatchFromDynSame<'a> {
|
||||
pub(crate) struct DispatchFromDynSame<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub trait_name: &'a str,
|
||||
|
@ -1304,7 +1304,7 @@ pub struct DispatchFromDynSame<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_coerce_unsized_may, code = E0374)]
|
||||
pub struct CoerceUnsizedOneField<'a> {
|
||||
pub(crate) struct CoerceUnsizedOneField<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub trait_name: &'a str,
|
||||
|
@ -1315,7 +1315,7 @@ pub struct CoerceUnsizedOneField<'a> {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_coerce_unsized_multi, code = E0375)]
|
||||
#[note]
|
||||
pub struct CoerceUnsizedMulti {
|
||||
pub(crate) struct CoerceUnsizedMulti {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1327,7 +1327,7 @@ pub struct CoerceUnsizedMulti {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_coerce_unsized_may, code = E0378)]
|
||||
pub struct CoerceUnsizedMay<'a> {
|
||||
pub(crate) struct CoerceUnsizedMay<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub trait_name: &'a str,
|
||||
|
@ -1335,7 +1335,7 @@ pub struct CoerceUnsizedMay<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_trait_cannot_impl_for_ty, code = E0204)]
|
||||
pub struct TraitCannotImplForTy {
|
||||
pub(crate) struct TraitCannotImplForTy {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub trait_name: String,
|
||||
|
@ -1347,7 +1347,7 @@ pub struct TraitCannotImplForTy {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[note(hir_analysis_requires_note)]
|
||||
pub struct ImplForTyRequires {
|
||||
pub(crate) struct ImplForTyRequires {
|
||||
#[primary_span]
|
||||
pub span: MultiSpan,
|
||||
pub error_predicate: String,
|
||||
|
@ -1358,7 +1358,7 @@ pub struct ImplForTyRequires {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_traits_with_defualt_impl, code = E0321)]
|
||||
#[note]
|
||||
pub struct TraitsWithDefaultImpl<'a> {
|
||||
pub(crate) struct TraitsWithDefaultImpl<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub traits: String,
|
||||
|
@ -1368,7 +1368,7 @@ pub struct TraitsWithDefaultImpl<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_cross_crate_traits, code = E0321)]
|
||||
pub struct CrossCrateTraits<'a> {
|
||||
pub(crate) struct CrossCrateTraits<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1378,7 +1378,7 @@ pub struct CrossCrateTraits<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_cross_crate_traits_defined, code = E0321)]
|
||||
pub struct CrossCrateTraitsDefined {
|
||||
pub(crate) struct CrossCrateTraitsDefined {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1390,7 +1390,7 @@ pub struct CrossCrateTraitsDefined {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_ty_param_first_local, code = E0210)]
|
||||
#[note]
|
||||
pub struct TyParamFirstLocal<'tcx> {
|
||||
pub(crate) struct TyParamFirstLocal<'tcx> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1403,7 +1403,7 @@ pub struct TyParamFirstLocal<'tcx> {
|
|||
#[derive(LintDiagnostic)]
|
||||
#[diag(hir_analysis_ty_param_first_local, code = E0210)]
|
||||
#[note]
|
||||
pub struct TyParamFirstLocalLint<'tcx> {
|
||||
pub(crate) struct TyParamFirstLocalLint<'tcx> {
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[note(hir_analysis_case_note)]
|
||||
|
@ -1415,7 +1415,7 @@ pub struct TyParamFirstLocalLint<'tcx> {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_ty_param_some, code = E0210)]
|
||||
#[note]
|
||||
pub struct TyParamSome {
|
||||
pub(crate) struct TyParamSome {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1427,7 +1427,7 @@ pub struct TyParamSome {
|
|||
#[derive(LintDiagnostic)]
|
||||
#[diag(hir_analysis_ty_param_some, code = E0210)]
|
||||
#[note]
|
||||
pub struct TyParamSomeLint {
|
||||
pub(crate) struct TyParamSomeLint {
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[note(hir_analysis_only_note)]
|
||||
|
@ -1436,7 +1436,7 @@ pub struct TyParamSomeLint {
|
|||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
pub enum OnlyCurrentTraits {
|
||||
pub(crate) enum OnlyCurrentTraits {
|
||||
#[diag(hir_analysis_only_current_traits_outside, code = E0117)]
|
||||
Outside {
|
||||
#[primary_span]
|
||||
|
@ -1465,20 +1465,20 @@ pub enum OnlyCurrentTraits {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(hir_analysis_only_current_traits_opaque)]
|
||||
pub struct OnlyCurrentTraitsOpaque {
|
||||
pub(crate) struct OnlyCurrentTraitsOpaque {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(hir_analysis_only_current_traits_foreign)]
|
||||
pub struct OnlyCurrentTraitsForeign {
|
||||
pub(crate) struct OnlyCurrentTraitsForeign {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(hir_analysis_only_current_traits_name)]
|
||||
pub struct OnlyCurrentTraitsName<'a> {
|
||||
pub(crate) struct OnlyCurrentTraitsName<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub name: &'a str,
|
||||
|
@ -1486,7 +1486,7 @@ pub struct OnlyCurrentTraitsName<'a> {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(hir_analysis_only_current_traits_pointer)]
|
||||
pub struct OnlyCurrentTraitsPointer<'a> {
|
||||
pub(crate) struct OnlyCurrentTraitsPointer<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub pointer: Ty<'a>,
|
||||
|
@ -1494,7 +1494,7 @@ pub struct OnlyCurrentTraitsPointer<'a> {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(hir_analysis_only_current_traits_ty)]
|
||||
pub struct OnlyCurrentTraitsTy<'a> {
|
||||
pub(crate) struct OnlyCurrentTraitsTy<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub ty: Ty<'a>,
|
||||
|
@ -1502,7 +1502,7 @@ pub struct OnlyCurrentTraitsTy<'a> {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(hir_analysis_only_current_traits_adt)]
|
||||
pub struct OnlyCurrentTraitsAdt {
|
||||
pub(crate) struct OnlyCurrentTraitsAdt {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub name: String,
|
||||
|
@ -1513,11 +1513,11 @@ pub struct OnlyCurrentTraitsAdt {
|
|||
hir_analysis_only_current_traits_pointer_sugg,
|
||||
applicability = "maybe-incorrect"
|
||||
)]
|
||||
pub struct OnlyCurrentTraitsPointerSugg<'a> {
|
||||
pub(crate) struct OnlyCurrentTraitsPointerSugg<'a> {
|
||||
#[suggestion_part(code = "WrapperType")]
|
||||
pub wrapper_span: Span,
|
||||
#[suggestion_part(code = "struct WrapperType(*{mut_key}{ptr_ty});\n\n")]
|
||||
pub struct_span: Span,
|
||||
pub(crate) struct_span: Span,
|
||||
pub mut_key: &'a str,
|
||||
pub ptr_ty: Ty<'a>,
|
||||
}
|
||||
|
@ -1525,7 +1525,7 @@ pub struct OnlyCurrentTraitsPointerSugg<'a> {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_static_mut_ref, code = E0796)]
|
||||
#[note]
|
||||
pub struct StaticMutRef<'a> {
|
||||
pub(crate) struct StaticMutRef<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1535,7 +1535,7 @@ pub struct StaticMutRef<'a> {
|
|||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum MutRefSugg {
|
||||
pub(crate) enum MutRefSugg {
|
||||
#[multipart_suggestion(
|
||||
hir_analysis_suggestion,
|
||||
style = "verbose",
|
||||
|
@ -1565,7 +1565,7 @@ pub enum MutRefSugg {
|
|||
#[diag(hir_analysis_static_mut_refs_lint)]
|
||||
#[note]
|
||||
#[note(hir_analysis_why_note)]
|
||||
pub struct RefOfMutStatic<'a> {
|
||||
pub(crate) struct RefOfMutStatic<'a> {
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[subdiagnostic]
|
||||
|
@ -1575,7 +1575,7 @@ pub struct RefOfMutStatic<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_not_supported_delegation)]
|
||||
pub struct UnsupportedDelegation<'a> {
|
||||
pub(crate) struct UnsupportedDelegation<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub descr: &'a str,
|
||||
|
@ -1585,7 +1585,7 @@ pub struct UnsupportedDelegation<'a> {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_method_should_return_future)]
|
||||
pub struct MethodShouldReturnFuture {
|
||||
pub(crate) struct MethodShouldReturnFuture {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub method_name: Symbol,
|
||||
|
@ -1649,7 +1649,7 @@ pub(crate) struct UnconstrainedGenericParameter {
|
|||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
pub enum UnnamedFieldsRepr<'a> {
|
||||
pub(crate) enum UnnamedFieldsRepr<'a> {
|
||||
#[diag(hir_analysis_unnamed_fields_repr_missing_repr_c)]
|
||||
MissingReprC {
|
||||
#[primary_span]
|
||||
|
@ -1678,14 +1678,14 @@ pub enum UnnamedFieldsRepr<'a> {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[note(hir_analysis_unnamed_fields_repr_field_defined)]
|
||||
pub struct UnnamedFieldsReprFieldDefined {
|
||||
pub(crate) struct UnnamedFieldsReprFieldDefined {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_opaque_captures_higher_ranked_lifetime, code = E0657)]
|
||||
pub struct OpaqueCapturesHigherRankedLifetime {
|
||||
pub(crate) struct OpaqueCapturesHigherRankedLifetime {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[label]
|
||||
|
@ -1697,7 +1697,7 @@ pub struct OpaqueCapturesHigherRankedLifetime {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_pattern_type_non_const_range)]
|
||||
pub struct NonConstRange {
|
||||
pub(crate) struct NonConstRange {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
@ -1706,7 +1706,7 @@ pub struct NonConstRange {
|
|||
#[diag(hir_analysis_invalid_receiver_ty, code = E0307)]
|
||||
#[note]
|
||||
#[help(hir_analysis_invalid_receiver_ty_help)]
|
||||
pub struct InvalidReceiverTy<'tcx> {
|
||||
pub(crate) struct InvalidReceiverTy<'tcx> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub receiver_ty: Ty<'tcx>,
|
||||
|
@ -1716,12 +1716,12 @@ pub struct InvalidReceiverTy<'tcx> {
|
|||
#[diag(hir_analysis_effects_without_next_solver)]
|
||||
#[note]
|
||||
#[help]
|
||||
pub struct EffectsWithoutNextSolver;
|
||||
pub(crate) struct EffectsWithoutNextSolver;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_cmse_call_inputs_stack_spill, code = E0798)]
|
||||
#[note]
|
||||
pub struct CmseCallInputsStackSpill {
|
||||
pub(crate) struct CmseCallInputsStackSpill {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1732,7 +1732,7 @@ pub struct CmseCallInputsStackSpill {
|
|||
#[diag(hir_analysis_cmse_call_output_stack_spill, code = E0798)]
|
||||
#[note(hir_analysis_note1)]
|
||||
#[note(hir_analysis_note2)]
|
||||
pub struct CmseCallOutputStackSpill {
|
||||
pub(crate) struct CmseCallOutputStackSpill {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -1740,7 +1740,7 @@ pub struct CmseCallOutputStackSpill {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_cmse_call_generic, code = E0798)]
|
||||
pub struct CmseCallGeneric {
|
||||
pub(crate) struct CmseCallGeneric {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue