1use rustc_errors::DiagArgFromDisplay;
2use rustc_errors::codes::*;
3use rustc_macros::{Diagnostic, Subdiagnostic};
4use rustc_span::{Ident, Span, Symbol};
5
6#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GenericTypeWithParentheses where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericTypeWithParentheses {
span: __binding_0, sub: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_generic_type_with_parentheses);
diag.code(E0214);
;
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)]
7#[diag(ast_lowering_generic_type_with_parentheses, code = E0214)]
8pub(crate) struct GenericTypeWithParentheses {
9 #[primary_span]
10 #[label]
11 pub span: Span,
12 #[subdiagnostic]
13 pub sub: Option<UseAngleBrackets>,
14}
15
16#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UseAngleBrackets {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UseAngleBrackets {
open_param: __binding_0, close_param: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_0 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("<"))
});
let __code_1 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(">"))
});
suggestions.push((__binding_0, __code_0));
suggestions.push((__binding_1, __code_1));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_lowering_use_angle_brackets);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
17#[multipart_suggestion(ast_lowering_use_angle_brackets, applicability = "maybe-incorrect")]
18pub(crate) struct UseAngleBrackets {
19 #[suggestion_part(code = "<")]
20 pub open_param: Span,
21 #[suggestion_part(code = ">")]
22 pub close_param: Span,
23}
24
25#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InvalidAbi
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidAbi {
span: __binding_0,
abi: __binding_1,
command: __binding_2,
suggestion: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_abi);
diag.code(E0703);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("abi", __binding_1);
diag.arg("command", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
26#[diag(ast_lowering_invalid_abi, code = E0703)]
27#[note]
28pub(crate) struct InvalidAbi {
29 #[primary_span]
30 #[label]
31 pub span: Span,
32 pub abi: Symbol,
33 pub command: String,
34 #[subdiagnostic]
35 pub suggestion: Option<InvalidAbiSuggestion>,
36}
37
38#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TupleStructWithDefault where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TupleStructWithDefault { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_default_field_in_tuple);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
39#[diag(ast_lowering_default_field_in_tuple)]
40pub(crate) struct TupleStructWithDefault {
41 #[primary_span]
42 #[label]
43 pub span: Span,
44}
45
46#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for InvalidAbiSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
InvalidAbiSuggestion {
span: __binding_0, suggestion: __binding_1 } => {
let __code_2 =
[::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::ast_lowering_invalid_abi_suggestion);
diag.span_suggestions_with_style(__binding_0, __message,
__code_2, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
47#[suggestion(
48 ast_lowering_invalid_abi_suggestion,
49 code = "\"{suggestion}\"",
50 applicability = "maybe-incorrect",
51 style = "verbose"
52)]
53pub(crate) struct InvalidAbiSuggestion {
54 #[primary_span]
55 pub span: Span,
56 pub suggestion: String,
57}
58
59#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AssocTyParentheses where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AssocTyParentheses { span: __binding_0, sub: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_assoc_ty_parentheses);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
60#[diag(ast_lowering_assoc_ty_parentheses)]
61pub(crate) struct AssocTyParentheses {
62 #[primary_span]
63 pub span: Span,
64 #[subdiagnostic]
65 pub sub: AssocTyParenthesesSub,
66}
67
68#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AssocTyParenthesesSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AssocTyParenthesesSub::Empty { parentheses_span: __binding_0
} => {
let mut suggestions = Vec::new();
let __code_3 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_3));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_lowering_remove_parentheses);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::Unspecified,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
AssocTyParenthesesSub::NotEmpty {
open_param: __binding_0, close_param: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_4 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("<"))
});
let __code_5 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(">"))
});
suggestions.push((__binding_0, __code_4));
suggestions.push((__binding_1, __code_5));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_lowering_use_angle_brackets);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::Unspecified,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
69pub(crate) enum AssocTyParenthesesSub {
70 #[multipart_suggestion(ast_lowering_remove_parentheses)]
71 Empty {
72 #[suggestion_part(code = "")]
73 parentheses_span: Span,
74 },
75 #[multipart_suggestion(ast_lowering_use_angle_brackets)]
76 NotEmpty {
77 #[suggestion_part(code = "<")]
78 open_param: Span,
79 #[suggestion_part(code = ">")]
80 close_param: Span,
81 },
82}
83
84#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MisplacedImplTrait<'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 {
MisplacedImplTrait {
span: __binding_0, position: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_misplaced_impl_trait);
diag.code(E0562);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("position", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
85#[diag(ast_lowering_misplaced_impl_trait, code = E0562)]
86#[note]
87pub(crate) struct MisplacedImplTrait<'a> {
88 #[primary_span]
89 pub span: Span,
90 pub position: DiagArgFromDisplay<'a>,
91}
92
93#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MisplacedAssocTyBinding where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MisplacedAssocTyBinding {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_assoc_ty_binding_in_dyn);
let __code_6 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" = impl"))
})].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_6,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
}
diag
}
}
}
}
};Diagnostic)]
94#[diag(ast_lowering_assoc_ty_binding_in_dyn)]
95pub(crate) struct MisplacedAssocTyBinding {
96 #[primary_span]
97 pub span: Span,
98 #[suggestion(code = " = impl", applicability = "maybe-incorrect", style = "verbose")]
99 pub suggestion: Option<Span>,
100}
101
102#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnderscoreExprLhsAssign where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnderscoreExprLhsAssign { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_underscore_expr_lhs_assign);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
103#[diag(ast_lowering_underscore_expr_lhs_assign)]
104pub(crate) struct UnderscoreExprLhsAssign {
105 #[primary_span]
106 #[label]
107 pub span: Span,
108}
109
110#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AwaitOnlyInAsyncFnAndBlocks where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AwaitOnlyInAsyncFnAndBlocks {
await_kw_span: __binding_0, item_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_await_only_in_async_fn_and_blocks);
diag.code(E0728);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_1) = __binding_1 {
diag.span_label(__binding_1,
crate::fluent_generated::ast_lowering_this_not_async);
}
diag
}
}
}
}
};Diagnostic)]
111#[diag(ast_lowering_await_only_in_async_fn_and_blocks, code = E0728)]
112pub(crate) struct AwaitOnlyInAsyncFnAndBlocks {
113 #[primary_span]
114 #[label]
115 pub await_kw_span: Span,
116 #[label(ast_lowering_this_not_async)]
117 pub item_span: Option<Span>,
118}
119
120#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CoroutineTooManyParameters where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CoroutineTooManyParameters { fn_decl_span: __binding_0 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_coroutine_too_many_parameters);
diag.code(E0628);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
121#[diag(ast_lowering_coroutine_too_many_parameters, code = E0628)]
122pub(crate) struct CoroutineTooManyParameters {
123 #[primary_span]
124 pub fn_decl_span: Span,
125}
126
127#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ClosureCannotBeStatic where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ClosureCannotBeStatic { fn_decl_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_closure_cannot_be_static);
diag.code(E0697);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
128#[diag(ast_lowering_closure_cannot_be_static, code = E0697)]
129pub(crate) struct ClosureCannotBeStatic {
130 #[primary_span]
131 pub fn_decl_span: Span,
132}
133
134#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FunctionalRecordUpdateDestructuringAssignment where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FunctionalRecordUpdateDestructuringAssignment {
span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_functional_record_update_destructuring_assignment);
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::_subdiag::suggestion, __code_7,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
135#[diag(ast_lowering_functional_record_update_destructuring_assignment)]
136pub(crate) struct FunctionalRecordUpdateDestructuringAssignment {
137 #[primary_span]
138 #[suggestion(code = "", applicability = "machine-applicable")]
139 pub span: Span,
140}
141
142#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncCoroutinesNotSupported where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncCoroutinesNotSupported { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_async_coroutines_not_supported);
diag.code(E0727);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
143#[diag(ast_lowering_async_coroutines_not_supported, code = E0727)]
144pub(crate) struct AsyncCoroutinesNotSupported {
145 #[primary_span]
146 pub span: Span,
147}
148
149#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InlineAsmUnsupportedTarget where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InlineAsmUnsupportedTarget { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_inline_asm_unsupported_target);
diag.code(E0472);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
150#[diag(ast_lowering_inline_asm_unsupported_target, code = E0472)]
151pub(crate) struct InlineAsmUnsupportedTarget {
152 #[primary_span]
153 pub span: Span,
154}
155
156#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttSyntaxOnlyX86 where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttSyntaxOnlyX86 { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_att_syntax_only_x86);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
157#[diag(ast_lowering_att_syntax_only_x86)]
158pub(crate) struct AttSyntaxOnlyX86 {
159 #[primary_span]
160 pub span: Span,
161}
162
163#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiSpecifiedMultipleTimes where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiSpecifiedMultipleTimes {
abi_span: __binding_0,
prev_name: __binding_1,
prev_span: __binding_2,
equivalent: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_abi_specified_multiple_times);
;
diag.arg("prev_name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
if __binding_3 {
diag.note(crate::fluent_generated::_subdiag::note);
}
diag
}
}
}
}
};Diagnostic)]
164#[diag(ast_lowering_abi_specified_multiple_times)]
165pub(crate) struct AbiSpecifiedMultipleTimes {
166 #[primary_span]
167 pub abi_span: Span,
168 pub prev_name: Symbol,
169 #[label]
170 pub prev_span: Span,
171 #[note]
172 pub equivalent: bool,
173}
174
175#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ClobberAbiNotSupported where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ClobberAbiNotSupported { abi_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_clobber_abi_not_supported);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
176#[diag(ast_lowering_clobber_abi_not_supported)]
177pub(crate) struct ClobberAbiNotSupported {
178 #[primary_span]
179 pub abi_span: Span,
180}
181
182#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidAbiClobberAbi where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidAbiClobberAbi {
abi_span: __binding_0, supported_abis: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_abi_clobber_abi);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("supported_abis", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
183#[note]
184#[diag(ast_lowering_invalid_abi_clobber_abi)]
185pub(crate) struct InvalidAbiClobberAbi {
186 #[primary_span]
187 pub abi_span: Span,
188 pub supported_abis: String,
189}
190
191#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidRegister<'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 {
InvalidRegister {
op_span: __binding_0, reg: __binding_1, error: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_register);
;
diag.arg("reg", __binding_1);
diag.arg("error", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
192#[diag(ast_lowering_invalid_register)]
193pub(crate) struct InvalidRegister<'a> {
194 #[primary_span]
195 pub op_span: Span,
196 pub reg: Symbol,
197 pub error: &'a str,
198}
199
200#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidRegisterClass where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidRegisterClass {
op_span: __binding_0,
reg_class: __binding_1,
supported_register_classes: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_register_class);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("reg_class", __binding_1);
diag.arg("supported_register_classes", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
201#[note]
202#[diag(ast_lowering_invalid_register_class)]
203pub(crate) struct InvalidRegisterClass {
204 #[primary_span]
205 pub op_span: Span,
206 pub reg_class: Symbol,
207 pub supported_register_classes: String,
208}
209
210#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidAsmTemplateModifierRegClass where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidAsmTemplateModifierRegClass {
placeholder_span: __binding_0,
op_span: __binding_1,
sub: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_asm_template_modifier_reg_class);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::ast_lowering_template_modifier);
diag.span_label(__binding_1,
crate::fluent_generated::ast_lowering_argument);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
211#[diag(ast_lowering_invalid_asm_template_modifier_reg_class)]
212pub(crate) struct InvalidAsmTemplateModifierRegClass {
213 #[primary_span]
214 #[label(ast_lowering_template_modifier)]
215 pub placeholder_span: Span,
216 #[label(ast_lowering_argument)]
217 pub op_span: Span,
218 #[subdiagnostic]
219 pub sub: InvalidAsmTemplateModifierRegClassSub,
220}
221
222#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
InvalidAsmTemplateModifierRegClassSub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
InvalidAsmTemplateModifierRegClassSub::SupportModifier {
class_name: __binding_0, modifiers: __binding_1 } => {
diag.store_args();
diag.arg("class_name", __binding_0);
diag.arg("modifiers", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_lowering_support_modifiers);
diag.note(__message);
diag.restore_args();
}
InvalidAsmTemplateModifierRegClassSub::DoesNotSupportModifier {
class_name: __binding_0 } => {
diag.store_args();
diag.arg("class_name", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_lowering_does_not_support_modifiers);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
223pub(crate) enum InvalidAsmTemplateModifierRegClassSub {
224 #[note(ast_lowering_support_modifiers)]
225 SupportModifier { class_name: Symbol, modifiers: String },
226 #[note(ast_lowering_does_not_support_modifiers)]
227 DoesNotSupportModifier { class_name: Symbol },
228}
229
230#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidAsmTemplateModifierConst where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidAsmTemplateModifierConst {
placeholder_span: __binding_0, op_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_asm_template_modifier_const);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::ast_lowering_template_modifier);
diag.span_label(__binding_1,
crate::fluent_generated::ast_lowering_argument);
diag
}
}
}
}
};Diagnostic)]
231#[diag(ast_lowering_invalid_asm_template_modifier_const)]
232pub(crate) struct InvalidAsmTemplateModifierConst {
233 #[primary_span]
234 #[label(ast_lowering_template_modifier)]
235 pub placeholder_span: Span,
236 #[label(ast_lowering_argument)]
237 pub op_span: Span,
238}
239
240#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidAsmTemplateModifierSym where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidAsmTemplateModifierSym {
placeholder_span: __binding_0, op_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_asm_template_modifier_sym);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::ast_lowering_template_modifier);
diag.span_label(__binding_1,
crate::fluent_generated::ast_lowering_argument);
diag
}
}
}
}
};Diagnostic)]
241#[diag(ast_lowering_invalid_asm_template_modifier_sym)]
242pub(crate) struct InvalidAsmTemplateModifierSym {
243 #[primary_span]
244 #[label(ast_lowering_template_modifier)]
245 pub placeholder_span: Span,
246 #[label(ast_lowering_argument)]
247 pub op_span: Span,
248}
249
250#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidAsmTemplateModifierLabel where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidAsmTemplateModifierLabel {
placeholder_span: __binding_0, op_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_asm_template_modifier_label);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::ast_lowering_template_modifier);
diag.span_label(__binding_1,
crate::fluent_generated::ast_lowering_argument);
diag
}
}
}
}
};Diagnostic)]
251#[diag(ast_lowering_invalid_asm_template_modifier_label)]
252pub(crate) struct InvalidAsmTemplateModifierLabel {
253 #[primary_span]
254 #[label(ast_lowering_template_modifier)]
255 pub placeholder_span: Span,
256 #[label(ast_lowering_argument)]
257 pub op_span: Span,
258}
259
260#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RegisterClassOnlyClobber where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RegisterClassOnlyClobber {
op_span: __binding_0, reg_class_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_register_class_only_clobber);
;
diag.arg("reg_class_name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
261#[diag(ast_lowering_register_class_only_clobber)]
262pub(crate) struct RegisterClassOnlyClobber {
263 #[primary_span]
264 pub op_span: Span,
265 pub reg_class_name: Symbol,
266}
267
268#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RegisterClassOnlyClobberStable where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RegisterClassOnlyClobberStable {
op_span: __binding_0, reg_class_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_register_class_only_clobber_stable);
;
diag.arg("reg_class_name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
269#[diag(ast_lowering_register_class_only_clobber_stable)]
270pub(crate) struct RegisterClassOnlyClobberStable {
271 #[primary_span]
272 pub op_span: Span,
273 pub reg_class_name: Symbol,
274}
275
276#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
RegisterConflict<'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 {
RegisterConflict {
op_span1: __binding_0,
op_span2: __binding_1,
reg1_name: __binding_2,
reg2_name: __binding_3,
in_out: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_register_conflict);
;
diag.arg("reg1_name", __binding_2);
diag.arg("reg2_name", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::ast_lowering_register1);
diag.span_label(__binding_1,
crate::fluent_generated::ast_lowering_register2);
if let Some(__binding_4) = __binding_4 {
diag.span_help(__binding_4,
crate::fluent_generated::_subdiag::help);
}
diag
}
}
}
}
};Diagnostic)]
277#[diag(ast_lowering_register_conflict)]
278pub(crate) struct RegisterConflict<'a> {
279 #[primary_span]
280 #[label(ast_lowering_register1)]
281 pub op_span1: Span,
282 #[label(ast_lowering_register2)]
283 pub op_span2: Span,
284 pub reg1_name: &'a str,
285 pub reg2_name: &'a str,
286 #[help]
287 pub in_out: Option<Span>,
288}
289
290#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
SubTupleBinding<'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 {
SubTupleBinding {
span: __binding_0,
ident: __binding_1,
ident_name: __binding_2,
ctx: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_sub_tuple_binding);
let __code_8 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(".."))
})].into_iter();
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("ident", __binding_1);
diag.arg("ident_name", __binding_2);
diag.arg("ctx", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::ast_lowering_sub_tuple_binding_suggestion,
__code_8, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
291#[help]
292#[diag(ast_lowering_sub_tuple_binding)]
293pub(crate) struct SubTupleBinding<'a> {
294 #[primary_span]
295 #[label]
296 #[suggestion(
297 ast_lowering_sub_tuple_binding_suggestion,
298 style = "verbose",
299 code = "..",
300 applicability = "maybe-incorrect"
301 )]
302 pub span: Span,
303 pub ident: Ident,
304 pub ident_name: Symbol,
305 pub ctx: &'a str,
306}
307
308#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
ExtraDoubleDot<'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 {
ExtraDoubleDot {
span: __binding_0, prev_span: __binding_1, ctx: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_extra_double_dot);
;
diag.arg("ctx", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::ast_lowering_previously_used_here);
diag
}
}
}
}
};Diagnostic)]
309#[diag(ast_lowering_extra_double_dot)]
310pub(crate) struct ExtraDoubleDot<'a> {
311 #[primary_span]
312 #[label]
313 pub span: Span,
314 #[label(ast_lowering_previously_used_here)]
315 pub prev_span: Span,
316 pub ctx: &'a str,
317}
318
319#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MisplacedDoubleDot where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MisplacedDoubleDot { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_misplaced_double_dot);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
320#[note]
321#[diag(ast_lowering_misplaced_double_dot)]
322pub(crate) struct MisplacedDoubleDot {
323 #[primary_span]
324 pub span: Span,
325}
326
327#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MatchArmWithNoBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MatchArmWithNoBody {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_match_arm_with_no_body);
let __code_9 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" => todo!(),"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_9,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
328#[diag(ast_lowering_match_arm_with_no_body)]
329pub(crate) struct MatchArmWithNoBody {
330 #[primary_span]
331 pub span: Span,
332 #[suggestion(code = " => todo!(),", applicability = "has-placeholders")]
333 pub suggestion: Span,
334}
335
336#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NeverPatternWithBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NeverPatternWithBody { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_never_pattern_with_body);
let __code_10 =
[::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_0,
crate::fluent_generated::_subdiag::suggestion, __code_10,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
337#[diag(ast_lowering_never_pattern_with_body)]
338pub(crate) struct NeverPatternWithBody {
339 #[primary_span]
340 #[label]
341 #[suggestion(code = "", applicability = "maybe-incorrect")]
342 pub span: Span,
343}
344
345#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NeverPatternWithGuard where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NeverPatternWithGuard { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_never_pattern_with_guard);
let __code_11 =
[::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_11,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
346#[diag(ast_lowering_never_pattern_with_guard)]
347pub(crate) struct NeverPatternWithGuard {
348 #[primary_span]
349 #[suggestion(code = "", applicability = "maybe-incorrect")]
350 pub span: Span,
351}
352
353#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ArbitraryExpressionInPattern where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ArbitraryExpressionInPattern {
span: __binding_0,
pattern_from_macro_note: __binding_1,
const_block_in_pattern_help: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_arbitrary_expression_in_pattern);
;
diag.span(__binding_0);
if __binding_1 {
diag.note(crate::fluent_generated::ast_lowering_pattern_from_macro_note);
}
if __binding_2 {
diag.help(crate::fluent_generated::ast_lowering_const_block_in_pattern_help);
}
diag
}
}
}
}
};Diagnostic)]
354#[diag(ast_lowering_arbitrary_expression_in_pattern)]
355pub(crate) struct ArbitraryExpressionInPattern {
356 #[primary_span]
357 pub span: Span,
358 #[note(ast_lowering_pattern_from_macro_note)]
359 pub pattern_from_macro_note: bool,
360 #[help(ast_lowering_const_block_in_pattern_help)]
361 pub const_block_in_pattern_help: bool,
362}
363
364#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InclusiveRangeWithNoEnd where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InclusiveRangeWithNoEnd { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_inclusive_range_with_no_end);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
365#[diag(ast_lowering_inclusive_range_with_no_end)]
366pub(crate) struct InclusiveRangeWithNoEnd {
367 #[primary_span]
368 pub span: Span,
369}
370
371#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for RTNSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
RTNSuggestion { output: __binding_0, input: __binding_1 } =>
{
let mut suggestions = Vec::new();
let __code_12 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
let __code_13 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("(..)"))
});
suggestions.push((__binding_0, __code_12));
suggestions.push((__binding_1, __code_13));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_lowering_bad_return_type_notation_output_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
372#[multipart_suggestion(
373 ast_lowering_bad_return_type_notation_output_suggestion,
374 applicability = "machine-applicable",
375 style = "verbose"
376)]
377pub(crate) struct RTNSuggestion {
379 #[suggestion_part(code = "")]
380 pub output: Span,
381 #[suggestion_part(code = "(..)")]
382 pub input: Span,
383}
384
385#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BadReturnTypeNotation where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BadReturnTypeNotation::Inputs { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_bad_return_type_notation_inputs);
let __code_14 =
[::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_14,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
BadReturnTypeNotation::Output {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_bad_return_type_notation_output);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
BadReturnTypeNotation::NeedsDots { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_bad_return_type_notation_needs_dots);
let __code_15 =
[::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_15,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
BadReturnTypeNotation::Position { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_bad_return_type_notation_position);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
386pub(crate) enum BadReturnTypeNotation {
387 #[diag(ast_lowering_bad_return_type_notation_inputs)]
388 Inputs {
389 #[primary_span]
390 #[suggestion(code = "(..)", applicability = "machine-applicable", style = "verbose")]
391 span: Span,
392 },
393 #[diag(ast_lowering_bad_return_type_notation_output)]
394 Output {
395 #[primary_span]
396 span: Span,
397 #[subdiagnostic]
398 suggestion: RTNSuggestion,
399 },
400 #[diag(ast_lowering_bad_return_type_notation_needs_dots)]
401 NeedsDots {
402 #[primary_span]
403 #[suggestion(code = "(..)", applicability = "machine-applicable", style = "verbose")]
404 span: Span,
405 },
406 #[diag(ast_lowering_bad_return_type_notation_position)]
407 Position {
408 #[primary_span]
409 span: Span,
410 },
411}
412
413#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GenericParamDefaultInBinder where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericParamDefaultInBinder { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_generic_param_default_in_binder);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
414#[diag(ast_lowering_generic_param_default_in_binder)]
415pub(crate) struct GenericParamDefaultInBinder {
416 #[primary_span]
417 pub span: Span,
418}
419
420#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncBoundNotOnTrait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncBoundNotOnTrait { span: __binding_0, descr: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_async_bound_not_on_trait);
;
diag.arg("descr", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
421#[diag(ast_lowering_async_bound_not_on_trait)]
422pub(crate) struct AsyncBoundNotOnTrait {
423 #[primary_span]
424 pub span: Span,
425 pub descr: &'static str,
426}
427
428#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncBoundOnlyForFnTraits where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncBoundOnlyForFnTraits { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_async_bound_only_for_fn_traits);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
429#[diag(ast_lowering_async_bound_only_for_fn_traits)]
430pub(crate) struct AsyncBoundOnlyForFnTraits {
431 #[primary_span]
432 pub span: Span,
433}
434
435#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NoPreciseCapturesOnApit where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoPreciseCapturesOnApit { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_no_precise_captures_on_apit);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
436#[diag(ast_lowering_no_precise_captures_on_apit)]
437pub(crate) struct NoPreciseCapturesOnApit {
438 #[primary_span]
439 pub span: Span,
440}
441
442#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for YieldInClosure
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
YieldInClosure { span: __binding_0, suggestion: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_yield_in_closure);
let __code_16 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("#[coroutine] "))
})].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_16,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
}
diag
}
}
}
}
};Diagnostic)]
443#[diag(ast_lowering_yield_in_closure)]
444pub(crate) struct YieldInClosure {
445 #[primary_span]
446 pub span: Span,
447 #[suggestion(code = "#[coroutine] ", applicability = "maybe-incorrect", style = "verbose")]
448 pub suggestion: Option<Span>,
449}
450
451#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidLegacyConstGenericArg where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidLegacyConstGenericArg {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_invalid_legacy_const_generic_arg);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
452#[diag(ast_lowering_invalid_legacy_const_generic_arg)]
453pub(crate) struct InvalidLegacyConstGenericArg {
454 #[primary_span]
455 pub span: Span,
456 #[subdiagnostic]
457 pub suggestion: UseConstGenericArg,
458}
459
460#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UseConstGenericArg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UseConstGenericArg {
end_of_fn: __binding_0,
const_args: __binding_1,
other_args: __binding_2,
call_args: __binding_3 } => {
let mut suggestions = Vec::new();
let __code_17 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("::<{0}>", __binding_1))
});
let __code_18 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
});
suggestions.push((__binding_0, __code_17));
suggestions.push((__binding_3, __code_18));
diag.store_args();
diag.arg("const_args", __binding_1);
diag.arg("other_args", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_lowering_invalid_legacy_const_generic_arg_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
461#[multipart_suggestion(
462 ast_lowering_invalid_legacy_const_generic_arg_suggestion,
463 applicability = "maybe-incorrect"
464)]
465pub(crate) struct UseConstGenericArg {
466 #[suggestion_part(code = "::<{const_args}>")]
467 pub end_of_fn: Span,
468 pub const_args: String,
469 pub other_args: String,
470 #[suggestion_part(code = "{other_args}")]
471 pub call_args: Span,
472}
473
474#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnionWithDefault where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnionWithDefault { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_union_default_field_values);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
475#[diag(ast_lowering_union_default_field_values)]
476pub(crate) struct UnionWithDefault {
477 #[primary_span]
478 pub span: Span,
479}
480
481#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnresolvedDelegationCallee where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnresolvedDelegationCallee { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_delegation_unresolved_callee);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
482#[diag(ast_lowering_delegation_unresolved_callee)]
483pub(crate) struct UnresolvedDelegationCallee {
484 #[primary_span]
485 pub span: Span,
486}
487
488#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CycleInDelegationSignatureResolution where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CycleInDelegationSignatureResolution { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_lowering_delegation_cycle_in_signature_resolution);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
489#[diag(ast_lowering_delegation_cycle_in_signature_resolution)]
490pub(crate) struct CycleInDelegationSignatureResolution {
491 #[primary_span]
492 pub span: Span,
493}