@@ -6,8 +6,7 @@ use rustc_errors::codes::*;
66use rustc_errors:: formatting:: DiagMessageAddArg ;
77use rustc_errors:: {
88 Applicability , Diag , DiagArgValue , DiagCtxtHandle , DiagMessage , DiagStyledString , Diagnostic ,
9- ElidedLifetimeInPathSubdiag , EmissionGuarantee , Level , MultiSpan , Subdiagnostic ,
10- SuggestionStyle , msg,
9+ ElidedLifetimeInPathSubdiag , EmissionGuarantee , Level , Subdiagnostic , SuggestionStyle , msg,
1110} ;
1211use rustc_hir as hir;
1312use rustc_hir:: def_id:: DefId ;
@@ -3089,42 +3088,6 @@ pub(crate) enum UnusedImportsSugg {
30893088 } ,
30903089}
30913090
3092- #[ derive( Diagnostic ) ]
3093- #[ diag( "the item `{$ident}` is imported redundantly" ) ]
3094- pub ( crate ) struct RedundantImport {
3095- #[ subdiagnostic]
3096- pub subs : Vec < RedundantImportSub > ,
3097- pub ident : Ident ,
3098- }
3099-
3100- #[ derive( Subdiagnostic ) ]
3101- pub ( crate ) enum RedundantImportSub {
3102- #[ label( "the item `{$ident}` is already imported here" ) ]
3103- ImportedHere {
3104- #[ primary_span]
3105- span : Span ,
3106- ident : Ident ,
3107- } ,
3108- #[ label( "the item `{$ident}` is already defined here" ) ]
3109- DefinedHere {
3110- #[ primary_span]
3111- span : Span ,
3112- ident : Ident ,
3113- } ,
3114- #[ label( "the item `{$ident}` is already imported by the extern prelude" ) ]
3115- ImportedPrelude {
3116- #[ primary_span]
3117- span : Span ,
3118- ident : Ident ,
3119- } ,
3120- #[ label( "the item `{$ident}` is already defined by the extern prelude" ) ]
3121- DefinedPrelude {
3122- #[ primary_span]
3123- span : Span ,
3124- ident : Ident ,
3125- } ,
3126- }
3127-
31283091#[ derive( Diagnostic ) ]
31293092#[ diag( "lifetime parameter `{$ident}` only used once" ) ]
31303093pub ( crate ) struct SingleUseLifetime {
@@ -3168,66 +3131,6 @@ pub(crate) struct NamedArgumentUsedPositionally {
31683131 pub named_arg_name : String ,
31693132}
31703133
3171- #[ derive( Diagnostic ) ]
3172- #[ diag( "ambiguous glob re-exports" ) ]
3173- pub ( crate ) struct AmbiguousGlobReexports {
3174- #[ label( "the name `{$name}` in the {$namespace} namespace is first re-exported here" ) ]
3175- pub first_reexport : Span ,
3176- #[ label( "but the name `{$name}` in the {$namespace} namespace is also re-exported here" ) ]
3177- pub duplicate_reexport : Span ,
3178-
3179- pub name : String ,
3180- pub namespace : String ,
3181- }
3182-
3183- #[ derive( Diagnostic ) ]
3184- #[ diag( "private item shadows public glob re-export" ) ]
3185- pub ( crate ) struct HiddenGlobReexports {
3186- #[ note(
3187- "the name `{$name}` in the {$namespace} namespace is supposed to be publicly re-exported here"
3188- ) ]
3189- pub glob_reexport : Span ,
3190- #[ note( "but the private item here shadows it" ) ]
3191- pub private_item : Span ,
3192-
3193- pub name : String ,
3194- pub namespace : String ,
3195- }
3196-
3197- #[ derive( Diagnostic ) ]
3198- #[ diag( "unnecessary qualification" ) ]
3199- pub ( crate ) struct UnusedQualifications {
3200- #[ suggestion(
3201- "remove the unnecessary path segments" ,
3202- style = "verbose" ,
3203- code = "" ,
3204- applicability = "machine-applicable"
3205- ) ]
3206- pub removal_span : Span ,
3207- }
3208-
3209- #[ derive( Diagnostic ) ]
3210- #[ diag(
3211- "{$elided ->
3212- [true] `&` without an explicit lifetime name cannot be used here
3213- *[false] `'_` cannot be used here
3214- }"
3215- ) ]
3216- pub ( crate ) struct AssociatedConstElidedLifetime {
3217- #[ suggestion(
3218- "use the `'static` lifetime" ,
3219- style = "verbose" ,
3220- code = "{code}" ,
3221- applicability = "machine-applicable"
3222- ) ]
3223- pub span : Span ,
3224-
3225- pub code : & ' static str ,
3226- pub elided : bool ,
3227- #[ note( "cannot automatically infer `'static` because of other lifetimes in scope" ) ]
3228- pub lifetimes_in_scope : MultiSpan ,
3229- }
3230-
32313134#[ derive( Diagnostic ) ]
32323135#[ diag( "creating a {$shared_label}reference to mutable static" ) ]
32333136pub ( crate ) struct RefOfMutStatic < ' a > {
@@ -3709,23 +3612,6 @@ pub(crate) struct UnknownCrateTypesSuggestion {
37093612 pub snippet : Symbol ,
37103613}
37113614
3712- #[ derive( Diagnostic ) ]
3713- #[ diag( "unreachable configuration predicate" ) ]
3714- pub ( crate ) struct UnreachableCfgSelectPredicate {
3715- #[ label( "this configuration predicate is never reached" ) ]
3716- pub span : Span ,
3717- }
3718-
3719- #[ derive( Diagnostic ) ]
3720- #[ diag( "unreachable configuration predicate" ) ]
3721- pub ( crate ) struct UnreachableCfgSelectPredicateWildcard {
3722- #[ label( "this configuration predicate is never reached" ) ]
3723- pub span : Span ,
3724-
3725- #[ label( "always matches" ) ]
3726- pub wildcard_span : Span ,
3727- }
3728-
37293615#[ derive( Diagnostic ) ]
37303616#[ diag( "positional format arguments are not allowed here" ) ]
37313617#[ help(
0 commit comments