1use std::io::Error;
2use std::path::{Path, PathBuf};
3
4use rustc_errors::codes::*;
5use rustc_errors::{
6 Applicability, Diag, DiagCtxtHandle, DiagSymbolList, Diagnostic, EmissionGuarantee, Level,
7 MultiSpan,
8};
9use rustc_hir::Target;
10use rustc_hir::attrs::{MirDialect, MirPhase};
11use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
12use rustc_middle::ty::{MainDefinition, Ty};
13use rustc_span::{DUMMY_SP, Span, Symbol};
14
15use crate::check_attr::ProcMacroKind;
16use crate::fluent_generated as fluent;
17use crate::lang_items::Duplicate;
18
19#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
IncorrectDoNotRecommendLocation {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
IncorrectDoNotRecommendLocation => {
diag.primary_message(crate::fluent_generated::passes_incorrect_do_not_recommend_location);
;
diag
}
};
}
}
};LintDiagnostic)]
20#[diag(passes_incorrect_do_not_recommend_location)]
21pub(crate) struct IncorrectDoNotRecommendLocation;
22
23#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AutoDiffAttr
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AutoDiffAttr { attr_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_autodiff_attr);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
24#[diag(passes_autodiff_attr)]
25pub(crate) struct AutoDiffAttr {
26 #[primary_span]
27 #[label]
28 pub attr_span: Span,
29}
30
31#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LoopMatchAttr
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LoopMatchAttr {
attr_span: __binding_0, node_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_loop_match_attr);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
32#[diag(passes_loop_match_attr)]
33pub(crate) struct LoopMatchAttr {
34 #[primary_span]
35 pub attr_span: Span,
36 #[label]
37 pub node_span: Span,
38}
39
40#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstContinueAttr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstContinueAttr {
attr_span: __binding_0, node_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_const_continue_attr);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
41#[diag(passes_const_continue_attr)]
42pub(crate) struct ConstContinueAttr {
43 #[primary_span]
44 pub attr_span: Span,
45 #[label]
46 pub node_span: Span,
47}
48
49#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
MixedExportNameAndNoMangle {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MixedExportNameAndNoMangle {
no_mangle_span: __binding_0,
export_name_span: __binding_1,
no_mangle_attr: __binding_2,
export_name_attr: __binding_3 } => {
diag.primary_message(crate::fluent_generated::passes_mixed_export_name_and_no_mangle);
;
let __code_0 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.arg("no_mangle_attr", __binding_2);
diag.arg("export_name_attr", __binding_3);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_0,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
};
}
}
};LintDiagnostic)]
50#[diag(passes_mixed_export_name_and_no_mangle)]
51pub(crate) struct MixedExportNameAndNoMangle {
52 #[label]
53 #[suggestion(style = "verbose", code = "", applicability = "machine-applicable")]
54 pub no_mangle_span: Span,
55 #[note]
56 pub export_name_span: Span,
57 pub no_mangle_attr: &'static str,
58 pub export_name_attr: &'static str,
59}
60
61#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
OuterCrateLevelAttr {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
OuterCrateLevelAttr { suggestion: __binding_0 } => {
diag.primary_message(crate::fluent_generated::passes_outer_crate_level_attr);
;
diag.subdiagnostic(__binding_0);
diag
}
};
}
}
};LintDiagnostic)]
62#[diag(passes_outer_crate_level_attr)]
63pub(crate) struct OuterCrateLevelAttr {
64 #[subdiagnostic]
65 pub suggestion: OuterCrateLevelAttrSuggestion,
66}
67
68#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for OuterCrateLevelAttrSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
OuterCrateLevelAttrSuggestion { bang_position: __binding_0 }
=> {
let mut suggestions = Vec::new();
let __code_1 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("!"))
});
suggestions.push((__binding_0, __code_1));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_outer_crate_level_attr_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::Unspecified,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
69#[multipart_suggestion(passes_outer_crate_level_attr_suggestion, style = "verbose")]
70pub(crate) struct OuterCrateLevelAttrSuggestion {
71 #[suggestion_part(code = "!")]
72 pub bang_position: Span,
73}
74
75#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
InnerCrateLevelAttr {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
InnerCrateLevelAttr => {
diag.primary_message(crate::fluent_generated::passes_inner_crate_level_attr);
;
diag
}
};
}
}
};LintDiagnostic)]
76#[diag(passes_inner_crate_level_attr)]
77pub(crate) struct InnerCrateLevelAttr;
78
79#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NonExhaustiveWithDefaultFieldValues where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NonExhaustiveWithDefaultFieldValues {
attr_span: __binding_0, defn_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_non_exhaustive_with_default_field_values);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
80#[diag(passes_non_exhaustive_with_default_field_values)]
81pub(crate) struct NonExhaustiveWithDefaultFieldValues {
82 #[primary_span]
83 pub attr_span: Span,
84 #[label]
85 pub defn_span: Span,
86}
87
88#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
DocAliasBadLocation<'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 {
DocAliasBadLocation {
span: __binding_0, location: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_alias_bad_location);
;
diag.arg("location", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
89#[diag(passes_doc_alias_bad_location)]
90pub(crate) struct DocAliasBadLocation<'a> {
91 #[primary_span]
92 pub span: Span,
93 pub location: &'a str,
94}
95
96#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocAliasNotAnAlias where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocAliasNotAnAlias {
span: __binding_0, attr_str: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_alias_not_an_alias);
;
diag.arg("attr_str", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
97#[diag(passes_doc_alias_not_an_alias)]
98pub(crate) struct DocAliasNotAnAlias {
99 #[primary_span]
100 pub span: Span,
101 pub attr_str: Symbol,
102}
103
104#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocKeywordAttributeEmptyMod where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocKeywordAttributeEmptyMod {
span: __binding_0, attr_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_keyword_attribute_empty_mod);
;
diag.arg("attr_name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
105#[diag(passes_doc_keyword_attribute_empty_mod)]
106pub(crate) struct DocKeywordAttributeEmptyMod {
107 #[primary_span]
108 pub span: Span,
109 pub attr_name: &'static str,
110}
111
112#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocKeywordAttributeNotMod where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocKeywordAttributeNotMod {
span: __binding_0, attr_name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_keyword_attribute_not_mod);
;
diag.arg("attr_name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
113#[diag(passes_doc_keyword_attribute_not_mod)]
114pub(crate) struct DocKeywordAttributeNotMod {
115 #[primary_span]
116 pub span: Span,
117 pub attr_name: &'static str,
118}
119
120#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocFakeVariadicNotValid where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocFakeVariadicNotValid { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_fake_variadic_not_valid);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
121#[diag(passes_doc_fake_variadic_not_valid)]
122pub(crate) struct DocFakeVariadicNotValid {
123 #[primary_span]
124 pub span: Span,
125}
126
127#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocKeywordOnlyImpl where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocKeywordOnlyImpl { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_keyword_only_impl);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
128#[diag(passes_doc_keyword_only_impl)]
129pub(crate) struct DocKeywordOnlyImpl {
130 #[primary_span]
131 pub span: Span,
132}
133
134#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocSearchUnboxInvalid where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocSearchUnboxInvalid { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_search_unbox_invalid);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
135#[diag(passes_doc_search_unbox_invalid)]
136pub(crate) struct DocSearchUnboxInvalid {
137 #[primary_span]
138 pub span: Span,
139}
140
141#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DocInlineConflict where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DocInlineConflict { spans: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_doc_inline_conflict);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
142#[diag(passes_doc_inline_conflict)]
143#[help]
144pub(crate) struct DocInlineConflict {
145 #[primary_span]
146 pub spans: MultiSpan,
147}
148
149#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for DocInlineOnlyUse
{
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
DocInlineOnlyUse {
attr_span: __binding_0, item_span: __binding_1 } => {
diag.primary_message(crate::fluent_generated::passes_doc_inline_only_use);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::passes_not_a_use_item_label);
diag
}
};
}
}
};LintDiagnostic)]
150#[diag(passes_doc_inline_only_use)]
151#[note]
152pub(crate) struct DocInlineOnlyUse {
153 #[label]
154 pub attr_span: Span,
155 #[label(passes_not_a_use_item_label)]
156 pub item_span: Span,
157}
158
159#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
DocMaskedOnlyExternCrate {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
DocMaskedOnlyExternCrate {
attr_span: __binding_0, item_span: __binding_1 } => {
diag.primary_message(crate::fluent_generated::passes_doc_masked_only_extern_crate);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::passes_not_an_extern_crate_label);
diag
}
};
}
}
};LintDiagnostic)]
160#[diag(passes_doc_masked_only_extern_crate)]
161#[note]
162pub(crate) struct DocMaskedOnlyExternCrate {
163 #[label]
164 pub attr_span: Span,
165 #[label(passes_not_an_extern_crate_label)]
166 pub item_span: Span,
167}
168
169#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
DocMaskedNotExternCrateSelf {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
DocMaskedNotExternCrateSelf {
attr_span: __binding_0, item_span: __binding_1 } => {
diag.primary_message(crate::fluent_generated::passes_doc_masked_not_extern_crate_self);
;
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::passes_extern_crate_self_label);
diag
}
};
}
}
};LintDiagnostic)]
170#[diag(passes_doc_masked_not_extern_crate_self)]
171pub(crate) struct DocMaskedNotExternCrateSelf {
172 #[label]
173 pub attr_span: Span,
174 #[label(passes_extern_crate_self_label)]
175 pub item_span: Span,
176}
177
178#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BothFfiConstAndPure where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BothFfiConstAndPure { attr_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_both_ffi_const_and_pure);
diag.code(E0757);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
179#[diag(passes_both_ffi_const_and_pure, code = E0757)]
180pub(crate) struct BothFfiConstAndPure {
181 #[primary_span]
182 pub attr_span: Span,
183}
184
185#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for Link {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
Link { span: __binding_0 } => {
diag.primary_message(crate::fluent_generated::passes_link);
diag.warn(crate::fluent_generated::_subdiag::warn);
;
if let Some(__binding_0) = __binding_0 {
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
}
diag
}
};
}
}
};LintDiagnostic)]
186#[diag(passes_link)]
187#[warning]
188pub(crate) struct Link {
189 #[label]
190 pub span: Option<Span>,
191}
192
193#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcLegacyConstGenericsOnly where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcLegacyConstGenericsOnly {
attr_span: __binding_0, param_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_legacy_const_generics_only);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
194#[diag(passes_rustc_legacy_const_generics_only)]
195pub(crate) struct RustcLegacyConstGenericsOnly {
196 #[primary_span]
197 pub attr_span: Span,
198 #[label]
199 pub param_span: Span,
200}
201
202#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcLegacyConstGenericsIndex where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcLegacyConstGenericsIndex {
attr_span: __binding_0, generics_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_legacy_const_generics_index);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
203#[diag(passes_rustc_legacy_const_generics_index)]
204pub(crate) struct RustcLegacyConstGenericsIndex {
205 #[primary_span]
206 pub attr_span: Span,
207 #[label]
208 pub generics_span: Span,
209}
210
211#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcLegacyConstGenericsIndexExceed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcLegacyConstGenericsIndexExceed {
span: __binding_0, arg_count: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_legacy_const_generics_index_exceed);
;
diag.arg("arg_count", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
212#[diag(passes_rustc_legacy_const_generics_index_exceed)]
213pub(crate) struct RustcLegacyConstGenericsIndexExceed {
214 #[primary_span]
215 #[label]
216 pub span: Span,
217 pub arg_count: usize,
218}
219
220#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcDirtyClean where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcDirtyClean { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_dirty_clean);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
221#[diag(passes_rustc_dirty_clean)]
222pub(crate) struct RustcDirtyClean {
223 #[primary_span]
224 pub span: Span,
225}
226
227#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ReprConflicting where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ReprConflicting { hint_spans: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_repr_conflicting);
diag.code(E0566);
;
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
228#[diag(passes_repr_conflicting, code = E0566)]
229pub(crate) struct ReprConflicting {
230 #[primary_span]
231 pub hint_spans: Vec<Span>,
232}
233
234#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidReprAlignForTarget where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidReprAlignForTarget {
span: __binding_0, size: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_repr_align_greater_than_target_max);
diag.code(E0589);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("size", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
235#[diag(passes_repr_align_greater_than_target_max, code = E0589)]
236#[note]
237pub(crate) struct InvalidReprAlignForTarget {
238 #[primary_span]
239 pub span: Span,
240 pub size: u64,
241}
242
243#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
ReprConflictingLint {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
ReprConflictingLint => {
diag.primary_message(crate::fluent_generated::passes_repr_conflicting);
diag.code(E0566);
;
diag
}
};
}
}
};LintDiagnostic)]
244#[diag(passes_repr_conflicting, code = E0566)]
245pub(crate) struct ReprConflictingLint;
246
247#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroOnlyAttribute where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroOnlyAttribute {
attr_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_macro_only_attribute);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
248#[diag(passes_macro_only_attribute)]
249pub(crate) struct MacroOnlyAttribute {
250 #[primary_span]
251 pub attr_span: Span,
252 #[label]
253 pub span: Span,
254}
255
256#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
DebugVisualizerUnreadable<'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 {
DebugVisualizerUnreadable {
span: __binding_0, file: __binding_1, error: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_debug_visualizer_unreadable);
;
diag.arg("file", __binding_1);
diag.arg("error", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
257#[diag(passes_debug_visualizer_unreadable)]
258pub(crate) struct DebugVisualizerUnreadable<'a> {
259 #[primary_span]
260 pub span: Span,
261 pub file: &'a Path,
262 pub error: Error,
263}
264
265#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcAllowConstFnUnstable where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcAllowConstFnUnstable {
attr_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_allow_const_fn_unstable);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
266#[diag(passes_rustc_allow_const_fn_unstable)]
267pub(crate) struct RustcAllowConstFnUnstable {
268 #[primary_span]
269 pub attr_span: Span,
270 #[label]
271 pub span: Span,
272}
273
274#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcPubTransparent where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcPubTransparent {
attr_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_pub_transparent);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
275#[diag(passes_rustc_pub_transparent)]
276pub(crate) struct RustcPubTransparent {
277 #[primary_span]
278 pub attr_span: Span,
279 #[label]
280 pub span: Span,
281}
282
283#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcForceInlineCoro where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcForceInlineCoro {
attr_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_force_inline_coro);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
284#[diag(passes_rustc_force_inline_coro)]
285pub(crate) struct RustcForceInlineCoro {
286 #[primary_span]
287 pub attr_span: Span,
288 #[label]
289 pub span: Span,
290}
291
292#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for MacroExport {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MacroExport::OnDeclMacro => {
diag.primary_message(crate::fluent_generated::passes_macro_export_on_decl_macro);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag
}
};
}
}
};LintDiagnostic)]
293pub(crate) enum MacroExport {
294 #[diag(passes_macro_export_on_decl_macro)]
295 #[note]
296 OnDeclMacro,
297}
298
299#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnusedNote {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnusedNote::EmptyList { name: __binding_0 } => {
diag.store_args();
diag.arg("name", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_unused_empty_lints_note);
diag.note(__message);
diag.restore_args();
}
UnusedNote::NoLints { name: __binding_0 } => {
diag.store_args();
diag.arg("name", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_unused_no_lints_note);
diag.note(__message);
diag.restore_args();
}
UnusedNote::DefaultMethodBodyConst => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_unused_default_method_body_const_note);
diag.note(__message);
diag.restore_args();
}
UnusedNote::LinkerMessagesBinaryCrateOnly => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_unused_linker_messages_note);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
300pub(crate) enum UnusedNote {
301 #[note(passes_unused_empty_lints_note)]
302 EmptyList { name: Symbol },
303 #[note(passes_unused_no_lints_note)]
304 NoLints { name: Symbol },
305 #[note(passes_unused_default_method_body_const_note)]
306 DefaultMethodBodyConst,
307 #[note(passes_unused_linker_messages_note)]
308 LinkerMessagesBinaryCrateOnly,
309}
310
311#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for Unused {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
Unused { attr_span: __binding_0, note: __binding_1 } => {
diag.primary_message(crate::fluent_generated::passes_unused);
;
let __code_2 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_2,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.subdiagnostic(__binding_1);
diag
}
};
}
}
};LintDiagnostic)]
312#[diag(passes_unused)]
313pub(crate) struct Unused {
314 #[suggestion(code = "", applicability = "machine-applicable")]
315 pub attr_span: Span,
316 #[subdiagnostic]
317 pub note: UnusedNote,
318}
319
320#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NonExportedMacroInvalidAttrs where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NonExportedMacroInvalidAttrs { attr_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_non_exported_macro_invalid_attrs);
diag.code(E0518);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
321#[diag(passes_non_exported_macro_invalid_attrs, code = E0518)]
322pub(crate) struct NonExportedMacroInvalidAttrs {
323 #[primary_span]
324 #[label]
325 pub attr_span: Span,
326}
327
328#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
InvalidMayDangle where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidMayDangle { attr_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_may_dangle);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
329#[diag(passes_may_dangle)]
330pub(crate) struct InvalidMayDangle {
331 #[primary_span]
332 pub attr_span: Span,
333}
334
335#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for UnusedDuplicate
{
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnusedDuplicate {
this: __binding_0, other: __binding_1, warning: __binding_2
} => {
diag.primary_message(crate::fluent_generated::passes_unused_duplicate);
;
let __code_3 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_3,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
if __binding_2 {
diag.warn(crate::fluent_generated::_subdiag::warn);
}
diag
}
};
}
}
};LintDiagnostic)]
336#[diag(passes_unused_duplicate)]
337pub(crate) struct UnusedDuplicate {
338 #[suggestion(code = "", applicability = "machine-applicable")]
339 pub this: Span,
340 #[note]
341 pub other: Span,
342 #[warning]
343 pub warning: bool,
344}
345
346#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnusedMultiple
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnusedMultiple {
this: __binding_0, other: __binding_1, name: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unused_multiple);
let __code_4 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
;
diag.arg("name", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_4,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
347#[diag(passes_unused_multiple)]
348pub(crate) struct UnusedMultiple {
349 #[primary_span]
350 #[suggestion(code = "", applicability = "machine-applicable")]
351 pub this: Span,
352 #[note]
353 pub other: Span,
354 pub name: Symbol,
355}
356
357#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
DeprecatedAnnotationHasNoEffect {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
DeprecatedAnnotationHasNoEffect { span: __binding_0 } => {
diag.primary_message(crate::fluent_generated::passes_deprecated_annotation_has_no_effect);
;
let __code_5 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_5,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
};
}
}
};LintDiagnostic)]
358#[diag(passes_deprecated_annotation_has_no_effect)]
359pub(crate) struct DeprecatedAnnotationHasNoEffect {
360 #[suggestion(applicability = "machine-applicable", code = "")]
361 pub span: Span,
362}
363
364#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnknownExternLangItem where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnknownExternLangItem {
span: __binding_0, lang_item: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unknown_external_lang_item);
diag.code(E0264);
;
diag.arg("lang_item", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
365#[diag(passes_unknown_external_lang_item, code = E0264)]
366pub(crate) struct UnknownExternLangItem {
367 #[primary_span]
368 pub span: Span,
369 pub lang_item: Symbol,
370}
371
372#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingPanicHandler where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingPanicHandler => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_missing_panic_handler);
;
diag
}
}
}
}
};Diagnostic)]
373#[diag(passes_missing_panic_handler)]
374pub(crate) struct MissingPanicHandler;
375
376#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
PanicUnwindWithoutStd where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
PanicUnwindWithoutStd => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_panic_unwind_without_std);
diag.help(crate::fluent_generated::_subdiag::help);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag
}
}
}
}
};Diagnostic)]
377#[diag(passes_panic_unwind_without_std)]
378#[help]
379#[note]
380pub(crate) struct PanicUnwindWithoutStd;
381
382#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingLangItem where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingLangItem { name: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_missing_lang_item);
diag.note(crate::fluent_generated::_subdiag::note);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("name", __binding_0);
diag
}
}
}
}
};Diagnostic)]
383#[diag(passes_missing_lang_item)]
384#[note]
385#[help]
386pub(crate) struct MissingLangItem {
387 pub name: Symbol,
388}
389
390#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LangItemWithTrackCaller where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LangItemWithTrackCaller {
attr_span: __binding_0,
name: __binding_1,
sig_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_lang_item_fn_with_track_caller);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
391#[diag(passes_lang_item_fn_with_track_caller)]
392pub(crate) struct LangItemWithTrackCaller {
393 #[primary_span]
394 pub attr_span: Span,
395 pub name: Symbol,
396 #[label]
397 pub sig_span: Span,
398}
399
400#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LangItemWithTargetFeature where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LangItemWithTargetFeature {
attr_span: __binding_0,
name: __binding_1,
sig_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_lang_item_fn_with_target_feature);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
401#[diag(passes_lang_item_fn_with_target_feature)]
402pub(crate) struct LangItemWithTargetFeature {
403 #[primary_span]
404 pub attr_span: Span,
405 pub name: Symbol,
406 #[label]
407 pub sig_span: Span,
408}
409
410#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LangItemOnIncorrectTarget where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LangItemOnIncorrectTarget {
span: __binding_0,
name: __binding_1,
expected_target: __binding_2,
actual_target: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_lang_item_on_incorrect_target);
diag.code(E0718);
;
diag.arg("name", __binding_1);
diag.arg("expected_target", __binding_2);
diag.arg("actual_target", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
411#[diag(passes_lang_item_on_incorrect_target, code = E0718)]
412pub(crate) struct LangItemOnIncorrectTarget {
413 #[primary_span]
414 #[label]
415 pub span: Span,
416 pub name: Symbol,
417 pub expected_target: Target,
418 pub actual_target: Target,
419}
420
421#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnknownLangItem where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnknownLangItem { span: __binding_0, name: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unknown_lang_item);
diag.code(E0522);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
422#[diag(passes_unknown_lang_item, code = E0522)]
423pub(crate) struct UnknownLangItem {
424 #[primary_span]
425 #[label]
426 pub span: Span,
427 pub name: Symbol,
428}
429
430pub(crate) struct InvalidAttrAtCrateLevel {
431 pub span: Span,
432 pub sugg_span: Option<Span>,
433 pub name: Symbol,
434 pub item: Option<ItemFollowingInnerAttr>,
435}
436
437#[derive(#[automatically_derived]
impl ::core::clone::Clone for ItemFollowingInnerAttr {
#[inline]
fn clone(&self) -> ItemFollowingInnerAttr {
let _: ::core::clone::AssertParamIsClone<Span>;
let _: ::core::clone::AssertParamIsClone<&'static str>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for ItemFollowingInnerAttr { }Copy)]
438pub(crate) struct ItemFollowingInnerAttr {
439 pub span: Span,
440 pub kind: &'static str,
441}
442
443impl<G: EmissionGuarantee> Diagnostic<'_, G> for InvalidAttrAtCrateLevel {
444 #[track_caller]
445 fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
446 let mut diag = Diag::new(dcx, level, fluent::passes_invalid_attr_at_crate_level);
447 diag.span(self.span);
448 diag.arg("name", self.name);
449 if let Some(span) = self.sugg_span {
452 diag.span_suggestion_verbose(
453 span,
454 fluent::passes_suggestion,
455 String::new(),
456 Applicability::MachineApplicable,
457 );
458 }
459 if let Some(item) = self.item {
460 diag.arg("kind", item.kind);
461 diag.span_label(item.span, fluent::passes_invalid_attr_at_crate_level_item);
462 }
463 diag
464 }
465}
466
467#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DuplicateDiagnosticItemInCrate where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DuplicateDiagnosticItemInCrate {
duplicate_span: __binding_0,
orig_span: __binding_1,
different_crates: __binding_2,
crate_name: __binding_3,
orig_crate_name: __binding_4,
name: __binding_5 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_duplicate_diagnostic_item_in_crate);
;
diag.arg("crate_name", __binding_3);
diag.arg("orig_crate_name", __binding_4);
diag.arg("name", __binding_5);
if let Some(__binding_0) = __binding_0 {
diag.span(__binding_0);
}
if let Some(__binding_1) = __binding_1 {
diag.span_note(__binding_1,
crate::fluent_generated::passes_diagnostic_item_first_defined);
}
if __binding_2 {
diag.note(crate::fluent_generated::_subdiag::note);
}
diag
}
}
}
}
};Diagnostic)]
468#[diag(passes_duplicate_diagnostic_item_in_crate)]
469pub(crate) struct DuplicateDiagnosticItemInCrate {
470 #[primary_span]
471 pub duplicate_span: Option<Span>,
472 #[note(passes_diagnostic_item_first_defined)]
473 pub orig_span: Option<Span>,
474 #[note]
475 pub different_crates: bool,
476 pub crate_name: Symbol,
477 pub orig_crate_name: Symbol,
478 pub name: Symbol,
479}
480
481#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LayoutAbi
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LayoutAbi { span: __binding_0, abi: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_layout_abi);
;
diag.arg("abi", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
482#[diag(passes_layout_abi)]
483pub(crate) struct LayoutAbi {
484 #[primary_span]
485 pub span: Span,
486 pub abi: String,
487}
488
489#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LayoutAlign
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LayoutAlign { span: __binding_0, align: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_layout_align);
;
diag.arg("align", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
490#[diag(passes_layout_align)]
491pub(crate) struct LayoutAlign {
492 #[primary_span]
493 pub span: Span,
494 pub align: String,
495}
496
497#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LayoutSize
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LayoutSize { span: __binding_0, size: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_layout_size);
;
diag.arg("size", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
498#[diag(passes_layout_size)]
499pub(crate) struct LayoutSize {
500 #[primary_span]
501 pub span: Span,
502 pub size: String,
503}
504
505#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LayoutHomogeneousAggregate where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LayoutHomogeneousAggregate {
span: __binding_0, homogeneous_aggregate: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_layout_homogeneous_aggregate);
;
diag.arg("homogeneous_aggregate", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
506#[diag(passes_layout_homogeneous_aggregate)]
507pub(crate) struct LayoutHomogeneousAggregate {
508 #[primary_span]
509 pub span: Span,
510 pub homogeneous_aggregate: String,
511}
512
513#[derive(const _: () =
{
impl<'_sess, 'tcx, G> rustc_errors::Diagnostic<'_sess, G> for
LayoutOf<'tcx> where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LayoutOf {
span: __binding_0,
normalized_ty: __binding_1,
ty_layout: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_layout_of);
;
diag.arg("normalized_ty", __binding_1);
diag.arg("ty_layout", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
514#[diag(passes_layout_of)]
515pub(crate) struct LayoutOf<'tcx> {
516 #[primary_span]
517 pub span: Span,
518 pub normalized_ty: Ty<'tcx>,
519 pub ty_layout: String,
520}
521
522#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AbiOf where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiOf {
span: __binding_0, fn_name: __binding_1, fn_abi: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_abi_of);
;
diag.arg("fn_name", __binding_1);
diag.arg("fn_abi", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
523#[diag(passes_abi_of)]
524pub(crate) struct AbiOf {
525 #[primary_span]
526 pub span: Span,
527 pub fn_name: Symbol,
528 pub fn_abi: String,
529}
530
531#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AbiNe where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiNe {
span: __binding_0, left: __binding_1, right: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_abi_ne);
;
diag.arg("left", __binding_1);
diag.arg("right", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
532#[diag(passes_abi_ne)]
533pub(crate) struct AbiNe {
534 #[primary_span]
535 pub span: Span,
536 pub left: String,
537 pub right: String,
538}
539
540#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AbiInvalidAttribute where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AbiInvalidAttribute { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_abi_invalid_attribute);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
541#[diag(passes_abi_invalid_attribute)]
542pub(crate) struct AbiInvalidAttribute {
543 #[primary_span]
544 pub span: Span,
545}
546
547#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnrecognizedArgument where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnrecognizedArgument { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unrecognized_argument);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
548#[diag(passes_unrecognized_argument)]
549pub(crate) struct UnrecognizedArgument {
550 #[primary_span]
551 pub span: Span,
552}
553
554#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FeatureStableTwice where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FeatureStableTwice {
span: __binding_0,
feature: __binding_1,
since: __binding_2,
prev_since: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_feature_stable_twice);
diag.code(E0711);
;
diag.arg("feature", __binding_1);
diag.arg("since", __binding_2);
diag.arg("prev_since", __binding_3);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
555#[diag(passes_feature_stable_twice, code = E0711)]
556pub(crate) struct FeatureStableTwice {
557 #[primary_span]
558 pub span: Span,
559 pub feature: Symbol,
560 pub since: Symbol,
561 pub prev_since: Symbol,
562}
563
564#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
FeaturePreviouslyDeclared<'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 {
FeaturePreviouslyDeclared {
span: __binding_0,
feature: __binding_1,
declared: __binding_2,
prev_declared: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_feature_previously_declared);
diag.code(E0711);
;
diag.arg("feature", __binding_1);
diag.arg("declared", __binding_2);
diag.arg("prev_declared", __binding_3);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
565#[diag(passes_feature_previously_declared, code = E0711)]
566pub(crate) struct FeaturePreviouslyDeclared<'a> {
567 #[primary_span]
568 pub span: Span,
569 pub feature: Symbol,
570 pub declared: &'a str,
571 pub prev_declared: &'a str,
572}
573
574#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MultipleRustcMain where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MultipleRustcMain {
span: __binding_0,
first: __binding_1,
additional: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_multiple_rustc_main);
diag.code(E0137);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::passes_first);
diag.span_label(__binding_2,
crate::fluent_generated::passes_additional);
diag
}
}
}
}
};Diagnostic)]
575#[diag(passes_multiple_rustc_main, code = E0137)]
576pub(crate) struct MultipleRustcMain {
577 #[primary_span]
578 pub span: Span,
579 #[label(passes_first)]
580 pub first: Span,
581 #[label(passes_additional)]
582 pub additional: Span,
583}
584
585#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ExternMain
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternMain { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_extern_main);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
586#[diag(passes_extern_main)]
587pub(crate) struct ExternMain {
588 #[primary_span]
589 pub span: Span,
590}
591
592pub(crate) struct NoMainErr {
593 pub sp: Span,
594 pub crate_name: Symbol,
595 pub has_filename: bool,
596 pub filename: PathBuf,
597 pub file_empty: bool,
598 pub non_main_fns: Vec<Span>,
599 pub main_def_opt: Option<MainDefinition>,
600 pub add_teach_note: bool,
601}
602
603impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for NoMainErr {
604 #[track_caller]
605 fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
606 let mut diag = Diag::new(dcx, level, fluent::passes_no_main_function);
607 diag.span(DUMMY_SP);
608 diag.code(E0601);
609 diag.arg("crate_name", self.crate_name);
610 diag.arg("filename", self.filename);
611 diag.arg("has_filename", self.has_filename);
612 let note = if !self.non_main_fns.is_empty() {
613 for &span in &self.non_main_fns {
614 diag.span_note(span, fluent::passes_here_is_main);
615 }
616 diag.note(fluent::passes_one_or_more_possible_main);
617 diag.help(fluent::passes_consider_moving_main);
618 fluent::passes_main_must_be_defined_at_crate
620 } else if self.has_filename {
621 fluent::passes_consider_adding_main_to_file
622 } else {
623 fluent::passes_consider_adding_main_at_crate
624 };
625 if self.file_empty {
626 diag.note(note);
627 } else {
628 diag.span(self.sp.shrink_to_hi());
629 diag.span_label(self.sp.shrink_to_hi(), note);
630 }
631
632 if let Some(main_def) = self.main_def_opt
633 && main_def.opt_fn_def_id().is_none()
634 {
635 diag.span_label(main_def.span, fluent::passes_non_function_main);
637 }
638
639 if self.add_teach_note {
640 diag.note(fluent::passes_teach_note);
641 }
642 diag
643 }
644}
645
646pub(crate) struct DuplicateLangItem {
647 pub local_span: Option<Span>,
648 pub lang_item_name: Symbol,
649 pub crate_name: Symbol,
650 pub dependency_of: Option<Symbol>,
651 pub is_local: bool,
652 pub path: String,
653 pub first_defined_span: Option<Span>,
654 pub orig_crate_name: Option<Symbol>,
655 pub orig_dependency_of: Option<Symbol>,
656 pub orig_is_local: bool,
657 pub orig_path: String,
658 pub(crate) duplicate: Duplicate,
659}
660
661impl<G: EmissionGuarantee> Diagnostic<'_, G> for DuplicateLangItem {
662 #[track_caller]
663 fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
664 let mut diag = Diag::new(
665 dcx,
666 level,
667 match self.duplicate {
668 Duplicate::Plain => fluent::passes_duplicate_lang_item,
669 Duplicate::Crate => fluent::passes_duplicate_lang_item_crate,
670 Duplicate::CrateDepends => fluent::passes_duplicate_lang_item_crate_depends,
671 },
672 );
673 diag.code(E0152);
674 diag.arg("lang_item_name", self.lang_item_name);
675 diag.arg("crate_name", self.crate_name);
676 if let Some(dependency_of) = self.dependency_of {
677 diag.arg("dependency_of", dependency_of);
678 }
679 diag.arg("path", self.path);
680 if let Some(orig_crate_name) = self.orig_crate_name {
681 diag.arg("orig_crate_name", orig_crate_name);
682 }
683 if let Some(orig_dependency_of) = self.orig_dependency_of {
684 diag.arg("orig_dependency_of", orig_dependency_of);
685 }
686 diag.arg("orig_path", self.orig_path);
687 if let Some(span) = self.local_span {
688 diag.span(span);
689 }
690 if let Some(span) = self.first_defined_span {
691 diag.span_note(span, fluent::passes_first_defined_span);
692 } else {
693 if self.orig_dependency_of.is_none() {
694 diag.note(fluent::passes_first_defined_crate);
695 } else {
696 diag.note(fluent::passes_first_defined_crate_depends);
697 }
698
699 if self.orig_is_local {
700 diag.note(fluent::passes_first_definition_local);
701 } else {
702 diag.note(fluent::passes_first_definition_path);
703 }
704
705 if self.is_local {
706 diag.note(fluent::passes_second_definition_local);
707 } else {
708 diag.note(fluent::passes_second_definition_path);
709 }
710 }
711 diag
712 }
713}
714
715#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectTarget<'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 {
IncorrectTarget {
span: __binding_0,
generics_span: __binding_1,
name: __binding_2,
kind: __binding_3,
num: __binding_4,
actual_num: __binding_5,
at_least: __binding_6 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_incorrect_target);
diag.code(E0718);
;
diag.arg("name", __binding_2);
diag.arg("kind", __binding_3);
diag.arg("num", __binding_4);
diag.arg("actual_num", __binding_5);
diag.arg("at_least", __binding_6);
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
716#[diag(passes_incorrect_target, code = E0718)]
717pub(crate) struct IncorrectTarget<'a> {
718 #[primary_span]
719 pub span: Span,
720 #[label]
721 pub generics_span: Span,
722 pub name: &'a str, pub kind: &'static str,
724 pub num: usize,
725 pub actual_num: usize,
726 pub at_least: bool,
727}
728
729#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IncorrectCrateType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IncorrectCrateType { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_incorrect_crate_type);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
730#[diag(passes_incorrect_crate_type)]
731pub(crate) struct IncorrectCrateType {
732 #[primary_span]
733 pub span: Span,
734}
735
736#[derive(const _: () =
{
impl<'__a, 'a> rustc_errors::LintDiagnostic<'__a, ()> for
UselessAssignment<'a> {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UselessAssignment {
is_field_assign: __binding_0, ty: __binding_1 } => {
diag.primary_message(crate::fluent_generated::passes_useless_assignment);
;
diag.arg("is_field_assign", __binding_0);
diag.arg("ty", __binding_1);
diag
}
};
}
}
};LintDiagnostic)]
737#[diag(passes_useless_assignment)]
738pub(crate) struct UselessAssignment<'a> {
739 pub is_field_assign: bool,
740 pub ty: Ty<'a>,
741}
742
743#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
InlineIgnoredForExported {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
InlineIgnoredForExported {} => {
diag.primary_message(crate::fluent_generated::passes_inline_ignored_for_exported);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag
}
};
}
}
};LintDiagnostic)]
744#[diag(passes_inline_ignored_for_exported)]
745#[help]
746pub(crate) struct InlineIgnoredForExported {}
747
748#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ObjectLifetimeErr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ObjectLifetimeErr { span: __binding_0, repr: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_object_lifetime_err);
;
diag.arg("repr", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
749#[diag(passes_object_lifetime_err)]
750pub(crate) struct ObjectLifetimeErr {
751 #[primary_span]
752 pub span: Span,
753 pub repr: String,
754}
755
756#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttrApplication where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttrApplication::Enum {
hint_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_attr_application_enum);
diag.code(E0517);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
AttrApplication::Struct {
hint_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_attr_application_struct);
diag.code(E0517);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
AttrApplication::StructUnion {
hint_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_attr_application_struct_union);
diag.code(E0517);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
AttrApplication::StructEnumUnion {
hint_span: __binding_0, span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_attr_application_struct_enum_union);
diag.code(E0517);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
757pub(crate) enum AttrApplication {
758 #[diag(passes_attr_application_enum, code = E0517)]
759 Enum {
760 #[primary_span]
761 hint_span: Span,
762 #[label]
763 span: Span,
764 },
765 #[diag(passes_attr_application_struct, code = E0517)]
766 Struct {
767 #[primary_span]
768 hint_span: Span,
769 #[label]
770 span: Span,
771 },
772 #[diag(passes_attr_application_struct_union, code = E0517)]
773 StructUnion {
774 #[primary_span]
775 hint_span: Span,
776 #[label]
777 span: Span,
778 },
779 #[diag(passes_attr_application_struct_enum_union, code = E0517)]
780 StructEnumUnion {
781 #[primary_span]
782 hint_span: Span,
783 #[label]
784 span: Span,
785 },
786}
787
788#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TransparentIncompatible where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TransparentIncompatible {
hint_spans: __binding_0, target: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_transparent_incompatible);
diag.code(E0692);
;
diag.arg("target", __binding_1);
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
789#[diag(passes_transparent_incompatible, code = E0692)]
790pub(crate) struct TransparentIncompatible {
791 #[primary_span]
792 pub hint_spans: Vec<Span>,
793 pub target: String,
794}
795
796#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DeprecatedAttribute where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DeprecatedAttribute { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_deprecated_attribute);
diag.code(E0549);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
797#[diag(passes_deprecated_attribute, code = E0549)]
798pub(crate) struct DeprecatedAttribute {
799 #[primary_span]
800 pub span: Span,
801}
802
803#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UselessStability where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UselessStability { span: __binding_0, item_sp: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_useless_stability);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::passes_item);
diag
}
}
}
}
};Diagnostic)]
804#[diag(passes_useless_stability)]
805pub(crate) struct UselessStability {
806 #[primary_span]
807 #[label]
808 pub span: Span,
809 #[label(passes_item)]
810 pub item_sp: Span,
811}
812
813#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotStabilizeDeprecated where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotStabilizeDeprecated {
span: __binding_0, item_sp: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_cannot_stabilize_deprecated);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::passes_item);
diag
}
}
}
}
};Diagnostic)]
814#[diag(passes_cannot_stabilize_deprecated)]
815pub(crate) struct CannotStabilizeDeprecated {
816 #[primary_span]
817 #[label]
818 pub span: Span,
819 #[label(passes_item)]
820 pub item_sp: Span,
821}
822
823#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnstableAttrForAlreadyStableFeature where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnstableAttrForAlreadyStableFeature {
attr_span: __binding_0, item_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unstable_attr_for_already_stable_feature);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_help(__binding_0,
crate::fluent_generated::_subdiag::help);
diag.span_label(__binding_1,
crate::fluent_generated::passes_item);
diag
}
}
}
}
};Diagnostic)]
824#[diag(passes_unstable_attr_for_already_stable_feature)]
825pub(crate) struct UnstableAttrForAlreadyStableFeature {
826 #[primary_span]
827 #[label]
828 #[help]
829 pub attr_span: Span,
830 #[label(passes_item)]
831 pub item_span: Span,
832}
833
834#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MissingStabilityAttr<'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 {
MissingStabilityAttr { span: __binding_0, descr: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_missing_stability_attr);
;
diag.arg("descr", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
835#[diag(passes_missing_stability_attr)]
836pub(crate) struct MissingStabilityAttr<'a> {
837 #[primary_span]
838 pub span: Span,
839 pub descr: &'a str,
840}
841
842#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MissingConstStabAttr<'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 {
MissingConstStabAttr { span: __binding_0, descr: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_missing_const_stab_attr);
;
diag.arg("descr", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
843#[diag(passes_missing_const_stab_attr)]
844pub(crate) struct MissingConstStabAttr<'a> {
845 #[primary_span]
846 pub span: Span,
847 pub descr: &'a str,
848}
849
850#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitImplConstStable where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitImplConstStable { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_trait_impl_const_stable);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
851#[diag(passes_trait_impl_const_stable)]
852#[note]
853pub(crate) struct TraitImplConstStable {
854 #[primary_span]
855 pub span: Span,
856}
857
858#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitImplConstStabilityMismatch where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitImplConstStabilityMismatch {
span: __binding_0,
impl_stability: __binding_1,
trait_stability: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_trait_impl_const_stability_mismatch);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
859#[diag(passes_trait_impl_const_stability_mismatch)]
860pub(crate) struct TraitImplConstStabilityMismatch {
861 #[primary_span]
862 pub span: Span,
863 #[subdiagnostic]
864 pub impl_stability: ImplConstStability,
865 #[subdiagnostic]
866 pub trait_stability: TraitConstStability,
867}
868
869#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for TraitConstStability {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TraitConstStability::Stable { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_trait_impl_const_stability_mismatch_trait_stable);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
TraitConstStability::Unstable { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_trait_impl_const_stability_mismatch_trait_unstable);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
870pub(crate) enum TraitConstStability {
871 #[note(passes_trait_impl_const_stability_mismatch_trait_stable)]
872 Stable {
873 #[primary_span]
874 span: Span,
875 },
876 #[note(passes_trait_impl_const_stability_mismatch_trait_unstable)]
877 Unstable {
878 #[primary_span]
879 span: Span,
880 },
881}
882
883#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ImplConstStability {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ImplConstStability::Stable { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_trait_impl_const_stability_mismatch_impl_stable);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
ImplConstStability::Unstable { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_trait_impl_const_stability_mismatch_impl_unstable);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
884pub(crate) enum ImplConstStability {
885 #[note(passes_trait_impl_const_stability_mismatch_impl_stable)]
886 Stable {
887 #[primary_span]
888 span: Span,
889 },
890 #[note(passes_trait_impl_const_stability_mismatch_impl_unstable)]
891 Unstable {
892 #[primary_span]
893 span: Span,
894 },
895}
896
897#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnknownFeature
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnknownFeature {
span: __binding_0,
feature: __binding_1,
suggestion: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unknown_feature);
diag.code(E0635);
;
diag.arg("feature", __binding_1);
diag.span(__binding_0);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
898#[diag(passes_unknown_feature, code = E0635)]
899pub(crate) struct UnknownFeature {
900 #[primary_span]
901 pub span: Span,
902 pub feature: Symbol,
903 #[subdiagnostic]
904 pub suggestion: Option<MisspelledFeature>,
905}
906
907#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MisspelledFeature {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MisspelledFeature {
span: __binding_0, actual_name: __binding_1 } => {
let __code_6 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("actual_name", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_misspelled_feature);
diag.span_suggestions_with_style(__binding_0, __message,
__code_6, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
908#[suggestion(
909 passes_misspelled_feature,
910 style = "verbose",
911 code = "{actual_name}",
912 applicability = "maybe-incorrect"
913)]
914pub(crate) struct MisspelledFeature {
915 #[primary_span]
916 pub span: Span,
917 pub actual_name: Symbol,
918}
919
920#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for RenamedFeature
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RenamedFeature {
span: __binding_0, feature: __binding_1, alias: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unknown_feature_alias);
diag.code(E0635);
;
diag.arg("feature", __binding_1);
diag.arg("alias", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
921#[diag(passes_unknown_feature_alias, code = E0635)]
922pub(crate) struct RenamedFeature {
923 #[primary_span]
924 pub span: Span,
925 pub feature: Symbol,
926 pub alias: Symbol,
927}
928
929#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ImpliedFeatureNotExist where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ImpliedFeatureNotExist {
span: __binding_0,
feature: __binding_1,
implied_by: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_implied_feature_not_exist);
;
diag.arg("feature", __binding_1);
diag.arg("implied_by", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
930#[diag(passes_implied_feature_not_exist)]
931pub(crate) struct ImpliedFeatureNotExist {
932 #[primary_span]
933 pub span: Span,
934 pub feature: Symbol,
935 pub implied_by: Symbol,
936}
937
938#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DuplicateFeatureErr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DuplicateFeatureErr {
span: __binding_0, feature: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_duplicate_feature_err);
diag.code(E0636);
;
diag.arg("feature", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
939#[diag(passes_duplicate_feature_err, code = E0636)]
940pub(crate) struct DuplicateFeatureErr {
941 #[primary_span]
942 pub span: Span,
943 pub feature: Symbol,
944}
945
946#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MissingConstErr where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MissingConstErr { fn_sig_span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_missing_const_err);
;
diag.span(__binding_0);
diag.span_help(__binding_0,
crate::fluent_generated::_subdiag::help);
diag
}
}
}
}
};Diagnostic)]
947#[diag(passes_missing_const_err)]
948pub(crate) struct MissingConstErr {
949 #[primary_span]
950 #[help]
951 pub fn_sig_span: Span,
952}
953
954#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstStableNotStable where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstStableNotStable {
fn_sig_span: __binding_0, const_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_const_stable_not_stable);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
955#[diag(passes_const_stable_not_stable)]
956pub(crate) struct ConstStableNotStable {
957 #[primary_span]
958 pub fn_sig_span: Span,
959 #[label]
960 pub const_span: Span,
961}
962
963#[derive(const _: () =
{
impl<'__a, 'tcx> rustc_errors::LintDiagnostic<'__a, ()> for
MultipleDeadCodes<'tcx> {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MultipleDeadCodes::DeadCodes {
multiple: __binding_0,
num: __binding_1,
descr: __binding_2,
participle: __binding_3,
name_list: __binding_4,
enum_variants_with_same_name: __binding_5,
parent_info: __binding_6,
ignored_derived_impls: __binding_7 } => {
diag.primary_message(crate::fluent_generated::passes_dead_codes);
;
diag.arg("multiple", __binding_0);
diag.arg("num", __binding_1);
diag.arg("descr", __binding_2);
diag.arg("participle", __binding_3);
diag.arg("name_list", __binding_4);
for __binding_5 in __binding_5 {
diag.subdiagnostic(__binding_5);
}
if let Some(__binding_6) = __binding_6 {
diag.subdiagnostic(__binding_6);
}
if let Some(__binding_7) = __binding_7 {
diag.subdiagnostic(__binding_7);
}
diag
}
MultipleDeadCodes::UnusedTupleStructFields {
multiple: __binding_0,
num: __binding_1,
descr: __binding_2,
participle: __binding_3,
name_list: __binding_4,
change_fields_suggestion: __binding_5,
parent_info: __binding_6,
ignored_derived_impls: __binding_7 } => {
diag.primary_message(crate::fluent_generated::passes_dead_codes);
;
diag.arg("multiple", __binding_0);
diag.arg("num", __binding_1);
diag.arg("descr", __binding_2);
diag.arg("participle", __binding_3);
diag.arg("name_list", __binding_4);
diag.subdiagnostic(__binding_5);
if let Some(__binding_6) = __binding_6 {
diag.subdiagnostic(__binding_6);
}
if let Some(__binding_7) = __binding_7 {
diag.subdiagnostic(__binding_7);
}
diag
}
};
}
}
};LintDiagnostic)]
964pub(crate) enum MultipleDeadCodes<'tcx> {
965 #[diag(passes_dead_codes)]
966 DeadCodes {
967 multiple: bool,
968 num: usize,
969 descr: &'tcx str,
970 participle: &'tcx str,
971 name_list: DiagSymbolList,
972 #[subdiagnostic]
973 enum_variants_with_same_name: Vec<EnumVariantSameName<'tcx>>,
975 #[subdiagnostic]
976 parent_info: Option<ParentInfo<'tcx>>,
977 #[subdiagnostic]
978 ignored_derived_impls: Option<IgnoredDerivedImpls>,
979 },
980 #[diag(passes_dead_codes)]
981 UnusedTupleStructFields {
982 multiple: bool,
983 num: usize,
984 descr: &'tcx str,
985 participle: &'tcx str,
986 name_list: DiagSymbolList,
987 #[subdiagnostic]
988 change_fields_suggestion: ChangeFields,
989 #[subdiagnostic]
990 parent_info: Option<ParentInfo<'tcx>>,
991 #[subdiagnostic]
992 ignored_derived_impls: Option<IgnoredDerivedImpls>,
993 },
994}
995
996#[derive(const _: () =
{
impl<'tcx> rustc_errors::Subdiagnostic for EnumVariantSameName<'tcx> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
EnumVariantSameName {
variant_span: __binding_0,
dead_name: __binding_1,
dead_descr: __binding_2 } => {
diag.store_args();
diag.arg("dead_name", __binding_1);
diag.arg("dead_descr", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_enum_variant_same_name);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
997#[note(passes_enum_variant_same_name)]
998pub(crate) struct EnumVariantSameName<'tcx> {
999 #[primary_span]
1000 pub variant_span: Span,
1001 pub dead_name: Symbol,
1002 pub dead_descr: &'tcx str,
1003}
1004
1005#[derive(const _: () =
{
impl<'tcx> rustc_errors::Subdiagnostic for ParentInfo<'tcx> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ParentInfo {
num: __binding_0,
descr: __binding_1,
parent_descr: __binding_2,
span: __binding_3 } => {
diag.store_args();
diag.arg("num", __binding_0);
diag.arg("descr", __binding_1);
diag.arg("parent_descr", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_parent_info);
diag.span_label(__binding_3, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1006#[label(passes_parent_info)]
1007pub(crate) struct ParentInfo<'tcx> {
1008 pub num: usize,
1009 pub descr: &'tcx str,
1010 pub parent_descr: &'tcx str,
1011 #[primary_span]
1012 pub span: Span,
1013}
1014
1015#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for IgnoredDerivedImpls {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
IgnoredDerivedImpls {
name: __binding_0,
trait_list: __binding_1,
trait_list_len: __binding_2 } => {
diag.store_args();
diag.arg("name", __binding_0);
diag.arg("trait_list", __binding_1);
diag.arg("trait_list_len", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_ignored_derived_impls);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1016#[note(passes_ignored_derived_impls)]
1017pub(crate) struct IgnoredDerivedImpls {
1018 pub name: Symbol,
1019 pub trait_list: DiagSymbolList,
1020 pub trait_list_len: usize,
1021}
1022
1023#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ChangeFields {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ChangeFields::ChangeToUnitTypeOrRemove {
num: __binding_0, spans: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_7 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("()"))
});
for __binding_1 in __binding_1 {
suggestions.push((__binding_1, __code_7.clone()));
}
diag.store_args();
diag.arg("num", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_change_fields_to_be_of_unit_type);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
ChangeFields::Remove { num: __binding_0 } => {
diag.store_args();
diag.arg("num", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_remove_fields);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1024pub(crate) enum ChangeFields {
1025 #[multipart_suggestion(
1026 passes_change_fields_to_be_of_unit_type,
1027 applicability = "has-placeholders"
1028 )]
1029 ChangeToUnitTypeOrRemove {
1030 num: usize,
1031 #[suggestion_part(code = "()")]
1032 spans: Vec<Span>,
1033 },
1034 #[help(passes_remove_fields)]
1035 Remove { num: usize },
1036}
1037
1038#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ProcMacroBadSig where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ProcMacroBadSig { span: __binding_0, kind: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_proc_macro_bad_sig);
;
diag.arg("kind", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1039#[diag(passes_proc_macro_bad_sig)]
1040pub(crate) struct ProcMacroBadSig {
1041 #[primary_span]
1042 pub span: Span,
1043 pub kind: ProcMacroKind,
1044}
1045
1046#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
UnnecessaryStableFeature {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnnecessaryStableFeature {
feature: __binding_0, since: __binding_1 } => {
diag.primary_message(crate::fluent_generated::passes_unnecessary_stable_feature);
;
diag.arg("feature", __binding_0);
diag.arg("since", __binding_1);
diag
}
};
}
}
};LintDiagnostic)]
1047#[diag(passes_unnecessary_stable_feature)]
1048pub(crate) struct UnnecessaryStableFeature {
1049 pub feature: Symbol,
1050 pub since: Symbol,
1051}
1052
1053#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
UnnecessaryPartialStableFeature {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnnecessaryPartialStableFeature {
span: __binding_0,
line: __binding_1,
feature: __binding_2,
since: __binding_3,
implies: __binding_4 } => {
diag.primary_message(crate::fluent_generated::passes_unnecessary_partial_stable_feature);
;
let __code_8 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_4))
})].into_iter();
let __code_9 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.arg("feature", __binding_2);
diag.arg("since", __binding_3);
diag.arg("implies", __binding_4);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_8,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::passes_suggestion_remove, __code_9,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
};
}
}
};LintDiagnostic)]
1054#[diag(passes_unnecessary_partial_stable_feature)]
1055pub(crate) struct UnnecessaryPartialStableFeature {
1056 #[suggestion(code = "{implies}", applicability = "maybe-incorrect")]
1057 pub span: Span,
1058 #[suggestion(passes_suggestion_remove, code = "", applicability = "maybe-incorrect")]
1059 pub line: Span,
1060 pub feature: Symbol,
1061 pub since: Symbol,
1062 pub implies: Symbol,
1063}
1064
1065#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
IneffectiveUnstableImpl {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
IneffectiveUnstableImpl => {
diag.primary_message(crate::fluent_generated::passes_ineffective_unstable_impl);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag
}
};
}
}
};LintDiagnostic)]
1066#[diag(passes_ineffective_unstable_impl)]
1067#[note]
1068pub(crate) struct IneffectiveUnstableImpl;
1069
1070#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SanitizeAttributeNotAllowed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SanitizeAttributeNotAllowed {
attr_span: __binding_0,
not_fn_impl_mod: __binding_1,
no_body: __binding_2,
help: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_sanitize_attribute_not_allowed);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.span_label(__binding_1,
crate::fluent_generated::passes_not_fn_impl_mod);
}
if let Some(__binding_2) = __binding_2 {
diag.span_label(__binding_2,
crate::fluent_generated::passes_no_body);
}
diag.help(crate::fluent_generated::_subdiag::help);
diag
}
}
}
}
};Diagnostic)]
1072#[diag(passes_sanitize_attribute_not_allowed)]
1073pub(crate) struct SanitizeAttributeNotAllowed {
1074 #[primary_span]
1075 pub attr_span: Span,
1076 #[label(passes_not_fn_impl_mod)]
1078 pub not_fn_impl_mod: Option<Span>,
1079 #[label(passes_no_body)]
1081 pub no_body: Option<Span>,
1082 #[help]
1084 pub help: (),
1085}
1086
1087#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RustcConstStableIndirectPairing where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RustcConstStableIndirectPairing { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_rustc_const_stable_indirect_pairing);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1089#[diag(passes_rustc_const_stable_indirect_pairing)]
1090pub(crate) struct RustcConstStableIndirectPairing {
1091 #[primary_span]
1092 pub span: Span,
1093}
1094
1095#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnsupportedAttributesInWhere where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnsupportedAttributesInWhere { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unsupported_attributes_in_where);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1096#[diag(passes_unsupported_attributes_in_where)]
1097#[help]
1098pub(crate) struct UnsupportedAttributesInWhere {
1099 #[primary_span]
1100 pub span: MultiSpan,
1101}
1102
1103#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
UnexportableItem<'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 {
UnexportableItem::Item {
span: __binding_0, descr: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unexportable_item);
;
diag.arg("descr", __binding_1);
diag.span(__binding_0);
diag
}
UnexportableItem::GenericFn(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unexportable_generic_fn);
;
diag.span(__binding_0);
diag
}
UnexportableItem::FnAbi(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unexportable_fn_abi);
;
diag.span(__binding_0);
diag
}
UnexportableItem::TypeRepr(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unexportable_type_repr);
;
diag.span(__binding_0);
diag
}
UnexportableItem::TypeInInterface {
span: __binding_0,
desc: __binding_1,
ty: __binding_2,
ty_span: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unexportable_type_in_interface);
;
diag.arg("desc", __binding_1);
diag.arg("ty", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_3,
crate::fluent_generated::_subdiag::label);
diag
}
UnexportableItem::PrivItem {
span: __binding_0,
vis_note: __binding_1,
vis_descr: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unexportable_priv_item);
;
diag.arg("vis_descr", __binding_2);
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
UnexportableItem::AdtWithPrivFields {
span: __binding_0,
vis_note: __binding_1,
field_name: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_unexportable_adt_with_private_fields);
;
diag.arg("field_name", __binding_2);
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
1104pub(crate) enum UnexportableItem<'a> {
1105 #[diag(passes_unexportable_item)]
1106 Item {
1107 #[primary_span]
1108 span: Span,
1109 descr: &'a str,
1110 },
1111
1112 #[diag(passes_unexportable_generic_fn)]
1113 GenericFn(#[primary_span] Span),
1114
1115 #[diag(passes_unexportable_fn_abi)]
1116 FnAbi(#[primary_span] Span),
1117
1118 #[diag(passes_unexportable_type_repr)]
1119 TypeRepr(#[primary_span] Span),
1120
1121 #[diag(passes_unexportable_type_in_interface)]
1122 TypeInInterface {
1123 #[primary_span]
1124 span: Span,
1125 desc: &'a str,
1126 ty: &'a str,
1127 #[label]
1128 ty_span: Span,
1129 },
1130
1131 #[diag(passes_unexportable_priv_item)]
1132 PrivItem {
1133 #[primary_span]
1134 span: Span,
1135 #[note]
1136 vis_note: Span,
1137 vis_descr: &'a str,
1138 },
1139
1140 #[diag(passes_unexportable_adt_with_private_fields)]
1141 AdtWithPrivFields {
1142 #[primary_span]
1143 span: Span,
1144 #[note]
1145 vis_note: Span,
1146 field_name: &'a str,
1147 },
1148}
1149
1150#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ReprAlignShouldBeAlign where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ReprAlignShouldBeAlign {
span: __binding_0, item: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_repr_align_should_be_align);
;
diag.arg("item", __binding_1);
diag.span(__binding_0);
diag.span_help(__binding_0,
crate::fluent_generated::_subdiag::help);
diag
}
}
}
}
};Diagnostic)]
1151#[diag(passes_repr_align_should_be_align)]
1152pub(crate) struct ReprAlignShouldBeAlign {
1153 #[primary_span]
1154 #[help]
1155 pub span: Span,
1156 pub item: &'static str,
1157}
1158
1159#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ReprAlignShouldBeAlignStatic where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ReprAlignShouldBeAlignStatic {
span: __binding_0, item: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_repr_align_should_be_align_static);
;
diag.arg("item", __binding_1);
diag.span(__binding_0);
diag.span_help(__binding_0,
crate::fluent_generated::_subdiag::help);
diag
}
}
}
}
};Diagnostic)]
1160#[diag(passes_repr_align_should_be_align_static)]
1161pub(crate) struct ReprAlignShouldBeAlignStatic {
1162 #[primary_span]
1163 #[help]
1164 pub span: Span,
1165 pub item: &'static str,
1166}
1167
1168#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CustomMirPhaseRequiresDialect where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CustomMirPhaseRequiresDialect {
attr_span: __binding_0, phase_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_custom_mir_phase_requires_dialect);
;
diag.span(__binding_0);
diag.span_label(__binding_1,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1169#[diag(passes_custom_mir_phase_requires_dialect)]
1170pub(crate) struct CustomMirPhaseRequiresDialect {
1171 #[primary_span]
1172 pub attr_span: Span,
1173 #[label]
1174 pub phase_span: Span,
1175}
1176
1177#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CustomMirIncompatibleDialectAndPhase where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CustomMirIncompatibleDialectAndPhase {
dialect: __binding_0,
phase: __binding_1,
attr_span: __binding_2,
dialect_span: __binding_3,
phase_span: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_custom_mir_incompatible_dialect_and_phase);
;
diag.arg("dialect", __binding_0);
diag.arg("phase", __binding_1);
diag.span(__binding_2);
diag.span_label(__binding_3,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_4,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1178#[diag(passes_custom_mir_incompatible_dialect_and_phase)]
1179pub(crate) struct CustomMirIncompatibleDialectAndPhase {
1180 pub dialect: MirDialect,
1181 pub phase: MirPhase,
1182 #[primary_span]
1183 pub attr_span: Span,
1184 #[label]
1185 pub dialect_span: Span,
1186 #[label]
1187 pub phase_span: Span,
1188}
1189
1190#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
EiiImplNotFunction where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EiiImplNotFunction { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_eii_impl_not_function);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1191#[diag(passes_eii_impl_not_function)]
1192pub(crate) struct EiiImplNotFunction {
1193 #[primary_span]
1194 pub span: Span,
1195}
1196
1197#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
EiiImplRequiresUnsafe where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EiiImplRequiresUnsafe {
span: __binding_0,
name: __binding_1,
suggestion: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_eii_impl_requires_unsafe);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
1198#[diag(passes_eii_impl_requires_unsafe)]
1199pub(crate) struct EiiImplRequiresUnsafe {
1200 #[primary_span]
1201 pub span: Span,
1202 pub name: Symbol,
1203 #[subdiagnostic]
1204 pub suggestion: EiiImplRequiresUnsafeSuggestion,
1205}
1206
1207#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for EiiImplRequiresUnsafeSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
EiiImplRequiresUnsafeSuggestion {
left: __binding_0, right: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_10 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("unsafe("))
});
let __code_11 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(")"))
});
suggestions.push((__binding_0, __code_10));
suggestions.push((__binding_1, __code_11));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_eii_impl_requires_unsafe_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1208#[multipart_suggestion(
1209 passes_eii_impl_requires_unsafe_suggestion,
1210 applicability = "machine-applicable"
1211)]
1212pub(crate) struct EiiImplRequiresUnsafeSuggestion {
1213 #[suggestion_part(code = "unsafe(")]
1214 pub left: Span,
1215 #[suggestion_part(code = ")")]
1216 pub right: Span,
1217}
1218
1219#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
EiiWithTrackCaller where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EiiWithTrackCaller {
attr_span: __binding_0,
name: __binding_1,
sig_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_eii_fn_with_track_caller);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1220#[diag(passes_eii_fn_with_track_caller)]
1221pub(crate) struct EiiWithTrackCaller {
1222 #[primary_span]
1223 pub attr_span: Span,
1224 pub name: Symbol,
1225 #[label]
1226 pub sig_span: Span,
1227}
1228
1229#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for EiiWithoutImpl
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
EiiWithoutImpl {
span: __binding_0,
name: __binding_1,
current_crate_name: __binding_2,
decl_crate_name: __binding_3,
help: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_eii_without_impl);
;
diag.arg("name", __binding_1);
diag.arg("current_crate_name", __binding_2);
diag.arg("decl_crate_name", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.help(crate::fluent_generated::_subdiag::help);
diag
}
}
}
}
};Diagnostic)]
1230#[diag(passes_eii_without_impl)]
1231pub(crate) struct EiiWithoutImpl {
1232 #[primary_span]
1233 #[label]
1234 pub span: Span,
1235 pub name: Symbol,
1236
1237 pub current_crate_name: Symbol,
1238 pub decl_crate_name: Symbol,
1239 #[help]
1240 pub help: (),
1241}
1242
1243#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
DuplicateEiiImpls where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
DuplicateEiiImpls {
name: __binding_0,
first_span: __binding_1,
first_crate: __binding_2,
second_span: __binding_3,
second_crate: __binding_4,
additional_crates: __binding_5,
num_additional_crates: __binding_6,
additional_crate_names: __binding_7,
help: __binding_8 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_duplicate_eii_impls);
;
diag.arg("name", __binding_0);
diag.arg("first_crate", __binding_2);
diag.arg("second_crate", __binding_4);
diag.arg("num_additional_crates", __binding_6);
diag.arg("additional_crate_names", __binding_7);
diag.span(__binding_1);
diag.span_label(__binding_1,
crate::fluent_generated::passes_first);
diag.span_label(__binding_3,
crate::fluent_generated::passes_second);
if let Some(__binding_5) = __binding_5 {
diag.note(crate::fluent_generated::_subdiag::note);
}
diag.help(crate::fluent_generated::_subdiag::help);
diag
}
}
}
}
};Diagnostic)]
1244#[diag(passes_duplicate_eii_impls)]
1245pub(crate) struct DuplicateEiiImpls {
1246 pub name: Symbol,
1247
1248 #[primary_span]
1249 #[label(passes_first)]
1250 pub first_span: Span,
1251 pub first_crate: Symbol,
1252
1253 #[label(passes_second)]
1254 pub second_span: Span,
1255 pub second_crate: Symbol,
1256
1257 #[note]
1258 pub additional_crates: Option<()>,
1259
1260 pub num_additional_crates: usize,
1261 pub additional_crate_names: String,
1262
1263 #[help]
1264 pub help: (),
1265}
1266
1267#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FunctionNotHaveDefaultImplementation where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FunctionNotHaveDefaultImplementation {
span: __binding_0, note_span: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_function_not_have_default_implementation);
;
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
1268#[diag(passes_function_not_have_default_implementation)]
1269pub(crate) struct FunctionNotHaveDefaultImplementation {
1270 #[primary_span]
1271 pub span: Span,
1272 #[note]
1273 pub note_span: Span,
1274}
1275
1276#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MustImplementNotFunction where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MustImplementNotFunction {
span: __binding_0, span_note: __binding_1, note: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_must_implement_not_function);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
1277#[diag(passes_must_implement_not_function)]
1278pub(crate) struct MustImplementNotFunction {
1279 #[primary_span]
1280 pub span: Span,
1281 #[subdiagnostic]
1282 pub span_note: MustImplementNotFunctionSpanNote,
1283 #[subdiagnostic]
1284 pub note: MustImplementNotFunctionNote,
1285}
1286
1287#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MustImplementNotFunctionSpanNote
{
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MustImplementNotFunctionSpanNote { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_must_implement_not_function_span_note);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1288#[note(passes_must_implement_not_function_span_note)]
1289pub(crate) struct MustImplementNotFunctionSpanNote {
1290 #[primary_span]
1291 pub span: Span,
1292}
1293
1294#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MustImplementNotFunctionNote {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MustImplementNotFunctionNote {} => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::passes_must_implement_not_function_note);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1295#[note(passes_must_implement_not_function_note)]
1296pub(crate) struct MustImplementNotFunctionNote {}
1297
1298#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FunctionNotFoundInTrait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FunctionNotFoundInTrait { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_function_not_found_in_trait);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1299#[diag(passes_function_not_found_in_trait)]
1300pub(crate) struct FunctionNotFoundInTrait {
1301 #[primary_span]
1302 pub span: Span,
1303}
1304
1305#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
FunctionNamesDuplicated where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
FunctionNamesDuplicated { spans: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_functions_names_duplicated);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0.clone());
diag
}
}
}
}
};Diagnostic)]
1306#[diag(passes_functions_names_duplicated)]
1307#[note]
1308pub(crate) struct FunctionNamesDuplicated {
1309 #[primary_span]
1310 pub spans: Vec<Span>,
1311}