1use std::borrow::Cow;
4use std::path::PathBuf;
5
6use rustc_ast::token::{self, InvisibleOrigin, MetaVarKind, Token};
7use rustc_ast::util::parser::ExprPrecedence;
8use rustc_ast::{Path, Visibility};
9use rustc_errors::codes::*;
10use rustc_errors::{
11 Applicability, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, IntoDiagArg,
12 Level, Subdiagnostic, SuggestionStyle,
13};
14use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
15use rustc_session::errors::ExprParenthesesNeeded;
16use rustc_span::edition::{Edition, LATEST_STABLE_EDITION};
17use rustc_span::{Ident, Span, Symbol};
18
19use crate::fluent_generated as fluent;
20
21#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AmbiguousPlus
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AmbiguousPlus { span: __binding_0, suggestion: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_maybe_report_ambiguous_plus);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
22#[diag(parse_maybe_report_ambiguous_plus)]
23pub(crate) struct AmbiguousPlus {
24 #[primary_span]
25 pub span: Span,
26 #[subdiagnostic]
27 pub suggestion: AddParen,
28}
29
30#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for BadTypePlus
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BadTypePlus { span: __binding_0, sub: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_maybe_recover_from_bad_type_plus);
diag.code(E0178);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
31#[diag(parse_maybe_recover_from_bad_type_plus, code = E0178)]
32pub(crate) struct BadTypePlus {
33 #[primary_span]
34 pub span: Span,
35 #[subdiagnostic]
36 pub sub: BadTypePlusSub,
37}
38
39#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AddParen {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AddParen { lo: __binding_0, hi: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_0 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_1 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_0));
suggestions.push((__binding_1, __code_1));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_add_paren);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
40#[multipart_suggestion(parse_add_paren, applicability = "machine-applicable")]
41pub(crate) struct AddParen {
42 #[suggestion_part(code = "(")]
43 pub lo: Span,
44 #[suggestion_part(code = ")")]
45 pub hi: Span,
46}
47
48#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for BadTypePlusSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
BadTypePlusSub::AddParen { suggestion: __binding_0 } => {
__binding_0.add_to_diag(diag);
diag.store_args();
diag.restore_args();
}
BadTypePlusSub::ForgotParen { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_forgot_paren);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
BadTypePlusSub::ExpectPath { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_expect_path);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
49pub(crate) enum BadTypePlusSub {
50 AddParen {
51 #[subdiagnostic]
52 suggestion: AddParen,
53 },
54 #[label(parse_forgot_paren)]
55 ForgotParen {
56 #[primary_span]
57 span: Span,
58 },
59 #[label(parse_expect_path)]
60 ExpectPath {
61 #[primary_span]
62 span: Span,
63 },
64}
65
66#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for BadQPathStage2
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BadQPathStage2 { span: __binding_0, wrap: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_maybe_recover_from_bad_qpath_stage_2);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
67#[diag(parse_maybe_recover_from_bad_qpath_stage_2)]
68pub(crate) struct BadQPathStage2 {
69 #[primary_span]
70 pub span: Span,
71 #[subdiagnostic]
72 pub wrap: WrapType,
73}
74
75#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitImplModifierInInherentImpl where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitImplModifierInInherentImpl {
span: __binding_0,
modifier: __binding_1,
modifier_name: __binding_2,
modifier_span: __binding_3,
self_ty: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_trait_impl_modifier_in_inherent_impl);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("modifier", __binding_1);
diag.arg("modifier_name", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_3,
crate::fluent_generated::parse_because);
diag.span_label(__binding_4,
crate::fluent_generated::parse_type);
diag
}
}
}
}
};Diagnostic)]
76#[diag(parse_trait_impl_modifier_in_inherent_impl)]
77#[note]
78pub(crate) struct TraitImplModifierInInherentImpl {
79 #[primary_span]
80 pub span: Span,
81 pub modifier: &'static str,
82 pub modifier_name: &'static str,
83 #[label(parse_because)]
84 pub modifier_span: Span,
85 #[label(parse_type)]
86 pub self_ty: Span,
87}
88
89#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for WrapType {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
WrapType { lo: __binding_0, hi: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_2 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("<"))
});
let __code_3 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(">"))
});
suggestions.push((__binding_0, __code_2));
suggestions.push((__binding_1, __code_3));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
90#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
91pub(crate) struct WrapType {
92 #[suggestion_part(code = "<")]
93 pub lo: Span,
94 #[suggestion_part(code = ">")]
95 pub hi: Span,
96}
97
98#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectSemicolon<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectSemicolon {
span: __binding_0, show_help: __binding_1, name: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_incorrect_semicolon);
let __code_4 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("name", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_4,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
if __binding_1 {
diag.help(crate::fluent_generated::_subdiag::help);
}
diag
}
}
}
}
};Diagnostic)]
99#[diag(parse_incorrect_semicolon)]
100pub(crate) struct IncorrectSemicolon<'a> {
101 #[primary_span]
102 #[suggestion(style = "verbose", code = "", applicability = "machine-applicable")]
103 pub span: Span,
104 #[help]
105 pub show_help: bool,
106 pub name: &'a str,
107}
108
109#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectUseOfAwait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectUseOfAwait { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_incorrect_use_of_await);
let __code_5 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::parse_parentheses_suggestion,
__code_5, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
110#[diag(parse_incorrect_use_of_await)]
111pub(crate) struct IncorrectUseOfAwait {
112 #[primary_span]
113 #[suggestion(
114 parse_parentheses_suggestion,
115 style = "verbose",
116 code = "",
117 applicability = "machine-applicable"
118 )]
119 pub span: Span,
120}
121
122#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectUseOfUse where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectUseOfUse { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_incorrect_use_of_use);
let __code_6 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::parse_parentheses_suggestion,
__code_6, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
123#[diag(parse_incorrect_use_of_use)]
124pub(crate) struct IncorrectUseOfUse {
125 #[primary_span]
126 #[suggestion(
127 parse_parentheses_suggestion,
128 style = "verbose",
129 code = "",
130 applicability = "machine-applicable"
131 )]
132 pub span: Span,
133}
134
135#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AwaitSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AwaitSuggestion {
removal: __binding_0,
dot_await: __binding_1,
question_mark: __binding_2 } => {
let mut suggestions = Vec::new();
let __code_7 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
let __code_8 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(".await{0}", __binding_2))
});
suggestions.push((__binding_0, __code_7));
suggestions.push((__binding_1, __code_8));
diag.store_args();
diag.arg("question_mark", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_incorrect_use_of_await_postfix_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
136#[multipart_suggestion(
137 parse_incorrect_use_of_await_postfix_suggestion,
138 applicability = "machine-applicable"
139)]
140pub(crate) struct AwaitSuggestion {
141 #[suggestion_part(code = "")]
142 pub removal: Span,
143 #[suggestion_part(code = ".await{question_mark}")]
144 pub dot_await: Span,
145 pub question_mark: &'static str,
146}
147
148#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for IncorrectAwait
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectAwait { span: __binding_0, suggestion: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_incorrect_use_of_await);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
149#[diag(parse_incorrect_use_of_await)]
150pub(crate) struct IncorrectAwait {
151 #[primary_span]
152 pub span: Span,
153 #[subdiagnostic]
154 pub suggestion: AwaitSuggestion,
155}
156
157#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InInTypo where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InInTypo { span: __binding_0, sugg_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_in_in_typo);
let __code_9 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_9,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
158#[diag(parse_in_in_typo)]
159pub(crate) struct InInTypo {
160 #[primary_span]
161 pub span: Span,
162 #[suggestion(code = "", style = "verbose", applicability = "machine-applicable")]
163 pub sugg_span: Span,
164}
165
166#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidVariableDeclaration where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidVariableDeclaration {
span: __binding_0, sub: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_variable_declaration);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
167#[diag(parse_invalid_variable_declaration)]
168pub(crate) struct InvalidVariableDeclaration {
169 #[primary_span]
170 pub span: Span,
171 #[subdiagnostic]
172 pub sub: InvalidVariableDeclarationSub,
173}
174
175#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for InvalidVariableDeclarationSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
InvalidVariableDeclarationSub::SwitchMutLetOrder(__binding_0)
=> {
let __code_10 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("let mut"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_switch_mut_let_order);
diag.span_suggestions_with_style(__binding_0, __message,
__code_10, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
InvalidVariableDeclarationSub::MissingLet(__binding_0) => {
let __code_11 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("let mut"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_missing_let_before_mut);
diag.span_suggestions_with_style(__binding_0, __message,
__code_11, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
InvalidVariableDeclarationSub::UseLetNotAuto(__binding_0) =>
{
let __code_12 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("let"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_let_not_auto);
diag.span_suggestions_with_style(__binding_0, __message,
__code_12, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
InvalidVariableDeclarationSub::UseLetNotVar(__binding_0) =>
{
let __code_13 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("let"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_let_not_var);
diag.span_suggestions_with_style(__binding_0, __message,
__code_13, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
176pub(crate) enum InvalidVariableDeclarationSub {
177 #[suggestion(
178 parse_switch_mut_let_order,
179 style = "verbose",
180 applicability = "maybe-incorrect",
181 code = "let mut"
182 )]
183 SwitchMutLetOrder(#[primary_span] Span),
184 #[suggestion(
185 parse_missing_let_before_mut,
186 applicability = "machine-applicable",
187 style = "verbose",
188 code = "let mut"
189 )]
190 MissingLet(#[primary_span] Span),
191 #[suggestion(
192 parse_use_let_not_auto,
193 style = "verbose",
194 applicability = "machine-applicable",
195 code = "let"
196 )]
197 UseLetNotAuto(#[primary_span] Span),
198 #[suggestion(
199 parse_use_let_not_var,
200 style = "verbose",
201 applicability = "machine-applicable",
202 code = "let"
203 )]
204 UseLetNotVar(#[primary_span] Span),
205}
206
207#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SwitchRefBoxOrder where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SwitchRefBoxOrder { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_switch_ref_box_order);
let __code_14 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("box ref"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_14,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
208#[diag(parse_switch_ref_box_order)]
209pub(crate) struct SwitchRefBoxOrder {
210 #[primary_span]
211 #[suggestion(applicability = "machine-applicable", style = "verbose", code = "box ref")]
212 pub span: Span,
213}
214
215#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidComparisonOperator where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidComparisonOperator {
span: __binding_0, invalid: __binding_1, sub: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_comparison_operator);
;
diag.arg("invalid", __binding_1);
diag.span(__binding_0);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
216#[diag(parse_invalid_comparison_operator)]
217pub(crate) struct InvalidComparisonOperator {
218 #[primary_span]
219 pub span: Span,
220 pub invalid: String,
221 #[subdiagnostic]
222 pub sub: InvalidComparisonOperatorSub,
223}
224
225#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for InvalidComparisonOperatorSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
InvalidComparisonOperatorSub::Correctable {
span: __binding_0,
invalid: __binding_1,
correct: __binding_2 } => {
let __code_15 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
})].into_iter();
diag.store_args();
diag.arg("invalid", __binding_1);
diag.arg("correct", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_instead);
diag.span_suggestions_with_style(__binding_0, __message,
__code_15, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
InvalidComparisonOperatorSub::Spaceship(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_spaceship_operator_invalid);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
226pub(crate) enum InvalidComparisonOperatorSub {
227 #[suggestion(
228 parse_use_instead,
229 style = "verbose",
230 applicability = "machine-applicable",
231 code = "{correct}"
232 )]
233 Correctable {
234 #[primary_span]
235 span: Span,
236 invalid: String,
237 correct: String,
238 },
239 #[label(parse_spaceship_operator_invalid)]
240 Spaceship(#[primary_span] Span),
241}
242
243#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidLogicalOperator where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidLogicalOperator {
span: __binding_0, incorrect: __binding_1, sub: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_logical_operator);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("incorrect", __binding_1);
diag.span(__binding_0);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
244#[diag(parse_invalid_logical_operator)]
245#[note]
246pub(crate) struct InvalidLogicalOperator {
247 #[primary_span]
248 pub span: Span,
249 pub incorrect: String,
250 #[subdiagnostic]
251 pub sub: InvalidLogicalOperatorSub,
252}
253
254#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for InvalidLogicalOperatorSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
InvalidLogicalOperatorSub::Conjunction(__binding_0) => {
let __code_16 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("&&"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_amp_amp_for_conjunction);
diag.span_suggestions_with_style(__binding_0, __message,
__code_16, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
InvalidLogicalOperatorSub::Disjunction(__binding_0) => {
let __code_17 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("||"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_pipe_pipe_for_disjunction);
diag.span_suggestions_with_style(__binding_0, __message,
__code_17, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
255pub(crate) enum InvalidLogicalOperatorSub {
256 #[suggestion(
257 parse_use_amp_amp_for_conjunction,
258 style = "verbose",
259 applicability = "machine-applicable",
260 code = "&&"
261 )]
262 Conjunction(#[primary_span] Span),
263 #[suggestion(
264 parse_use_pipe_pipe_for_disjunction,
265 style = "verbose",
266 applicability = "machine-applicable",
267 code = "||"
268 )]
269 Disjunction(#[primary_span] Span),
270}
271
272#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TildeAsUnaryOperator where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TildeAsUnaryOperator(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_tilde_is_not_unary_operator);
let __code_18 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("!"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_18,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
273#[diag(parse_tilde_is_not_unary_operator)]
274pub(crate) struct TildeAsUnaryOperator(
275 #[primary_span]
276 #[suggestion(style = "verbose", applicability = "machine-applicable", code = "!")]
277 pub Span,
278);
279
280#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NotAsNegationOperator where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NotAsNegationOperator {
negated: __binding_0,
negated_desc: __binding_1,
sub: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_not);
;
diag.arg("negated_desc", __binding_1);
diag.span(__binding_0);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
281#[diag(parse_unexpected_token_after_not)]
282pub(crate) struct NotAsNegationOperator {
283 #[primary_span]
284 pub negated: Span,
285 pub negated_desc: String,
286 #[subdiagnostic]
287 pub sub: NotAsNegationOperatorSub,
288}
289
290#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for NotAsNegationOperatorSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
NotAsNegationOperatorSub::SuggestNotDefault(__binding_0) =>
{
let __code_19 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("!"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_unexpected_token_after_not_default);
diag.span_suggestions_with_style(__binding_0, __message,
__code_19, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
NotAsNegationOperatorSub::SuggestNotBitwise(__binding_0) =>
{
let __code_20 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("!"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_unexpected_token_after_not_bitwise);
diag.span_suggestions_with_style(__binding_0, __message,
__code_20, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
NotAsNegationOperatorSub::SuggestNotLogical(__binding_0) =>
{
let __code_21 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("!"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_unexpected_token_after_not_logical);
diag.span_suggestions_with_style(__binding_0, __message,
__code_21, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
291pub(crate) enum NotAsNegationOperatorSub {
292 #[suggestion(
293 parse_unexpected_token_after_not_default,
294 style = "verbose",
295 applicability = "machine-applicable",
296 code = "!"
297 )]
298 SuggestNotDefault(#[primary_span] Span),
299
300 #[suggestion(
301 parse_unexpected_token_after_not_bitwise,
302 style = "verbose",
303 applicability = "machine-applicable",
304 code = "!"
305 )]
306 SuggestNotBitwise(#[primary_span] Span),
307
308 #[suggestion(
309 parse_unexpected_token_after_not_logical,
310 style = "verbose",
311 applicability = "machine-applicable",
312 code = "!"
313 )]
314 SuggestNotLogical(#[primary_span] Span),
315}
316
317#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MalformedLoopLabel where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MalformedLoopLabel {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_malformed_loop_label);
let __code_22 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\'"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_22,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
318#[diag(parse_malformed_loop_label)]
319pub(crate) struct MalformedLoopLabel {
320 #[primary_span]
321 pub span: Span,
322 #[suggestion(applicability = "machine-applicable", code = "'", style = "verbose")]
323 pub suggestion: Span,
324}
325
326#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LifetimeInBorrowExpression where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LifetimeInBorrowExpression {
span: __binding_0, lifetime_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_lifetime_in_borrow_expression);
let __code_23 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_23,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
327#[diag(parse_lifetime_in_borrow_expression)]
328pub(crate) struct LifetimeInBorrowExpression {
329 #[primary_span]
330 pub span: Span,
331 #[suggestion(applicability = "machine-applicable", code = "", style = "verbose")]
332 #[label]
333 pub lifetime_span: Span,
334}
335
336#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FieldExpressionWithGeneric where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FieldExpressionWithGeneric(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_field_expression_with_generic);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
337#[diag(parse_field_expression_with_generic)]
338pub(crate) struct FieldExpressionWithGeneric(#[primary_span] pub Span);
339
340#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroInvocationWithQualifiedPath where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroInvocationWithQualifiedPath(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_macro_invocation_with_qualified_path);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
341#[diag(parse_macro_invocation_with_qualified_path)]
342pub(crate) struct MacroInvocationWithQualifiedPath(#[primary_span] pub Span);
343
344#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedTokenAfterLabel where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedTokenAfterLabel {
span: __binding_0,
remove_label: __binding_1,
enclose_in_block: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_label);
let __code_24 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_unexpected_token_after_label);
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_suggestion_remove_label,
__code_24, rustc_errors::Applicability::Unspecified,
rustc_errors::SuggestionStyle::ShowAlways);
}
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
345#[diag(parse_unexpected_token_after_label)]
346pub(crate) struct UnexpectedTokenAfterLabel {
347 #[primary_span]
348 #[label(parse_unexpected_token_after_label)]
349 pub span: Span,
350 #[suggestion(parse_suggestion_remove_label, style = "verbose", code = "")]
351 pub remove_label: Option<Span>,
352 #[subdiagnostic]
353 pub enclose_in_block: Option<UnexpectedTokenAfterLabelSugg>,
354}
355
356#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnexpectedTokenAfterLabelSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnexpectedTokenAfterLabelSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_25 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{ "))
});
let __code_26 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_25));
suggestions.push((__binding_1, __code_26));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_enclose_in_block);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
357#[multipart_suggestion(parse_suggestion_enclose_in_block, applicability = "machine-applicable")]
358pub(crate) struct UnexpectedTokenAfterLabelSugg {
359 #[suggestion_part(code = "{{ ")]
360 pub left: Span,
361 #[suggestion_part(code = " }}")]
362 pub right: Span,
363}
364
365#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RequireColonAfterLabeledExpression where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RequireColonAfterLabeledExpression {
span: __binding_0,
label: __binding_1,
label_end: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_require_colon_after_labeled_expression);
let __code_27 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(": "))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::_subdiag::suggestion, __code_27,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
366#[diag(parse_require_colon_after_labeled_expression)]
367#[note]
368pub(crate) struct RequireColonAfterLabeledExpression {
369 #[primary_span]
370 pub span: Span,
371 #[label]
372 pub label: Span,
373 #[suggestion(style = "verbose", applicability = "machine-applicable", code = ": ")]
374 pub label_end: Span,
375}
376
377#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DoCatchSyntaxRemoved where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DoCatchSyntaxRemoved { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_do_catch_syntax_removed);
let __code_28 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("try"))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_28,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
378#[diag(parse_do_catch_syntax_removed)]
379#[note]
380pub(crate) struct DoCatchSyntaxRemoved {
381 #[primary_span]
382 #[suggestion(applicability = "machine-applicable", code = "try", style = "verbose")]
383 pub span: Span,
384}
385
386#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FloatLiteralRequiresIntegerPart where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FloatLiteralRequiresIntegerPart {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_float_literal_requires_integer_part);
let __code_29 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("0"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_29,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
387#[diag(parse_float_literal_requires_integer_part)]
388pub(crate) struct FloatLiteralRequiresIntegerPart {
389 #[primary_span]
390 pub span: Span,
391 #[suggestion(applicability = "machine-applicable", code = "0", style = "verbose")]
392 pub suggestion: Span,
393}
394
395#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingSemicolonBeforeArray where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingSemicolonBeforeArray {
open_delim: __binding_0, semicolon: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_semicolon_before_array);
let __code_30 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(";"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_30,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
396#[diag(parse_missing_semicolon_before_array)]
397pub(crate) struct MissingSemicolonBeforeArray {
398 #[primary_span]
399 pub open_delim: Span,
400 #[suggestion(style = "verbose", applicability = "maybe-incorrect", code = ";")]
401 pub semicolon: Span,
402}
403
404#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MissingDotDot
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingDotDot {
token_span: __binding_0, sugg_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expect_dotdot_not_dotdotdot);
let __code_31 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(".."))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_31,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
405#[diag(parse_expect_dotdot_not_dotdotdot)]
406pub(crate) struct MissingDotDot {
407 #[primary_span]
408 pub token_span: Span,
409 #[suggestion(applicability = "maybe-incorrect", code = "..", style = "verbose")]
410 pub sugg_span: Span,
411}
412
413#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidBlockMacroSegment where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidBlockMacroSegment {
span: __binding_0, context: __binding_1, wrap: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_block_macro_segment);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
414#[diag(parse_invalid_block_macro_segment)]
415pub(crate) struct InvalidBlockMacroSegment {
416 #[primary_span]
417 pub span: Span,
418 #[label]
419 pub context: Span,
420 #[subdiagnostic]
421 pub wrap: WrapInExplicitBlock,
422}
423
424#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for WrapInExplicitBlock {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
WrapInExplicitBlock { lo: __binding_0, hi: __binding_1 } =>
{
let mut suggestions = Vec::new();
let __code_32 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{ "))
});
let __code_33 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_32));
suggestions.push((__binding_1, __code_33));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
425#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
426pub(crate) struct WrapInExplicitBlock {
427 #[suggestion_part(code = "{{ ")]
428 pub lo: Span,
429 #[suggestion_part(code = " }}")]
430 pub hi: Span,
431}
432
433#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IfExpressionMissingThenBlock where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IfExpressionMissingThenBlock {
if_span: __binding_0,
missing_then_block_sub: __binding_1,
let_else_sub: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_if_expression_missing_then_block);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
434#[diag(parse_if_expression_missing_then_block)]
435pub(crate) struct IfExpressionMissingThenBlock {
436 #[primary_span]
437 pub if_span: Span,
438 #[subdiagnostic]
439 pub missing_then_block_sub: IfExpressionMissingThenBlockSub,
440 #[subdiagnostic]
441 pub let_else_sub: Option<IfExpressionLetSomeSub>,
442}
443
444#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for IfExpressionMissingThenBlockSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
IfExpressionMissingThenBlockSub::UnfinishedCondition(__binding_0)
=> {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_condition_possibly_unfinished);
diag.span_help(__binding_0, __message);
diag.restore_args();
}
IfExpressionMissingThenBlockSub::AddThenBlock(__binding_0)
=> {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_add_then_block);
diag.span_help(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
445pub(crate) enum IfExpressionMissingThenBlockSub {
446 #[help(parse_condition_possibly_unfinished)]
447 UnfinishedCondition(#[primary_span] Span),
448 #[help(parse_add_then_block)]
449 AddThenBlock(#[primary_span] Span),
450}
451
452#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TernaryOperator where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TernaryOperator {
span: __binding_0, sugg: __binding_1, no_sugg: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_ternary_operator);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
if __binding_2 {
diag.help(crate::fluent_generated::parse_use_if_else);
}
diag
}
}
}
}
};Diagnostic)]
453#[diag(parse_ternary_operator)]
454pub(crate) struct TernaryOperator {
455 #[primary_span]
456 pub span: Span,
457 #[subdiagnostic]
459 pub sugg: Option<TernaryOperatorSuggestion>,
460 #[help(parse_use_if_else)]
462 pub no_sugg: bool,
463}
464
465#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for TernaryOperatorSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TernaryOperatorSuggestion {
before_cond: __binding_0,
question: __binding_1,
colon: __binding_2,
end: __binding_3 } => {
let mut suggestions = Vec::new();
let __code_34 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("if "))
});
let __code_35 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{"))
});
let __code_36 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("}} else {{"))
});
let __code_37 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_34));
suggestions.push((__binding_1, __code_35));
suggestions.push((__binding_2, __code_36));
suggestions.push((__binding_3, __code_37));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_if_else);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic, #[automatically_derived]
impl ::core::marker::Copy for TernaryOperatorSuggestion { }Copy, #[automatically_derived]
impl ::core::clone::Clone for TernaryOperatorSuggestion {
#[inline]
fn clone(&self) -> TernaryOperatorSuggestion {
let _: ::core::clone::AssertParamIsClone<Span>;
*self
}
}Clone)]
466#[multipart_suggestion(parse_use_if_else, applicability = "maybe-incorrect", style = "verbose")]
467pub(crate) struct TernaryOperatorSuggestion {
468 #[suggestion_part(code = "if ")]
469 pub before_cond: Span,
470 #[suggestion_part(code = "{{")]
471 pub question: Span,
472 #[suggestion_part(code = "}} else {{")]
473 pub colon: Span,
474 #[suggestion_part(code = " }}")]
475 pub end: Span,
476}
477
478#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for IfExpressionLetSomeSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
IfExpressionLetSomeSub { if_span: __binding_0 } => {
let __code_38 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_extra_if_in_let_else);
diag.span_suggestions_with_style(__binding_0, __message,
__code_38, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
479#[suggestion(
480 parse_extra_if_in_let_else,
481 applicability = "maybe-incorrect",
482 code = "",
483 style = "verbose"
484)]
485pub(crate) struct IfExpressionLetSomeSub {
486 #[primary_span]
487 pub if_span: Span,
488}
489
490#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IfExpressionMissingCondition where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IfExpressionMissingCondition {
if_span: __binding_0, block_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_if_expression_missing_condition);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_condition_label);
diag.span_label(__binding_1,
crate::fluent_generated::parse_block_label);
diag
}
}
}
}
};Diagnostic)]
491#[diag(parse_if_expression_missing_condition)]
492pub(crate) struct IfExpressionMissingCondition {
493 #[primary_span]
494 #[label(parse_condition_label)]
495 pub if_span: Span,
496 #[label(parse_block_label)]
497 pub block_span: Span,
498}
499
500#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedExpressionFoundLet where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedExpressionFoundLet {
span: __binding_0,
reason: __binding_1,
missing_let: __binding_2,
comparison: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_expression_found_let);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
501#[diag(parse_expected_expression_found_let)]
502#[note]
503pub(crate) struct ExpectedExpressionFoundLet {
504 #[primary_span]
505 pub span: Span,
506 #[subdiagnostic]
507 pub reason: ForbiddenLetReason,
508 #[subdiagnostic]
509 pub missing_let: Option<MaybeMissingLet>,
510 #[subdiagnostic]
511 pub comparison: Option<MaybeComparison>,
512}
513
514#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for OrInLetChain
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
OrInLetChain { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_or_in_let_chain);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
515#[diag(parse_or_in_let_chain)]
516pub(crate) struct OrInLetChain {
517 #[primary_span]
518 pub span: Span,
519}
520
521#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MaybeMissingLet {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MaybeMissingLet { span: __binding_0 } => {
let mut suggestions = Vec::new();
let __code_39 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("let "))
});
suggestions.push((__binding_0, __code_39));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_maybe_missing_let);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic, #[automatically_derived]
impl ::core::clone::Clone for MaybeMissingLet {
#[inline]
fn clone(&self) -> MaybeMissingLet {
let _: ::core::clone::AssertParamIsClone<Span>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for MaybeMissingLet { }Copy)]
522#[multipart_suggestion(
523 parse_maybe_missing_let,
524 applicability = "maybe-incorrect",
525 style = "verbose"
526)]
527pub(crate) struct MaybeMissingLet {
528 #[suggestion_part(code = "let ")]
529 pub span: Span,
530}
531
532#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MaybeComparison {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MaybeComparison { span: __binding_0 } => {
let mut suggestions = Vec::new();
let __code_40 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("="))
});
suggestions.push((__binding_0, __code_40));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_maybe_comparison);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic, #[automatically_derived]
impl ::core::clone::Clone for MaybeComparison {
#[inline]
fn clone(&self) -> MaybeComparison {
let _: ::core::clone::AssertParamIsClone<Span>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for MaybeComparison { }Copy)]
533#[multipart_suggestion(
534 parse_maybe_comparison,
535 applicability = "maybe-incorrect",
536 style = "verbose"
537)]
538pub(crate) struct MaybeComparison {
539 #[suggestion_part(code = "=")]
540 pub span: Span,
541}
542
543#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedEqForLetExpr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedEqForLetExpr {
span: __binding_0, sugg_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expect_eq_instead_of_eqeq);
let __code_41 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("="))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_41,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
544#[diag(parse_expect_eq_instead_of_eqeq)]
545pub(crate) struct ExpectedEqForLetExpr {
546 #[primary_span]
547 pub span: Span,
548 #[suggestion(applicability = "maybe-incorrect", code = "=", style = "verbose")]
549 pub sugg_span: Span,
550}
551
552#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedElseBlock where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedElseBlock {
first_tok_span: __binding_0,
first_tok: __binding_1,
else_span: __binding_2,
condition_start: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_else_block);
let __code_42 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("if "))
})].into_iter();
;
diag.arg("first_tok", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_3,
crate::fluent_generated::_subdiag::suggestion, __code_42,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
553#[diag(parse_expected_else_block)]
554pub(crate) struct ExpectedElseBlock {
555 #[primary_span]
556 pub first_tok_span: Span,
557 pub first_tok: String,
558 #[label]
559 pub else_span: Span,
560 #[suggestion(applicability = "maybe-incorrect", code = "if ", style = "verbose")]
561 pub condition_start: Span,
562}
563
564#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedStructField where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedStructField {
span: __binding_0,
token: __binding_1,
ident_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_struct_field);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_2,
crate::fluent_generated::parse_ident_label);
diag
}
}
}
}
};Diagnostic)]
565#[diag(parse_expected_struct_field)]
566pub(crate) struct ExpectedStructField {
567 #[primary_span]
568 #[label]
569 pub span: Span,
570 pub token: Token,
571 #[label(parse_ident_label)]
572 pub ident_span: Span,
573}
574
575#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
OuterAttributeNotAllowedOnIfElse where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
OuterAttributeNotAllowedOnIfElse {
last: __binding_0,
branch_span: __binding_1,
ctx_span: __binding_2,
ctx: __binding_3,
attributes: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_outer_attribute_not_allowed_on_if_else);
let __code_43 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("ctx", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::parse_branch_label);
diag.span_label(__binding_2,
crate::fluent_generated::parse_ctx_label);
diag.span_suggestions_with_style(__binding_4,
crate::fluent_generated::_subdiag::suggestion, __code_43,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
576#[diag(parse_outer_attribute_not_allowed_on_if_else)]
577pub(crate) struct OuterAttributeNotAllowedOnIfElse {
578 #[primary_span]
579 pub last: Span,
580
581 #[label(parse_branch_label)]
582 pub branch_span: Span,
583
584 #[label(parse_ctx_label)]
585 pub ctx_span: Span,
586 pub ctx: String,
587
588 #[suggestion(applicability = "machine-applicable", code = "", style = "verbose")]
589 pub attributes: Span,
590}
591
592#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingInInForLoop where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingInInForLoop { span: __binding_0, sub: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_in_in_for_loop);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
593#[diag(parse_missing_in_in_for_loop)]
594pub(crate) struct MissingInInForLoop {
595 #[primary_span]
596 pub span: Span,
597 #[subdiagnostic]
598 pub sub: MissingInInForLoopSub,
599}
600
601#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MissingInInForLoopSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MissingInInForLoopSub::InNotOf(__binding_0) => {
let __code_44 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("in"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_in);
diag.span_suggestions_with_style(__binding_0, __message,
__code_44, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
MissingInInForLoopSub::InNotEq(__binding_0) => {
let __code_45 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("in"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_in);
diag.span_suggestions_with_style(__binding_0, __message,
__code_45, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
MissingInInForLoopSub::AddIn(__binding_0) => {
let __code_46 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" in "))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_add_in);
diag.span_suggestions_with_style(__binding_0, __message,
__code_46, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
602pub(crate) enum MissingInInForLoopSub {
603 #[suggestion(parse_use_in, style = "verbose", applicability = "maybe-incorrect", code = "in")]
606 InNotOf(#[primary_span] Span),
607 #[suggestion(parse_use_in, style = "verbose", applicability = "maybe-incorrect", code = "in")]
609 InNotEq(#[primary_span] Span),
610 #[suggestion(parse_add_in, style = "verbose", applicability = "maybe-incorrect", code = " in ")]
611 AddIn(#[primary_span] Span),
612}
613
614#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingExpressionInForLoop where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingExpressionInForLoop { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_expression_in_for_loop);
let __code_47 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("/* expression */ "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_47,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
615#[diag(parse_missing_expression_in_for_loop)]
616pub(crate) struct MissingExpressionInForLoop {
617 #[primary_span]
618 #[suggestion(
619 code = "/* expression */ ",
620 applicability = "has-placeholders",
621 style = "verbose"
622 )]
623 pub span: Span,
624}
625
626#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LoopElseNotSupported where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LoopElseNotSupported {
span: __binding_0,
loop_kind: __binding_1,
loop_kw: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_loop_else);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("loop_kind", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::parse_loop_keyword);
diag
}
}
}
}
};Diagnostic)]
627#[diag(parse_loop_else)]
628#[note]
629pub(crate) struct LoopElseNotSupported {
630 #[primary_span]
631 pub span: Span,
632 pub loop_kind: &'static str,
633 #[label(parse_loop_keyword)]
634 pub loop_kw: Span,
635}
636
637#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingCommaAfterMatchArm where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingCommaAfterMatchArm { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_comma_after_match_arm);
let __code_48 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(","))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_48,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
638#[diag(parse_missing_comma_after_match_arm)]
639pub(crate) struct MissingCommaAfterMatchArm {
640 #[primary_span]
641 #[suggestion(applicability = "machine-applicable", code = ",", style = "verbose")]
642 pub span: Span,
643}
644
645#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CatchAfterTry
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CatchAfterTry { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_catch_after_try);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
646#[diag(parse_catch_after_try)]
647#[help]
648pub(crate) struct CatchAfterTry {
649 #[primary_span]
650 pub span: Span,
651}
652
653#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CommaAfterBaseStruct where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CommaAfterBaseStruct { span: __binding_0, comma: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_comma_after_base_struct);
let __code_49 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_49,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
654#[diag(parse_comma_after_base_struct)]
655#[note]
656pub(crate) struct CommaAfterBaseStruct {
657 #[primary_span]
658 pub span: Span,
659 #[suggestion(style = "verbose", applicability = "machine-applicable", code = "")]
660 pub comma: Span,
661}
662
663#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for EqFieldInit
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EqFieldInit { span: __binding_0, eq: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_eq_field_init);
let __code_50 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(":"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_50,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
664#[diag(parse_eq_field_init)]
665pub(crate) struct EqFieldInit {
666 #[primary_span]
667 pub span: Span,
668 #[suggestion(applicability = "machine-applicable", code = ":", style = "verbose")]
669 pub eq: Span,
670}
671
672#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for DotDotDot
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DotDotDot { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_dotdotdot);
let __code_51 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(".."))
})].into_iter();
let __code_52 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("..="))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::parse_suggest_exclusive_range,
__code_51, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::parse_suggest_inclusive_range,
__code_52, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
673#[diag(parse_dotdotdot)]
674pub(crate) struct DotDotDot {
675 #[primary_span]
676 #[suggestion(
677 parse_suggest_exclusive_range,
678 applicability = "maybe-incorrect",
679 code = "..",
680 style = "verbose"
681 )]
682 #[suggestion(
683 parse_suggest_inclusive_range,
684 applicability = "maybe-incorrect",
685 code = "..=",
686 style = "verbose"
687 )]
688 pub span: Span,
689}
690
691#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LeftArrowOperator where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LeftArrowOperator { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_left_arrow_operator);
let __code_53 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("< -"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_53,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
692#[diag(parse_left_arrow_operator)]
693pub(crate) struct LeftArrowOperator {
694 #[primary_span]
695 #[suggestion(applicability = "maybe-incorrect", code = "< -", style = "verbose")]
696 pub span: Span,
697}
698
699#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for RemoveLet
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RemoveLet { span: __binding_0, suggestion: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_remove_let);
let __code_54 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_54,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
700#[diag(parse_remove_let)]
701pub(crate) struct RemoveLet {
702 #[primary_span]
703 pub span: Span,
704 #[suggestion(applicability = "machine-applicable", code = "", style = "verbose")]
705 pub suggestion: Span,
706}
707
708#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UseEqInstead
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UseEqInstead { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_use_eq_instead);
let __code_55 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("="))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_55,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
709#[diag(parse_use_eq_instead)]
710pub(crate) struct UseEqInstead {
711 #[primary_span]
712 #[suggestion(style = "verbose", applicability = "machine-applicable", code = "=")]
713 pub span: Span,
714}
715
716#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UseEmptyBlockNotSemi where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UseEmptyBlockNotSemi { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_use_empty_block_not_semi);
let __code_56 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{}}"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_56,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::HideCodeAlways);
diag
}
}
}
}
};Diagnostic)]
717#[diag(parse_use_empty_block_not_semi)]
718pub(crate) struct UseEmptyBlockNotSemi {
719 #[primary_span]
720 #[suggestion(style = "hidden", applicability = "machine-applicable", code = "{{}}")]
721 pub span: Span,
722}
723
724#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ComparisonInterpretedAsGeneric where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ComparisonInterpretedAsGeneric {
comparison: __binding_0,
r#type: __binding_1,
args: __binding_2,
suggestion: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_comparison_interpreted_as_generic);
;
diag.arg("type", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_label_comparison);
diag.span_label(__binding_2,
crate::fluent_generated::parse_label_args);
diag.subdiagnostic(__binding_3);
diag
}
}
}
}
};Diagnostic)]
725#[diag(parse_comparison_interpreted_as_generic)]
726pub(crate) struct ComparisonInterpretedAsGeneric {
727 #[primary_span]
728 #[label(parse_label_comparison)]
729 pub comparison: Span,
730 pub r#type: Path,
731 #[label(parse_label_args)]
732 pub args: Span,
733 #[subdiagnostic]
734 pub suggestion: ComparisonOrShiftInterpretedAsGenericSugg,
735}
736
737#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ShiftInterpretedAsGeneric where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ShiftInterpretedAsGeneric {
shift: __binding_0,
r#type: __binding_1,
args: __binding_2,
suggestion: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_shift_interpreted_as_generic);
;
diag.arg("type", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_label_comparison);
diag.span_label(__binding_2,
crate::fluent_generated::parse_label_args);
diag.subdiagnostic(__binding_3);
diag
}
}
}
}
};Diagnostic)]
738#[diag(parse_shift_interpreted_as_generic)]
739pub(crate) struct ShiftInterpretedAsGeneric {
740 #[primary_span]
741 #[label(parse_label_comparison)]
742 pub shift: Span,
743 pub r#type: Path,
744 #[label(parse_label_args)]
745 pub args: Span,
746 #[subdiagnostic]
747 pub suggestion: ComparisonOrShiftInterpretedAsGenericSugg,
748}
749
750#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
ComparisonOrShiftInterpretedAsGenericSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ComparisonOrShiftInterpretedAsGenericSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_57 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_58 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_57));
suggestions.push((__binding_1, __code_58));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
751#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
752pub(crate) struct ComparisonOrShiftInterpretedAsGenericSugg {
753 #[suggestion_part(code = "(")]
754 pub left: Span,
755 #[suggestion_part(code = ")")]
756 pub right: Span,
757}
758
759#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FoundExprWouldBeStmt where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FoundExprWouldBeStmt {
span: __binding_0,
token: __binding_1,
suggestion: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_found_expr_would_be_stmt);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
760#[diag(parse_found_expr_would_be_stmt)]
761pub(crate) struct FoundExprWouldBeStmt {
762 #[primary_span]
763 #[label]
764 pub span: Span,
765 pub token: Token,
766 #[subdiagnostic]
767 pub suggestion: ExprParenthesesNeeded,
768}
769
770#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FrontmatterExtraCharactersAfterClose where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FrontmatterExtraCharactersAfterClose { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_frontmatter_extra_characters_after_close);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
771#[diag(parse_frontmatter_extra_characters_after_close)]
772pub(crate) struct FrontmatterExtraCharactersAfterClose {
773 #[primary_span]
774 pub span: Span,
775}
776
777#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FrontmatterInvalidInfostring where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FrontmatterInvalidInfostring { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_frontmatter_invalid_infostring);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
778#[diag(parse_frontmatter_invalid_infostring)]
779#[note]
780pub(crate) struct FrontmatterInvalidInfostring {
781 #[primary_span]
782 pub span: Span,
783}
784
785#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FrontmatterInvalidOpeningPrecedingWhitespace where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FrontmatterInvalidOpeningPrecedingWhitespace {
span: __binding_0, note_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_frontmatter_invalid_opening_preceding_whitespace);
;
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
786#[diag(parse_frontmatter_invalid_opening_preceding_whitespace)]
787pub(crate) struct FrontmatterInvalidOpeningPrecedingWhitespace {
788 #[primary_span]
789 pub span: Span,
790 #[note]
791 pub note_span: Span,
792}
793
794#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FrontmatterUnclosed where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FrontmatterUnclosed {
span: __binding_0, note_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_frontmatter_unclosed);
;
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
795#[diag(parse_frontmatter_unclosed)]
796pub(crate) struct FrontmatterUnclosed {
797 #[primary_span]
798 pub span: Span,
799 #[note]
800 pub note_span: Span,
801}
802
803#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FrontmatterInvalidClosingPrecedingWhitespace where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FrontmatterInvalidClosingPrecedingWhitespace {
span: __binding_0, note_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_frontmatter_invalid_close_preceding_whitespace);
;
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
804#[diag(parse_frontmatter_invalid_close_preceding_whitespace)]
805pub(crate) struct FrontmatterInvalidClosingPrecedingWhitespace {
806 #[primary_span]
807 pub span: Span,
808 #[note]
809 pub note_span: Span,
810}
811
812#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FrontmatterLengthMismatch where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FrontmatterLengthMismatch {
span: __binding_0,
opening: __binding_1,
close: __binding_2,
len_opening: __binding_3,
len_close: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_frontmatter_length_mismatch);
;
diag.arg("len_opening", __binding_3);
diag.arg("len_close", __binding_4);
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::parse_label_opening);
diag.span_label(__binding_2,
crate::fluent_generated::parse_label_close);
diag
}
}
}
}
};Diagnostic)]
813#[diag(parse_frontmatter_length_mismatch)]
814pub(crate) struct FrontmatterLengthMismatch {
815 #[primary_span]
816 pub span: Span,
817 #[label(parse_label_opening)]
818 pub opening: Span,
819 #[label(parse_label_close)]
820 pub close: Span,
821 pub len_opening: usize,
822 pub len_close: usize,
823}
824
825#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FrontmatterTooManyDashes where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FrontmatterTooManyDashes { len_opening: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_frontmatter_too_many_dashes);
;
diag.arg("len_opening", __binding_0);
diag
}
}
}
}
};Diagnostic)]
826#[diag(parse_frontmatter_too_many_dashes)]
827pub(crate) struct FrontmatterTooManyDashes {
828 pub len_opening: usize,
829}
830
831#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BareCrFrontmatter where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BareCrFrontmatter { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_bare_cr_in_frontmatter);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
832#[diag(parse_bare_cr_in_frontmatter)]
833pub(crate) struct BareCrFrontmatter {
834 #[primary_span]
835 pub span: Span,
836}
837
838#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LeadingPlusNotSupported where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LeadingPlusNotSupported {
span: __binding_0,
remove_plus: __binding_1,
add_parentheses: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_leading_plus_not_supported);
let __code_59 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_suggestion_remove_plus,
__code_59, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
}
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
839#[diag(parse_leading_plus_not_supported)]
840pub(crate) struct LeadingPlusNotSupported {
841 #[primary_span]
842 #[label]
843 pub span: Span,
844 #[suggestion(
845 parse_suggestion_remove_plus,
846 style = "verbose",
847 code = "",
848 applicability = "machine-applicable"
849 )]
850 pub remove_plus: Option<Span>,
851 #[subdiagnostic]
852 pub add_parentheses: Option<ExprParenthesesNeeded>,
853}
854
855#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ParenthesesWithStructFields where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ParenthesesWithStructFields {
span: __binding_0,
r#type: __binding_1,
braces_for_struct: __binding_2,
no_fields_for_fn: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_parentheses_with_struct_fields);
;
diag.arg("type", __binding_1);
diag.span(__binding_0);
diag.subdiagnostic(__binding_2);
diag.subdiagnostic(__binding_3);
diag
}
}
}
}
};Diagnostic)]
856#[diag(parse_parentheses_with_struct_fields)]
857pub(crate) struct ParenthesesWithStructFields {
858 #[primary_span]
859 pub span: Span,
860 pub r#type: Path,
861 #[subdiagnostic]
862 pub braces_for_struct: BracesForStructLiteral,
863 #[subdiagnostic]
864 pub no_fields_for_fn: NoFieldsForFnCall,
865}
866
867#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for BracesForStructLiteral {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
BracesForStructLiteral {
first: __binding_0, second: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_60 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" {{ "))
});
let __code_61 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_60));
suggestions.push((__binding_1, __code_61));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_braces_for_struct);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
868#[multipart_suggestion(parse_suggestion_braces_for_struct, applicability = "maybe-incorrect")]
869pub(crate) struct BracesForStructLiteral {
870 #[suggestion_part(code = " {{ ")]
871 pub first: Span,
872 #[suggestion_part(code = " }}")]
873 pub second: Span,
874}
875
876#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for NoFieldsForFnCall {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
NoFieldsForFnCall { fields: __binding_0 } => {
let mut suggestions = Vec::new();
let __code_62 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
for __binding_0 in __binding_0 {
suggestions.push((__binding_0, __code_62.clone()));
}
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_no_fields_for_fn);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
877#[multipart_suggestion(parse_suggestion_no_fields_for_fn, applicability = "maybe-incorrect")]
878pub(crate) struct NoFieldsForFnCall {
879 #[suggestion_part(code = "")]
880 pub fields: Vec<Span>,
881}
882
883#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LabeledLoopInBreak where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LabeledLoopInBreak { span: __binding_0, sub: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_labeled_loop_in_break);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
884#[diag(parse_labeled_loop_in_break)]
885pub(crate) struct LabeledLoopInBreak {
886 #[primary_span]
887 pub span: Span,
888 #[subdiagnostic]
889 pub sub: WrapInParentheses,
890}
891
892#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for WrapInParentheses {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
WrapInParentheses::Expression {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_63 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_64 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_63));
suggestions.push((__binding_1, __code_64));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_wrap_expression_in_parentheses);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
WrapInParentheses::MacroArgs {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_65 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_66 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_65));
suggestions.push((__binding_1, __code_66));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_wrap_macro_in_parentheses);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
893pub(crate) enum WrapInParentheses {
894 #[multipart_suggestion(
895 parse_sugg_wrap_expression_in_parentheses,
896 applicability = "machine-applicable"
897 )]
898 Expression {
899 #[suggestion_part(code = "(")]
900 left: Span,
901 #[suggestion_part(code = ")")]
902 right: Span,
903 },
904 #[multipart_suggestion(
905 parse_sugg_wrap_macro_in_parentheses,
906 applicability = "machine-applicable"
907 )]
908 MacroArgs {
909 #[suggestion_part(code = "(")]
910 left: Span,
911 #[suggestion_part(code = ")")]
912 right: Span,
913 },
914}
915
916#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ArrayBracketsInsteadOfBraces where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ArrayBracketsInsteadOfBraces {
span: __binding_0, sub: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_array_brackets_instead_of_braces);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
917#[diag(parse_array_brackets_instead_of_braces)]
918pub(crate) struct ArrayBracketsInsteadOfBraces {
919 #[primary_span]
920 pub span: Span,
921 #[subdiagnostic]
922 pub sub: ArrayBracketsInsteadOfBracesSugg,
923}
924
925#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ArrayBracketsInsteadOfBracesSugg
{
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ArrayBracketsInsteadOfBracesSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_67 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("["))
});
let __code_68 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("]"))
});
suggestions.push((__binding_0, __code_67));
suggestions.push((__binding_1, __code_68));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
926#[multipart_suggestion(parse_suggestion, applicability = "maybe-incorrect")]
927pub(crate) struct ArrayBracketsInsteadOfBracesSugg {
928 #[suggestion_part(code = "[")]
929 pub left: Span,
930 #[suggestion_part(code = "]")]
931 pub right: Span,
932}
933
934#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MatchArmBodyWithoutBraces where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MatchArmBodyWithoutBraces {
statements: __binding_0,
arrow: __binding_1,
num_statements: __binding_2,
sub: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_match_arm_body_without_braces);
;
diag.arg("num_statements", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_label_statements);
diag.span_label(__binding_1,
crate::fluent_generated::parse_label_arrow);
diag.subdiagnostic(__binding_3);
diag
}
}
}
}
};Diagnostic)]
935#[diag(parse_match_arm_body_without_braces)]
936pub(crate) struct MatchArmBodyWithoutBraces {
937 #[primary_span]
938 #[label(parse_label_statements)]
939 pub statements: Span,
940 #[label(parse_label_arrow)]
941 pub arrow: Span,
942 pub num_statements: usize,
943 #[subdiagnostic]
944 pub sub: MatchArmBodyWithoutBracesSugg,
945}
946
947#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InclusiveRangeExtraEquals where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InclusiveRangeExtraEquals { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_inclusive_range_extra_equals);
let __code_69 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("..="))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::parse_suggestion_remove_eq,
__code_69, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
948#[diag(parse_inclusive_range_extra_equals)]
949#[note]
950pub(crate) struct InclusiveRangeExtraEquals {
951 #[primary_span]
952 #[suggestion(
953 parse_suggestion_remove_eq,
954 style = "verbose",
955 code = "..=",
956 applicability = "maybe-incorrect"
957 )]
958 pub span: Span,
959}
960
961#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InclusiveRangeMatchArrow where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InclusiveRangeMatchArrow {
arrow: __binding_0,
span: __binding_1,
after_pat: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_inclusive_range_match_arrow);
let __code_70 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::_subdiag::suggestion, __code_70,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
962#[diag(parse_inclusive_range_match_arrow)]
963pub(crate) struct InclusiveRangeMatchArrow {
964 #[primary_span]
965 pub arrow: Span,
966 #[label]
967 pub span: Span,
968 #[suggestion(style = "verbose", code = " ", applicability = "machine-applicable")]
969 pub after_pat: Span,
970}
971
972#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InclusiveRangeNoEnd where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InclusiveRangeNoEnd {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_inclusive_range_no_end);
let __code_71 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.code(E0586);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_suggestion_open_range,
__code_71, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
973#[diag(parse_inclusive_range_no_end, code = E0586)]
974#[note]
975pub(crate) struct InclusiveRangeNoEnd {
976 #[primary_span]
977 pub span: Span,
978 #[suggestion(
979 parse_suggestion_open_range,
980 code = "",
981 applicability = "machine-applicable",
982 style = "verbose"
983 )]
984 pub suggestion: Span,
985}
986
987#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MatchArmBodyWithoutBracesSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MatchArmBodyWithoutBracesSugg::AddBraces {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_72 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{ "))
});
let __code_73 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_72));
suggestions.push((__binding_1, __code_73));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_add_braces);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
MatchArmBodyWithoutBracesSugg::UseComma {
semicolon: __binding_0 } => {
let __code_74 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(","))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_use_comma_not_semicolon);
diag.span_suggestions_with_style(__binding_0, __message,
__code_74, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
988pub(crate) enum MatchArmBodyWithoutBracesSugg {
989 #[multipart_suggestion(parse_suggestion_add_braces, applicability = "machine-applicable")]
990 AddBraces {
991 #[suggestion_part(code = "{{ ")]
992 left: Span,
993 #[suggestion_part(code = " }}")]
994 right: Span,
995 },
996 #[suggestion(
997 parse_suggestion_use_comma_not_semicolon,
998 code = ",",
999 applicability = "machine-applicable",
1000 style = "verbose"
1001 )]
1002 UseComma {
1003 #[primary_span]
1004 semicolon: Span,
1005 },
1006}
1007
1008#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StructLiteralNotAllowedHere where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StructLiteralNotAllowedHere {
span: __binding_0, sub: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_struct_literal_not_allowed_here);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1009#[diag(parse_struct_literal_not_allowed_here)]
1010pub(crate) struct StructLiteralNotAllowedHere {
1011 #[primary_span]
1012 pub span: Span,
1013 #[subdiagnostic]
1014 pub sub: StructLiteralNotAllowedHereSugg,
1015}
1016
1017#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for StructLiteralNotAllowedHereSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
StructLiteralNotAllowedHereSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_75 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_76 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_75));
suggestions.push((__binding_1, __code_76));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1018#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1019pub(crate) struct StructLiteralNotAllowedHereSugg {
1020 #[suggestion_part(code = "(")]
1021 pub left: Span,
1022 #[suggestion_part(code = ")")]
1023 pub right: Span,
1024}
1025
1026#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidLiteralSuffixOnTupleIndex where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidLiteralSuffixOnTupleIndex {
span: __binding_0, suffix: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_literal_suffix_on_tuple_index);
;
diag.arg("suffix", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1027#[diag(parse_invalid_literal_suffix_on_tuple_index)]
1028pub(crate) struct InvalidLiteralSuffixOnTupleIndex {
1029 #[primary_span]
1030 #[label]
1031 pub span: Span,
1032 pub suffix: Symbol,
1033}
1034
1035#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NonStringAbiLiteral where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NonStringAbiLiteral { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_non_string_abi_literal);
let __code_77 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\"C\""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_77,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1036#[diag(parse_non_string_abi_literal)]
1037pub(crate) struct NonStringAbiLiteral {
1038 #[primary_span]
1039 #[suggestion(code = "\"C\"", applicability = "maybe-incorrect", style = "verbose")]
1040 pub span: Span,
1041}
1042
1043#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MismatchedClosingDelimiter where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MismatchedClosingDelimiter {
spans: __binding_0,
delimiter: __binding_1,
unmatched: __binding_2,
opening_candidate: __binding_3,
unclosed: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_mismatched_closing_delimiter);
;
diag.arg("delimiter", __binding_1);
diag.span(__binding_0.clone());
diag.span_label(__binding_2,
crate::fluent_generated::parse_label_unmatched);
if let Some(__binding_3) = __binding_3 {
diag.span_label(__binding_3,
crate::fluent_generated::parse_label_opening_candidate);
}
if let Some(__binding_4) = __binding_4 {
diag.span_label(__binding_4,
crate::fluent_generated::parse_label_unclosed);
}
diag
}
}
}
}
};Diagnostic)]
1044#[diag(parse_mismatched_closing_delimiter)]
1045pub(crate) struct MismatchedClosingDelimiter {
1046 #[primary_span]
1047 pub spans: Vec<Span>,
1048 pub delimiter: String,
1049 #[label(parse_label_unmatched)]
1050 pub unmatched: Span,
1051 #[label(parse_label_opening_candidate)]
1052 pub opening_candidate: Option<Span>,
1053 #[label(parse_label_unclosed)]
1054 pub unclosed: Option<Span>,
1055}
1056
1057#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectVisibilityRestriction where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectVisibilityRestriction {
span: __binding_0, inner_str: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_incorrect_visibility_restriction);
let __code_78 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("in {0}", __binding_1))
})].into_iter();
diag.code(E0704);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("inner_str", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_78,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1058#[diag(parse_incorrect_visibility_restriction, code = E0704)]
1059#[help]
1060pub(crate) struct IncorrectVisibilityRestriction {
1061 #[primary_span]
1062 #[suggestion(code = "in {inner_str}", applicability = "machine-applicable", style = "verbose")]
1063 pub span: Span,
1064 pub inner_str: String,
1065}
1066
1067#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AssignmentElseNotAllowed where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AssignmentElseNotAllowed { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_assignment_else_not_allowed);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1068#[diag(parse_assignment_else_not_allowed)]
1069pub(crate) struct AssignmentElseNotAllowed {
1070 #[primary_span]
1071 pub span: Span,
1072}
1073
1074#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedStatementAfterOuterAttr where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedStatementAfterOuterAttr { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_statement_after_outer_attr);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1075#[diag(parse_expected_statement_after_outer_attr)]
1076pub(crate) struct ExpectedStatementAfterOuterAttr {
1077 #[primary_span]
1078 pub span: Span,
1079}
1080
1081#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocCommentDoesNotDocumentAnything where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocCommentDoesNotDocumentAnything {
span: __binding_0, missing_comma: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_doc_comment_does_not_document_anything);
let __code_79 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(","))
})].into_iter();
diag.code(E0585);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_79,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
}
diag
}
}
}
}
};Diagnostic)]
1082#[diag(parse_doc_comment_does_not_document_anything, code = E0585)]
1083#[help]
1084pub(crate) struct DocCommentDoesNotDocumentAnything {
1085 #[primary_span]
1086 pub span: Span,
1087 #[suggestion(code = ",", applicability = "machine-applicable", style = "verbose")]
1088 pub missing_comma: Option<Span>,
1089}
1090
1091#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstLetMutuallyExclusive where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstLetMutuallyExclusive { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_const_let_mutually_exclusive);
let __code_80 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("const"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_80,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1092#[diag(parse_const_let_mutually_exclusive)]
1093pub(crate) struct ConstLetMutuallyExclusive {
1094 #[primary_span]
1095 #[suggestion(code = "const", applicability = "maybe-incorrect", style = "verbose")]
1096 pub span: Span,
1097}
1098
1099#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidExpressionInLetElse where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidExpressionInLetElse {
span: __binding_0, operator: __binding_1, sugg: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_expression_in_let_else);
;
diag.arg("operator", __binding_1);
diag.span(__binding_0);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
1100#[diag(parse_invalid_expression_in_let_else)]
1101pub(crate) struct InvalidExpressionInLetElse {
1102 #[primary_span]
1103 pub span: Span,
1104 pub operator: &'static str,
1105 #[subdiagnostic]
1106 pub sugg: WrapInParentheses,
1107}
1108
1109#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidCurlyInLetElse where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidCurlyInLetElse { span: __binding_0, sugg: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_curly_in_let_else);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1110#[diag(parse_invalid_curly_in_let_else)]
1111pub(crate) struct InvalidCurlyInLetElse {
1112 #[primary_span]
1113 pub span: Span,
1114 #[subdiagnostic]
1115 pub sugg: WrapInParentheses,
1116}
1117
1118#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CompoundAssignmentExpressionInLet where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CompoundAssignmentExpressionInLet {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_compound_assignment_expression_in_let);
let __code_81 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_81,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1119#[diag(parse_compound_assignment_expression_in_let)]
1120#[help]
1121pub(crate) struct CompoundAssignmentExpressionInLet {
1122 #[primary_span]
1123 pub span: Span,
1124 #[suggestion(style = "verbose", code = "", applicability = "maybe-incorrect")]
1125 pub suggestion: Span,
1126}
1127
1128#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SuffixedLiteralInAttribute where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SuffixedLiteralInAttribute { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_suffixed_literal_in_attribute);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1129#[diag(parse_suffixed_literal_in_attribute)]
1130#[help]
1131pub(crate) struct SuffixedLiteralInAttribute {
1132 #[primary_span]
1133 pub span: Span,
1134}
1135
1136#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidMetaItem where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidMetaItem {
span: __binding_0,
descr: __binding_1,
quote_ident_sugg: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_meta_item);
;
diag.arg("descr", __binding_1);
diag.span(__binding_0);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
1137#[diag(parse_invalid_meta_item)]
1138pub(crate) struct InvalidMetaItem {
1139 #[primary_span]
1140 pub span: Span,
1141 pub descr: String,
1142 #[subdiagnostic]
1143 pub quote_ident_sugg: Option<InvalidMetaItemQuoteIdentSugg>,
1144}
1145
1146#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for InvalidMetaItemQuoteIdentSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
InvalidMetaItemQuoteIdentSugg {
before: __binding_0, after: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_82 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\""))
});
let __code_83 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\""))
});
suggestions.push((__binding_0, __code_82));
suggestions.push((__binding_1, __code_83));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_quote_ident_sugg);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1147#[multipart_suggestion(parse_quote_ident_sugg, applicability = "machine-applicable")]
1148pub(crate) struct InvalidMetaItemQuoteIdentSugg {
1149 #[suggestion_part(code = "\"")]
1150 pub before: Span,
1151 #[suggestion_part(code = "\"")]
1152 pub after: Span,
1153}
1154
1155#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for SuggEscapeIdentifier {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
SuggEscapeIdentifier {
span: __binding_0, ident_name: __binding_1 } => {
let __code_84 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("r#"))
})].into_iter();
diag.store_args();
diag.arg("ident_name", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_escape_identifier);
diag.span_suggestions_with_style(__binding_0, __message,
__code_84, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1156#[suggestion(
1157 parse_sugg_escape_identifier,
1158 style = "verbose",
1159 applicability = "maybe-incorrect",
1160 code = "r#"
1161)]
1162pub(crate) struct SuggEscapeIdentifier {
1163 #[primary_span]
1164 pub span: Span,
1165 pub ident_name: String,
1166}
1167
1168#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for SuggRemoveComma {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
SuggRemoveComma { span: __binding_0 } => {
let __code_85 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_remove_comma);
diag.span_suggestions_with_style(__binding_0, __message,
__code_85, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1169#[suggestion(
1170 parse_sugg_remove_comma,
1171 applicability = "machine-applicable",
1172 code = "",
1173 style = "verbose"
1174)]
1175pub(crate) struct SuggRemoveComma {
1176 #[primary_span]
1177 pub span: Span,
1178}
1179
1180#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for SuggAddMissingLetStmt {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
SuggAddMissingLetStmt { span: __binding_0 } => {
let __code_86 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("let "))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_add_let_for_stmt);
diag.span_suggestions_with_style(__binding_0, __message,
__code_86, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1181#[suggestion(
1182 parse_sugg_add_let_for_stmt,
1183 style = "verbose",
1184 applicability = "maybe-incorrect",
1185 code = "let "
1186)]
1187pub(crate) struct SuggAddMissingLetStmt {
1188 #[primary_span]
1189 pub span: Span,
1190}
1191
1192#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ExpectedIdentifierFound {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ExpectedIdentifierFound::ReservedIdentifier(__binding_0) =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_expected_identifier_found_reserved_identifier);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
ExpectedIdentifierFound::Keyword(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_expected_identifier_found_keyword);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
ExpectedIdentifierFound::ReservedKeyword(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_expected_identifier_found_reserved_keyword);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
ExpectedIdentifierFound::DocComment(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_expected_identifier_found_doc_comment);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
ExpectedIdentifierFound::MetaVar(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_expected_identifier_found_metavar);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
ExpectedIdentifierFound::Other(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_expected_identifier);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1193pub(crate) enum ExpectedIdentifierFound {
1194 #[label(parse_expected_identifier_found_reserved_identifier)]
1195 ReservedIdentifier(#[primary_span] Span),
1196 #[label(parse_expected_identifier_found_keyword)]
1197 Keyword(#[primary_span] Span),
1198 #[label(parse_expected_identifier_found_reserved_keyword)]
1199 ReservedKeyword(#[primary_span] Span),
1200 #[label(parse_expected_identifier_found_doc_comment)]
1201 DocComment(#[primary_span] Span),
1202 #[label(parse_expected_identifier_found_metavar)]
1203 MetaVar(#[primary_span] Span),
1204 #[label(parse_expected_identifier)]
1205 Other(#[primary_span] Span),
1206}
1207
1208impl ExpectedIdentifierFound {
1209 pub(crate) fn new(token_descr: Option<TokenDescription>, span: Span) -> Self {
1210 (match token_descr {
1211 Some(TokenDescription::ReservedIdentifier) => {
1212 ExpectedIdentifierFound::ReservedIdentifier
1213 }
1214 Some(TokenDescription::Keyword) => ExpectedIdentifierFound::Keyword,
1215 Some(TokenDescription::ReservedKeyword) => ExpectedIdentifierFound::ReservedKeyword,
1216 Some(TokenDescription::DocComment) => ExpectedIdentifierFound::DocComment,
1217 Some(TokenDescription::MetaVar(_)) => ExpectedIdentifierFound::MetaVar,
1218 None => ExpectedIdentifierFound::Other,
1219 })(span)
1220 }
1221}
1222
1223pub(crate) struct ExpectedIdentifier {
1224 pub span: Span,
1225 pub token: Token,
1226 pub suggest_raw: Option<SuggEscapeIdentifier>,
1227 pub suggest_remove_comma: Option<SuggRemoveComma>,
1228 pub help_cannot_start_number: Option<HelpIdentifierStartsWithNumber>,
1229}
1230
1231impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for ExpectedIdentifier {
1232 #[track_caller]
1233 fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
1234 let token_descr = TokenDescription::from_token(&self.token);
1235
1236 let mut add_token = true;
1237 let mut diag = Diag::new(
1238 dcx,
1239 level,
1240 match token_descr {
1241 Some(TokenDescription::ReservedIdentifier) => {
1242 fluent::parse_expected_identifier_found_reserved_identifier_str
1243 }
1244 Some(TokenDescription::Keyword) => {
1245 fluent::parse_expected_identifier_found_keyword_str
1246 }
1247 Some(TokenDescription::ReservedKeyword) => {
1248 fluent::parse_expected_identifier_found_reserved_keyword_str
1249 }
1250 Some(TokenDescription::DocComment) => {
1251 fluent::parse_expected_identifier_found_doc_comment_str
1252 }
1253 Some(TokenDescription::MetaVar(_)) => {
1254 add_token = false;
1255 fluent::parse_expected_identifier_found_metavar_str
1256 }
1257 None => fluent::parse_expected_identifier_found_str,
1258 },
1259 );
1260 diag.span(self.span);
1261 if add_token {
1262 diag.arg("token", self.token);
1263 }
1264
1265 if let Some(sugg) = self.suggest_raw {
1266 sugg.add_to_diag(&mut diag);
1267 }
1268
1269 ExpectedIdentifierFound::new(token_descr, self.span).add_to_diag(&mut diag);
1270
1271 if let Some(sugg) = self.suggest_remove_comma {
1272 sugg.add_to_diag(&mut diag);
1273 }
1274
1275 if let Some(help) = self.help_cannot_start_number {
1276 help.add_to_diag(&mut diag);
1277 }
1278
1279 diag
1280 }
1281}
1282
1283#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for HelpIdentifierStartsWithNumber {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
HelpIdentifierStartsWithNumber { num_span: __binding_0 } =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_invalid_identifier_with_leading_number);
diag.span_help(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1284#[help(parse_invalid_identifier_with_leading_number)]
1285pub(crate) struct HelpIdentifierStartsWithNumber {
1286 #[primary_span]
1287 pub num_span: Span,
1288}
1289
1290pub(crate) struct ExpectedSemi {
1291 pub span: Span,
1292 pub token: Token,
1293
1294 pub unexpected_token_label: Option<Span>,
1295 pub sugg: ExpectedSemiSugg,
1296}
1297
1298impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for ExpectedSemi {
1299 #[track_caller]
1300 fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
1301 let token_descr = TokenDescription::from_token(&self.token);
1302
1303 let mut add_token = true;
1304 let mut diag = Diag::new(
1305 dcx,
1306 level,
1307 match token_descr {
1308 Some(TokenDescription::ReservedIdentifier) => {
1309 fluent::parse_expected_semi_found_reserved_identifier_str
1310 }
1311 Some(TokenDescription::Keyword) => fluent::parse_expected_semi_found_keyword_str,
1312 Some(TokenDescription::ReservedKeyword) => {
1313 fluent::parse_expected_semi_found_reserved_keyword_str
1314 }
1315 Some(TokenDescription::DocComment) => {
1316 fluent::parse_expected_semi_found_doc_comment_str
1317 }
1318 Some(TokenDescription::MetaVar(_)) => {
1319 add_token = false;
1320 fluent::parse_expected_semi_found_metavar_str
1321 }
1322 None => fluent::parse_expected_semi_found_str,
1323 },
1324 );
1325 diag.span(self.span);
1326 if add_token {
1327 diag.arg("token", self.token);
1328 }
1329
1330 if let Some(unexpected_token_label) = self.unexpected_token_label {
1331 diag.span_label(unexpected_token_label, fluent::parse_label_unexpected_token);
1332 }
1333
1334 self.sugg.add_to_diag(&mut diag);
1335
1336 diag
1337 }
1338}
1339
1340#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ExpectedSemiSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ExpectedSemiSugg::ChangeToSemi(__binding_0) => {
let __code_87 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(";"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_change_this_to_semi);
diag.span_suggestions_with_style(__binding_0, __message,
__code_87, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::HideCodeInline);
diag.restore_args();
}
ExpectedSemiSugg::AddSemi(__binding_0) => {
let __code_88 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(";"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_add_semi);
diag.span_suggestions_with_style(__binding_0, __message,
__code_88, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::HideCodeInline);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1341pub(crate) enum ExpectedSemiSugg {
1342 #[suggestion(
1343 parse_sugg_change_this_to_semi,
1344 code = ";",
1345 applicability = "machine-applicable",
1346 style = "short"
1347 )]
1348 ChangeToSemi(#[primary_span] Span),
1349 #[suggestion(
1350 parse_sugg_add_semi,
1351 code = ";",
1352 applicability = "machine-applicable",
1353 style = "short"
1354 )]
1355 AddSemi(#[primary_span] Span),
1356}
1357
1358#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StructLiteralBodyWithoutPath where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StructLiteralBodyWithoutPath {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_struct_literal_body_without_path);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1359#[diag(parse_struct_literal_body_without_path)]
1360pub(crate) struct StructLiteralBodyWithoutPath {
1361 #[primary_span]
1362 pub span: Span,
1363 #[subdiagnostic]
1364 pub sugg: StructLiteralBodyWithoutPathSugg,
1365}
1366
1367#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for StructLiteralBodyWithoutPathSugg
{
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
StructLiteralBodyWithoutPathSugg {
before: __binding_0, after: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_89 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{ SomeStruct "))
});
let __code_90 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_89));
suggestions.push((__binding_1, __code_90));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1368#[multipart_suggestion(parse_suggestion, applicability = "has-placeholders")]
1369pub(crate) struct StructLiteralBodyWithoutPathSugg {
1370 #[suggestion_part(code = "{{ SomeStruct ")]
1371 pub before: Span,
1372 #[suggestion_part(code = " }}")]
1373 pub after: Span,
1374}
1375
1376#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnmatchedAngleBrackets where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnmatchedAngleBrackets {
span: __binding_0, num_extra_brackets: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unmatched_angle_brackets);
let __code_91 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("num_extra_brackets", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_91,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1377#[diag(parse_unmatched_angle_brackets)]
1378pub(crate) struct UnmatchedAngleBrackets {
1379 #[primary_span]
1380 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
1381 pub span: Span,
1382 pub num_extra_brackets: usize,
1383}
1384
1385#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GenericParamsWithoutAngleBrackets where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericParamsWithoutAngleBrackets {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_generic_parameters_without_angle_brackets);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1386#[diag(parse_generic_parameters_without_angle_brackets)]
1387pub(crate) struct GenericParamsWithoutAngleBrackets {
1388 #[primary_span]
1389 pub span: Span,
1390 #[subdiagnostic]
1391 pub sugg: GenericParamsWithoutAngleBracketsSugg,
1392}
1393
1394#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
GenericParamsWithoutAngleBracketsSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
GenericParamsWithoutAngleBracketsSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_92 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("<"))
});
let __code_93 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(">"))
});
suggestions.push((__binding_0, __code_92));
suggestions.push((__binding_1, __code_93));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1395#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1396pub(crate) struct GenericParamsWithoutAngleBracketsSugg {
1397 #[suggestion_part(code = "<")]
1398 pub left: Span,
1399 #[suggestion_part(code = ">")]
1400 pub right: Span,
1401}
1402
1403#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ComparisonOperatorsCannotBeChained where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ComparisonOperatorsCannotBeChained {
span: __binding_0,
suggest_turbofish: __binding_1,
help_turbofish: __binding_2,
chaining_sugg: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_comparison_operators_cannot_be_chained);
let __code_94 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("::"))
})].into_iter();
;
diag.span(__binding_0.clone());
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_sugg_turbofish_syntax,
__code_94, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
}
if __binding_2 {
diag.help(crate::fluent_generated::parse_sugg_turbofish_syntax);
}
if __binding_2 {
diag.help(crate::fluent_generated::parse_sugg_parentheses_for_function_args);
}
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
1404#[diag(parse_comparison_operators_cannot_be_chained)]
1405pub(crate) struct ComparisonOperatorsCannotBeChained {
1406 #[primary_span]
1407 pub span: Vec<Span>,
1408 #[suggestion(
1409 parse_sugg_turbofish_syntax,
1410 style = "verbose",
1411 code = "::",
1412 applicability = "maybe-incorrect"
1413 )]
1414 pub suggest_turbofish: Option<Span>,
1415 #[help(parse_sugg_turbofish_syntax)]
1416 #[help(parse_sugg_parentheses_for_function_args)]
1417 pub help_turbofish: bool,
1418 #[subdiagnostic]
1419 pub chaining_sugg: Option<ComparisonOperatorsCannotBeChainedSugg>,
1420}
1421
1422#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
ComparisonOperatorsCannotBeChainedSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ComparisonOperatorsCannotBeChainedSugg::SplitComparison {
span: __binding_0, middle_term: __binding_1 } => {
let __code_95 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" && {0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("middle_term", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_split_comparison);
diag.span_suggestions_with_style(__binding_0, __message,
__code_95, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
ComparisonOperatorsCannotBeChainedSugg::Parenthesize {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_96 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_97 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_96));
suggestions.push((__binding_1, __code_97));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_parenthesize);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1423pub(crate) enum ComparisonOperatorsCannotBeChainedSugg {
1424 #[suggestion(
1425 parse_sugg_split_comparison,
1426 style = "verbose",
1427 code = " && {middle_term}",
1428 applicability = "maybe-incorrect"
1429 )]
1430 SplitComparison {
1431 #[primary_span]
1432 span: Span,
1433 middle_term: String,
1434 },
1435 #[multipart_suggestion(parse_sugg_parenthesize, applicability = "maybe-incorrect")]
1436 Parenthesize {
1437 #[suggestion_part(code = "(")]
1438 left: Span,
1439 #[suggestion_part(code = ")")]
1440 right: Span,
1441 },
1442}
1443
1444#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
QuestionMarkInType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
QuestionMarkInType { span: __binding_0, sugg: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_question_mark_in_type);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1445#[diag(parse_question_mark_in_type)]
1446pub(crate) struct QuestionMarkInType {
1447 #[primary_span]
1448 #[label]
1449 pub span: Span,
1450 #[subdiagnostic]
1451 pub sugg: QuestionMarkInTypeSugg,
1452}
1453
1454#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for QuestionMarkInTypeSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
QuestionMarkInTypeSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_98 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("Option<"))
});
let __code_99 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(">"))
});
suggestions.push((__binding_0, __code_98));
suggestions.push((__binding_1, __code_99));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1455#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1456pub(crate) struct QuestionMarkInTypeSugg {
1457 #[suggestion_part(code = "Option<")]
1458 pub left: Span,
1459 #[suggestion_part(code = ">")]
1460 pub right: Span,
1461}
1462
1463#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ParenthesesInForHead where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ParenthesesInForHead { span: __binding_0, sugg: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_parentheses_in_for_head);
;
diag.span(__binding_0.clone());
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1464#[diag(parse_unexpected_parentheses_in_for_head)]
1465pub(crate) struct ParenthesesInForHead {
1466 #[primary_span]
1467 pub span: Vec<Span>,
1468 #[subdiagnostic]
1469 pub sugg: ParenthesesInForHeadSugg,
1470}
1471
1472#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ParenthesesInForHeadSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ParenthesesInForHeadSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_100 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" "))
});
let __code_101 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" "))
});
suggestions.push((__binding_0, __code_100));
suggestions.push((__binding_1, __code_101));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1473#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1474pub(crate) struct ParenthesesInForHeadSugg {
1475 #[suggestion_part(code = " ")]
1476 pub left: Span,
1477 #[suggestion_part(code = " ")]
1478 pub right: Span,
1479}
1480
1481#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ParenthesesInMatchPat where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ParenthesesInMatchPat { span: __binding_0, sugg: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_parentheses_in_match_arm_pattern);
;
diag.span(__binding_0.clone());
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1482#[diag(parse_unexpected_parentheses_in_match_arm_pattern)]
1483pub(crate) struct ParenthesesInMatchPat {
1484 #[primary_span]
1485 pub span: Vec<Span>,
1486 #[subdiagnostic]
1487 pub sugg: ParenthesesInMatchPatSugg,
1488}
1489
1490#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ParenthesesInMatchPatSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ParenthesesInMatchPatSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_102 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
let __code_103 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_102));
suggestions.push((__binding_1, __code_103));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1491#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1492pub(crate) struct ParenthesesInMatchPatSugg {
1493 #[suggestion_part(code = "")]
1494 pub left: Span,
1495 #[suggestion_part(code = "")]
1496 pub right: Span,
1497}
1498
1499#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocCommentOnParamType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocCommentOnParamType { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_doc_comment_on_param_type);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1500#[diag(parse_doc_comment_on_param_type)]
1501pub(crate) struct DocCommentOnParamType {
1502 #[primary_span]
1503 #[label]
1504 pub span: Span,
1505}
1506
1507#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttributeOnParamType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttributeOnParamType { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_attribute_on_param_type);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1508#[diag(parse_attribute_on_param_type)]
1509pub(crate) struct AttributeOnParamType {
1510 #[primary_span]
1511 #[label]
1512 pub span: Span,
1513}
1514
1515#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttributeOnType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttributeOnType { span: __binding_0, fix_span: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_attribute_on_type);
let __code_104 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_104,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag
}
}
}
}
};Diagnostic)]
1516#[diag(parse_attribute_on_type)]
1517pub(crate) struct AttributeOnType {
1518 #[primary_span]
1519 #[label]
1520 pub span: Span,
1521 #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
1522 pub fix_span: Span,
1523}
1524
1525#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttributeOnGenericArg where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttributeOnGenericArg {
span: __binding_0, fix_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_attribute_on_generic_arg);
let __code_105 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_105,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag
}
}
}
}
};Diagnostic)]
1526#[diag(parse_attribute_on_generic_arg)]
1527pub(crate) struct AttributeOnGenericArg {
1528 #[primary_span]
1529 #[label]
1530 pub span: Span,
1531 #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
1532 pub fix_span: Span,
1533}
1534
1535#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttributeOnEmptyType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttributeOnEmptyType { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_attribute_on_empty_type);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1536#[diag(parse_attribute_on_empty_type)]
1537pub(crate) struct AttributeOnEmptyType {
1538 #[primary_span]
1539 #[label]
1540 pub span: Span,
1541}
1542
1543#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PatternMethodParamWithoutBody where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PatternMethodParamWithoutBody { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_pattern_method_param_without_body);
let __code_106 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("_"))
})].into_iter();
diag.code(E0642);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_106,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1544#[diag(parse_pattern_method_param_without_body, code = E0642)]
1545pub(crate) struct PatternMethodParamWithoutBody {
1546 #[primary_span]
1547 #[suggestion(code = "_", applicability = "machine-applicable", style = "verbose")]
1548 pub span: Span,
1549}
1550
1551#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SelfParamNotFirst where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SelfParamNotFirst { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_self_param_not_first);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1552#[diag(parse_self_param_not_first)]
1553pub(crate) struct SelfParamNotFirst {
1554 #[primary_span]
1555 #[label]
1556 pub span: Span,
1557}
1558
1559#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstGenericWithoutBraces where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstGenericWithoutBraces {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_const_generic_without_braces);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1560#[diag(parse_const_generic_without_braces)]
1561pub(crate) struct ConstGenericWithoutBraces {
1562 #[primary_span]
1563 pub span: Span,
1564 #[subdiagnostic]
1565 pub sugg: ConstGenericWithoutBracesSugg,
1566}
1567
1568#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ConstGenericWithoutBracesSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ConstGenericWithoutBracesSugg {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_107 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{ "))
});
let __code_108 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_107));
suggestions.push((__binding_1, __code_108));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1569#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1570pub(crate) struct ConstGenericWithoutBracesSugg {
1571 #[suggestion_part(code = "{{ ")]
1572 pub left: Span,
1573 #[suggestion_part(code = " }}")]
1574 pub right: Span,
1575}
1576
1577#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedConstParamDeclaration where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedConstParamDeclaration {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_const_param_declaration);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
1578#[diag(parse_unexpected_const_param_declaration)]
1579pub(crate) struct UnexpectedConstParamDeclaration {
1580 #[primary_span]
1581 #[label]
1582 pub span: Span,
1583 #[subdiagnostic]
1584 pub sugg: Option<UnexpectedConstParamDeclarationSugg>,
1585}
1586
1587#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
UnexpectedConstParamDeclarationSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnexpectedConstParamDeclarationSugg::AddParam {
impl_generics: __binding_0,
incorrect_decl: __binding_1,
snippet: __binding_2,
ident: __binding_3 } => {
let mut suggestions = Vec::new();
let __code_109 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("<{0}>", __binding_2))
});
let __code_110 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_3))
});
suggestions.push((__binding_0, __code_109));
suggestions.push((__binding_1, __code_110));
diag.store_args();
diag.arg("snippet", __binding_2);
diag.arg("ident", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
UnexpectedConstParamDeclarationSugg::AppendParam {
impl_generics_end: __binding_0,
incorrect_decl: __binding_1,
snippet: __binding_2,
ident: __binding_3 } => {
let mut suggestions = Vec::new();
let __code_111 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(", {0}", __binding_2))
});
let __code_112 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_3))
});
suggestions.push((__binding_0, __code_111));
suggestions.push((__binding_1, __code_112));
diag.store_args();
diag.arg("snippet", __binding_2);
diag.arg("ident", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1588pub(crate) enum UnexpectedConstParamDeclarationSugg {
1589 #[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1590 AddParam {
1591 #[suggestion_part(code = "<{snippet}>")]
1592 impl_generics: Span,
1593 #[suggestion_part(code = "{ident}")]
1594 incorrect_decl: Span,
1595 snippet: String,
1596 ident: String,
1597 },
1598 #[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1599 AppendParam {
1600 #[suggestion_part(code = ", {snippet}")]
1601 impl_generics_end: Span,
1602 #[suggestion_part(code = "{ident}")]
1603 incorrect_decl: Span,
1604 snippet: String,
1605 ident: String,
1606 },
1607}
1608
1609#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedConstInGenericParam where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedConstInGenericParam {
span: __binding_0, to_remove: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_const_in_generic_param);
let __code_113 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_113,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
}
diag
}
}
}
}
};Diagnostic)]
1610#[diag(parse_unexpected_const_in_generic_param)]
1611pub(crate) struct UnexpectedConstInGenericParam {
1612 #[primary_span]
1613 pub span: Span,
1614 #[suggestion(style = "verbose", code = "", applicability = "maybe-incorrect")]
1615 pub to_remove: Option<Span>,
1616}
1617
1618#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncMoveOrderIncorrect where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncMoveOrderIncorrect { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_async_move_order_incorrect);
let __code_114 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("async move"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_114,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1619#[diag(parse_async_move_order_incorrect)]
1620pub(crate) struct AsyncMoveOrderIncorrect {
1621 #[primary_span]
1622 #[suggestion(style = "verbose", code = "async move", applicability = "maybe-incorrect")]
1623 pub span: Span,
1624}
1625
1626#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncUseOrderIncorrect where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncUseOrderIncorrect { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_async_use_order_incorrect);
let __code_115 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("async use"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_115,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1627#[diag(parse_async_use_order_incorrect)]
1628pub(crate) struct AsyncUseOrderIncorrect {
1629 #[primary_span]
1630 #[suggestion(style = "verbose", code = "async use", applicability = "maybe-incorrect")]
1631 pub span: Span,
1632}
1633
1634#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DoubleColonInBound where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DoubleColonInBound { span: __binding_0, between: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_double_colon_in_bound);
let __code_116 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(": "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_116,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1635#[diag(parse_double_colon_in_bound)]
1636pub(crate) struct DoubleColonInBound {
1637 #[primary_span]
1638 pub span: Span,
1639 #[suggestion(code = ": ", applicability = "machine-applicable", style = "verbose")]
1640 pub between: Span,
1641}
1642
1643#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnPtrWithGenerics where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnPtrWithGenerics { span: __binding_0, sugg: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_fn_ptr_with_generics);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
1644#[diag(parse_fn_ptr_with_generics)]
1645pub(crate) struct FnPtrWithGenerics {
1646 #[primary_span]
1647 pub span: Span,
1648 #[subdiagnostic]
1649 pub sugg: Option<FnPtrWithGenericsSugg>,
1650}
1651
1652#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MisplacedReturnType {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MisplacedReturnType {
fn_params_end: __binding_0,
snippet: __binding_1,
ret_ty_span: __binding_2 } => {
let mut suggestions = Vec::new();
let __code_117 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" {0}", __binding_1))
});
let __code_118 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_117));
suggestions.push((__binding_2, __code_118));
diag.store_args();
diag.arg("snippet", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_misplaced_return_type);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1653#[multipart_suggestion(
1654 parse_misplaced_return_type,
1655 style = "verbose",
1656 applicability = "maybe-incorrect"
1657)]
1658pub(crate) struct MisplacedReturnType {
1659 #[suggestion_part(code = " {snippet}")]
1660 pub fn_params_end: Span,
1661 pub snippet: String,
1662 #[suggestion_part(code = "")]
1663 pub ret_ty_span: Span,
1664}
1665
1666#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for FnPtrWithGenericsSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
FnPtrWithGenericsSugg {
left: __binding_0,
snippet: __binding_1,
right: __binding_2,
arity: __binding_3,
for_param_list_exists: __binding_4 } => {
let mut suggestions = Vec::new();
let __code_119 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
});
let __code_120 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_119));
suggestions.push((__binding_2, __code_120));
diag.store_args();
diag.arg("snippet", __binding_1);
diag.arg("arity", __binding_3);
diag.arg("for_param_list_exists", __binding_4);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1667#[multipart_suggestion(parse_suggestion, applicability = "maybe-incorrect")]
1668pub(crate) struct FnPtrWithGenericsSugg {
1669 #[suggestion_part(code = "{snippet}")]
1670 pub left: Span,
1671 pub snippet: String,
1672 #[suggestion_part(code = "")]
1673 pub right: Span,
1674 pub arity: usize,
1675 pub for_param_list_exists: bool,
1676}
1677
1678pub(crate) struct FnTraitMissingParen {
1679 pub span: Span,
1680}
1681
1682impl Subdiagnostic for FnTraitMissingParen {
1683 fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
1684 diag.span_label(self.span, crate::fluent_generated::parse_fn_trait_missing_paren);
1685 diag.span_suggestion_short(
1686 self.span.shrink_to_hi(),
1687 crate::fluent_generated::parse_add_paren,
1688 "()",
1689 Applicability::MachineApplicable,
1690 );
1691 }
1692}
1693
1694#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedIfWithIf where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedIfWithIf(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_if_with_if);
let __code_121 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_121,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1695#[diag(parse_unexpected_if_with_if)]
1696pub(crate) struct UnexpectedIfWithIf(
1697 #[primary_span]
1698 #[suggestion(applicability = "machine-applicable", code = " ", style = "verbose")]
1699 pub Span,
1700);
1701
1702#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FnTypoWithImpl
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnTypoWithImpl { fn_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_maybe_fn_typo_with_impl);
let __code_122 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("impl"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_122,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1703#[diag(parse_maybe_fn_typo_with_impl)]
1704pub(crate) struct FnTypoWithImpl {
1705 #[primary_span]
1706 #[suggestion(applicability = "maybe-incorrect", code = "impl", style = "verbose")]
1707 pub fn_span: Span,
1708}
1709
1710#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedFnPathFoundFnKeyword where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedFnPathFoundFnKeyword { fn_token_span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_fn_path_found_fn_keyword);
let __code_123 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("Fn"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_123,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1711#[diag(parse_expected_fn_path_found_fn_keyword)]
1712pub(crate) struct ExpectedFnPathFoundFnKeyword {
1713 #[primary_span]
1714 #[suggestion(applicability = "machine-applicable", code = "Fn", style = "verbose")]
1715 pub fn_token_span: Span,
1716}
1717
1718#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnPathFoundNamedParams where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnPathFoundNamedParams { named_param_span: __binding_0 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_path_found_named_params);
let __code_124 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_124,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
1719#[diag(parse_path_found_named_params)]
1720pub(crate) struct FnPathFoundNamedParams {
1721 #[primary_span]
1722 #[suggestion(applicability = "machine-applicable", code = "")]
1723 pub named_param_span: Span,
1724}
1725
1726#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PathFoundCVariadicParams where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PathFoundCVariadicParams { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_path_found_c_variadic_params);
let __code_125 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_125,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
1727#[diag(parse_path_found_c_variadic_params)]
1728pub(crate) struct PathFoundCVariadicParams {
1729 #[primary_span]
1730 #[suggestion(applicability = "machine-applicable", code = "")]
1731 pub span: Span,
1732}
1733
1734#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PathFoundAttributeInParams where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PathFoundAttributeInParams { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_path_found_attribute_in_params);
let __code_126 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_126,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
1735#[diag(parse_path_found_attribute_in_params)]
1736pub(crate) struct PathFoundAttributeInParams {
1737 #[primary_span]
1738 #[suggestion(applicability = "machine-applicable", code = "")]
1739 pub span: Span,
1740}
1741
1742#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PathSingleColon where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PathSingleColon { span: __binding_0, suggestion: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_path_double_colon);
let __code_127 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(":"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_127,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1743#[diag(parse_path_double_colon)]
1744pub(crate) struct PathSingleColon {
1745 #[primary_span]
1746 pub span: Span,
1747
1748 #[suggestion(applicability = "machine-applicable", code = ":", style = "verbose")]
1749 pub suggestion: Span,
1750}
1751
1752#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PathTripleColon where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PathTripleColon { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_path_double_colon);
let __code_128 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_128,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1753#[diag(parse_path_double_colon)]
1754pub(crate) struct PathTripleColon {
1755 #[primary_span]
1756 #[suggestion(applicability = "maybe-incorrect", code = "", style = "verbose")]
1757 pub span: Span,
1758}
1759
1760#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ColonAsSemi
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ColonAsSemi { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_colon_as_semi);
let __code_129 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(";"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_129,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1761#[diag(parse_colon_as_semi)]
1762pub(crate) struct ColonAsSemi {
1763 #[primary_span]
1764 #[suggestion(applicability = "machine-applicable", code = ";", style = "verbose")]
1765 pub span: Span,
1766}
1767
1768#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
WhereClauseBeforeTupleStructBody where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
WhereClauseBeforeTupleStructBody {
span: __binding_0,
name: __binding_1,
body: __binding_2,
sugg: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_where_clause_before_tuple_struct_body);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::parse_name_label);
diag.span_label(__binding_2,
crate::fluent_generated::parse_body_label);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
1769#[diag(parse_where_clause_before_tuple_struct_body)]
1770pub(crate) struct WhereClauseBeforeTupleStructBody {
1771 #[primary_span]
1772 #[label]
1773 pub span: Span,
1774 #[label(parse_name_label)]
1775 pub name: Span,
1776 #[label(parse_body_label)]
1777 pub body: Span,
1778 #[subdiagnostic]
1779 pub sugg: Option<WhereClauseBeforeTupleStructBodySugg>,
1780}
1781
1782#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
WhereClauseBeforeTupleStructBodySugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
WhereClauseBeforeTupleStructBodySugg {
left: __binding_0, snippet: __binding_1, right: __binding_2
} => {
let mut suggestions = Vec::new();
let __code_130 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
});
let __code_131 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_130));
suggestions.push((__binding_2, __code_131));
diag.store_args();
diag.arg("snippet", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1783#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
1784pub(crate) struct WhereClauseBeforeTupleStructBodySugg {
1785 #[suggestion_part(code = "{snippet}")]
1786 pub left: Span,
1787 pub snippet: String,
1788 #[suggestion_part(code = "")]
1789 pub right: Span,
1790}
1791
1792#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AsyncFnIn2015
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncFnIn2015 { span: __binding_0, help: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_async_fn_in_2015);
diag.code(E0670);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1793#[diag(parse_async_fn_in_2015, code = E0670)]
1794pub(crate) struct AsyncFnIn2015 {
1795 #[primary_span]
1796 #[label]
1797 pub span: Span,
1798 #[subdiagnostic]
1799 pub help: HelpUseLatestEdition,
1800}
1801
1802#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AsyncBlockIn2015 {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AsyncBlockIn2015 { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_async_block_in_2015);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1803#[label(parse_async_block_in_2015)]
1804pub(crate) struct AsyncBlockIn2015 {
1805 #[primary_span]
1806 pub span: Span,
1807}
1808
1809#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncMoveBlockIn2015 where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncMoveBlockIn2015 { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_async_move_block_in_2015);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1810#[diag(parse_async_move_block_in_2015)]
1811pub(crate) struct AsyncMoveBlockIn2015 {
1812 #[primary_span]
1813 pub span: Span,
1814}
1815
1816#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncUseBlockIn2015 where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncUseBlockIn2015 { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_async_use_block_in_2015);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1817#[diag(parse_async_use_block_in_2015)]
1818pub(crate) struct AsyncUseBlockIn2015 {
1819 #[primary_span]
1820 pub span: Span,
1821}
1822
1823#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncBoundModifierIn2015 where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncBoundModifierIn2015 {
span: __binding_0, help: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_async_bound_modifier_in_2015);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1824#[diag(parse_async_bound_modifier_in_2015)]
1825pub(crate) struct AsyncBoundModifierIn2015 {
1826 #[primary_span]
1827 pub span: Span,
1828 #[subdiagnostic]
1829 pub help: HelpUseLatestEdition,
1830}
1831
1832#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LetChainPre2024 where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LetChainPre2024 { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_let_chain_pre_2024);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1833#[diag(parse_let_chain_pre_2024)]
1834pub(crate) struct LetChainPre2024 {
1835 #[primary_span]
1836 pub span: Span,
1837}
1838
1839#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SelfArgumentPointer where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SelfArgumentPointer { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_self_argument_pointer);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1840#[diag(parse_self_argument_pointer)]
1841pub(crate) struct SelfArgumentPointer {
1842 #[primary_span]
1843 #[label]
1844 pub span: Span,
1845}
1846
1847#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedTokenAfterDot where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedTokenAfterDot {
span: __binding_0, actual: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_dot);
;
diag.arg("actual", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1848#[diag(parse_unexpected_token_after_dot)]
1849pub(crate) struct UnexpectedTokenAfterDot {
1850 #[primary_span]
1851 pub span: Span,
1852 pub actual: String,
1853}
1854
1855#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
VisibilityNotFollowedByItem where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
VisibilityNotFollowedByItem {
span: __binding_0, vis: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_visibility_not_followed_by_item);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("vis", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1856#[diag(parse_visibility_not_followed_by_item)]
1857#[help]
1858pub(crate) struct VisibilityNotFollowedByItem {
1859 #[primary_span]
1860 #[label]
1861 pub span: Span,
1862 pub vis: Visibility,
1863}
1864
1865#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DefaultNotFollowedByItem where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DefaultNotFollowedByItem { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_default_not_followed_by_item);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1866#[diag(parse_default_not_followed_by_item)]
1867#[note]
1868pub(crate) struct DefaultNotFollowedByItem {
1869 #[primary_span]
1870 #[label]
1871 pub span: Span,
1872}
1873
1874#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingKeywordForItemDefinition where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingKeywordForItemDefinition::Enum {
span: __binding_0,
insert_span: __binding_1,
ident: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_enum_for_enum_definition);
let __code_132 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("enum "))
})].into_iter();
;
diag.arg("ident", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_132,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
MissingKeywordForItemDefinition::EnumOrStruct {
span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_enum_or_struct_for_item_definition);
;
diag.span(__binding_0);
diag
}
MissingKeywordForItemDefinition::Struct {
span: __binding_0,
insert_span: __binding_1,
ident: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_struct_for_struct_definition);
let __code_133 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("struct "))
})].into_iter();
;
diag.arg("ident", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_133,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
MissingKeywordForItemDefinition::Function {
span: __binding_0,
insert_span: __binding_1,
ident: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_fn_for_function_definition);
let __code_134 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("fn "))
})].into_iter();
;
diag.arg("ident", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_134,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
MissingKeywordForItemDefinition::Method {
span: __binding_0,
insert_span: __binding_1,
ident: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_fn_for_method_definition);
let __code_135 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("fn "))
})].into_iter();
;
diag.arg("ident", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_135,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
MissingKeywordForItemDefinition::Ambiguous {
span: __binding_0, subdiag: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_fn_or_struct_for_item_definition);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
1875pub(crate) enum MissingKeywordForItemDefinition {
1876 #[diag(parse_missing_enum_for_enum_definition)]
1877 Enum {
1878 #[primary_span]
1879 span: Span,
1880 #[suggestion(style = "verbose", applicability = "maybe-incorrect", code = "enum ")]
1881 insert_span: Span,
1882 ident: Ident,
1883 },
1884 #[diag(parse_missing_enum_or_struct_for_item_definition)]
1885 EnumOrStruct {
1886 #[primary_span]
1887 span: Span,
1888 },
1889 #[diag(parse_missing_struct_for_struct_definition)]
1890 Struct {
1891 #[primary_span]
1892 span: Span,
1893 #[suggestion(style = "verbose", applicability = "maybe-incorrect", code = "struct ")]
1894 insert_span: Span,
1895 ident: Ident,
1896 },
1897 #[diag(parse_missing_fn_for_function_definition)]
1898 Function {
1899 #[primary_span]
1900 span: Span,
1901 #[suggestion(style = "verbose", applicability = "maybe-incorrect", code = "fn ")]
1902 insert_span: Span,
1903 ident: Ident,
1904 },
1905 #[diag(parse_missing_fn_for_method_definition)]
1906 Method {
1907 #[primary_span]
1908 span: Span,
1909 #[suggestion(style = "verbose", applicability = "maybe-incorrect", code = "fn ")]
1910 insert_span: Span,
1911 ident: Ident,
1912 },
1913 #[diag(parse_missing_fn_or_struct_for_item_definition)]
1914 Ambiguous {
1915 #[primary_span]
1916 span: Span,
1917 #[subdiagnostic]
1918 subdiag: Option<AmbiguousMissingKwForItemSub>,
1919 },
1920}
1921
1922#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AmbiguousMissingKwForItemSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AmbiguousMissingKwForItemSub::SuggestMacro {
span: __binding_0, snippet: __binding_1 } => {
let __code_136 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}!", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("snippet", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.span_suggestions_with_style(__binding_0, __message,
__code_136, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
AmbiguousMissingKwForItemSub::HelpMacro => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_help);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1923pub(crate) enum AmbiguousMissingKwForItemSub {
1924 #[suggestion(
1925 parse_suggestion,
1926 applicability = "maybe-incorrect",
1927 code = "{snippet}!",
1928 style = "verbose"
1929 )]
1930 SuggestMacro {
1931 #[primary_span]
1932 span: Span,
1933 snippet: String,
1934 },
1935 #[help(parse_help)]
1936 HelpMacro,
1937}
1938
1939#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingFnParams where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingFnParams { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_fn_params);
let __code_137 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("()"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_137,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1940#[diag(parse_missing_fn_params)]
1941pub(crate) struct MissingFnParams {
1942 #[primary_span]
1943 #[suggestion(code = "()", applicability = "machine-applicable", style = "verbose")]
1944 pub span: Span,
1945}
1946
1947#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidPathSepInFnDefinition where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidPathSepInFnDefinition { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_path_sep_in_fn_definition);
let __code_138 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_138,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1948#[diag(parse_invalid_path_sep_in_fn_definition)]
1949pub(crate) struct InvalidPathSepInFnDefinition {
1950 #[primary_span]
1951 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
1952 pub span: Span,
1953}
1954
1955#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingTraitInTraitImpl where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingTraitInTraitImpl {
span: __binding_0, for_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_trait_in_trait_impl);
let __code_139 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" Trait "))
})].into_iter();
let __code_140 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::parse_suggestion_add_trait,
__code_139, rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_suggestion_remove_for,
__code_140, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1956#[diag(parse_missing_trait_in_trait_impl)]
1957pub(crate) struct MissingTraitInTraitImpl {
1958 #[primary_span]
1959 #[suggestion(
1960 parse_suggestion_add_trait,
1961 code = " Trait ",
1962 applicability = "has-placeholders",
1963 style = "verbose"
1964 )]
1965 pub span: Span,
1966 #[suggestion(
1967 parse_suggestion_remove_for,
1968 code = "",
1969 applicability = "maybe-incorrect",
1970 style = "verbose"
1971 )]
1972 pub for_span: Span,
1973}
1974
1975#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingForInTraitImpl where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingForInTraitImpl { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_for_in_trait_impl);
let __code_141 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" for "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_141,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
1976#[diag(parse_missing_for_in_trait_impl)]
1977pub(crate) struct MissingForInTraitImpl {
1978 #[primary_span]
1979 #[suggestion(style = "verbose", code = " for ", applicability = "machine-applicable")]
1980 pub span: Span,
1981}
1982
1983#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedTraitInTraitImplFoundType where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedTraitInTraitImplFoundType { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_trait_in_trait_impl_found_type);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1984#[diag(parse_expected_trait_in_trait_impl_found_type)]
1985pub(crate) struct ExpectedTraitInTraitImplFoundType {
1986 #[primary_span]
1987 pub span: Span,
1988}
1989
1990#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExtraImplKeywordInTraitImpl where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExtraImplKeywordInTraitImpl {
extra_impl_kw: __binding_0, impl_trait_span: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_extra_impl_keyword_in_trait_impl);
let __code_142 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_142,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::HideCodeInline);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
1991#[diag(parse_extra_impl_keyword_in_trait_impl)]
1992pub(crate) struct ExtraImplKeywordInTraitImpl {
1993 #[primary_span]
1994 #[suggestion(code = "", applicability = "maybe-incorrect", style = "short")]
1995 pub extra_impl_kw: Span,
1996 #[note]
1997 pub impl_trait_span: Span,
1998}
1999
2000#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BoundsNotAllowedOnTraitAliases where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BoundsNotAllowedOnTraitAliases { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_bounds_not_allowed_on_trait_aliases);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2001#[diag(parse_bounds_not_allowed_on_trait_aliases)]
2002pub(crate) struct BoundsNotAllowedOnTraitAliases {
2003 #[primary_span]
2004 pub span: Span,
2005}
2006
2007#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitAliasCannotBeAuto where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitAliasCannotBeAuto { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_trait_alias_cannot_be_auto);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_trait_alias_cannot_be_auto);
diag
}
}
}
}
};Diagnostic)]
2008#[diag(parse_trait_alias_cannot_be_auto)]
2009pub(crate) struct TraitAliasCannotBeAuto {
2010 #[primary_span]
2011 #[label(parse_trait_alias_cannot_be_auto)]
2012 pub span: Span,
2013}
2014
2015#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitAliasCannotBeUnsafe where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitAliasCannotBeUnsafe { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_trait_alias_cannot_be_unsafe);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_trait_alias_cannot_be_unsafe);
diag
}
}
}
}
};Diagnostic)]
2016#[diag(parse_trait_alias_cannot_be_unsafe)]
2017pub(crate) struct TraitAliasCannotBeUnsafe {
2018 #[primary_span]
2019 #[label(parse_trait_alias_cannot_be_unsafe)]
2020 pub span: Span,
2021}
2022
2023#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AssociatedStaticItemNotAllowed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AssociatedStaticItemNotAllowed { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_associated_static_item_not_allowed);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2024#[diag(parse_associated_static_item_not_allowed)]
2025pub(crate) struct AssociatedStaticItemNotAllowed {
2026 #[primary_span]
2027 pub span: Span,
2028}
2029
2030#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExternCrateNameWithDashes where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternCrateNameWithDashes {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_extern_crate_name_with_dashes);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
2031#[diag(parse_extern_crate_name_with_dashes)]
2032pub(crate) struct ExternCrateNameWithDashes {
2033 #[primary_span]
2034 #[label]
2035 pub span: Span,
2036 #[subdiagnostic]
2037 pub sugg: ExternCrateNameWithDashesSugg,
2038}
2039
2040#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ExternCrateNameWithDashesSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ExternCrateNameWithDashesSugg { dashes: __binding_0 } => {
let mut suggestions = Vec::new();
let __code_143 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("_"))
});
for __binding_0 in __binding_0 {
suggestions.push((__binding_0, __code_143.clone()));
}
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2041#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
2042pub(crate) struct ExternCrateNameWithDashesSugg {
2043 #[suggestion_part(code = "_")]
2044 pub dashes: Vec<Span>,
2045}
2046
2047#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExternItemCannotBeConst where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternItemCannotBeConst {
ident_span: __binding_0, const_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_extern_item_cannot_be_const);
let __code_144 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("static "))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_144,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
}
diag
}
}
}
}
};Diagnostic)]
2048#[diag(parse_extern_item_cannot_be_const)]
2049#[note]
2050pub(crate) struct ExternItemCannotBeConst {
2051 #[primary_span]
2052 pub ident_span: Span,
2053 #[suggestion(code = "static ", applicability = "machine-applicable", style = "verbose")]
2054 pub const_span: Option<Span>,
2055}
2056
2057#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstGlobalCannotBeMutable where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstGlobalCannotBeMutable {
ident_span: __binding_0, const_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_const_global_cannot_be_mutable);
let __code_145 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("static"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_145,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2058#[diag(parse_const_global_cannot_be_mutable)]
2059pub(crate) struct ConstGlobalCannotBeMutable {
2060 #[primary_span]
2061 #[label]
2062 pub ident_span: Span,
2063 #[suggestion(code = "static", style = "verbose", applicability = "maybe-incorrect")]
2064 pub const_span: Span,
2065}
2066
2067#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingConstType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingConstType {
span: __binding_0, kind: __binding_1, colon: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_const_type);
let __code_146 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0} <type>",
__binding_2))
})].into_iter();
;
diag.arg("kind", __binding_1);
diag.arg("colon", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_146,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2068#[diag(parse_missing_const_type)]
2069pub(crate) struct MissingConstType {
2070 #[primary_span]
2071 #[suggestion(code = "{colon} <type>", style = "verbose", applicability = "has-placeholders")]
2072 pub span: Span,
2073
2074 pub kind: &'static str,
2075 pub colon: &'static str,
2076}
2077
2078#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
EnumStructMutuallyExclusive where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EnumStructMutuallyExclusive { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_enum_struct_mutually_exclusive);
let __code_147 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("enum"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_147,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2079#[diag(parse_enum_struct_mutually_exclusive)]
2080pub(crate) struct EnumStructMutuallyExclusive {
2081 #[primary_span]
2082 #[suggestion(code = "enum", style = "verbose", applicability = "machine-applicable")]
2083 pub span: Span,
2084}
2085
2086#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedTokenAfterStructName where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedTokenAfterStructName::ReservedIdentifier {
span: __binding_0, token: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_struct_name_found_reserved_identifier);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_unexpected_token_after_struct_name);
diag
}
UnexpectedTokenAfterStructName::Keyword {
span: __binding_0, token: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_struct_name_found_keyword);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_unexpected_token_after_struct_name);
diag
}
UnexpectedTokenAfterStructName::ReservedKeyword {
span: __binding_0, token: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_struct_name_found_reserved_keyword);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_unexpected_token_after_struct_name);
diag
}
UnexpectedTokenAfterStructName::DocComment {
span: __binding_0, token: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_struct_name_found_doc_comment);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_unexpected_token_after_struct_name);
diag
}
UnexpectedTokenAfterStructName::MetaVar { span: __binding_0
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_struct_name_found_metavar);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_unexpected_token_after_struct_name);
diag
}
UnexpectedTokenAfterStructName::Other {
span: __binding_0, token: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_token_after_struct_name_found_other);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_unexpected_token_after_struct_name);
diag
}
}
}
}
};Diagnostic)]
2087pub(crate) enum UnexpectedTokenAfterStructName {
2088 #[diag(parse_unexpected_token_after_struct_name_found_reserved_identifier)]
2089 ReservedIdentifier {
2090 #[primary_span]
2091 #[label(parse_unexpected_token_after_struct_name)]
2092 span: Span,
2093 token: Token,
2094 },
2095 #[diag(parse_unexpected_token_after_struct_name_found_keyword)]
2096 Keyword {
2097 #[primary_span]
2098 #[label(parse_unexpected_token_after_struct_name)]
2099 span: Span,
2100 token: Token,
2101 },
2102 #[diag(parse_unexpected_token_after_struct_name_found_reserved_keyword)]
2103 ReservedKeyword {
2104 #[primary_span]
2105 #[label(parse_unexpected_token_after_struct_name)]
2106 span: Span,
2107 token: Token,
2108 },
2109 #[diag(parse_unexpected_token_after_struct_name_found_doc_comment)]
2110 DocComment {
2111 #[primary_span]
2112 #[label(parse_unexpected_token_after_struct_name)]
2113 span: Span,
2114 token: Token,
2115 },
2116 #[diag(parse_unexpected_token_after_struct_name_found_metavar)]
2117 MetaVar {
2118 #[primary_span]
2119 #[label(parse_unexpected_token_after_struct_name)]
2120 span: Span,
2121 },
2122 #[diag(parse_unexpected_token_after_struct_name_found_other)]
2123 Other {
2124 #[primary_span]
2125 #[label(parse_unexpected_token_after_struct_name)]
2126 span: Span,
2127 token: Token,
2128 },
2129}
2130
2131impl UnexpectedTokenAfterStructName {
2132 pub(crate) fn new(span: Span, token: Token) -> Self {
2133 match TokenDescription::from_token(&token) {
2134 Some(TokenDescription::ReservedIdentifier) => Self::ReservedIdentifier { span, token },
2135 Some(TokenDescription::Keyword) => Self::Keyword { span, token },
2136 Some(TokenDescription::ReservedKeyword) => Self::ReservedKeyword { span, token },
2137 Some(TokenDescription::DocComment) => Self::DocComment { span, token },
2138 Some(TokenDescription::MetaVar(_)) => Self::MetaVar { span },
2139 None => Self::Other { span, token },
2140 }
2141 }
2142}
2143
2144#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedSelfInGenericParameters where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedSelfInGenericParameters { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_self_in_generic_parameters);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2145#[diag(parse_unexpected_self_in_generic_parameters)]
2146#[note]
2147pub(crate) struct UnexpectedSelfInGenericParameters {
2148 #[primary_span]
2149 pub span: Span,
2150}
2151
2152#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedDefaultValueForLifetimeInGenericParameters where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedDefaultValueForLifetimeInGenericParameters {
span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_default_value_for_lifetime_in_generic_parameters);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
2153#[diag(parse_unexpected_default_value_for_lifetime_in_generic_parameters)]
2154pub(crate) struct UnexpectedDefaultValueForLifetimeInGenericParameters {
2155 #[primary_span]
2156 #[label]
2157 pub span: Span,
2158}
2159
2160#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MultipleWhereClauses where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MultipleWhereClauses {
span: __binding_0,
previous: __binding_1,
between: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_multiple_where_clauses);
let __code_148 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(","))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::_subdiag::suggestion, __code_148,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2161#[diag(parse_multiple_where_clauses)]
2162pub(crate) struct MultipleWhereClauses {
2163 #[primary_span]
2164 pub span: Span,
2165 #[label]
2166 pub previous: Span,
2167 #[suggestion(style = "verbose", code = ",", applicability = "maybe-incorrect")]
2168 pub between: Span,
2169}
2170
2171#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedNonterminal where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedNonterminal::Item(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_nonterminal_expected_item_keyword);
;
diag.span(__binding_0);
diag
}
UnexpectedNonterminal::Statement(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_nonterminal_expected_statement);
;
diag.span(__binding_0);
diag
}
UnexpectedNonterminal::Ident {
span: __binding_0, token: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_nonterminal_expected_ident);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag
}
UnexpectedNonterminal::Lifetime {
span: __binding_0, token: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_nonterminal_expected_lifetime);
;
diag.arg("token", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2172pub(crate) enum UnexpectedNonterminal {
2173 #[diag(parse_nonterminal_expected_item_keyword)]
2174 Item(#[primary_span] Span),
2175 #[diag(parse_nonterminal_expected_statement)]
2176 Statement(#[primary_span] Span),
2177 #[diag(parse_nonterminal_expected_ident)]
2178 Ident {
2179 #[primary_span]
2180 span: Span,
2181 token: Token,
2182 },
2183 #[diag(parse_nonterminal_expected_lifetime)]
2184 Lifetime {
2185 #[primary_span]
2186 span: Span,
2187 token: Token,
2188 },
2189}
2190
2191#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TopLevelOrPatternNotAllowed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TopLevelOrPatternNotAllowed::LetBinding {
span: __binding_0, sub: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_or_pattern_not_allowed_in_let_binding);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
TopLevelOrPatternNotAllowed::FunctionParameter {
span: __binding_0, sub: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_or_pattern_not_allowed_in_fn_parameters);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
2192pub(crate) enum TopLevelOrPatternNotAllowed {
2193 #[diag(parse_or_pattern_not_allowed_in_let_binding)]
2194 LetBinding {
2195 #[primary_span]
2196 span: Span,
2197 #[subdiagnostic]
2198 sub: Option<TopLevelOrPatternNotAllowedSugg>,
2199 },
2200 #[diag(parse_or_pattern_not_allowed_in_fn_parameters)]
2201 FunctionParameter {
2202 #[primary_span]
2203 span: Span,
2204 #[subdiagnostic]
2205 sub: Option<TopLevelOrPatternNotAllowedSugg>,
2206 },
2207}
2208
2209#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotBeRawIdent where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotBeRawIdent { span: __binding_0, ident: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_cannot_be_raw_ident);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2210#[diag(parse_cannot_be_raw_ident)]
2211pub(crate) struct CannotBeRawIdent {
2212 #[primary_span]
2213 pub span: Span,
2214 pub ident: Symbol,
2215}
2216
2217#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotBeRawLifetime where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotBeRawLifetime { span: __binding_0, ident: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_cannot_be_raw_lifetime);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2218#[diag(parse_cannot_be_raw_lifetime)]
2219pub(crate) struct CannotBeRawLifetime {
2220 #[primary_span]
2221 pub span: Span,
2222 pub ident: Symbol,
2223}
2224
2225#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
KeywordLifetime where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
KeywordLifetime { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_keyword_lifetime);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2226#[diag(parse_keyword_lifetime)]
2227pub(crate) struct KeywordLifetime {
2228 #[primary_span]
2229 pub span: Span,
2230}
2231
2232#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for KeywordLabel
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
KeywordLabel { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_keyword_label);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2233#[diag(parse_keyword_label)]
2234pub(crate) struct KeywordLabel {
2235 #[primary_span]
2236 pub span: Span,
2237}
2238
2239#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CrDocComment
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CrDocComment { span: __binding_0, block: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_cr_doc_comment);
;
diag.arg("block", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2240#[diag(parse_cr_doc_comment)]
2241pub(crate) struct CrDocComment {
2242 #[primary_span]
2243 pub span: Span,
2244 pub block: bool,
2245}
2246
2247#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NoDigitsLiteral where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoDigitsLiteral { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_no_digits_literal);
diag.code(E0768);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2248#[diag(parse_no_digits_literal, code = E0768)]
2249pub(crate) struct NoDigitsLiteral {
2250 #[primary_span]
2251 pub span: Span,
2252}
2253
2254#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidDigitLiteral where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidDigitLiteral { span: __binding_0, base: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_digit_literal);
;
diag.arg("base", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2255#[diag(parse_invalid_digit_literal)]
2256pub(crate) struct InvalidDigitLiteral {
2257 #[primary_span]
2258 pub span: Span,
2259 pub base: u32,
2260}
2261
2262#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
EmptyExponentFloat where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EmptyExponentFloat { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_empty_exponent_float);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2263#[diag(parse_empty_exponent_float)]
2264pub(crate) struct EmptyExponentFloat {
2265 #[primary_span]
2266 pub span: Span,
2267}
2268
2269#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FloatLiteralUnsupportedBase where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FloatLiteralUnsupportedBase {
span: __binding_0, base: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_float_literal_unsupported_base);
;
diag.arg("base", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2270#[diag(parse_float_literal_unsupported_base)]
2271pub(crate) struct FloatLiteralUnsupportedBase {
2272 #[primary_span]
2273 pub span: Span,
2274 pub base: &'static str,
2275}
2276
2277#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
UnknownPrefix<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnknownPrefix {
span: __binding_0, prefix: __binding_1, sugg: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unknown_prefix);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("prefix", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
2278#[diag(parse_unknown_prefix)]
2279#[note]
2280pub(crate) struct UnknownPrefix<'a> {
2281 #[primary_span]
2282 #[label]
2283 pub span: Span,
2284 pub prefix: &'a str,
2285 #[subdiagnostic]
2286 pub sugg: Option<UnknownPrefixSugg>,
2287}
2288
2289#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for MacroExpandsToAdtField<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MacroExpandsToAdtField { adt_ty: __binding_0 } => {
diag.store_args();
diag.arg("adt_ty", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_macro_expands_to_adt_field);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2290#[note(parse_macro_expands_to_adt_field)]
2291pub(crate) struct MacroExpandsToAdtField<'a> {
2292 pub adt_ty: &'a str,
2293}
2294
2295#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnknownPrefixSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnknownPrefixSugg::UseBr(__binding_0) => {
let __code_149 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("br"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_br);
diag.span_suggestions_with_style(__binding_0, __message,
__code_149, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
UnknownPrefixSugg::UseCr(__binding_0) => {
let __code_150 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("cr"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_cr);
diag.span_suggestions_with_style(__binding_0, __message,
__code_150, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
UnknownPrefixSugg::Whitespace(__binding_0) => {
let __code_151 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" "))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_whitespace);
diag.span_suggestions_with_style(__binding_0, __message,
__code_151, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
UnknownPrefixSugg::MeantStr {
start: __binding_0, end: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_152 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\""))
});
let __code_153 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\""))
});
suggestions.push((__binding_0, __code_152));
suggestions.push((__binding_1, __code_153));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_str);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2296pub(crate) enum UnknownPrefixSugg {
2297 #[suggestion(
2298 parse_suggestion_br,
2299 code = "br",
2300 applicability = "maybe-incorrect",
2301 style = "verbose"
2302 )]
2303 UseBr(#[primary_span] Span),
2304 #[suggestion(
2305 parse_suggestion_cr,
2306 code = "cr",
2307 applicability = "maybe-incorrect",
2308 style = "verbose"
2309 )]
2310 UseCr(#[primary_span] Span),
2311 #[suggestion(
2312 parse_suggestion_whitespace,
2313 code = " ",
2314 applicability = "maybe-incorrect",
2315 style = "verbose"
2316 )]
2317 Whitespace(#[primary_span] Span),
2318 #[multipart_suggestion(
2319 parse_suggestion_str,
2320 applicability = "maybe-incorrect",
2321 style = "verbose"
2322 )]
2323 MeantStr {
2324 #[suggestion_part(code = "\"")]
2325 start: Span,
2326 #[suggestion_part(code = "\"")]
2327 end: Span,
2328 },
2329}
2330
2331#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ReservedMultihash where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ReservedMultihash { span: __binding_0, sugg: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_reserved_multihash);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
2332#[diag(parse_reserved_multihash)]
2333#[note]
2334pub(crate) struct ReservedMultihash {
2335 #[primary_span]
2336 pub span: Span,
2337 #[subdiagnostic]
2338 pub sugg: Option<GuardedStringSugg>,
2339}
2340#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ReservedString
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ReservedString { span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_reserved_string);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
2341#[diag(parse_reserved_string)]
2342#[note]
2343pub(crate) struct ReservedString {
2344 #[primary_span]
2345 pub span: Span,
2346 #[subdiagnostic]
2347 pub sugg: Option<GuardedStringSugg>,
2348}
2349#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for GuardedStringSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
GuardedStringSugg(__binding_0) => {
let __code_154 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" "))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion_whitespace);
diag.span_suggestions_with_style(__binding_0, __message,
__code_154, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2350#[suggestion(
2351 parse_suggestion_whitespace,
2352 code = " ",
2353 applicability = "maybe-incorrect",
2354 style = "verbose"
2355)]
2356pub(crate) struct GuardedStringSugg(#[primary_span] pub Span);
2357
2358#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for TooManyHashes
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TooManyHashes { span: __binding_0, num: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_too_many_hashes);
;
diag.arg("num", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2359#[diag(parse_too_many_hashes)]
2360pub(crate) struct TooManyHashes {
2361 #[primary_span]
2362 pub span: Span,
2363 pub num: u32,
2364}
2365
2366#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnknownTokenStart where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnknownTokenStart {
span: __binding_0,
escaped: __binding_1,
sugg: __binding_2,
null: __binding_3,
repeat: __binding_4,
invisible: __binding_5 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unknown_start_of_token);
;
diag.arg("escaped", __binding_1);
diag.span(__binding_0);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
if let Some(__binding_4) = __binding_4 {
diag.subdiagnostic(__binding_4);
}
if let Some(__binding_5) = __binding_5 {
diag.subdiagnostic(__binding_5);
}
diag
}
}
}
}
};Diagnostic)]
2367#[diag(parse_unknown_start_of_token)]
2368pub(crate) struct UnknownTokenStart {
2369 #[primary_span]
2370 pub span: Span,
2371 pub escaped: String,
2372 #[subdiagnostic]
2373 pub sugg: Option<TokenSubstitution>,
2374 #[subdiagnostic]
2375 pub null: Option<UnknownTokenNull>,
2376 #[subdiagnostic]
2377 pub repeat: Option<UnknownTokenRepeat>,
2378 #[subdiagnostic]
2379 pub invisible: Option<InvisibleCharacter>,
2380}
2381
2382#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for TokenSubstitution {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TokenSubstitution::DirectedQuotes {
span: __binding_0,
suggestion: __binding_1,
ascii_str: __binding_2,
ascii_name: __binding_3 } => {
let __code_155 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("suggestion", __binding_1);
diag.arg("ascii_str", __binding_2);
diag.arg("ascii_name", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_quotes);
diag.span_suggestions_with_style(__binding_0, __message,
__code_155, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
TokenSubstitution::Other {
span: __binding_0,
suggestion: __binding_1,
ch: __binding_2,
u_name: __binding_3,
ascii_str: __binding_4,
ascii_name: __binding_5 } => {
let __code_156 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("suggestion", __binding_1);
diag.arg("ch", __binding_2);
diag.arg("u_name", __binding_3);
diag.arg("ascii_str", __binding_4);
diag.arg("ascii_name", __binding_5);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_other);
diag.span_suggestions_with_style(__binding_0, __message,
__code_156, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2383pub(crate) enum TokenSubstitution {
2384 #[suggestion(
2385 parse_sugg_quotes,
2386 code = "{suggestion}",
2387 applicability = "maybe-incorrect",
2388 style = "verbose"
2389 )]
2390 DirectedQuotes {
2391 #[primary_span]
2392 span: Span,
2393 suggestion: String,
2394 ascii_str: &'static str,
2395 ascii_name: &'static str,
2396 },
2397 #[suggestion(
2398 parse_sugg_other,
2399 code = "{suggestion}",
2400 applicability = "maybe-incorrect",
2401 style = "verbose"
2402 )]
2403 Other {
2404 #[primary_span]
2405 span: Span,
2406 suggestion: String,
2407 ch: String,
2408 u_name: &'static str,
2409 ascii_str: &'static str,
2410 ascii_name: &'static str,
2411 },
2412}
2413
2414#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnknownTokenRepeat {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnknownTokenRepeat { repeats: __binding_0 } => {
diag.store_args();
diag.arg("repeats", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_note_repeats);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2415#[note(parse_note_repeats)]
2416pub(crate) struct UnknownTokenRepeat {
2417 pub repeats: usize,
2418}
2419
2420#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for InvisibleCharacter {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
InvisibleCharacter => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_help_invisible_char);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2421#[help(parse_help_invisible_char)]
2422pub(crate) struct InvisibleCharacter;
2423
2424#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnknownTokenNull {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnknownTokenNull => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_help_null);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2425#[help(parse_help_null)]
2426pub(crate) struct UnknownTokenNull;
2427
2428#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnescapeError
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnescapeError::InvalidUnicodeEscape {
span: __binding_0, surrogate: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_unicode_escape);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("surrogate", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::EscapeOnlyChar {
span: __binding_0,
char_span: __binding_1,
escaped_sugg: __binding_2,
escaped_msg: __binding_3,
byte: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_escape_only_char);
let __code_157 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
})].into_iter();
;
diag.arg("escaped_sugg", __binding_2);
diag.arg("escaped_msg", __binding_3);
diag.arg("byte", __binding_4);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_escape, __code_157,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
UnescapeError::BareCr {
span: __binding_0, double_quotes: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_bare_cr);
let __code_158 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\\r"))
})].into_iter();
;
diag.arg("double_quotes", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::parse_escape, __code_158,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
UnescapeError::BareCrRawString(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_bare_cr_in_raw_string);
;
diag.span(__binding_0);
diag
}
UnescapeError::TooShortHexEscape(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_too_short_hex_escape);
;
diag.span(__binding_0);
diag
}
UnescapeError::InvalidCharInEscape {
span: __binding_0, is_hex: __binding_1, ch: __binding_2 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_char_in_escape);
;
diag.arg("is_hex", __binding_1);
diag.arg("ch", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::LeadingUnderscoreUnicodeEscape {
span: __binding_0, ch: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_leading_underscore_unicode_escape);
;
diag.arg("ch", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_leading_underscore_unicode_escape_label);
diag
}
UnescapeError::OverlongUnicodeEscape(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_overlong_unicode_escape);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::UnclosedUnicodeEscape(__binding_0,
__binding_1) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unclosed_unicode_escape);
let __code_159 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("}}"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_terminate, __code_159,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
UnescapeError::NoBraceInUnicodeEscape {
span: __binding_0, label: __binding_1, sub: __binding_2 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_no_brace_unicode_escape);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
}
diag.subdiagnostic(__binding_2);
diag
}
UnescapeError::UnicodeEscapeInByte(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unicode_escape_in_byte);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::EmptyUnicodeEscape(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_empty_unicode_escape);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::ZeroChars(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_zero_chars);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::LoneSlash(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_lone_slash);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::UnskippedWhitespace {
span: __binding_0, char_span: __binding_1, ch: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unskipped_whitespace);
;
diag.arg("ch", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::MultipleSkippedLinesWarning(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_multiple_skipped_lines);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
UnescapeError::MoreThanOneChar {
span: __binding_0,
note: __binding_1,
suggestion: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_more_than_one_char);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag.subdiagnostic(__binding_2);
diag
}
UnescapeError::NulInCStr { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_nul_in_c_str);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2429pub(crate) enum UnescapeError {
2430 #[diag(parse_invalid_unicode_escape)]
2431 #[help]
2432 InvalidUnicodeEscape {
2433 #[primary_span]
2434 #[label]
2435 span: Span,
2436 surrogate: bool,
2437 },
2438 #[diag(parse_escape_only_char)]
2439 EscapeOnlyChar {
2440 #[primary_span]
2441 span: Span,
2442 #[suggestion(
2443 parse_escape,
2444 applicability = "machine-applicable",
2445 code = "{escaped_sugg}",
2446 style = "verbose"
2447 )]
2448 char_span: Span,
2449 escaped_sugg: String,
2450 escaped_msg: String,
2451 byte: bool,
2452 },
2453 #[diag(parse_bare_cr)]
2454 BareCr {
2455 #[primary_span]
2456 #[suggestion(
2457 parse_escape,
2458 applicability = "machine-applicable",
2459 code = "\\r",
2460 style = "verbose"
2461 )]
2462 span: Span,
2463 double_quotes: bool,
2464 },
2465 #[diag(parse_bare_cr_in_raw_string)]
2466 BareCrRawString(#[primary_span] Span),
2467 #[diag(parse_too_short_hex_escape)]
2468 TooShortHexEscape(#[primary_span] Span),
2469 #[diag(parse_invalid_char_in_escape)]
2470 InvalidCharInEscape {
2471 #[primary_span]
2472 #[label]
2473 span: Span,
2474 is_hex: bool,
2475 ch: String,
2476 },
2477 #[diag(parse_leading_underscore_unicode_escape)]
2478 LeadingUnderscoreUnicodeEscape {
2479 #[primary_span]
2480 #[label(parse_leading_underscore_unicode_escape_label)]
2481 span: Span,
2482 ch: String,
2483 },
2484 #[diag(parse_overlong_unicode_escape)]
2485 OverlongUnicodeEscape(
2486 #[primary_span]
2487 #[label]
2488 Span,
2489 ),
2490 #[diag(parse_unclosed_unicode_escape)]
2491 UnclosedUnicodeEscape(
2492 #[primary_span]
2493 #[label]
2494 Span,
2495 #[suggestion(
2496 parse_terminate,
2497 code = "}}",
2498 applicability = "maybe-incorrect",
2499 style = "verbose"
2500 )]
2501 Span,
2502 ),
2503 #[diag(parse_no_brace_unicode_escape)]
2504 NoBraceInUnicodeEscape {
2505 #[primary_span]
2506 span: Span,
2507 #[label]
2508 label: Option<Span>,
2509 #[subdiagnostic]
2510 sub: NoBraceUnicodeSub,
2511 },
2512 #[diag(parse_unicode_escape_in_byte)]
2513 #[help]
2514 UnicodeEscapeInByte(
2515 #[primary_span]
2516 #[label]
2517 Span,
2518 ),
2519 #[diag(parse_empty_unicode_escape)]
2520 EmptyUnicodeEscape(
2521 #[primary_span]
2522 #[label]
2523 Span,
2524 ),
2525 #[diag(parse_zero_chars)]
2526 ZeroChars(
2527 #[primary_span]
2528 #[label]
2529 Span,
2530 ),
2531 #[diag(parse_lone_slash)]
2532 LoneSlash(
2533 #[primary_span]
2534 #[label]
2535 Span,
2536 ),
2537 #[diag(parse_unskipped_whitespace)]
2538 UnskippedWhitespace {
2539 #[primary_span]
2540 span: Span,
2541 #[label]
2542 char_span: Span,
2543 ch: String,
2544 },
2545 #[diag(parse_multiple_skipped_lines)]
2546 MultipleSkippedLinesWarning(
2547 #[primary_span]
2548 #[label]
2549 Span,
2550 ),
2551 #[diag(parse_more_than_one_char)]
2552 MoreThanOneChar {
2553 #[primary_span]
2554 span: Span,
2555 #[subdiagnostic]
2556 note: Option<MoreThanOneCharNote>,
2557 #[subdiagnostic]
2558 suggestion: MoreThanOneCharSugg,
2559 },
2560 #[diag(parse_nul_in_c_str)]
2561 NulInCStr {
2562 #[primary_span]
2563 span: Span,
2564 },
2565}
2566
2567#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MoreThanOneCharSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MoreThanOneCharSugg::NormalizedForm {
span: __binding_0, ch: __binding_1, normalized: __binding_2
} => {
let __code_160 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
})].into_iter();
diag.store_args();
diag.arg("ch", __binding_1);
diag.arg("normalized", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_consider_normalized);
diag.span_suggestions_with_style(__binding_0, __message,
__code_160, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
MoreThanOneCharSugg::RemoveNonPrinting {
span: __binding_0, ch: __binding_1 } => {
let __code_161 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("ch", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_remove_non);
diag.span_suggestions_with_style(__binding_0, __message,
__code_161, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
MoreThanOneCharSugg::QuotesFull {
span: __binding_0, is_byte: __binding_1, sugg: __binding_2 }
=> {
let __code_162 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
})].into_iter();
diag.store_args();
diag.arg("is_byte", __binding_1);
diag.arg("sugg", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_double_quotes);
diag.span_suggestions_with_style(__binding_0, __message,
__code_162, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
MoreThanOneCharSugg::Quotes {
start: __binding_0,
end: __binding_1,
is_byte: __binding_2,
prefix: __binding_3 } => {
let mut suggestions = Vec::new();
let __code_163 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}\"", __binding_3))
});
let __code_164 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\""))
});
suggestions.push((__binding_0, __code_163));
suggestions.push((__binding_1, __code_164));
diag.store_args();
diag.arg("is_byte", __binding_2);
diag.arg("prefix", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_double_quotes);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2568pub(crate) enum MoreThanOneCharSugg {
2569 #[suggestion(
2570 parse_consider_normalized,
2571 code = "{normalized}",
2572 applicability = "machine-applicable",
2573 style = "verbose"
2574 )]
2575 NormalizedForm {
2576 #[primary_span]
2577 span: Span,
2578 ch: String,
2579 normalized: String,
2580 },
2581 #[suggestion(
2582 parse_remove_non,
2583 code = "{ch}",
2584 applicability = "maybe-incorrect",
2585 style = "verbose"
2586 )]
2587 RemoveNonPrinting {
2588 #[primary_span]
2589 span: Span,
2590 ch: String,
2591 },
2592 #[suggestion(
2593 parse_use_double_quotes,
2594 code = "{sugg}",
2595 applicability = "machine-applicable",
2596 style = "verbose"
2597 )]
2598 QuotesFull {
2599 #[primary_span]
2600 span: Span,
2601 is_byte: bool,
2602 sugg: String,
2603 },
2604 #[multipart_suggestion(parse_use_double_quotes, applicability = "machine-applicable")]
2605 Quotes {
2606 #[suggestion_part(code = "{prefix}\"")]
2607 start: Span,
2608 #[suggestion_part(code = "\"")]
2609 end: Span,
2610 is_byte: bool,
2611 prefix: &'static str,
2612 },
2613}
2614
2615#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MoreThanOneCharNote {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MoreThanOneCharNote::AllCombining {
span: __binding_0,
chr: __binding_1,
len: __binding_2,
escaped_marks: __binding_3 } => {
diag.store_args();
diag.arg("chr", __binding_1);
diag.arg("len", __binding_2);
diag.arg("escaped_marks", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_followed_by);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
MoreThanOneCharNote::NonPrinting {
span: __binding_0, escaped: __binding_1 } => {
diag.store_args();
diag.arg("escaped", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_non_printing);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2616pub(crate) enum MoreThanOneCharNote {
2617 #[note(parse_followed_by)]
2618 AllCombining {
2619 #[primary_span]
2620 span: Span,
2621 chr: String,
2622 len: usize,
2623 escaped_marks: String,
2624 },
2625 #[note(parse_non_printing)]
2626 NonPrinting {
2627 #[primary_span]
2628 span: Span,
2629 escaped: String,
2630 },
2631}
2632
2633#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for NoBraceUnicodeSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
NoBraceUnicodeSub::Suggestion {
span: __binding_0, suggestion: __binding_1 } => {
let __code_165 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("suggestion", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_use_braces);
diag.span_suggestions_with_style(__binding_0, __message,
__code_165, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
NoBraceUnicodeSub::Help => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_format_of_unicode);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2634pub(crate) enum NoBraceUnicodeSub {
2635 #[suggestion(
2636 parse_use_braces,
2637 code = "{suggestion}",
2638 applicability = "maybe-incorrect",
2639 style = "verbose"
2640 )]
2641 Suggestion {
2642 #[primary_span]
2643 span: Span,
2644 suggestion: String,
2645 },
2646 #[help(parse_format_of_unicode)]
2647 Help,
2648}
2649
2650#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for WrapInParens {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
WrapInParens { lo: __binding_0, hi: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_166 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_167 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_166));
suggestions.push((__binding_1, __code_167));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_wrap_pattern_in_parens);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2651#[multipart_suggestion(parse_sugg_wrap_pattern_in_parens, applicability = "machine-applicable")]
2652pub(crate) struct WrapInParens {
2653 #[suggestion_part(code = "(")]
2654 pub(crate) lo: Span,
2655 #[suggestion_part(code = ")")]
2656 pub(crate) hi: Span,
2657}
2658
2659#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for TopLevelOrPatternNotAllowedSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TopLevelOrPatternNotAllowedSugg::RemoveLeadingVert {
span: __binding_0 } => {
let __code_168 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_sugg_remove_leading_vert_in_pattern);
diag.span_suggestions_with_style(__binding_0, __message,
__code_168, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag.restore_args();
}
TopLevelOrPatternNotAllowedSugg::WrapInParens {
span: __binding_0, suggestion: __binding_1 } => {
__binding_1.add_to_diag(diag);
diag.store_args();
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2660pub(crate) enum TopLevelOrPatternNotAllowedSugg {
2661 #[suggestion(
2662 parse_sugg_remove_leading_vert_in_pattern,
2663 code = "",
2664 applicability = "machine-applicable",
2665 style = "tool-only"
2666 )]
2667 RemoveLeadingVert {
2668 #[primary_span]
2669 span: Span,
2670 },
2671 WrapInParens {
2672 #[primary_span]
2673 span: Span,
2674 #[subdiagnostic]
2675 suggestion: WrapInParens,
2676 },
2677}
2678
2679#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedVertVertBeforeFunctionParam where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedVertVertBeforeFunctionParam { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_vert_vert_before_function_parameter);
let __code_169 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.note(crate::fluent_generated::parse_note_pattern_alternatives_use_single_vert);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_169,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2680#[diag(parse_unexpected_vert_vert_before_function_parameter)]
2681#[note(parse_note_pattern_alternatives_use_single_vert)]
2682pub(crate) struct UnexpectedVertVertBeforeFunctionParam {
2683 #[primary_span]
2684 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
2685 pub span: Span,
2686}
2687
2688#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedVertVertInPattern where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedVertVertInPattern {
span: __binding_0, start: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_vert_vert_in_pattern);
let __code_170 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("|"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_170,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
if let Some(__binding_1) = __binding_1 {
diag.span_label(__binding_1,
crate::fluent_generated::parse_label_while_parsing_or_pattern_here);
}
diag
}
}
}
}
};Diagnostic)]
2689#[diag(parse_unexpected_vert_vert_in_pattern)]
2690pub(crate) struct UnexpectedVertVertInPattern {
2691 #[primary_span]
2692 #[suggestion(code = "|", applicability = "machine-applicable", style = "verbose")]
2693 pub span: Span,
2694 #[label(parse_label_while_parsing_or_pattern_here)]
2695 pub start: Option<Span>,
2696}
2697
2698#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for TrailingVertSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TrailingVertSuggestion { span: __binding_0 } => {
let __code_171 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_trailing_vert_not_allowed);
diag.span_suggestions_with_style(__binding_0, __message,
__code_171, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2699#[suggestion(
2700 parse_trailing_vert_not_allowed,
2701 code = "",
2702 applicability = "machine-applicable",
2703 style = "tool-only"
2704)]
2705pub(crate) struct TrailingVertSuggestion {
2706 #[primary_span]
2707 pub span: Span,
2708}
2709
2710#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TrailingVertNotAllowed where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TrailingVertNotAllowed {
span: __binding_0,
suggestion: __binding_1,
start: __binding_2,
token: __binding_3,
note_double_vert: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_trailing_vert_not_allowed);
;
diag.arg("token", __binding_3);
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
if let Some(__binding_2) = __binding_2 {
diag.span_label(__binding_2,
crate::fluent_generated::parse_label_while_parsing_or_pattern_here);
}
if __binding_4 {
diag.note(crate::fluent_generated::parse_note_pattern_alternatives_use_single_vert);
}
diag
}
}
}
}
};Diagnostic)]
2711#[diag(parse_trailing_vert_not_allowed)]
2712pub(crate) struct TrailingVertNotAllowed {
2713 #[primary_span]
2714 pub span: Span,
2715 #[subdiagnostic]
2716 pub suggestion: TrailingVertSuggestion,
2717 #[label(parse_label_while_parsing_or_pattern_here)]
2718 pub start: Option<Span>,
2719 pub token: Token,
2720 #[note(parse_note_pattern_alternatives_use_single_vert)]
2721 pub note_double_vert: bool,
2722}
2723
2724#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DotDotDotRestPattern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DotDotDotRestPattern {
span: __binding_0,
suggestion: __binding_1,
var_args: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_dotdotdot_rest_pattern);
let __code_172 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_172,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
}
if let Some(__binding_2) = __binding_2 {
diag.note(crate::fluent_generated::_subdiag::note);
}
diag
}
}
}
}
};Diagnostic)]
2725#[diag(parse_dotdotdot_rest_pattern)]
2726pub(crate) struct DotDotDotRestPattern {
2727 #[primary_span]
2728 #[label]
2729 pub span: Span,
2730 #[suggestion(style = "verbose", code = "", applicability = "machine-applicable")]
2731 pub suggestion: Option<Span>,
2732 #[note]
2733 pub var_args: Option<()>,
2734}
2735
2736#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PatternOnWrongSideOfAt where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PatternOnWrongSideOfAt {
whole_span: __binding_0,
whole_pat: __binding_1,
pattern: __binding_2,
binding: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_pattern_on_wrong_side_of_at);
let __code_173 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
;
diag.arg("whole_pat", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_173,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.span_label(__binding_2,
crate::fluent_generated::parse_label_pattern);
diag.span_label(__binding_3,
crate::fluent_generated::parse_label_binding);
diag
}
}
}
}
};Diagnostic)]
2737#[diag(parse_pattern_on_wrong_side_of_at)]
2738pub(crate) struct PatternOnWrongSideOfAt {
2739 #[primary_span]
2740 #[suggestion(code = "{whole_pat}", applicability = "machine-applicable", style = "verbose")]
2741 pub whole_span: Span,
2742 pub whole_pat: String,
2743 #[label(parse_label_pattern)]
2744 pub pattern: Span,
2745 #[label(parse_label_binding)]
2746 pub binding: Span,
2747}
2748
2749#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedBindingLeftOfAt where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedBindingLeftOfAt {
whole_span: __binding_0, lhs: __binding_1, rhs: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_binding_left_of_at);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::parse_label_lhs);
diag.span_label(__binding_2,
crate::fluent_generated::parse_label_rhs);
diag
}
}
}
}
};Diagnostic)]
2750#[diag(parse_expected_binding_left_of_at)]
2751#[note]
2752pub(crate) struct ExpectedBindingLeftOfAt {
2753 #[primary_span]
2754 pub whole_span: Span,
2755 #[label(parse_label_lhs)]
2756 pub lhs: Span,
2757 #[label(parse_label_rhs)]
2758 pub rhs: Span,
2759}
2760
2761#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ParenRangeSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ParenRangeSuggestion { lo: __binding_0, hi: __binding_1 } =>
{
let mut suggestions = Vec::new();
let __code_174 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_175 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_174));
suggestions.push((__binding_1, __code_175));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_ambiguous_range_pattern_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2762#[multipart_suggestion(
2763 parse_ambiguous_range_pattern_suggestion,
2764 applicability = "machine-applicable"
2765)]
2766pub(crate) struct ParenRangeSuggestion {
2767 #[suggestion_part(code = "(")]
2768 pub lo: Span,
2769 #[suggestion_part(code = ")")]
2770 pub hi: Span,
2771}
2772
2773#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AmbiguousRangePattern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AmbiguousRangePattern {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_ambiguous_range_pattern);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
2774#[diag(parse_ambiguous_range_pattern)]
2775pub(crate) struct AmbiguousRangePattern {
2776 #[primary_span]
2777 pub span: Span,
2778 #[subdiagnostic]
2779 pub suggestion: ParenRangeSuggestion,
2780}
2781
2782#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedLifetimeInPattern where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedLifetimeInPattern {
span: __binding_0,
symbol: __binding_1,
suggestion: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_lifetime_in_pattern);
let __code_176 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("symbol", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::_subdiag::suggestion, __code_176,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2783#[diag(parse_unexpected_lifetime_in_pattern)]
2784pub(crate) struct UnexpectedLifetimeInPattern {
2785 #[primary_span]
2786 pub span: Span,
2787 pub symbol: Symbol,
2788 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
2789 pub suggestion: Span,
2790}
2791
2792#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidMutInPattern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidMutInPattern::NestedIdent {
span: __binding_0, pat: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_mut_on_nested_ident_pattern);
let __code_177 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.note(crate::fluent_generated::parse_note_mut_pattern_usage);
;
diag.arg("pat", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_177,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
InvalidMutInPattern::NonIdent { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_mut_on_non_ident_pattern);
let __code_178 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.note(crate::fluent_generated::parse_note_mut_pattern_usage);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_178,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2793pub(crate) enum InvalidMutInPattern {
2794 #[diag(parse_mut_on_nested_ident_pattern)]
2795 #[note(parse_note_mut_pattern_usage)]
2796 NestedIdent {
2797 #[primary_span]
2798 #[suggestion(code = "{pat}", applicability = "machine-applicable", style = "verbose")]
2799 span: Span,
2800 pat: String,
2801 },
2802 #[diag(parse_mut_on_non_ident_pattern)]
2803 #[note(parse_note_mut_pattern_usage)]
2804 NonIdent {
2805 #[primary_span]
2806 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
2807 span: Span,
2808 },
2809}
2810
2811#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RepeatedMutInPattern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RepeatedMutInPattern {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_repeated_mut_in_pattern);
let __code_179 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_179,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2812#[diag(parse_repeated_mut_in_pattern)]
2813pub(crate) struct RepeatedMutInPattern {
2814 #[primary_span]
2815 pub span: Span,
2816 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
2817 pub suggestion: Span,
2818}
2819
2820#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DotDotDotRangeToPatternNotAllowed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DotDotDotRangeToPatternNotAllowed { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_dot_dot_dot_range_to_pattern_not_allowed);
let __code_180 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("..="))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_180,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2821#[diag(parse_dot_dot_dot_range_to_pattern_not_allowed)]
2822pub(crate) struct DotDotDotRangeToPatternNotAllowed {
2823 #[primary_span]
2824 #[suggestion(style = "verbose", code = "..=", applicability = "machine-applicable")]
2825 pub span: Span,
2826}
2827
2828#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
EnumPatternInsteadOfIdentifier where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EnumPatternInsteadOfIdentifier { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_enum_pattern_instead_of_identifier);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2829#[diag(parse_enum_pattern_instead_of_identifier)]
2830pub(crate) struct EnumPatternInsteadOfIdentifier {
2831 #[primary_span]
2832 pub span: Span,
2833}
2834
2835#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AtDotDotInStructPattern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AtDotDotInStructPattern {
span: __binding_0, remove: __binding_1, ident: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_at_dot_dot_in_struct_pattern);
let __code_181 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("ident", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_181,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2836#[diag(parse_at_dot_dot_in_struct_pattern)]
2837pub(crate) struct AtDotDotInStructPattern {
2838 #[primary_span]
2839 pub span: Span,
2840 #[suggestion(code = "", style = "verbose", applicability = "machine-applicable")]
2841 pub remove: Span,
2842 pub ident: Ident,
2843}
2844
2845#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AtInStructPattern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AtInStructPattern { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_at_in_struct_pattern);
diag.note(crate::fluent_generated::_subdiag::note);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2846#[diag(parse_at_in_struct_pattern)]
2847#[note]
2848#[help]
2849pub(crate) struct AtInStructPattern {
2850 #[primary_span]
2851 pub span: Span,
2852}
2853
2854#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DotDotDotForRemainingFields where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DotDotDotForRemainingFields {
span: __binding_0, token_str: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_dot_dot_dot_for_remaining_fields);
let __code_182 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(".."))
})].into_iter();
;
diag.arg("token_str", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_182,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2855#[diag(parse_dot_dot_dot_for_remaining_fields)]
2856pub(crate) struct DotDotDotForRemainingFields {
2857 #[primary_span]
2858 #[suggestion(code = "..", style = "verbose", applicability = "machine-applicable")]
2859 pub span: Span,
2860 pub token_str: Cow<'static, str>,
2861}
2862
2863#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedCommaAfterPatternField where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedCommaAfterPatternField { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_comma_after_pattern_field);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
2864#[diag(parse_expected_comma_after_pattern_field)]
2865pub(crate) struct ExpectedCommaAfterPatternField {
2866 #[primary_span]
2867 pub span: Span,
2868}
2869
2870#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedExpressionInPattern where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedExpressionInPattern {
span: __binding_0,
is_bound: __binding_1,
expr_precedence: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_expr_in_pat);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("is_bound", __binding_1);
diag.arg("expr_precedence", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
2871#[diag(parse_unexpected_expr_in_pat)]
2872#[note]
2873pub(crate) struct UnexpectedExpressionInPattern {
2874 #[primary_span]
2876 #[label]
2877 pub span: Span,
2878 pub is_bound: bool,
2880 pub expr_precedence: ExprPrecedence,
2882}
2883
2884#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnexpectedExpressionInPatternSugg
{
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnexpectedExpressionInPatternSugg::CreateGuard {
ident_span: __binding_0,
pat_hi: __binding_1,
ident: __binding_2,
expr: __binding_3 } => {
let mut suggestions = Vec::new();
let __code_183 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
});
let __code_184 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" if {1} == {0}",
__binding_3, __binding_2))
});
suggestions.push((__binding_0, __code_183));
suggestions.push((__binding_1, __code_184));
diag.store_args();
diag.arg("ident", __binding_2);
diag.arg("expr", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_unexpected_expr_in_pat_create_guard_sugg);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
UnexpectedExpressionInPatternSugg::UpdateGuard {
ident_span: __binding_0,
guard_lo: __binding_1,
guard_hi: __binding_2,
guard_hi_paren: __binding_3,
ident: __binding_4,
expr: __binding_5 } => {
let mut suggestions = Vec::new();
let __code_185 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_4))
});
let __code_186 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
let __code_187 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{1} && {2} == {0}",
__binding_5, __binding_3, __binding_4))
});
suggestions.push((__binding_0, __code_185));
if let Some(__binding_1) = __binding_1 {
suggestions.push((__binding_1, __code_186));
}
suggestions.push((__binding_2, __code_187));
diag.store_args();
diag.arg("guard_hi_paren", __binding_3);
diag.arg("ident", __binding_4);
diag.arg("expr", __binding_5);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_unexpected_expr_in_pat_update_guard_sugg);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
UnexpectedExpressionInPatternSugg::Const {
stmt_lo: __binding_0,
ident_span: __binding_1,
ident: __binding_2,
expr: __binding_3,
indentation: __binding_4 } => {
let mut suggestions = Vec::new();
let __code_188 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{2}const {1}: /* Type */ = {0};\n",
__binding_3, __binding_2, __binding_4))
});
let __code_189 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
});
suggestions.push((__binding_0, __code_188));
suggestions.push((__binding_1, __code_189));
diag.store_args();
diag.arg("ident", __binding_2);
diag.arg("expr", __binding_3);
diag.arg("indentation", __binding_4);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_unexpected_expr_in_pat_const_sugg);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2885pub(crate) enum UnexpectedExpressionInPatternSugg {
2886 #[multipart_suggestion(
2887 parse_unexpected_expr_in_pat_create_guard_sugg,
2888 applicability = "maybe-incorrect"
2889 )]
2890 CreateGuard {
2891 #[suggestion_part(code = "{ident}")]
2893 ident_span: Span,
2894 #[suggestion_part(code = " if {ident} == {expr}")]
2896 pat_hi: Span,
2897 ident: String,
2899 expr: String,
2901 },
2902
2903 #[multipart_suggestion(
2904 parse_unexpected_expr_in_pat_update_guard_sugg,
2905 applicability = "maybe-incorrect"
2906 )]
2907 UpdateGuard {
2908 #[suggestion_part(code = "{ident}")]
2910 ident_span: Span,
2911 #[suggestion_part(code = "(")]
2913 guard_lo: Option<Span>,
2914 #[suggestion_part(code = "{guard_hi_paren} && {ident} == {expr}")]
2916 guard_hi: Span,
2917 guard_hi_paren: &'static str,
2919 ident: String,
2921 expr: String,
2923 },
2924
2925 #[multipart_suggestion(
2926 parse_unexpected_expr_in_pat_const_sugg,
2927 applicability = "has-placeholders"
2928 )]
2929 Const {
2930 #[suggestion_part(code = "{indentation}const {ident}: /* Type */ = {expr};\n")]
2932 stmt_lo: Span,
2933 #[suggestion_part(code = "{ident}")]
2935 ident_span: Span,
2936 ident: String,
2938 expr: String,
2940 indentation: String,
2942 },
2943}
2944
2945#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnexpectedParenInRangePat where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnexpectedParenInRangePat {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unexpected_paren_in_range_pat);
;
diag.span(__binding_0.clone());
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
2946#[diag(parse_unexpected_paren_in_range_pat)]
2947pub(crate) struct UnexpectedParenInRangePat {
2948 #[primary_span]
2949 pub span: Vec<Span>,
2950 #[subdiagnostic]
2951 pub sugg: UnexpectedParenInRangePatSugg,
2952}
2953
2954#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnexpectedParenInRangePatSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnexpectedParenInRangePatSugg {
start_span: __binding_0, end_span: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_190 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
let __code_191 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_190));
suggestions.push((__binding_1, __code_191));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_unexpected_paren_in_range_pat_sugg);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
2955#[multipart_suggestion(
2956 parse_unexpected_paren_in_range_pat_sugg,
2957 applicability = "machine-applicable"
2958)]
2959pub(crate) struct UnexpectedParenInRangePatSugg {
2960 #[suggestion_part(code = "")]
2961 pub start_span: Span,
2962 #[suggestion_part(code = "")]
2963 pub end_span: Span,
2964}
2965
2966#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ReturnTypesUseThinArrow where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ReturnTypesUseThinArrow {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_return_types_use_thin_arrow);
let __code_192 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" -> "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_192,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2967#[diag(parse_return_types_use_thin_arrow)]
2968pub(crate) struct ReturnTypesUseThinArrow {
2969 #[primary_span]
2970 pub span: Span,
2971 #[suggestion(style = "verbose", code = " -> ", applicability = "machine-applicable")]
2972 pub suggestion: Span,
2973}
2974
2975#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NeedPlusAfterTraitObjectLifetime where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NeedPlusAfterTraitObjectLifetime {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_need_plus_after_trait_object_lifetime);
let __code_193 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" + /* Trait */"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_193,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
2976#[diag(parse_need_plus_after_trait_object_lifetime)]
2977pub(crate) struct NeedPlusAfterTraitObjectLifetime {
2978 #[primary_span]
2979 pub span: Span,
2980 #[suggestion(code = " + /* Trait */", applicability = "has-placeholders")]
2981 pub suggestion: Span,
2982}
2983
2984#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedMutOrConstInRawPointerType where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedMutOrConstInRawPointerType {
span: __binding_0, after_asterisk: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_mut_or_const_in_raw_pointer_type);
let __code_194 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("mut "))
}),
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("const "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_194,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
2985#[diag(parse_expected_mut_or_const_in_raw_pointer_type)]
2986pub(crate) struct ExpectedMutOrConstInRawPointerType {
2987 #[primary_span]
2988 pub span: Span,
2989 #[suggestion(code("mut ", "const "), applicability = "has-placeholders", style = "verbose")]
2990 pub after_asterisk: Span,
2991}
2992
2993#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LifetimeAfterMut where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LifetimeAfterMut {
span: __binding_0,
suggest_lifetime: __binding_1,
snippet: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_lifetime_after_mut);
let __code_195 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("&{0} mut", __binding_2))
})].into_iter();
;
diag.arg("snippet", __binding_2);
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_195,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
}
diag
}
}
}
}
};Diagnostic)]
2994#[diag(parse_lifetime_after_mut)]
2995pub(crate) struct LifetimeAfterMut {
2996 #[primary_span]
2997 pub span: Span,
2998 #[suggestion(code = "&{snippet} mut", applicability = "maybe-incorrect", style = "verbose")]
2999 pub suggest_lifetime: Option<Span>,
3000 pub snippet: String,
3001}
3002
3003#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for DynAfterMut
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DynAfterMut { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_dyn_after_mut);
let __code_196 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("&mut dyn"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_196,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3004#[diag(parse_dyn_after_mut)]
3005pub(crate) struct DynAfterMut {
3006 #[primary_span]
3007 #[suggestion(code = "&mut dyn", applicability = "machine-applicable", style = "verbose")]
3008 pub span: Span,
3009}
3010
3011#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnPointerCannotBeConst where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnPointerCannotBeConst {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_fn_pointer_cannot_be_const);
let __code_197 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_197,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3012#[diag(parse_fn_pointer_cannot_be_const)]
3013#[note]
3014pub(crate) struct FnPointerCannotBeConst {
3015 #[primary_span]
3016 #[label]
3017 pub span: Span,
3018 #[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
3019 pub suggestion: Span,
3020}
3021
3022#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnPointerCannotBeAsync where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnPointerCannotBeAsync {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_fn_pointer_cannot_be_async);
let __code_198 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_198,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3023#[diag(parse_fn_pointer_cannot_be_async)]
3024#[note]
3025pub(crate) struct FnPointerCannotBeAsync {
3026 #[primary_span]
3027 #[label]
3028 pub span: Span,
3029 #[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
3030 pub suggestion: Span,
3031}
3032
3033#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NestedCVariadicType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NestedCVariadicType { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_nested_c_variadic_type);
diag.code(E0743);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3034#[diag(parse_nested_c_variadic_type, code = E0743)]
3035pub(crate) struct NestedCVariadicType {
3036 #[primary_span]
3037 pub span: Span,
3038}
3039
3040#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidCVariadicType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidCVariadicType { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_dotdotdot_rest_type);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3041#[diag(parse_dotdotdot_rest_type)]
3042#[note]
3043pub(crate) struct InvalidCVariadicType {
3044 #[primary_span]
3045 pub span: Span,
3046}
3047
3048#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidDynKeyword where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidDynKeyword {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_dyn_keyword);
let __code_199 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_199,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3049#[diag(parse_invalid_dyn_keyword)]
3050#[help]
3051pub(crate) struct InvalidDynKeyword {
3052 #[primary_span]
3053 pub span: Span,
3054 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
3055 pub suggestion: Span,
3056}
3057
3058#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for HelpUseLatestEdition {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
HelpUseLatestEdition::Cargo { edition: __binding_0 } => {
diag.store_args();
diag.arg("edition", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_help_set_edition_cargo);
diag.help(__message);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_note_edition_guide);
diag.note(__message);
diag.restore_args();
}
HelpUseLatestEdition::Standalone { edition: __binding_0 } =>
{
diag.store_args();
diag.arg("edition", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_help_set_edition_standalone);
diag.help(__message);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_note_edition_guide);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3059pub(crate) enum HelpUseLatestEdition {
3060 #[help(parse_help_set_edition_cargo)]
3061 #[note(parse_note_edition_guide)]
3062 Cargo { edition: Edition },
3063 #[help(parse_help_set_edition_standalone)]
3064 #[note(parse_note_edition_guide)]
3065 Standalone { edition: Edition },
3066}
3067
3068impl HelpUseLatestEdition {
3069 pub(crate) fn new() -> Self {
3070 let edition = LATEST_STABLE_EDITION;
3071 if rustc_session::utils::was_invoked_from_cargo() {
3072 Self::Cargo { edition }
3073 } else {
3074 Self::Standalone { edition }
3075 }
3076 }
3077}
3078
3079#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BoxSyntaxRemoved where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BoxSyntaxRemoved { span: __binding_0, sugg: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_box_syntax_removed);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
3080#[diag(parse_box_syntax_removed)]
3081pub(crate) struct BoxSyntaxRemoved {
3082 #[primary_span]
3083 pub span: Span,
3084 #[subdiagnostic]
3085 pub sugg: AddBoxNew,
3086}
3087
3088#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AddBoxNew {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AddBoxNew { box_kw_and_lo: __binding_0, hi: __binding_1 } =>
{
let mut suggestions = Vec::new();
let __code_200 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("Box::new("))
});
let __code_201 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_200));
suggestions.push((__binding_1, __code_201));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_box_syntax_removed_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3089#[multipart_suggestion(
3090 parse_box_syntax_removed_suggestion,
3091 applicability = "machine-applicable",
3092 style = "verbose"
3093)]
3094pub(crate) struct AddBoxNew {
3095 #[suggestion_part(code = "Box::new(")]
3096 pub box_kw_and_lo: Span,
3097 #[suggestion_part(code = ")")]
3098 pub hi: Span,
3099}
3100
3101#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BadReturnTypeNotationOutput where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BadReturnTypeNotationOutput {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_bad_return_type_notation_output);
let __code_202 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_202,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3102#[diag(parse_bad_return_type_notation_output)]
3103pub(crate) struct BadReturnTypeNotationOutput {
3104 #[primary_span]
3105 pub span: Span,
3106 #[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
3107 pub suggestion: Span,
3108}
3109
3110#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BadAssocTypeBounds where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BadAssocTypeBounds { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_bad_assoc_type_bounds);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3111#[diag(parse_bad_assoc_type_bounds)]
3112pub(crate) struct BadAssocTypeBounds {
3113 #[primary_span]
3114 #[label]
3115 pub span: Span,
3116}
3117
3118#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttrAfterGeneric where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttrAfterGeneric { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_attr_after_generic);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3119#[diag(parse_attr_after_generic)]
3120pub(crate) struct AttrAfterGeneric {
3121 #[primary_span]
3122 #[label]
3123 pub span: Span,
3124}
3125
3126#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttrWithoutGenerics where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttrWithoutGenerics { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_attr_without_generics);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3127#[diag(parse_attr_without_generics)]
3128pub(crate) struct AttrWithoutGenerics {
3129 #[primary_span]
3130 #[label]
3131 pub span: Span,
3132}
3133
3134#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
WhereOnGenerics where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
WhereOnGenerics { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_where_generics);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3135#[diag(parse_where_generics)]
3136pub(crate) struct WhereOnGenerics {
3137 #[primary_span]
3138 #[label]
3139 pub span: Span,
3140}
3141
3142#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for GenericsInPath
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericsInPath { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_generics_in_path);
;
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
3143#[diag(parse_generics_in_path)]
3144pub(crate) struct GenericsInPath {
3145 #[primary_span]
3146 pub span: Vec<Span>,
3147}
3148
3149#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LifetimeInEqConstraint where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LifetimeInEqConstraint {
span: __binding_0,
lifetime: __binding_1,
binding_label: __binding_2,
colon_sugg: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_lifetime_in_eq_constraint);
let __code_203 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(": "))
})].into_iter();
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("lifetime", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_2,
crate::fluent_generated::parse_context_label);
diag.span_suggestions_with_style(__binding_3,
crate::fluent_generated::parse_colon_sugg, __code_203,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3150#[diag(parse_lifetime_in_eq_constraint)]
3151#[help]
3152pub(crate) struct LifetimeInEqConstraint {
3153 #[primary_span]
3154 #[label]
3155 pub span: Span,
3156 pub lifetime: Ident,
3157 #[label(parse_context_label)]
3158 pub binding_label: Span,
3159 #[suggestion(
3160 parse_colon_sugg,
3161 style = "verbose",
3162 applicability = "maybe-incorrect",
3163 code = ": "
3164 )]
3165 pub colon_sugg: Span,
3166}
3167
3168#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ModifierLifetime where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ModifierLifetime { span: __binding_0, modifier: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_modifier_lifetime);
let __code_204 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("modifier", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_204,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag
}
}
}
}
};Diagnostic)]
3169#[diag(parse_modifier_lifetime)]
3170pub(crate) struct ModifierLifetime {
3171 #[primary_span]
3172 #[suggestion(style = "tool-only", applicability = "maybe-incorrect", code = "")]
3173 pub span: Span,
3174 pub modifier: &'static str,
3175}
3176
3177#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnderscoreLiteralSuffix where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnderscoreLiteralSuffix { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_underscore_literal_suffix);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3178#[diag(parse_underscore_literal_suffix)]
3179pub(crate) struct UnderscoreLiteralSuffix {
3180 #[primary_span]
3181 pub span: Span,
3182}
3183
3184#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedLabelFoundIdent where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedLabelFoundIdent {
span: __binding_0, start: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expect_label_found_ident);
let __code_205 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\'"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_205,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3185#[diag(parse_expect_label_found_ident)]
3186pub(crate) struct ExpectedLabelFoundIdent {
3187 #[primary_span]
3188 pub span: Span,
3189 #[suggestion(code = "'", applicability = "machine-applicable", style = "verbose")]
3190 pub start: Span,
3191}
3192
3193#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InappropriateDefault where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InappropriateDefault {
span: __binding_0, article: __binding_1, descr: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_inappropriate_default);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("article", __binding_1);
diag.arg("descr", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3194#[diag(parse_inappropriate_default)]
3195#[note]
3196pub(crate) struct InappropriateDefault {
3197 #[primary_span]
3198 #[label]
3199 pub span: Span,
3200 pub article: &'static str,
3201 pub descr: &'static str,
3202}
3203
3204#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RecoverImportAsUse where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RecoverImportAsUse {
span: __binding_0, token_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_recover_import_as_use);
let __code_206 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("use"))
})].into_iter();
;
diag.arg("token_name", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_206,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3205#[diag(parse_recover_import_as_use)]
3206pub(crate) struct RecoverImportAsUse {
3207 #[primary_span]
3208 #[suggestion(code = "use", applicability = "machine-applicable", style = "verbose")]
3209 pub span: Span,
3210 pub token_name: String,
3211}
3212
3213#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SingleColonImportPath where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SingleColonImportPath { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_single_colon_import_path);
let __code_207 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("::"))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_207,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3214#[diag(parse_single_colon_import_path)]
3215#[note]
3216pub(crate) struct SingleColonImportPath {
3217 #[primary_span]
3218 #[suggestion(code = "::", applicability = "machine-applicable", style = "verbose")]
3219 pub span: Span,
3220}
3221
3222#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for BadItemKind
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BadItemKind {
span: __binding_0,
descr: __binding_1,
ctx: __binding_2,
help: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_bad_item_kind);
;
diag.arg("descr", __binding_1);
diag.arg("ctx", __binding_2);
diag.span(__binding_0);
if __binding_3 {
diag.help(crate::fluent_generated::_subdiag::help);
}
diag
}
}
}
}
};Diagnostic)]
3223#[diag(parse_bad_item_kind)]
3224pub(crate) struct BadItemKind {
3225 #[primary_span]
3226 pub span: Span,
3227 pub descr: &'static str,
3228 pub ctx: &'static str,
3229 #[help]
3230 pub help: bool,
3231}
3232
3233#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroRulesMissingBang where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroRulesMissingBang { span: __binding_0, hi: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_macro_rules_missing_bang);
let __code_208 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("!"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_208,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3234#[diag(parse_macro_rules_missing_bang)]
3235pub(crate) struct MacroRulesMissingBang {
3236 #[primary_span]
3237 pub span: Span,
3238 #[suggestion(code = "!", applicability = "machine-applicable", style = "verbose")]
3239 pub hi: Span,
3240}
3241
3242#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroNameRemoveBang where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroNameRemoveBang { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_macro_name_remove_bang);
let __code_209 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_209,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::HideCodeInline);
diag
}
}
}
}
};Diagnostic)]
3243#[diag(parse_macro_name_remove_bang)]
3244pub(crate) struct MacroNameRemoveBang {
3245 #[primary_span]
3246 #[suggestion(code = "", applicability = "machine-applicable", style = "short")]
3247 pub span: Span,
3248}
3249
3250#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MacroRulesVisibility<'a> where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroRulesVisibility { span: __binding_0, vis: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_macro_rules_visibility);
let __code_210 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("#[macro_export]"))
})].into_iter();
;
diag.arg("vis", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_210,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3251#[diag(parse_macro_rules_visibility)]
3252pub(crate) struct MacroRulesVisibility<'a> {
3253 #[primary_span]
3254 #[suggestion(code = "#[macro_export]", applicability = "maybe-incorrect", style = "verbose")]
3255 pub span: Span,
3256 pub vis: &'a str,
3257}
3258
3259#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MacroInvocationVisibility<'a> where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroInvocationVisibility {
span: __binding_0, vis: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_macro_invocation_visibility);
let __code_211 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("vis", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_211,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3260#[diag(parse_macro_invocation_visibility)]
3261#[help]
3262pub(crate) struct MacroInvocationVisibility<'a> {
3263 #[primary_span]
3264 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
3265 pub span: Span,
3266 pub vis: &'a str,
3267}
3268
3269#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
NestedAdt<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NestedAdt {
span: __binding_0,
item: __binding_1,
keyword: __binding_2,
kw_str: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_nested_adt);
let __code_212 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("keyword", __binding_2);
diag.arg("kw_str", __binding_3);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_212,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3270#[diag(parse_nested_adt)]
3271pub(crate) struct NestedAdt<'a> {
3272 #[primary_span]
3273 pub span: Span,
3274 #[suggestion(code = "", applicability = "maybe-incorrect", style = "verbose")]
3275 pub item: Span,
3276 pub keyword: &'a str,
3277 pub kw_str: Cow<'a, str>,
3278}
3279
3280#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FunctionBodyEqualsExpr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FunctionBodyEqualsExpr {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_function_body_equals_expr);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
3281#[diag(parse_function_body_equals_expr)]
3282pub(crate) struct FunctionBodyEqualsExpr {
3283 #[primary_span]
3284 pub span: Span,
3285 #[subdiagnostic]
3286 pub sugg: FunctionBodyEqualsExprSugg,
3287}
3288
3289#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for FunctionBodyEqualsExprSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
FunctionBodyEqualsExprSugg {
eq: __binding_0, semi: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_213 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{"))
});
let __code_214 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_213));
suggestions.push((__binding_1, __code_214));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3290#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
3291pub(crate) struct FunctionBodyEqualsExprSugg {
3292 #[suggestion_part(code = "{{")]
3293 pub eq: Span,
3294 #[suggestion_part(code = " }}")]
3295 pub semi: Span,
3296}
3297
3298#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for BoxNotPat
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BoxNotPat {
span: __binding_0,
kw: __binding_1,
lo: __binding_2,
descr: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_box_not_pat);
let __code_215 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("r#"))
})].into_iter();
;
diag.arg("descr", __binding_3);
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::_subdiag::suggestion, __code_215,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3299#[diag(parse_box_not_pat)]
3300pub(crate) struct BoxNotPat {
3301 #[primary_span]
3302 pub span: Span,
3303 #[note]
3304 pub kw: Span,
3305 #[suggestion(code = "r#", applicability = "maybe-incorrect", style = "verbose")]
3306 pub lo: Span,
3307 pub descr: String,
3308}
3309
3310#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnmatchedAngle
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnmatchedAngle { span: __binding_0, plural: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unmatched_angle);
let __code_216 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("plural", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_216,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3311#[diag(parse_unmatched_angle)]
3312pub(crate) struct UnmatchedAngle {
3313 #[primary_span]
3314 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
3315 pub span: Span,
3316 pub plural: bool,
3317}
3318
3319#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingPlusBounds where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingPlusBounds {
span: __binding_0, hi: __binding_1, sym: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_missing_plus_in_bounds);
let __code_217 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" +"))
})].into_iter();
;
diag.arg("sym", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_217,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3320#[diag(parse_missing_plus_in_bounds)]
3321pub(crate) struct MissingPlusBounds {
3322 #[primary_span]
3323 pub span: Span,
3324 #[suggestion(code = " +", applicability = "maybe-incorrect", style = "verbose")]
3325 pub hi: Span,
3326 pub sym: Symbol,
3327}
3328
3329#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectParensTraitBounds where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectParensTraitBounds {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_incorrect_parens_trait_bounds);
;
diag.span(__binding_0.clone());
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
3330#[diag(parse_incorrect_parens_trait_bounds)]
3331pub(crate) struct IncorrectParensTraitBounds {
3332 #[primary_span]
3333 pub span: Vec<Span>,
3334 #[subdiagnostic]
3335 pub sugg: IncorrectParensTraitBoundsSugg,
3336}
3337
3338#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for IncorrectParensTraitBoundsSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
IncorrectParensTraitBoundsSugg {
wrong_span: __binding_0, new_span: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_218 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" "))
});
let __code_219 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("("))
});
suggestions.push((__binding_0, __code_218));
suggestions.push((__binding_1, __code_219));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_incorrect_parens_trait_bounds_sugg);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3339#[multipart_suggestion(
3340 parse_incorrect_parens_trait_bounds_sugg,
3341 applicability = "machine-applicable"
3342)]
3343pub(crate) struct IncorrectParensTraitBoundsSugg {
3344 #[suggestion_part(code = " ")]
3345 pub wrong_span: Span,
3346 #[suggestion_part(code = "(")]
3347 pub new_span: Span,
3348}
3349
3350#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
KwBadCase<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
KwBadCase {
span: __binding_0, kw: __binding_1, case: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_kw_bad_case);
let __code_220 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
;
diag.arg("kw", __binding_1);
diag.arg("case", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_220,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3351#[diag(parse_kw_bad_case)]
3352pub(crate) struct KwBadCase<'a> {
3353 #[primary_span]
3354 #[suggestion(code = "{kw}", style = "verbose", applicability = "machine-applicable")]
3355 pub span: Span,
3356 pub kw: &'a str,
3357 pub case: Case,
3358}
3359
3360pub(crate) enum Case {
3361 Upper,
3362 Lower,
3363 Mixed,
3364}
3365
3366impl IntoDiagArg for Case {
3367 fn into_diag_arg(self, path: &mut Option<PathBuf>) -> DiagArgValue {
3368 match self {
3369 Case::Upper => "uppercase",
3370 Case::Lower => "lowercase",
3371 Case::Mixed => "the correct case",
3372 }
3373 .into_diag_arg(path)
3374 }
3375}
3376
3377#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnknownBuiltinConstruct where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnknownBuiltinConstruct {
span: __binding_0, name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_unknown_builtin_construct);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3378#[diag(parse_unknown_builtin_construct)]
3379pub(crate) struct UnknownBuiltinConstruct {
3380 #[primary_span]
3381 pub span: Span,
3382 pub name: Ident,
3383}
3384
3385#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedBuiltinIdent where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedBuiltinIdent { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expected_builtin_ident);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3386#[diag(parse_expected_builtin_ident)]
3387pub(crate) struct ExpectedBuiltinIdent {
3388 #[primary_span]
3389 pub span: Span,
3390}
3391
3392#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StaticWithGenerics where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StaticWithGenerics { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_static_with_generics);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3393#[diag(parse_static_with_generics)]
3394pub(crate) struct StaticWithGenerics {
3395 #[primary_span]
3396 pub span: Span,
3397}
3398
3399#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
WhereClauseBeforeConstBody where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
WhereClauseBeforeConstBody {
span: __binding_0,
name: __binding_1,
body: __binding_2,
sugg: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_where_clause_before_const_body);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::parse_name_label);
diag.span_label(__binding_2,
crate::fluent_generated::parse_body_label);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
3400#[diag(parse_where_clause_before_const_body)]
3401pub(crate) struct WhereClauseBeforeConstBody {
3402 #[primary_span]
3403 #[label]
3404 pub span: Span,
3405 #[label(parse_name_label)]
3406 pub name: Span,
3407 #[label(parse_body_label)]
3408 pub body: Span,
3409 #[subdiagnostic]
3410 pub sugg: Option<WhereClauseBeforeConstBodySugg>,
3411}
3412
3413#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for WhereClauseBeforeConstBodySugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
WhereClauseBeforeConstBodySugg {
left: __binding_0, snippet: __binding_1, right: __binding_2
} => {
let mut suggestions = Vec::new();
let __code_221 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("= {0} ", __binding_1))
});
let __code_222 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_221));
suggestions.push((__binding_2, __code_222));
diag.store_args();
diag.arg("snippet", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3414#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
3415pub(crate) struct WhereClauseBeforeConstBodySugg {
3416 #[suggestion_part(code = "= {snippet} ")]
3417 pub left: Span,
3418 pub snippet: String,
3419 #[suggestion_part(code = "")]
3420 pub right: Span,
3421}
3422
3423#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GenericArgsInPatRequireTurbofishSyntax where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericArgsInPatRequireTurbofishSyntax {
span: __binding_0, suggest_turbofish: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_generic_args_in_pat_require_turbofish_syntax);
let __code_223 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("::"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::parse_sugg_turbofish_syntax,
__code_223, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3424#[diag(parse_generic_args_in_pat_require_turbofish_syntax)]
3425pub(crate) struct GenericArgsInPatRequireTurbofishSyntax {
3426 #[primary_span]
3427 pub span: Span,
3428 #[suggestion(
3429 parse_sugg_turbofish_syntax,
3430 style = "verbose",
3431 code = "::",
3432 applicability = "maybe-incorrect"
3433 )]
3434 pub suggest_turbofish: Span,
3435}
3436
3437#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
TransposeDynOrImpl<'a> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TransposeDynOrImpl {
span: __binding_0, kw: __binding_1, sugg: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_transpose_dyn_or_impl);
;
diag.arg("kw", __binding_1);
diag.span(__binding_0);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
3438#[diag(parse_transpose_dyn_or_impl)]
3439pub(crate) struct TransposeDynOrImpl<'a> {
3440 #[primary_span]
3441 pub span: Span,
3442 pub kw: &'a str,
3443 #[subdiagnostic]
3444 pub sugg: TransposeDynOrImplSugg<'a>,
3445}
3446
3447#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for TransposeDynOrImplSugg<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TransposeDynOrImplSugg {
removal_span: __binding_0,
insertion_span: __binding_1,
kw: __binding_2 } => {
let mut suggestions = Vec::new();
let __code_224 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
let __code_225 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0} ", __binding_2))
});
suggestions.push((__binding_0, __code_224));
suggestions.push((__binding_1, __code_225));
diag.store_args();
diag.arg("kw", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3448#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
3449pub(crate) struct TransposeDynOrImplSugg<'a> {
3450 #[suggestion_part(code = "")]
3451 pub removal_span: Span,
3452 #[suggestion_part(code = "{kw} ")]
3453 pub insertion_span: Span,
3454 pub kw: &'a str,
3455}
3456
3457#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ArrayIndexInOffsetOf where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ArrayIndexInOffsetOf(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_array_index_offset_of);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3458#[diag(parse_array_index_offset_of)]
3459pub(crate) struct ArrayIndexInOffsetOf(#[primary_span] pub Span);
3460
3461#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidOffsetOf where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidOffsetOf(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_invalid_offset_of);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3462#[diag(parse_invalid_offset_of)]
3463pub(crate) struct InvalidOffsetOf(#[primary_span] pub Span);
3464
3465#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AsyncImpl
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncImpl { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_async_impl);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3466#[diag(parse_async_impl)]
3467pub(crate) struct AsyncImpl {
3468 #[primary_span]
3469 pub span: Span,
3470}
3471
3472#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ExprRArrowCall
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExprRArrowCall { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_expr_rarrow_call);
let __code_226 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("."))
})].into_iter();
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_226,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3473#[diag(parse_expr_rarrow_call)]
3474#[help]
3475pub(crate) struct ExprRArrowCall {
3476 #[primary_span]
3477 #[suggestion(style = "verbose", applicability = "machine-applicable", code = ".")]
3478 pub span: Span,
3479}
3480
3481#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DotDotRangeAttribute where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DotDotRangeAttribute { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_dot_dot_range_attribute);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3482#[diag(parse_dot_dot_range_attribute)]
3483pub(crate) struct DotDotRangeAttribute {
3484 #[primary_span]
3485 pub span: Span,
3486}
3487
3488#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BinderBeforeModifiers where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BinderBeforeModifiers {
binder_span: __binding_0, modifiers_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_binder_before_modifiers);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3489#[diag(parse_binder_before_modifiers)]
3490pub(crate) struct BinderBeforeModifiers {
3491 #[primary_span]
3492 pub binder_span: Span,
3493 #[label]
3494 pub modifiers_span: Span,
3495}
3496
3497#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BinderAndPolarity where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BinderAndPolarity {
polarity_span: __binding_0,
binder_span: __binding_1,
polarity: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_binder_and_polarity);
;
diag.arg("polarity", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3498#[diag(parse_binder_and_polarity)]
3499pub(crate) struct BinderAndPolarity {
3500 #[primary_span]
3501 pub polarity_span: Span,
3502 #[label]
3503 pub binder_span: Span,
3504 pub polarity: &'static str,
3505}
3506
3507#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PolarityAndModifiers where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PolarityAndModifiers {
polarity_span: __binding_0,
modifiers_span: __binding_1,
polarity: __binding_2,
modifiers_concatenated: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_modifiers_and_polarity);
;
diag.arg("polarity", __binding_2);
diag.arg("modifiers_concatenated", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3508#[diag(parse_modifiers_and_polarity)]
3509pub(crate) struct PolarityAndModifiers {
3510 #[primary_span]
3511 pub polarity_span: Span,
3512 #[label]
3513 pub modifiers_span: Span,
3514 pub polarity: &'static str,
3515 pub modifiers_concatenated: String,
3516}
3517
3518#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectTypeOnSelf where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectTypeOnSelf {
span: __binding_0, move_self_modifier: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_incorrect_type_on_self);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
3519#[diag(parse_incorrect_type_on_self)]
3520pub(crate) struct IncorrectTypeOnSelf {
3521 #[primary_span]
3522 pub span: Span,
3523 #[subdiagnostic]
3524 pub move_self_modifier: MoveSelfModifier,
3525}
3526
3527#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MoveSelfModifier {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MoveSelfModifier {
removal_span: __binding_0,
insertion_span: __binding_1,
modifier: __binding_2 } => {
let mut suggestions = Vec::new();
let __code_227 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
let __code_228 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
});
suggestions.push((__binding_0, __code_227));
suggestions.push((__binding_1, __code_228));
diag.store_args();
diag.arg("modifier", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3528#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
3529pub(crate) struct MoveSelfModifier {
3530 #[suggestion_part(code = "")]
3531 pub removal_span: Span,
3532 #[suggestion_part(code = "{modifier}")]
3533 pub insertion_span: Span,
3534 pub modifier: String,
3535}
3536
3537#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
AsmUnsupportedOperand<'a> where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsmUnsupportedOperand {
span: __binding_0,
symbol: __binding_1,
macro_name: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_unsupported_operand);
;
diag.arg("symbol", __binding_1);
diag.arg("macro_name", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3538#[diag(parse_asm_unsupported_operand)]
3539pub(crate) struct AsmUnsupportedOperand<'a> {
3540 #[primary_span]
3541 #[label]
3542 pub(crate) span: Span,
3543 pub(crate) symbol: &'a str,
3544 pub(crate) macro_name: &'static str,
3545}
3546
3547#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsmUnderscoreInput where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsmUnderscoreInput { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_underscore_input);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3548#[diag(parse_asm_underscore_input)]
3549pub(crate) struct AsmUnderscoreInput {
3550 #[primary_span]
3551 pub(crate) span: Span,
3552}
3553
3554#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AsmSymNoPath
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsmSymNoPath { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_sym_no_path);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3555#[diag(parse_asm_sym_no_path)]
3556pub(crate) struct AsmSymNoPath {
3557 #[primary_span]
3558 pub(crate) span: Span,
3559}
3560
3561#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsmRequiresTemplate where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsmRequiresTemplate { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_requires_template);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3562#[diag(parse_asm_requires_template)]
3563pub(crate) struct AsmRequiresTemplate {
3564 #[primary_span]
3565 pub(crate) span: Span,
3566}
3567
3568#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsmExpectedComma where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsmExpectedComma { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_expected_comma);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3569#[diag(parse_asm_expected_comma)]
3570pub(crate) struct AsmExpectedComma {
3571 #[primary_span]
3572 #[label]
3573 pub(crate) span: Span,
3574}
3575
3576#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsmExpectedOther where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsmExpectedOther {
span: __binding_0, is_inline_asm: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_expected_other);
;
diag.arg("is_inline_asm", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::parse_asm_expected_other);
diag
}
}
}
}
};Diagnostic)]
3577#[diag(parse_asm_expected_other)]
3578pub(crate) struct AsmExpectedOther {
3579 #[primary_span]
3580 #[label(parse_asm_expected_other)]
3581 pub(crate) span: Span,
3582 pub(crate) is_inline_asm: bool,
3583}
3584
3585#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for NonABI where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NonABI { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_non_abi);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3586#[diag(parse_asm_non_abi)]
3587pub(crate) struct NonABI {
3588 #[primary_span]
3589 pub(crate) span: Span,
3590}
3591
3592#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsmExpectedStringLiteral where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsmExpectedStringLiteral { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_expected_string_literal);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
3593#[diag(parse_asm_expected_string_literal)]
3594pub(crate) struct AsmExpectedStringLiteral {
3595 #[primary_span]
3596 #[label]
3597 pub(crate) span: Span,
3598}
3599
3600#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedRegisterClassOrExplicitRegister where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedRegisterClassOrExplicitRegister { span: __binding_0
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_asm_expected_register_class_or_explicit_register);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3601#[diag(parse_asm_expected_register_class_or_explicit_register)]
3602pub(crate) struct ExpectedRegisterClassOrExplicitRegister {
3603 #[primary_span]
3604 pub(crate) span: Span,
3605}
3606
3607#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
HiddenUnicodeCodepointsDiag {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
HiddenUnicodeCodepointsDiag {
label: __binding_0,
count: __binding_1,
span_label: __binding_2,
labels: __binding_3,
sub: __binding_4 } => {
diag.primary_message(crate::fluent_generated::parse_hidden_unicode_codepoints);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("label", __binding_0);
diag.arg("count", __binding_1);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag.subdiagnostic(__binding_4);
diag
}
};
}
}
};LintDiagnostic)]
3608#[diag(parse_hidden_unicode_codepoints)]
3609#[note]
3610pub(crate) struct HiddenUnicodeCodepointsDiag {
3611 pub label: String,
3612 pub count: usize,
3613 #[label]
3614 pub span_label: Span,
3615 #[subdiagnostic]
3616 pub labels: Option<HiddenUnicodeCodepointsDiagLabels>,
3617 #[subdiagnostic]
3618 pub sub: HiddenUnicodeCodepointsDiagSub,
3619}
3620
3621pub(crate) struct HiddenUnicodeCodepointsDiagLabels {
3622 pub spans: Vec<(char, Span)>,
3623}
3624
3625impl Subdiagnostic for HiddenUnicodeCodepointsDiagLabels {
3626 fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
3627 for (c, span) in self.spans {
3628 diag.span_label(span, ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0:?}", c))
})format!("{c:?}"));
3629 }
3630 }
3631}
3632
3633pub(crate) enum HiddenUnicodeCodepointsDiagSub {
3634 Escape { spans: Vec<(char, Span)> },
3635 NoEscape { spans: Vec<(char, Span)> },
3636}
3637
3638impl Subdiagnostic for HiddenUnicodeCodepointsDiagSub {
3640 fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
3641 match self {
3642 HiddenUnicodeCodepointsDiagSub::Escape { spans } => {
3643 diag.multipart_suggestion_with_style(
3644 fluent::parse_suggestion_remove,
3645 spans.iter().map(|(_, span)| (*span, "".to_string())).collect(),
3646 Applicability::MachineApplicable,
3647 SuggestionStyle::HideCodeAlways,
3648 );
3649 diag.multipart_suggestion(
3650 fluent::parse_suggestion_escape,
3651 spans
3652 .into_iter()
3653 .map(|(c, span)| {
3654 let c = ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0:?}", c))
})format!("{c:?}");
3655 (span, c[1..c.len() - 1].to_string())
3656 })
3657 .collect(),
3658 Applicability::MachineApplicable,
3659 );
3660 }
3661 HiddenUnicodeCodepointsDiagSub::NoEscape { spans } => {
3662 diag.arg(
3666 "escaped",
3667 spans
3668 .into_iter()
3669 .map(|(c, _)| ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0:?}", c))
})format!("{c:?}"))
3670 .collect::<Vec<String>>()
3671 .join(", "),
3672 );
3673 diag.note(fluent::parse_suggestion_remove);
3674 diag.note(fluent::parse_no_suggestion_note_escape);
3675 }
3676 }
3677 }
3678}
3679
3680#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
VarargsWithoutPattern {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
VarargsWithoutPattern { span: __binding_0 } => {
diag.primary_message(crate::fluent_generated::parse_varargs_without_pattern);
;
let __code_229 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("_: ..."))
})].into_iter();
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_229,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
};
}
}
};LintDiagnostic)]
3681#[diag(parse_varargs_without_pattern)]
3682pub(crate) struct VarargsWithoutPattern {
3683 #[suggestion(code = "_: ...", applicability = "machine-applicable")]
3684 pub span: Span,
3685}
3686
3687#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ImplReuseInherentImpl where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ImplReuseInherentImpl { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_delegation_non_trait_impl_reuse);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
3688#[diag(parse_delegation_non_trait_impl_reuse)]
3689pub(crate) struct ImplReuseInherentImpl {
3690 #[primary_span]
3691 pub span: Span,
3692}
3693
3694#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StructLiteralPlaceholderPath where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StructLiteralPlaceholderPath { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_struct_literal_placeholder_path);
let __code_230 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("/* Type */"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_230,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3695#[diag(parse_struct_literal_placeholder_path)]
3696pub(crate) struct StructLiteralPlaceholderPath {
3697 #[primary_span]
3698 #[label]
3699 #[suggestion(applicability = "has-placeholders", code = "/* Type */", style = "verbose")]
3700 pub span: Span,
3701}
3702
3703#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StructLiteralWithoutPathLate where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StructLiteralWithoutPathLate {
span: __binding_0, suggestion_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::parse_struct_literal_body_without_path_late);
let __code_231 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("/* Type */ "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_231,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
3704#[diag(parse_struct_literal_body_without_path_late)]
3705pub(crate) struct StructLiteralWithoutPathLate {
3706 #[primary_span]
3707 #[label]
3708 pub span: Span,
3709 #[suggestion(applicability = "has-placeholders", code = "/* Type */ ", style = "verbose")]
3710 pub suggestion_span: Span,
3711}
3712
3713#[derive(#[automatically_derived]
impl ::core::clone::Clone for ForbiddenLetReason {
#[inline]
fn clone(&self) -> ForbiddenLetReason {
let _: ::core::clone::AssertParamIsClone<Span>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for ForbiddenLetReason { }Copy, const _: () =
{
impl rustc_errors::Subdiagnostic for ForbiddenLetReason {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ForbiddenLetReason::OtherForbidden => {}
ForbiddenLetReason::NotSupportedOr(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_not_supported_or);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
ForbiddenLetReason::NotSupportedParentheses(__binding_0) =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_not_supported_parentheses);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
3715pub(crate) enum ForbiddenLetReason {
3716 OtherForbidden,
3718 #[note(parse_not_supported_or)]
3720 NotSupportedOr(#[primary_span] Span),
3721 #[note(parse_not_supported_parentheses)]
3726 NotSupportedParentheses(#[primary_span] Span),
3727}
3728
3729#[derive(#[automatically_derived]
impl ::core::fmt::Debug for MisspelledKw {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "MisspelledKw",
"similar_kw", &self.similar_kw, "span", &self.span,
"is_incorrect_case", &&self.is_incorrect_case)
}
}Debug, const _: () =
{
impl rustc_errors::Subdiagnostic for MisspelledKw {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MisspelledKw {
similar_kw: __binding_0,
span: __binding_1,
is_incorrect_case: __binding_2 } => {
let __code_232 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_0))
})].into_iter();
diag.store_args();
diag.arg("similar_kw", __binding_0);
diag.arg("is_incorrect_case", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::parse_misspelled_kw);
diag.span_suggestions_with_style(__binding_1, __message,
__code_232, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};rustc_macros::Subdiagnostic)]
3730#[suggestion(
3731 parse_misspelled_kw,
3732 applicability = "machine-applicable",
3733 code = "{similar_kw}",
3734 style = "verbose"
3735)]
3736pub(crate) struct MisspelledKw {
3737 pub similar_kw: String,
3740 #[primary_span]
3741 pub span: Span,
3742 pub is_incorrect_case: bool,
3743}
3744
3745#[derive(#[automatically_derived]
impl ::core::clone::Clone for TokenDescription {
#[inline]
fn clone(&self) -> TokenDescription {
let _: ::core::clone::AssertParamIsClone<MetaVarKind>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for TokenDescription { }Copy, #[automatically_derived]
impl ::core::fmt::Debug for TokenDescription {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
TokenDescription::ReservedIdentifier =>
::core::fmt::Formatter::write_str(f, "ReservedIdentifier"),
TokenDescription::Keyword =>
::core::fmt::Formatter::write_str(f, "Keyword"),
TokenDescription::ReservedKeyword =>
::core::fmt::Formatter::write_str(f, "ReservedKeyword"),
TokenDescription::DocComment =>
::core::fmt::Formatter::write_str(f, "DocComment"),
TokenDescription::MetaVar(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"MetaVar", &__self_0),
}
}
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for TokenDescription {
#[inline]
fn eq(&self, other: &TokenDescription) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr &&
match (self, other) {
(TokenDescription::MetaVar(__self_0),
TokenDescription::MetaVar(__arg1_0)) =>
__self_0 == __arg1_0,
_ => true,
}
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for TokenDescription {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<MetaVarKind>;
}
}Eq)]
3746pub(super) enum TokenDescription {
3747 ReservedIdentifier,
3748 Keyword,
3749 ReservedKeyword,
3750 DocComment,
3751
3752 MetaVar(MetaVarKind),
3757}
3758
3759impl TokenDescription {
3760 pub(super) fn from_token(token: &Token) -> Option<Self> {
3761 match token.kind {
3762 _ if token.is_special_ident() => Some(TokenDescription::ReservedIdentifier),
3763 _ if token.is_used_keyword() => Some(TokenDescription::Keyword),
3764 _ if token.is_unused_keyword() => Some(TokenDescription::ReservedKeyword),
3765 token::DocComment(..) => Some(TokenDescription::DocComment),
3766 token::OpenInvisible(InvisibleOrigin::MetaVar(kind)) => {
3767 Some(TokenDescription::MetaVar(kind))
3768 }
3769 _ => None,
3770 }
3771 }
3772}