1use rustc_abi::ExternAbi;
4use rustc_ast::ParamKindOrd;
5use rustc_errors::codes::*;
6use rustc_errors::{Applicability, Diag, EmissionGuarantee, Subdiagnostic};
7use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
8use rustc_span::{Ident, Span, Symbol};
9
10use crate::fluent_generated as fluent;
11
12#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
VisibilityNotPermitted where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
VisibilityNotPermitted {
span: __binding_0,
note: __binding_1,
remove_qualifier_sugg: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_visibility_not_permitted);
let __code_0 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.code(E0449);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::ast_passes_remove_qualifier_sugg,
__code_0, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
13#[diag(ast_passes_visibility_not_permitted, code = E0449)]
14pub(crate) struct VisibilityNotPermitted {
15 #[primary_span]
16 pub span: Span,
17 #[subdiagnostic]
18 pub note: VisibilityNotPermittedNote,
19 #[suggestion(
20 ast_passes_remove_qualifier_sugg,
21 code = "",
22 applicability = "machine-applicable"
23 )]
24 pub remove_qualifier_sugg: Span,
25}
26
27#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for VisibilityNotPermittedNote {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
VisibilityNotPermittedNote::EnumVariant => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_enum_variant);
diag.note(__message);
diag.restore_args();
}
VisibilityNotPermittedNote::TraitImpl => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_trait_impl);
diag.note(__message);
diag.restore_args();
}
VisibilityNotPermittedNote::IndividualImplItems => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_individual_impl_items);
diag.note(__message);
diag.restore_args();
}
VisibilityNotPermittedNote::IndividualForeignItems => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_individual_foreign_items);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
28pub(crate) enum VisibilityNotPermittedNote {
29 #[note(ast_passes_enum_variant)]
30 EnumVariant,
31 #[note(ast_passes_trait_impl)]
32 TraitImpl,
33 #[note(ast_passes_individual_impl_items)]
34 IndividualImplItems,
35 #[note(ast_passes_individual_foreign_items)]
36 IndividualForeignItems,
37}
38#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ImplFnConst
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ImplFnConst {
span: __binding_0, parent_constness: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_impl_fn_const);
let __code_1 =
[::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::ast_passes_label, __code_1,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.span_label(__binding_1,
crate::fluent_generated::ast_passes_parent_constness);
diag
}
}
}
}
};Diagnostic)]
39#[diag(ast_passes_impl_fn_const)]
40pub(crate) struct ImplFnConst {
41 #[primary_span]
42 #[suggestion(ast_passes_label, code = "", applicability = "machine-applicable")]
43 pub span: Span,
44 #[label(ast_passes_parent_constness)]
45 pub parent_constness: Span,
46}
47
48#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for TraitFnConst
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitFnConst {
span: __binding_0,
in_impl: __binding_1,
const_context_label: __binding_2,
remove_const_sugg: __binding_3,
requires_multiple_changes: __binding_4,
make_impl_const_sugg: __binding_5,
make_trait_const_sugg: __binding_6 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_trait_fn_const);
let __code_2 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
let __code_3 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("const "))
})].into_iter();
let __code_4 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("const "))
})].into_iter();
diag.code(E0379);
;
diag.arg("in_impl", __binding_1);
diag.arg("requires_multiple_changes", __binding_4);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_2) = __binding_2 {
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_const_context_label);
}
diag.span_suggestions_with_style(__binding_3.0,
crate::fluent_generated::ast_passes_remove_const_sugg,
__code_2, __binding_3.1,
rustc_errors::SuggestionStyle::ShowCode);
if let Some(__binding_5) = __binding_5 {
diag.span_suggestions_with_style(__binding_5,
crate::fluent_generated::ast_passes_make_impl_const_sugg,
__code_3, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
}
if let Some(__binding_6) = __binding_6 {
diag.span_suggestions_with_style(__binding_6,
crate::fluent_generated::ast_passes_make_trait_const_sugg,
__code_4, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
}
diag
}
}
}
}
};Diagnostic)]
49#[diag(ast_passes_trait_fn_const, code = E0379)]
50pub(crate) struct TraitFnConst {
51 #[primary_span]
52 #[label]
53 pub span: Span,
54 pub in_impl: bool,
55 #[label(ast_passes_const_context_label)]
56 pub const_context_label: Option<Span>,
57 #[suggestion(ast_passes_remove_const_sugg, code = "")]
58 pub remove_const_sugg: (Span, Applicability),
59 pub requires_multiple_changes: bool,
60 #[suggestion(
61 ast_passes_make_impl_const_sugg,
62 code = "const ",
63 applicability = "maybe-incorrect"
64 )]
65 pub make_impl_const_sugg: Option<Span>,
66 #[suggestion(
67 ast_passes_make_trait_const_sugg,
68 code = "const ",
69 applicability = "maybe-incorrect"
70 )]
71 pub make_trait_const_sugg: Option<Span>,
72}
73
74#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AsyncFnInConstTraitOrTraitImpl where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AsyncFnInConstTraitOrTraitImpl {
async_keyword: __binding_0,
context: __binding_1,
const_keyword: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_async_fn_in_const_trait_or_trait_impl);
;
diag.arg("context", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
75#[diag(ast_passes_async_fn_in_const_trait_or_trait_impl)]
76pub(crate) struct AsyncFnInConstTraitOrTraitImpl {
77 #[primary_span]
78 pub async_keyword: Span,
79 pub context: &'static str,
80 #[label]
81 pub const_keyword: Span,
82}
83
84#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ForbiddenBound
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ForbiddenBound { spans: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_forbidden_bound);
;
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
85#[diag(ast_passes_forbidden_bound)]
86pub(crate) struct ForbiddenBound {
87 #[primary_span]
88 pub spans: Vec<Span>,
89}
90
91#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ForbiddenConstParam where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ForbiddenConstParam { const_param_spans: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_forbidden_const_param);
;
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
92#[diag(ast_passes_forbidden_const_param)]
93pub(crate) struct ForbiddenConstParam {
94 #[primary_span]
95 pub const_param_spans: Vec<Span>,
96}
97
98#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FnParamTooMany
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnParamTooMany {
span: __binding_0, max_num_args: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_param_too_many);
;
diag.arg("max_num_args", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
99#[diag(ast_passes_fn_param_too_many)]
100pub(crate) struct FnParamTooMany {
101 #[primary_span]
102 pub span: Span,
103 pub max_num_args: usize,
104}
105
106#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnParamCVarArgsNotLast where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnParamCVarArgsNotLast { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_param_c_var_args_not_last);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
107#[diag(ast_passes_fn_param_c_var_args_not_last)]
108pub(crate) struct FnParamCVarArgsNotLast {
109 #[primary_span]
110 pub span: Span,
111}
112
113#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnParamDocComment where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnParamDocComment { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_param_doc_comment);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
114#[diag(ast_passes_fn_param_doc_comment)]
115pub(crate) struct FnParamDocComment {
116 #[primary_span]
117 #[label]
118 pub span: Span,
119}
120
121#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnParamForbiddenAttr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnParamForbiddenAttr { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_param_forbidden_attr);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
122#[diag(ast_passes_fn_param_forbidden_attr)]
123pub(crate) struct FnParamForbiddenAttr {
124 #[primary_span]
125 pub span: Span,
126}
127
128#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnParamForbiddenSelf where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnParamForbiddenSelf { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_param_forbidden_self);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
129#[diag(ast_passes_fn_param_forbidden_self)]
130#[note]
131pub(crate) struct FnParamForbiddenSelf {
132 #[primary_span]
133 #[label]
134 pub span: Span,
135}
136
137#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ForbiddenDefault where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ForbiddenDefault { span: __binding_0, def_span: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_forbidden_default);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
138#[diag(ast_passes_forbidden_default)]
139pub(crate) struct ForbiddenDefault {
140 #[primary_span]
141 pub span: Span,
142 #[label]
143 pub def_span: Span,
144}
145
146#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AssocConstWithoutBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AssocConstWithoutBody {
span: __binding_0, replace_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_assoc_const_without_body);
let __code_5 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" = <expr>;"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_5,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
147#[diag(ast_passes_assoc_const_without_body)]
148pub(crate) struct AssocConstWithoutBody {
149 #[primary_span]
150 pub span: Span,
151 #[suggestion(code = " = <expr>;", applicability = "has-placeholders")]
152 pub replace_span: Span,
153}
154
155#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AssocFnWithoutBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AssocFnWithoutBody {
span: __binding_0, replace_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_assoc_fn_without_body);
let __code_6 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" {{ <body> }}"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_6,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
156#[diag(ast_passes_assoc_fn_without_body)]
157pub(crate) struct AssocFnWithoutBody {
158 #[primary_span]
159 pub span: Span,
160 #[suggestion(code = " {{ <body> }}", applicability = "has-placeholders")]
161 pub replace_span: Span,
162}
163
164#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AssocTypeWithoutBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AssocTypeWithoutBody {
span: __binding_0, replace_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_assoc_type_without_body);
let __code_7 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" = <type>;"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_7,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
165#[diag(ast_passes_assoc_type_without_body)]
166pub(crate) struct AssocTypeWithoutBody {
167 #[primary_span]
168 pub span: Span,
169 #[suggestion(code = " = <type>;", applicability = "has-placeholders")]
170 pub replace_span: Span,
171}
172
173#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstWithoutBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstWithoutBody {
span: __binding_0, replace_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_const_without_body);
let __code_8 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" = <expr>;"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_8,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
174#[diag(ast_passes_const_without_body)]
175pub(crate) struct ConstWithoutBody {
176 #[primary_span]
177 pub span: Span,
178 #[suggestion(code = " = <expr>;", applicability = "has-placeholders")]
179 pub replace_span: Span,
180}
181
182#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StaticWithoutBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StaticWithoutBody {
span: __binding_0, replace_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_static_without_body);
let __code_9 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" = <expr>;"))
})].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)]
183#[diag(ast_passes_static_without_body)]
184pub(crate) struct StaticWithoutBody {
185 #[primary_span]
186 pub span: Span,
187 #[suggestion(code = " = <expr>;", applicability = "has-placeholders")]
188 pub replace_span: Span,
189}
190
191#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TyAliasWithoutBody where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TyAliasWithoutBody {
span: __binding_0, replace_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_ty_alias_without_body);
let __code_10 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" = <type>;"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_10,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
192#[diag(ast_passes_ty_alias_without_body)]
193pub(crate) struct TyAliasWithoutBody {
194 #[primary_span]
195 pub span: Span,
196 #[suggestion(code = " = <type>;", applicability = "has-placeholders")]
197 pub replace_span: Span,
198}
199
200#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FnWithoutBody
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnWithoutBody {
span: __binding_0,
replace_span: __binding_1,
extern_block_suggestion: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_without_body);
let __code_11 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" {{ <body> }}"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_11,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
201#[diag(ast_passes_fn_without_body)]
202pub(crate) struct FnWithoutBody {
203 #[primary_span]
204 pub span: Span,
205 #[suggestion(code = " {{ <body> }}", applicability = "has-placeholders")]
206 pub replace_span: Span,
207 #[subdiagnostic]
208 pub extern_block_suggestion: Option<ExternBlockSuggestion>,
209}
210
211#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ExternBlockSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ExternBlockSuggestion::Implicit {
start_span: __binding_0, end_span: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_12 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("extern {{"))
});
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_passes_extern_block_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
ExternBlockSuggestion::Explicit {
start_span: __binding_0,
end_span: __binding_1,
abi: __binding_2 } => {
let mut suggestions = Vec::new();
let __code_14 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("extern \"{0}\" {{",
__binding_2))
});
let __code_15 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(" }}"))
});
suggestions.push((__binding_0, __code_14));
suggestions.push((__binding_1, __code_15));
diag.store_args();
diag.arg("abi", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_extern_block_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
212pub(crate) enum ExternBlockSuggestion {
213 #[multipart_suggestion(ast_passes_extern_block_suggestion, applicability = "maybe-incorrect")]
214 Implicit {
215 #[suggestion_part(code = "extern {{")]
216 start_span: Span,
217 #[suggestion_part(code = " }}")]
218 end_span: Span,
219 },
220 #[multipart_suggestion(ast_passes_extern_block_suggestion, applicability = "maybe-incorrect")]
221 Explicit {
222 #[suggestion_part(code = "extern \"{abi}\" {{")]
223 start_span: Span,
224 #[suggestion_part(code = " }}")]
225 end_span: Span,
226 abi: Symbol,
227 },
228}
229
230#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidSafetyOnExtern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidSafetyOnExtern {
item_span: __binding_0, block: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_extern_invalid_safety);
let __code_16 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("unsafe "))
})].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::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
}
diag
}
}
}
}
};Diagnostic)]
231#[diag(ast_passes_extern_invalid_safety)]
232pub(crate) struct InvalidSafetyOnExtern {
233 #[primary_span]
234 pub item_span: Span,
235 #[suggestion(code = "unsafe ", applicability = "machine-applicable", style = "verbose")]
236 pub block: Option<Span>,
237}
238
239#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidSafetyOnItem where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidSafetyOnItem { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_item_invalid_safety);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
240#[diag(ast_passes_item_invalid_safety)]
241pub(crate) struct InvalidSafetyOnItem {
242 #[primary_span]
243 pub span: Span,
244}
245
246#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidSafetyOnFnPtr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidSafetyOnFnPtr { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_ptr_invalid_safety);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
247#[diag(ast_passes_fn_ptr_invalid_safety)]
248pub(crate) struct InvalidSafetyOnFnPtr {
249 #[primary_span]
250 pub span: Span,
251}
252
253#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnsafeStatic
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnsafeStatic { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_unsafe_static);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
254#[diag(ast_passes_unsafe_static)]
255pub(crate) struct UnsafeStatic {
256 #[primary_span]
257 pub span: Span,
258}
259
260#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
BoundInContext<'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 {
BoundInContext { span: __binding_0, ctx: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_bound_in_context);
;
diag.arg("ctx", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
261#[diag(ast_passes_bound_in_context)]
262pub(crate) struct BoundInContext<'a> {
263 #[primary_span]
264 pub span: Span,
265 pub ctx: &'a str,
266}
267
268#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
ExternTypesCannotHave<'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 {
ExternTypesCannotHave {
span: __binding_0,
descr: __binding_1,
remove_descr: __binding_2,
block_span: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_extern_types_cannot);
let __code_17 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.note(crate::fluent_generated::ast_passes_extern_keyword_link);
;
diag.arg("descr", __binding_1);
diag.arg("remove_descr", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_17,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.span_label(__binding_3,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
269#[diag(ast_passes_extern_types_cannot)]
270#[note(ast_passes_extern_keyword_link)]
271pub(crate) struct ExternTypesCannotHave<'a> {
272 #[primary_span]
273 #[suggestion(code = "", applicability = "maybe-incorrect")]
274 pub span: Span,
275 pub descr: &'a str,
276 pub remove_descr: &'a str,
277 #[label]
278 pub block_span: Span,
279}
280
281#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
BodyInExtern<'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 {
BodyInExtern {
span: __binding_0,
body: __binding_1,
block: __binding_2,
kind: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_body_in_extern);
diag.note(crate::fluent_generated::ast_passes_extern_keyword_link);
;
diag.arg("kind", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::ast_passes_cannot_have);
diag.span_label(__binding_1,
crate::fluent_generated::ast_passes_invalid);
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_existing);
diag
}
}
}
}
};Diagnostic)]
282#[diag(ast_passes_body_in_extern)]
283#[note(ast_passes_extern_keyword_link)]
284pub(crate) struct BodyInExtern<'a> {
285 #[primary_span]
286 #[label(ast_passes_cannot_have)]
287 pub span: Span,
288 #[label(ast_passes_invalid)]
289 pub body: Span,
290 #[label(ast_passes_existing)]
291 pub block: Span,
292 pub kind: &'a str,
293}
294
295#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FnBodyInExtern
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnBodyInExtern {
span: __binding_0, body: __binding_1, block: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fn_body_extern);
let __code_18 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(";"))
})].into_iter();
diag.help(crate::fluent_generated::_subdiag::help);
diag.note(crate::fluent_generated::ast_passes_extern_keyword_link);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::ast_passes_cannot_have);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_18,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
296#[diag(ast_passes_fn_body_extern)]
297#[help]
298#[note(ast_passes_extern_keyword_link)]
299pub(crate) struct FnBodyInExtern {
300 #[primary_span]
301 #[label(ast_passes_cannot_have)]
302 pub span: Span,
303 #[suggestion(code = ";", applicability = "maybe-incorrect")]
304 pub body: Span,
305 #[label]
306 pub block: Span,
307}
308
309#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FnQualifierInExtern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FnQualifierInExtern {
span: __binding_0, block: __binding_1, kw: __binding_2 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_extern_fn_qualifiers);
let __code_19 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("kw", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_19,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
310#[diag(ast_passes_extern_fn_qualifiers)]
311pub(crate) struct FnQualifierInExtern {
312 #[primary_span]
313 #[suggestion(code = "", applicability = "maybe-incorrect")]
314 pub span: Span,
315 #[label]
316 pub block: Span,
317 pub kw: &'static str,
318}
319
320#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExternItemAscii where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternItemAscii { span: __binding_0, block: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_extern_item_ascii);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
321#[diag(ast_passes_extern_item_ascii)]
322#[note]
323pub(crate) struct ExternItemAscii {
324 #[primary_span]
325 pub span: Span,
326 #[label]
327 pub block: Span,
328}
329
330#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CVariadicNoExtern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CVariadicNoExtern { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_c_variadic_no_extern);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
331#[diag(ast_passes_c_variadic_no_extern)]
332#[help]
333pub(crate) struct CVariadicNoExtern {
334 #[primary_span]
335 pub span: Span,
336}
337
338#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CVariadicMustBeUnsafe where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CVariadicMustBeUnsafe {
span: __binding_0, unsafe_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_c_variadic_must_be_unsafe);
let __code_20 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("unsafe "))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::ast_passes_suggestion, __code_20,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
339#[diag(ast_passes_c_variadic_must_be_unsafe)]
340pub(crate) struct CVariadicMustBeUnsafe {
341 #[primary_span]
342 pub span: Span,
343
344 #[suggestion(
345 ast_passes_suggestion,
346 applicability = "maybe-incorrect",
347 code = "unsafe ",
348 style = "verbose"
349 )]
350 pub unsafe_span: Span,
351}
352
353#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CVariadicBadExtern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CVariadicBadExtern {
span: __binding_0,
abi: __binding_1,
extern_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_c_variadic_bad_extern);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("abi", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
354#[diag(ast_passes_c_variadic_bad_extern)]
355#[help]
356pub(crate) struct CVariadicBadExtern {
357 #[primary_span]
358 pub span: Span,
359 pub abi: &'static str,
360 #[label]
361 pub extern_span: Span,
362}
363
364#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CVariadicBadNakedExtern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CVariadicBadNakedExtern {
span: __binding_0,
abi: __binding_1,
extern_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_c_variadic_bad_naked_extern);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("abi", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
365#[diag(ast_passes_c_variadic_bad_naked_extern)]
366#[help]
367pub(crate) struct CVariadicBadNakedExtern {
368 #[primary_span]
369 pub span: Span,
370 pub abi: &'static str,
371 #[label]
372 pub extern_span: Span,
373}
374
375#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
ItemUnderscore<'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 {
ItemUnderscore { span: __binding_0, kind: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_item_underscore);
;
diag.arg("kind", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
376#[diag(ast_passes_item_underscore)]
377pub(crate) struct ItemUnderscore<'a> {
378 #[primary_span]
379 #[label]
380 pub span: Span,
381 pub kind: &'a str,
382}
383
384#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for NoMangleAscii
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NoMangleAscii { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_nomangle_ascii);
diag.code(E0754);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
385#[diag(ast_passes_nomangle_ascii, code = E0754)]
386pub(crate) struct NoMangleAscii {
387 #[primary_span]
388 pub span: Span,
389}
390
391#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ModuleNonAscii
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ModuleNonAscii { span: __binding_0, name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_module_nonascii);
diag.code(E0754);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
392#[diag(ast_passes_module_nonascii, code = E0754)]
393#[help]
394pub(crate) struct ModuleNonAscii {
395 #[primary_span]
396 pub span: Span,
397 pub name: Symbol,
398}
399
400#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AutoTraitGeneric where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AutoTraitGeneric { span: __binding_0, ident: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_auto_generic);
let __code_21 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.code(E0567);
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_21,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
401#[diag(ast_passes_auto_generic, code = E0567)]
402pub(crate) struct AutoTraitGeneric {
403 #[primary_span]
404 #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
405 pub span: Span,
406 #[label]
407 pub ident: Span,
408}
409
410#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AutoTraitBounds where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AutoTraitBounds {
span: __binding_0, removal: __binding_1, ident: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_auto_super_lifetime);
let __code_22 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.code(E0568);
;
diag.span(__binding_0.clone());
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_22,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
411#[diag(ast_passes_auto_super_lifetime, code = E0568)]
412pub(crate) struct AutoTraitBounds {
413 #[primary_span]
414 pub span: Vec<Span>,
415 #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
416 pub removal: Span,
417 #[label]
418 pub ident: Span,
419}
420
421#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AutoTraitItems
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AutoTraitItems {
spans: __binding_0, total: __binding_1, ident: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_auto_items);
let __code_23 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.code(E0380);
;
diag.span(__binding_0.clone());
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_23,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
422#[diag(ast_passes_auto_items, code = E0380)]
423pub(crate) struct AutoTraitItems {
424 #[primary_span]
425 pub spans: Vec<Span>,
426 #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
427 pub total: Span,
428 #[label]
429 pub ident: Span,
430}
431
432#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ConstAutoTrait
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstAutoTrait { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_const_auto_trait);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
433#[diag(ast_passes_const_auto_trait)]
434#[help]
435pub(crate) struct ConstAutoTrait {
436 #[primary_span]
437 pub span: Span,
438}
439
440#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ArgsBeforeConstraint where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ArgsBeforeConstraint {
arg_spans: __binding_0,
constraints: __binding_1,
args: __binding_2,
data: __binding_3,
suggestion: __binding_4,
constraint_len: __binding_5,
args_len: __binding_6,
constraint_spans: __binding_7,
arg_spans2: __binding_8 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_generic_before_constraints);
let __code_24 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_4))
})].into_iter();
;
diag.arg("suggestion", __binding_4);
diag.arg("constraint_len", __binding_5);
diag.arg("args_len", __binding_6);
diag.span(__binding_0.clone());
diag.span_label(__binding_1,
crate::fluent_generated::ast_passes_constraints);
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_args);
diag.span_suggestions_with_style(__binding_3,
crate::fluent_generated::_subdiag::suggestion, __code_24,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.subdiagnostic(__binding_7);
diag.subdiagnostic(__binding_8);
diag
}
}
}
}
};Diagnostic)]
441#[diag(ast_passes_generic_before_constraints)]
442pub(crate) struct ArgsBeforeConstraint {
443 #[primary_span]
444 pub arg_spans: Vec<Span>,
445 #[label(ast_passes_constraints)]
446 pub constraints: Span,
447 #[label(ast_passes_args)]
448 pub args: Span,
449 #[suggestion(code = "{suggestion}", applicability = "machine-applicable", style = "verbose")]
450 pub data: Span,
451 pub suggestion: String,
452 pub constraint_len: usize,
453 pub args_len: usize,
454 #[subdiagnostic]
455 pub constraint_spans: EmptyLabelManySpans,
456 #[subdiagnostic]
457 pub arg_spans2: EmptyLabelManySpans,
458}
459
460pub(crate) struct EmptyLabelManySpans(pub Vec<Span>);
461
462impl Subdiagnostic for EmptyLabelManySpans {
464 fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
465 diag.span_labels(self.0, "");
466 }
467}
468
469#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PatternFnPointer where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PatternFnPointer { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_pattern_in_fn_pointer);
diag.code(E0561);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
470#[diag(ast_passes_pattern_in_fn_pointer, code = E0561)]
471pub(crate) struct PatternFnPointer {
472 #[primary_span]
473 pub span: Span,
474}
475
476#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitObjectBound where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitObjectBound { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_trait_object_single_bound);
diag.code(E0226);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
477#[diag(ast_passes_trait_object_single_bound, code = E0226)]
478pub(crate) struct TraitObjectBound {
479 #[primary_span]
480 pub span: Span,
481}
482
483#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NestedImplTrait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NestedImplTrait {
span: __binding_0, outer: __binding_1, inner: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_nested_impl_trait);
diag.code(E0666);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::ast_passes_outer);
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_inner);
diag
}
}
}
}
};Diagnostic)]
484#[diag(ast_passes_nested_impl_trait, code = E0666)]
485pub(crate) struct NestedImplTrait {
486 #[primary_span]
487 pub span: Span,
488 #[label(ast_passes_outer)]
489 pub outer: Span,
490 #[label(ast_passes_inner)]
491 pub inner: Span,
492}
493
494#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AtLeastOneTrait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AtLeastOneTrait { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_at_least_one_trait);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
495#[diag(ast_passes_at_least_one_trait)]
496pub(crate) struct AtLeastOneTrait {
497 #[primary_span]
498 pub span: Span,
499}
500
501#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
OutOfOrderParams<'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 {
OutOfOrderParams {
spans: __binding_0,
sugg_span: __binding_1,
param_ord: __binding_2,
max_param: __binding_3,
ordered_params: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_out_of_order_params);
let __code_25 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_4))
})].into_iter();
;
diag.arg("param_ord", __binding_2);
diag.arg("max_param", __binding_3);
diag.arg("ordered_params", __binding_4);
diag.span(__binding_0.clone());
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_25,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
502#[diag(ast_passes_out_of_order_params)]
503pub(crate) struct OutOfOrderParams<'a> {
504 #[primary_span]
505 pub spans: Vec<Span>,
506 #[suggestion(code = "{ordered_params}", applicability = "machine-applicable")]
507 pub sugg_span: Span,
508 pub param_ord: &'a ParamKindOrd,
509 pub max_param: &'a ParamKindOrd,
510 pub ordered_params: &'a str,
511}
512
513#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ObsoleteAuto
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ObsoleteAuto { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_obsolete_auto);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
514#[diag(ast_passes_obsolete_auto)]
515#[help]
516pub(crate) struct ObsoleteAuto {
517 #[primary_span]
518 pub span: Span,
519}
520
521#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnsafeNegativeImpl where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnsafeNegativeImpl {
span: __binding_0,
negative: __binding_1,
r#unsafe: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_unsafe_negative_impl);
diag.code(E0198);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::ast_passes_negative);
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_unsafe);
diag
}
}
}
}
};Diagnostic)]
522#[diag(ast_passes_unsafe_negative_impl, code = E0198)]
523pub(crate) struct UnsafeNegativeImpl {
524 #[primary_span]
525 pub span: Span,
526 #[label(ast_passes_negative)]
527 pub negative: Span,
528 #[label(ast_passes_unsafe)]
529 pub r#unsafe: Span,
530}
531
532#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnsafeItem
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnsafeItem { span: __binding_0, kind: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_unsafe_item);
;
diag.arg("kind", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
533#[diag(ast_passes_unsafe_item)]
534pub(crate) struct UnsafeItem {
535 #[primary_span]
536 pub span: Span,
537 pub kind: &'static str,
538}
539
540#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingUnsafeOnExtern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingUnsafeOnExtern { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_missing_unsafe_on_extern);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
541#[diag(ast_passes_missing_unsafe_on_extern)]
542pub(crate) struct MissingUnsafeOnExtern {
543 #[primary_span]
544 pub span: Span,
545}
546
547#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
MissingUnsafeOnExternLint {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MissingUnsafeOnExternLint { suggestion: __binding_0 } => {
diag.primary_message(crate::fluent_generated::ast_passes_missing_unsafe_on_extern_lint);
;
let __code_26 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("unsafe "))
})].into_iter();
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_26,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
};
}
}
};LintDiagnostic)]
548#[diag(ast_passes_missing_unsafe_on_extern_lint)]
549pub(crate) struct MissingUnsafeOnExternLint {
550 #[suggestion(code = "unsafe ", applicability = "machine-applicable")]
551 pub suggestion: Span,
552}
553
554#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FieldlessUnion
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FieldlessUnion { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_fieldless_union);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
555#[diag(ast_passes_fieldless_union)]
556pub(crate) struct FieldlessUnion {
557 #[primary_span]
558 pub span: Span,
559}
560
561#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
WhereClauseAfterTypeAlias where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
WhereClauseAfterTypeAlias {
span: __binding_0, help: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_where_clause_after_type_alias);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
if __binding_1 {
diag.help(crate::fluent_generated::_subdiag::help);
}
diag
}
}
}
}
};Diagnostic)]
562#[diag(ast_passes_where_clause_after_type_alias)]
563#[note]
564pub(crate) struct WhereClauseAfterTypeAlias {
565 #[primary_span]
566 pub span: Span,
567 #[help]
568 pub help: bool,
569}
570
571#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
WhereClauseBeforeTypeAlias where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
WhereClauseBeforeTypeAlias {
span: __binding_0, sugg: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_where_clause_before_type_alias);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
572#[diag(ast_passes_where_clause_before_type_alias)]
573#[note]
574pub(crate) struct WhereClauseBeforeTypeAlias {
575 #[primary_span]
576 pub span: Span,
577 #[subdiagnostic]
578 pub sugg: WhereClauseBeforeTypeAliasSugg,
579}
580
581#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for WhereClauseBeforeTypeAliasSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
WhereClauseBeforeTypeAliasSugg::Remove { span: __binding_0 }
=> {
let __code_27 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_remove_suggestion);
diag.span_suggestions_with_style(__binding_0, __message,
__code_27, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
WhereClauseBeforeTypeAliasSugg::Move {
left: __binding_0, snippet: __binding_1, right: __binding_2
} => {
let mut suggestions = Vec::new();
let __code_28 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
let __code_29 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
});
suggestions.push((__binding_0, __code_28));
suggestions.push((__binding_2, __code_29));
diag.store_args();
diag.arg("snippet", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_move_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
582pub(crate) enum WhereClauseBeforeTypeAliasSugg {
583 #[suggestion(ast_passes_remove_suggestion, applicability = "machine-applicable", code = "")]
584 Remove {
585 #[primary_span]
586 span: Span,
587 },
588 #[multipart_suggestion(
589 ast_passes_move_suggestion,
590 applicability = "machine-applicable",
591 style = "verbose"
592 )]
593 Move {
594 #[suggestion_part(code = "")]
595 left: Span,
596 snippet: String,
597 #[suggestion_part(code = "{snippet}")]
598 right: Span,
599 },
600}
601
602#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GenericDefaultTrailing where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericDefaultTrailing { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_generic_default_trailing);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
603#[diag(ast_passes_generic_default_trailing)]
604pub(crate) struct GenericDefaultTrailing {
605 #[primary_span]
606 pub span: Span,
607}
608
609#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NestedLifetimes where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NestedLifetimes { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_nested_lifetimes);
diag.code(E0316);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
610#[diag(ast_passes_nested_lifetimes, code = E0316)]
611pub(crate) struct NestedLifetimes {
612 #[primary_span]
613 pub span: Span,
614}
615
616#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstBoundTraitObject where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstBoundTraitObject { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_const_bound_trait_object);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
617#[diag(ast_passes_const_bound_trait_object)]
618pub(crate) struct ConstBoundTraitObject {
619 #[primary_span]
620 pub span: Span,
621}
622
623#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TildeConstDisallowed where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TildeConstDisallowed {
span: __binding_0, reason: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_tilde_const_disallowed);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
626#[diag(ast_passes_tilde_const_disallowed)]
627pub(crate) struct TildeConstDisallowed {
628 #[primary_span]
629 pub span: Span,
630 #[subdiagnostic]
631 pub reason: TildeConstReason,
632}
633
634#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for TildeConstReason {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TildeConstReason::Closure => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_closure);
diag.note(__message);
diag.restore_args();
}
TildeConstReason::Function { ident: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_function);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::Trait { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_trait);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::TraitImpl { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_trait_impl);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::Impl { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_impl);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::TraitAssocTy { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_trait_assoc_ty);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::TraitImplAssocTy { span: __binding_0 } =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_trait_impl_assoc_ty);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::InherentAssocTy { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_inherent_assoc_ty);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::Struct { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_struct);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::Enum { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_enum);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::Union { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_union);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::AnonConst { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_anon_const);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TildeConstReason::TraitObject => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_object);
diag.note(__message);
diag.restore_args();
}
TildeConstReason::Item => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_item);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic, #[automatically_derived]
impl ::core::marker::Copy for TildeConstReason { }Copy, #[automatically_derived]
impl ::core::clone::Clone for TildeConstReason {
#[inline]
fn clone(&self) -> TildeConstReason {
let _: ::core::clone::AssertParamIsClone<Span>;
*self
}
}Clone)]
635pub(crate) enum TildeConstReason {
636 #[note(ast_passes_closure)]
637 Closure,
638 #[note(ast_passes_function)]
639 Function {
640 #[primary_span]
641 ident: Span,
642 },
643 #[note(ast_passes_trait)]
644 Trait {
645 #[primary_span]
646 span: Span,
647 },
648 #[note(ast_passes_trait_impl)]
649 TraitImpl {
650 #[primary_span]
651 span: Span,
652 },
653 #[note(ast_passes_impl)]
654 Impl {
655 #[primary_span]
656 span: Span,
657 },
658 #[note(ast_passes_trait_assoc_ty)]
659 TraitAssocTy {
660 #[primary_span]
661 span: Span,
662 },
663 #[note(ast_passes_trait_impl_assoc_ty)]
664 TraitImplAssocTy {
665 #[primary_span]
666 span: Span,
667 },
668 #[note(ast_passes_inherent_assoc_ty)]
669 InherentAssocTy {
670 #[primary_span]
671 span: Span,
672 },
673 #[note(ast_passes_struct)]
674 Struct {
675 #[primary_span]
676 span: Span,
677 },
678 #[note(ast_passes_enum)]
679 Enum {
680 #[primary_span]
681 span: Span,
682 },
683 #[note(ast_passes_union)]
684 Union {
685 #[primary_span]
686 span: Span,
687 },
688 #[note(ast_passes_anon_const)]
689 AnonConst {
690 #[primary_span]
691 span: Span,
692 },
693 #[note(ast_passes_object)]
694 TraitObject,
695 #[note(ast_passes_item)]
696 Item,
697}
698
699#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstAndCoroutine where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstAndCoroutine {
spans: __binding_0,
const_span: __binding_1,
coroutine_span: __binding_2,
span: __binding_3,
coroutine_kind: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_const_and_coroutine);
;
diag.arg("coroutine_kind", __binding_4);
diag.span(__binding_0.clone());
diag.span_label(__binding_1,
crate::fluent_generated::ast_passes_const);
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_coroutine);
diag.span_label(__binding_3,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
700#[diag(ast_passes_const_and_coroutine)]
701pub(crate) struct ConstAndCoroutine {
702 #[primary_span]
703 pub spans: Vec<Span>,
704 #[label(ast_passes_const)]
705 pub const_span: Span,
706 #[label(ast_passes_coroutine)]
707 pub coroutine_span: Span,
708 #[label]
709 pub span: Span,
710 pub coroutine_kind: &'static str,
711}
712
713#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstAndCVariadic where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstAndCVariadic {
spans: __binding_0,
const_span: __binding_1,
variadic_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_const_and_c_variadic);
;
diag.span(__binding_0.clone());
diag.span_label(__binding_1,
crate::fluent_generated::ast_passes_const);
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_variadic);
diag
}
}
}
}
};Diagnostic)]
714#[diag(ast_passes_const_and_c_variadic)]
715pub(crate) struct ConstAndCVariadic {
716 #[primary_span]
717 pub spans: Vec<Span>,
718 #[label(ast_passes_const)]
719 pub const_span: Span,
720 #[label(ast_passes_variadic)]
721 pub variadic_span: Span,
722}
723
724#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CoroutineAndCVariadic where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CoroutineAndCVariadic {
spans: __binding_0,
coroutine_kind: __binding_1,
coroutine_span: __binding_2,
variadic_span: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_coroutine_and_c_variadic);
;
diag.arg("coroutine_kind", __binding_1);
diag.span(__binding_0.clone());
diag.span_label(__binding_2,
crate::fluent_generated::ast_passes_const);
diag.span_label(__binding_3,
crate::fluent_generated::ast_passes_variadic);
diag
}
}
}
}
};Diagnostic)]
725#[diag(ast_passes_coroutine_and_c_variadic)]
726pub(crate) struct CoroutineAndCVariadic {
727 #[primary_span]
728 pub spans: Vec<Span>,
729 pub coroutine_kind: &'static str,
730 #[label(ast_passes_const)]
731 pub coroutine_span: Span,
732 #[label(ast_passes_variadic)]
733 pub variadic_span: Span,
734}
735
736#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
CVariadicNotSupported<'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 {
CVariadicNotSupported {
variadic_span: __binding_0, target: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_c_variadic_not_supported);
;
diag.arg("target", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
737#[diag(ast_passes_c_variadic_not_supported)]
738pub(crate) struct CVariadicNotSupported<'a> {
739 #[primary_span]
740 pub variadic_span: Span,
741 pub target: &'a str,
742}
743
744#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PatternInForeign where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PatternInForeign { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_pattern_in_foreign);
diag.code(E0130);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
745#[diag(ast_passes_pattern_in_foreign, code = E0130)]
746pub(crate) struct PatternInForeign {
748 #[primary_span]
749 #[label]
750 pub span: Span,
751}
752
753#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PatternInBodiless where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PatternInBodiless { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_pattern_in_bodiless);
diag.code(E0642);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
754#[diag(ast_passes_pattern_in_bodiless, code = E0642)]
755pub(crate) struct PatternInBodiless {
757 #[primary_span]
758 #[label]
759 pub span: Span,
760}
761
762#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
EqualityInWhere where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EqualityInWhere {
span: __binding_0, assoc: __binding_1, assoc2: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_equality_in_where);
diag.note(crate::fluent_generated::_subdiag::note);
;
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);
}
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
763#[diag(ast_passes_equality_in_where)]
764#[note]
765pub(crate) struct EqualityInWhere {
766 #[primary_span]
767 #[label]
768 pub span: Span,
769 #[subdiagnostic]
770 pub assoc: Option<AssociatedSuggestion>,
771 #[subdiagnostic]
772 pub assoc2: Option<AssociatedSuggestion2>,
773}
774
775#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AssociatedSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AssociatedSuggestion {
span: __binding_0,
ident: __binding_1,
param: __binding_2,
path: __binding_3 } => {
let __code_30 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}: {1}", __binding_2,
__binding_3))
})].into_iter();
diag.store_args();
diag.arg("ident", __binding_1);
diag.arg("param", __binding_2);
diag.arg("path", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_suggestion);
diag.span_suggestions_with_style(__binding_0, __message,
__code_30, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
776#[suggestion(
777 ast_passes_suggestion,
778 code = "{param}: {path}",
779 style = "verbose",
780 applicability = "maybe-incorrect"
781)]
782pub(crate) struct AssociatedSuggestion {
783 #[primary_span]
784 pub span: Span,
785 pub ident: Ident,
786 pub param: Ident,
787 pub path: String,
788}
789
790#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AssociatedSuggestion2 {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AssociatedSuggestion2 {
span: __binding_0,
args: __binding_1,
predicate: __binding_2,
trait_segment: __binding_3,
potential_assoc: __binding_4 } => {
let mut suggestions = Vec::new();
let __code_31 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
});
let __code_32 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
});
suggestions.push((__binding_0, __code_31));
suggestions.push((__binding_2, __code_32));
diag.store_args();
diag.arg("args", __binding_1);
diag.arg("trait_segment", __binding_3);
diag.arg("potential_assoc", __binding_4);
let __message =
diag.eagerly_translate(crate::fluent_generated::ast_passes_suggestion_path);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
791#[multipart_suggestion(ast_passes_suggestion_path, applicability = "maybe-incorrect")]
792pub(crate) struct AssociatedSuggestion2 {
793 #[suggestion_part(code = "{args}")]
794 pub span: Span,
795 pub args: String,
796 #[suggestion_part(code = "")]
797 pub predicate: Span,
798 pub trait_segment: Ident,
799 pub potential_assoc: Ident,
800}
801
802#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FeatureOnNonNightly where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FeatureOnNonNightly {
span: __binding_0,
channel: __binding_1,
stable_features: __binding_2,
sugg: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_feature_on_non_nightly);
let __code_33 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.code(E0554);
;
diag.arg("channel", __binding_1);
diag.span(__binding_0);
for __binding_2 in __binding_2 {
diag.subdiagnostic(__binding_2);
}
if let Some(__binding_3) = __binding_3 {
diag.span_suggestions_with_style(__binding_3,
crate::fluent_generated::_subdiag::suggestion, __code_33,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
}
diag
}
}
}
}
};Diagnostic)]
803#[diag(ast_passes_feature_on_non_nightly, code = E0554)]
804pub(crate) struct FeatureOnNonNightly {
805 #[primary_span]
806 pub span: Span,
807 pub channel: &'static str,
808 #[subdiagnostic]
809 pub stable_features: Vec<StableFeature>,
810 #[suggestion(code = "", applicability = "machine-applicable")]
811 pub sugg: Option<Span>,
812}
813
814pub(crate) struct StableFeature {
815 pub name: Symbol,
816 pub since: Symbol,
817}
818
819impl Subdiagnostic for StableFeature {
820 fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
821 diag.arg("name", self.name);
822 diag.arg("since", self.since);
823 diag.help(fluent::ast_passes_stable_since);
824 }
825}
826
827#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncompatibleFeatures where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncompatibleFeatures {
spans: __binding_0, f1: __binding_1, f2: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_incompatible_features);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("f1", __binding_1);
diag.arg("f2", __binding_2);
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
828#[diag(ast_passes_incompatible_features)]
829#[help]
830pub(crate) struct IncompatibleFeatures {
831 #[primary_span]
832 pub spans: Vec<Span>,
833 pub f1: Symbol,
834 pub f2: Symbol,
835}
836
837#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NegativeBoundUnsupported where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NegativeBoundUnsupported { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_negative_bound_not_supported);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
838#[diag(ast_passes_negative_bound_not_supported)]
839pub(crate) struct NegativeBoundUnsupported {
840 #[primary_span]
841 pub span: Span,
842}
843
844#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstraintOnNegativeBound where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstraintOnNegativeBound { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_constraint_on_negative_bound);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
845#[diag(ast_passes_constraint_on_negative_bound)]
846pub(crate) struct ConstraintOnNegativeBound {
847 #[primary_span]
848 pub span: Span,
849}
850
851#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NegativeBoundWithParentheticalNotation where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NegativeBoundWithParentheticalNotation { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_negative_bound_with_parenthetical_notation);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
852#[diag(ast_passes_negative_bound_with_parenthetical_notation)]
853pub(crate) struct NegativeBoundWithParentheticalNotation {
854 #[primary_span]
855 pub span: Span,
856}
857
858#[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_passes_match_arm_with_no_body);
let __code_34 =
[::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_34,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
859#[diag(ast_passes_match_arm_with_no_body)]
860pub(crate) struct MatchArmWithNoBody {
861 #[primary_span]
862 pub span: Span,
863 #[suggestion(
867 code = " => {{ todo!() }}",
868 applicability = "has-placeholders",
869 style = "verbose"
870 )]
871 pub suggestion: Span,
872}
873
874#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PreciseCapturingNotAllowedHere where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PreciseCapturingNotAllowedHere {
span: __binding_0, loc: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_precise_capturing_not_allowed_here);
;
diag.arg("loc", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
875#[diag(ast_passes_precise_capturing_not_allowed_here)]
876pub(crate) struct PreciseCapturingNotAllowedHere {
877 #[primary_span]
878 pub span: Span,
879 pub loc: &'static str,
880}
881
882#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DuplicatePreciseCapturing where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DuplicatePreciseCapturing {
bound1: __binding_0, bound2: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_precise_capturing_duplicated);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
883#[diag(ast_passes_precise_capturing_duplicated)]
884pub(crate) struct DuplicatePreciseCapturing {
885 #[primary_span]
886 pub bound1: Span,
887 #[label]
888 pub bound2: Span,
889}
890
891#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MissingAbi
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingAbi { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_extern_without_abi);
let __code_35 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("extern \"<abi>\""))
})].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_35,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
892#[diag(ast_passes_extern_without_abi)]
893#[help]
894pub(crate) struct MissingAbi {
895 #[primary_span]
896 #[suggestion(code = "extern \"<abi>\"", applicability = "has-placeholders")]
897 pub span: Span,
898}
899
900#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for MissingAbiSugg {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MissingAbiSugg { span: __binding_0, default_abi: __binding_1
} => {
diag.primary_message(crate::fluent_generated::ast_passes_extern_without_abi_sugg);
;
let __code_36 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("extern {0}",
__binding_1))
})].into_iter();
diag.arg("default_abi", __binding_1);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_36,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
};
}
}
};LintDiagnostic)]
901#[diag(ast_passes_extern_without_abi_sugg)]
902pub(crate) struct MissingAbiSugg {
903 #[suggestion(code = "extern {default_abi}", applicability = "machine-applicable")]
904 pub span: Span,
905 pub default_abi: ExternAbi,
906}
907
908#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiCustomSafeForeignFunction where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiCustomSafeForeignFunction {
span: __binding_0, safe_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_abi_custom_safe_foreign_function);
let __code_37 =
[::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::ast_passes_suggestion, __code_37,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
909#[diag(ast_passes_abi_custom_safe_foreign_function)]
910pub(crate) struct AbiCustomSafeForeignFunction {
911 #[primary_span]
912 pub span: Span,
913
914 #[suggestion(
915 ast_passes_suggestion,
916 applicability = "maybe-incorrect",
917 code = "",
918 style = "verbose"
919 )]
920 pub safe_span: Span,
921}
922
923#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiCustomSafeFunction where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiCustomSafeFunction {
span: __binding_0,
abi: __binding_1,
unsafe_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_abi_custom_safe_function);
let __code_38 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("unsafe "))
})].into_iter();
;
diag.arg("abi", __binding_1);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::ast_passes_suggestion, __code_38,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
924#[diag(ast_passes_abi_custom_safe_function)]
925pub(crate) struct AbiCustomSafeFunction {
926 #[primary_span]
927 pub span: Span,
928 pub abi: ExternAbi,
929
930 #[suggestion(
931 ast_passes_suggestion,
932 applicability = "maybe-incorrect",
933 code = "unsafe ",
934 style = "verbose"
935 )]
936 pub unsafe_span: Span,
937}
938
939#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiCannotBeCoroutine where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiCannotBeCoroutine {
span: __binding_0,
abi: __binding_1,
coroutine_kind_span: __binding_2,
coroutine_kind_str: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_abi_cannot_be_coroutine);
let __code_39 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("abi", __binding_1);
diag.arg("coroutine_kind_str", __binding_3);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::ast_passes_suggestion, __code_39,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
940#[diag(ast_passes_abi_cannot_be_coroutine)]
941pub(crate) struct AbiCannotBeCoroutine {
942 #[primary_span]
943 pub span: Span,
944 pub abi: ExternAbi,
945
946 #[suggestion(
947 ast_passes_suggestion,
948 applicability = "maybe-incorrect",
949 code = "",
950 style = "verbose"
951 )]
952 pub coroutine_kind_span: Span,
953 pub coroutine_kind_str: &'static str,
954}
955
956#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiMustNotHaveParametersOrReturnType where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiMustNotHaveParametersOrReturnType {
spans: __binding_0,
abi: __binding_1,
suggestion_span: __binding_2,
symbol: __binding_3,
padding: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_abi_must_not_have_parameters_or_return_type);
let __code_40 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}fn {1}()",
__binding_4, __binding_3))
})].into_iter();
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("abi", __binding_1);
diag.arg("symbol", __binding_3);
diag.arg("padding", __binding_4);
diag.span(__binding_0.clone());
diag.span_suggestions_with_style(__binding_2,
crate::fluent_generated::ast_passes_suggestion, __code_40,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
}
}
}
};Diagnostic)]
957#[diag(ast_passes_abi_must_not_have_parameters_or_return_type)]
958#[note]
959pub(crate) struct AbiMustNotHaveParametersOrReturnType {
960 #[primary_span]
961 pub spans: Vec<Span>,
962 pub abi: ExternAbi,
963
964 #[suggestion(
965 ast_passes_suggestion,
966 applicability = "maybe-incorrect",
967 code = "{padding}fn {symbol}()",
968 style = "verbose"
969 )]
970 pub suggestion_span: Span,
971 pub symbol: Symbol,
972 pub padding: &'static str,
973}
974
975#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiMustNotHaveReturnType where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiMustNotHaveReturnType {
span: __binding_0, abi: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_abi_must_not_have_return_type);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("abi", __binding_1);
diag.span(__binding_0);
diag.span_help(__binding_0,
crate::fluent_generated::_subdiag::help);
diag
}
}
}
}
};Diagnostic)]
976#[diag(ast_passes_abi_must_not_have_return_type)]
977#[note]
978pub(crate) struct AbiMustNotHaveReturnType {
979 #[primary_span]
980 #[help]
981 pub span: Span,
982 pub abi: ExternAbi,
983}
984
985#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiX86Interrupt where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiX86Interrupt {
spans: __binding_0, param_count: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_abi_x86_interrupt);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("param_count", __binding_1);
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
986#[diag(ast_passes_abi_x86_interrupt)]
987#[note]
988pub(crate) struct AbiX86Interrupt {
989 #[primary_span]
990 pub spans: Vec<Span>,
991 pub param_count: usize,
992}
993
994#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ScalableVectorNotTupleStruct where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ScalableVectorNotTupleStruct { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::ast_passes_scalable_vector_not_tuple_struct);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
995#[diag(ast_passes_scalable_vector_not_tuple_struct)]
996pub(crate) struct ScalableVectorNotTupleStruct {
997 #[primary_span]
998 pub span: Span,
999}