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