@@ -2421,3 +2421,227 @@ pub(crate) struct UnderscoreLiteralSuffix {
24212421 #[ primary_span]
24222422 pub span : Span ,
24232423}
2424+
2425+ #[ derive( Diagnostic ) ]
2426+ #[ diag( parse_expect_label_found_ident) ]
2427+ pub ( crate ) struct ExpectedLabelFoundIdent {
2428+ #[ primary_span]
2429+ pub span : Span ,
2430+ #[ suggestion( code = "'" , applicability = "machine-applicable" , style = "short" ) ]
2431+ pub start : Span ,
2432+ }
2433+
2434+ #[ derive( Diagnostic ) ]
2435+ #[ diag( parse_inappropriate_default) ]
2436+ #[ note]
2437+ pub ( crate ) struct InappropriateDefault {
2438+ #[ primary_span]
2439+ #[ label]
2440+ pub span : Span ,
2441+ pub article : & ' static str ,
2442+ pub descr : & ' static str ,
2443+ }
2444+
2445+ #[ derive( Diagnostic ) ]
2446+ #[ diag( parse_recover_import_as_use) ]
2447+ pub ( crate ) struct RecoverImportAsUse {
2448+ #[ primary_span]
2449+ #[ suggestion( code = "use" , applicability = "machine-applicable" , style = "short" ) ]
2450+ pub span : Span ,
2451+ pub token_name : String ,
2452+ }
2453+
2454+ #[ derive( Diagnostic ) ]
2455+ #[ diag( parse_single_colon_import_path) ]
2456+ #[ note]
2457+ pub ( crate ) struct SingleColonImportPath {
2458+ #[ primary_span]
2459+ #[ suggestion( code = "::" , applicability = "machine-applicable" , style = "short" ) ]
2460+ pub span : Span ,
2461+ }
2462+
2463+ #[ derive( Diagnostic ) ]
2464+ #[ diag( parse_bad_item_kind) ]
2465+ #[ help]
2466+ pub ( crate ) struct BadItemKind {
2467+ #[ primary_span]
2468+ pub span : Span ,
2469+ pub descr : & ' static str ,
2470+ pub ctx : & ' static str ,
2471+ }
2472+
2473+ #[ derive( Diagnostic ) ]
2474+ #[ diag( parse_single_colon_struct_type) ]
2475+ pub ( crate ) struct SingleColonStructType {
2476+ #[ primary_span]
2477+ #[ suggestion( code = "::" , applicability = "maybe-incorrect" , style = "verbose" ) ]
2478+ pub span : Span ,
2479+ }
2480+
2481+ #[ derive( Diagnostic ) ]
2482+ #[ diag( parse_equals_struct_default) ]
2483+ pub ( crate ) struct EqualsStructDefault {
2484+ #[ primary_span]
2485+ #[ suggestion( code = "" , applicability = "machine-applicable" ) ]
2486+ pub span : Span ,
2487+ }
2488+
2489+ #[ derive( Diagnostic ) ]
2490+ #[ diag( parse_macro_rules_missing_bang) ]
2491+ pub ( crate ) struct MacroRulesMissingBang {
2492+ #[ primary_span]
2493+ pub span : Span ,
2494+ #[ suggestion( code = "!" , applicability = "machine-applicable" , style = "verbose" ) ]
2495+ pub hi : Span ,
2496+ }
2497+
2498+ #[ derive( Diagnostic ) ]
2499+ #[ diag( parse_macro_name_remove_bang) ]
2500+ pub ( crate ) struct MacroNameRemoveBang {
2501+ #[ primary_span]
2502+ #[ suggestion( code = "" , applicability = "machine-applicable" ) ]
2503+ pub span : Span ,
2504+ }
2505+
2506+ #[ derive( Diagnostic ) ]
2507+ #[ diag( parse_macro_rules_visibility) ]
2508+ pub ( crate ) struct MacroRulesVisibility < ' a > {
2509+ #[ primary_span]
2510+ #[ suggestion( code = "#[macro_export]" , applicability = "maybe-incorrect" ) ]
2511+ pub span : Span ,
2512+ pub vis : & ' a str ,
2513+ }
2514+
2515+ #[ derive( Diagnostic ) ]
2516+ #[ diag( parse_macro_invocation_visibility) ]
2517+ #[ help]
2518+ pub ( crate ) struct MacroInvocationVisibility < ' a > {
2519+ #[ primary_span]
2520+ #[ suggestion( code = "" , applicability = "machine-applicable" ) ]
2521+ pub span : Span ,
2522+ pub vis : & ' a str ,
2523+ }
2524+
2525+ #[ derive( Diagnostic ) ]
2526+ #[ diag( parse_nested_adt) ]
2527+ pub ( crate ) struct NestedAdt < ' a > {
2528+ #[ primary_span]
2529+ pub span : Span ,
2530+ #[ suggestion( code = "" , applicability = "maybe-incorrect" ) ]
2531+ pub item : Span ,
2532+ pub keyword : & ' a str ,
2533+ pub kw_str : Cow < ' a , str > ,
2534+ }
2535+
2536+ #[ derive( Diagnostic ) ]
2537+ #[ diag( parse_function_body_equals_expr) ]
2538+ pub ( crate ) struct FunctionBodyEqualsExpr {
2539+ #[ primary_span]
2540+ pub span : Span ,
2541+ #[ subdiagnostic]
2542+ pub sugg : FunctionBodyEqualsExprSugg ,
2543+ }
2544+
2545+ #[ derive( Subdiagnostic ) ]
2546+ #[ multipart_suggestion( parse_suggestion, applicability = "machine-applicable" ) ]
2547+ pub ( crate ) struct FunctionBodyEqualsExprSugg {
2548+ #[ suggestion_part( code = "{{" ) ]
2549+ pub eq : Span ,
2550+ #[ suggestion_part( code = " }}" ) ]
2551+ pub semi : Span ,
2552+ }
2553+
2554+ #[ derive( Diagnostic ) ]
2555+ #[ diag( parse_box_not_pat) ]
2556+ pub ( crate ) struct BoxNotPat {
2557+ #[ primary_span]
2558+ pub span : Span ,
2559+ #[ note]
2560+ pub kw : Span ,
2561+ #[ suggestion( code = "r#" , applicability = "maybe-incorrect" , style = "verbose" ) ]
2562+ pub lo : Span ,
2563+ pub descr : String ,
2564+ }
2565+
2566+ #[ derive( Diagnostic ) ]
2567+ #[ diag( parse_unmatched_angle) ]
2568+ pub ( crate ) struct UnmatchedAngle {
2569+ #[ primary_span]
2570+ #[ suggestion( code = "" , applicability = "machine-applicable" ) ]
2571+ pub span : Span ,
2572+ pub plural : bool ,
2573+ }
2574+
2575+ #[ derive( Diagnostic ) ]
2576+ #[ diag( parse_missing_plus_in_bounds) ]
2577+ pub ( crate ) struct MissingPlusBounds {
2578+ #[ primary_span]
2579+ pub span : Span ,
2580+ #[ suggestion( code = " +" , applicability = "maybe-incorrect" , style = "verbose" ) ]
2581+ pub hi : Span ,
2582+ pub sym : Symbol ,
2583+ }
2584+
2585+ #[ derive( Diagnostic ) ]
2586+ #[ diag( parse_incorrect_braces_trait_bounds) ]
2587+ pub ( crate ) struct IncorrectBracesTraitBounds {
2588+ #[ primary_span]
2589+ pub span : Vec < Span > ,
2590+ #[ subdiagnostic]
2591+ pub sugg : IncorrectBracesTraitBoundsSugg ,
2592+ }
2593+
2594+ #[ derive( Subdiagnostic ) ]
2595+ #[ multipart_suggestion( parse_suggestion, applicability = "machine-applicable" ) ]
2596+ pub ( crate ) struct IncorrectBracesTraitBoundsSugg {
2597+ #[ suggestion_part( code = " " ) ]
2598+ pub l : Span ,
2599+ #[ suggestion_part( code = "" ) ]
2600+ pub r : Span ,
2601+ }
2602+
2603+ #[ derive( Diagnostic ) ]
2604+ #[ diag( parse_kw_bad_case) ]
2605+ pub ( crate ) struct KwBadCase < ' a > {
2606+ #[ primary_span]
2607+ #[ suggestion( code = "{kw}" , applicability = "machine-applicable" ) ]
2608+ pub span : Span ,
2609+ pub kw : & ' a str ,
2610+ }
2611+
2612+ #[ derive( Diagnostic ) ]
2613+ #[ diag( parse_meta_bad_delim) ]
2614+ pub ( crate ) struct MetaBadDelim {
2615+ #[ primary_span]
2616+ pub span : Span ,
2617+ #[ subdiagnostic]
2618+ pub sugg : MetaBadDelimSugg ,
2619+ }
2620+
2621+ #[ derive( Diagnostic ) ]
2622+ #[ diag( parse_cfg_attr_bad_delim) ]
2623+ pub ( crate ) struct CfgAttrBadDelim {
2624+ #[ primary_span]
2625+ pub span : Span ,
2626+ #[ subdiagnostic]
2627+ pub sugg : MetaBadDelimSugg ,
2628+ }
2629+
2630+ #[ derive( Subdiagnostic ) ]
2631+ #[ multipart_suggestion( parse_meta_bad_delim_suggestion, applicability = "machine-applicable" ) ]
2632+ pub ( crate ) struct MetaBadDelimSugg {
2633+ #[ suggestion_part( code = "(" ) ]
2634+ pub open : Span ,
2635+ #[ suggestion_part( code = ")" ) ]
2636+ pub close : Span ,
2637+ }
2638+
2639+ #[ derive( Diagnostic ) ]
2640+ #[ diag( parse_malformed_cfg_attr) ]
2641+ #[ note]
2642+ pub ( crate ) struct MalformedCfgAttr {
2643+ #[ primary_span]
2644+ #[ suggestion( code = "{sugg}" ) ]
2645+ pub span : Span ,
2646+ pub sugg : & ' static str ,
2647+ }
0 commit comments