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
LayoutInvalidAttribute where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LayoutInvalidAttribute { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::passes_layout_invalid_attribute);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
523#[diag(passes_layout_invalid_attribute)]
524pub(crate) struct LayoutInvalidAttribute {
525 #[primary_span]
526 pub span: Span,
527}
528
529#[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)]
530#[diag(passes_abi_of)]
531pub(crate) struct AbiOf {
532 #[primary_span]
533 pub span: Span,
534 pub fn_name: Symbol,
535 pub fn_abi: String,
536}
537
538#[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)]
539#[diag(passes_abi_ne)]
540pub(crate) struct AbiNe {
541 #[primary_span]
542 pub span: Span,
543 pub left: String,
544 pub right: String,
545}
546
547#[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)]
548#[diag(passes_abi_invalid_attribute)]
549pub(crate) struct AbiInvalidAttribute {
550 #[primary_span]
551 pub span: Span,
552}
553
554#[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)]
555#[diag(passes_unrecognized_argument)]
556pub(crate) struct UnrecognizedArgument {
557 #[primary_span]
558 pub span: Span,
559}
560
561#[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)]
562#[diag(passes_feature_stable_twice, code = E0711)]
563pub(crate) struct FeatureStableTwice {
564 #[primary_span]
565 pub span: Span,
566 pub feature: Symbol,
567 pub since: Symbol,
568 pub prev_since: Symbol,
569}
570
571#[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)]
572#[diag(passes_feature_previously_declared, code = E0711)]
573pub(crate) struct FeaturePreviouslyDeclared<'a> {
574 #[primary_span]
575 pub span: Span,
576 pub feature: Symbol,
577 pub declared: &'a str,
578 pub prev_declared: &'a str,
579}
580
581#[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)]
582#[diag(passes_multiple_rustc_main, code = E0137)]
583pub(crate) struct MultipleRustcMain {
584 #[primary_span]
585 pub span: Span,
586 #[label(passes_first)]
587 pub first: Span,
588 #[label(passes_additional)]
589 pub additional: Span,
590}
591
592#[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)]
593#[diag(passes_extern_main)]
594pub(crate) struct ExternMain {
595 #[primary_span]
596 pub span: Span,
597}
598
599pub(crate) struct NoMainErr {
600 pub sp: Span,
601 pub crate_name: Symbol,
602 pub has_filename: bool,
603 pub filename: PathBuf,
604 pub file_empty: bool,
605 pub non_main_fns: Vec<Span>,
606 pub main_def_opt: Option<MainDefinition>,
607 pub add_teach_note: bool,
608}
609
610impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for NoMainErr {
611 #[track_caller]
612 fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
613 let mut diag = Diag::new(dcx, level, fluent::passes_no_main_function);
614 diag.span(DUMMY_SP);
615 diag.code(E0601);
616 diag.arg("crate_name", self.crate_name);
617 diag.arg("filename", self.filename);
618 diag.arg("has_filename", self.has_filename);
619 let note = if !self.non_main_fns.is_empty() {
620 for &span in &self.non_main_fns {
621 diag.span_note(span, fluent::passes_here_is_main);
622 }
623 diag.note(fluent::passes_one_or_more_possible_main);
624 diag.help(fluent::passes_consider_moving_main);
625 fluent::passes_main_must_be_defined_at_crate
627 } else if self.has_filename {
628 fluent::passes_consider_adding_main_to_file
629 } else {
630 fluent::passes_consider_adding_main_at_crate
631 };
632 if self.file_empty {
633 diag.note(note);
634 } else {
635 diag.span(self.sp.shrink_to_hi());
636 diag.span_label(self.sp.shrink_to_hi(), note);
637 }
638
639 if let Some(main_def) = self.main_def_opt
640 && main_def.opt_fn_def_id().is_none()
641 {
642 diag.span_label(main_def.span, fluent::passes_non_function_main);
644 }
645
646 if self.add_teach_note {
647 diag.note(fluent::passes_teach_note);
648 }
649 diag
650 }
651}
652
653pub(crate) struct DuplicateLangItem {
654 pub local_span: Option<Span>,
655 pub lang_item_name: Symbol,
656 pub crate_name: Symbol,
657 pub dependency_of: Option<Symbol>,
658 pub is_local: bool,
659 pub path: String,
660 pub first_defined_span: Option<Span>,
661 pub orig_crate_name: Option<Symbol>,
662 pub orig_dependency_of: Option<Symbol>,
663 pub orig_is_local: bool,
664 pub orig_path: String,
665 pub(crate) duplicate: Duplicate,
666}
667
668impl<G: EmissionGuarantee> Diagnostic<'_, G> for DuplicateLangItem {
669 #[track_caller]
670 fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
671 let mut diag = Diag::new(
672 dcx,
673 level,
674 match self.duplicate {
675 Duplicate::Plain => fluent::passes_duplicate_lang_item,
676 Duplicate::Crate => fluent::passes_duplicate_lang_item_crate,
677 Duplicate::CrateDepends => fluent::passes_duplicate_lang_item_crate_depends,
678 },
679 );
680 diag.code(E0152);
681 diag.arg("lang_item_name", self.lang_item_name);
682 diag.arg("crate_name", self.crate_name);
683 if let Some(dependency_of) = self.dependency_of {
684 diag.arg("dependency_of", dependency_of);
685 }
686 diag.arg("path", self.path);
687 if let Some(orig_crate_name) = self.orig_crate_name {
688 diag.arg("orig_crate_name", orig_crate_name);
689 }
690 if let Some(orig_dependency_of) = self.orig_dependency_of {
691 diag.arg("orig_dependency_of", orig_dependency_of);
692 }
693 diag.arg("orig_path", self.orig_path);
694 if let Some(span) = self.local_span {
695 diag.span(span);
696 }
697 if let Some(span) = self.first_defined_span {
698 diag.span_note(span, fluent::passes_first_defined_span);
699 } else {
700 if self.orig_dependency_of.is_none() {
701 diag.note(fluent::passes_first_defined_crate);
702 } else {
703 diag.note(fluent::passes_first_defined_crate_depends);
704 }
705
706 if self.orig_is_local {
707 diag.note(fluent::passes_first_definition_local);
708 } else {
709 diag.note(fluent::passes_first_definition_path);
710 }
711
712 if self.is_local {
713 diag.note(fluent::passes_second_definition_local);
714 } else {
715 diag.note(fluent::passes_second_definition_path);
716 }
717 }
718 diag
719 }
720}
721
722#[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)]
723#[diag(passes_incorrect_target, code = E0718)]
724pub(crate) struct IncorrectTarget<'a> {
725 #[primary_span]
726 pub span: Span,
727 #[label]
728 pub generics_span: Span,
729 pub name: &'a str, pub kind: &'static str,
731 pub num: usize,
732 pub actual_num: usize,
733 pub at_least: bool,
734}
735
736#[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)]
737#[diag(passes_incorrect_crate_type)]
738pub(crate) struct IncorrectCrateType {
739 #[primary_span]
740 pub span: Span,
741}
742
743#[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)]
744#[diag(passes_useless_assignment)]
745pub(crate) struct UselessAssignment<'a> {
746 pub is_field_assign: bool,
747 pub ty: Ty<'a>,
748}
749
750#[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)]
751#[diag(passes_inline_ignored_for_exported)]
752#[help]
753pub(crate) struct InlineIgnoredForExported {}
754
755#[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)]
756#[diag(passes_object_lifetime_err)]
757pub(crate) struct ObjectLifetimeErr {
758 #[primary_span]
759 pub span: Span,
760 pub repr: String,
761}
762
763#[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)]
764pub(crate) enum AttrApplication {
765 #[diag(passes_attr_application_enum, code = E0517)]
766 Enum {
767 #[primary_span]
768 hint_span: Span,
769 #[label]
770 span: Span,
771 },
772 #[diag(passes_attr_application_struct, code = E0517)]
773 Struct {
774 #[primary_span]
775 hint_span: Span,
776 #[label]
777 span: Span,
778 },
779 #[diag(passes_attr_application_struct_union, code = E0517)]
780 StructUnion {
781 #[primary_span]
782 hint_span: Span,
783 #[label]
784 span: Span,
785 },
786 #[diag(passes_attr_application_struct_enum_union, code = E0517)]
787 StructEnumUnion {
788 #[primary_span]
789 hint_span: Span,
790 #[label]
791 span: Span,
792 },
793}
794
795#[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)]
796#[diag(passes_transparent_incompatible, code = E0692)]
797pub(crate) struct TransparentIncompatible {
798 #[primary_span]
799 pub hint_spans: Vec<Span>,
800 pub target: String,
801}
802
803#[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)]
804#[diag(passes_deprecated_attribute, code = E0549)]
805pub(crate) struct DeprecatedAttribute {
806 #[primary_span]
807 pub span: Span,
808}
809
810#[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)]
811#[diag(passes_useless_stability)]
812pub(crate) struct UselessStability {
813 #[primary_span]
814 #[label]
815 pub span: Span,
816 #[label(passes_item)]
817 pub item_sp: Span,
818}
819
820#[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)]
821#[diag(passes_cannot_stabilize_deprecated)]
822pub(crate) struct CannotStabilizeDeprecated {
823 #[primary_span]
824 #[label]
825 pub span: Span,
826 #[label(passes_item)]
827 pub item_sp: Span,
828}
829
830#[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)]
831#[diag(passes_unstable_attr_for_already_stable_feature)]
832pub(crate) struct UnstableAttrForAlreadyStableFeature {
833 #[primary_span]
834 #[label]
835 #[help]
836 pub attr_span: Span,
837 #[label(passes_item)]
838 pub item_span: Span,
839}
840
841#[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)]
842#[diag(passes_missing_stability_attr)]
843pub(crate) struct MissingStabilityAttr<'a> {
844 #[primary_span]
845 pub span: Span,
846 pub descr: &'a str,
847}
848
849#[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)]
850#[diag(passes_missing_const_stab_attr)]
851pub(crate) struct MissingConstStabAttr<'a> {
852 #[primary_span]
853 pub span: Span,
854 pub descr: &'a str,
855}
856
857#[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)]
858#[diag(passes_trait_impl_const_stable)]
859#[note]
860pub(crate) struct TraitImplConstStable {
861 #[primary_span]
862 pub span: Span,
863}
864
865#[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)]
866#[diag(passes_trait_impl_const_stability_mismatch)]
867pub(crate) struct TraitImplConstStabilityMismatch {
868 #[primary_span]
869 pub span: Span,
870 #[subdiagnostic]
871 pub impl_stability: ImplConstStability,
872 #[subdiagnostic]
873 pub trait_stability: TraitConstStability,
874}
875
876#[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)]
877pub(crate) enum TraitConstStability {
878 #[note(passes_trait_impl_const_stability_mismatch_trait_stable)]
879 Stable {
880 #[primary_span]
881 span: Span,
882 },
883 #[note(passes_trait_impl_const_stability_mismatch_trait_unstable)]
884 Unstable {
885 #[primary_span]
886 span: Span,
887 },
888}
889
890#[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)]
891pub(crate) enum ImplConstStability {
892 #[note(passes_trait_impl_const_stability_mismatch_impl_stable)]
893 Stable {
894 #[primary_span]
895 span: Span,
896 },
897 #[note(passes_trait_impl_const_stability_mismatch_impl_unstable)]
898 Unstable {
899 #[primary_span]
900 span: Span,
901 },
902}
903
904#[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)]
905#[diag(passes_unknown_feature, code = E0635)]
906pub(crate) struct UnknownFeature {
907 #[primary_span]
908 pub span: Span,
909 pub feature: Symbol,
910 #[subdiagnostic]
911 pub suggestion: Option<MisspelledFeature>,
912}
913
914#[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)]
915#[suggestion(
916 passes_misspelled_feature,
917 style = "verbose",
918 code = "{actual_name}",
919 applicability = "maybe-incorrect"
920)]
921pub(crate) struct MisspelledFeature {
922 #[primary_span]
923 pub span: Span,
924 pub actual_name: Symbol,
925}
926
927#[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)]
928#[diag(passes_unknown_feature_alias, code = E0635)]
929pub(crate) struct RenamedFeature {
930 #[primary_span]
931 pub span: Span,
932 pub feature: Symbol,
933 pub alias: Symbol,
934}
935
936#[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)]
937#[diag(passes_implied_feature_not_exist)]
938pub(crate) struct ImpliedFeatureNotExist {
939 #[primary_span]
940 pub span: Span,
941 pub feature: Symbol,
942 pub implied_by: Symbol,
943}
944
945#[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)]
946#[diag(passes_duplicate_feature_err, code = E0636)]
947pub(crate) struct DuplicateFeatureErr {
948 #[primary_span]
949 pub span: Span,
950 pub feature: Symbol,
951}
952
953#[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)]
954#[diag(passes_missing_const_err)]
955pub(crate) struct MissingConstErr {
956 #[primary_span]
957 #[help]
958 pub fn_sig_span: Span,
959}
960
961#[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)]
962#[diag(passes_const_stable_not_stable)]
963pub(crate) struct ConstStableNotStable {
964 #[primary_span]
965 pub fn_sig_span: Span,
966 #[label]
967 pub const_span: Span,
968}
969
970#[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)]
971pub(crate) enum MultipleDeadCodes<'tcx> {
972 #[diag(passes_dead_codes)]
973 DeadCodes {
974 multiple: bool,
975 num: usize,
976 descr: &'tcx str,
977 participle: &'tcx str,
978 name_list: DiagSymbolList,
979 #[subdiagnostic]
980 enum_variants_with_same_name: Vec<EnumVariantSameName<'tcx>>,
982 #[subdiagnostic]
983 parent_info: Option<ParentInfo<'tcx>>,
984 #[subdiagnostic]
985 ignored_derived_impls: Option<IgnoredDerivedImpls>,
986 },
987 #[diag(passes_dead_codes)]
988 UnusedTupleStructFields {
989 multiple: bool,
990 num: usize,
991 descr: &'tcx str,
992 participle: &'tcx str,
993 name_list: DiagSymbolList,
994 #[subdiagnostic]
995 change_fields_suggestion: ChangeFields,
996 #[subdiagnostic]
997 parent_info: Option<ParentInfo<'tcx>>,
998 #[subdiagnostic]
999 ignored_derived_impls: Option<IgnoredDerivedImpls>,
1000 },
1001}
1002
1003#[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)]
1004#[note(passes_enum_variant_same_name)]
1005pub(crate) struct EnumVariantSameName<'tcx> {
1006 #[primary_span]
1007 pub variant_span: Span,
1008 pub dead_name: Symbol,
1009 pub dead_descr: &'tcx str,
1010}
1011
1012#[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)]
1013#[label(passes_parent_info)]
1014pub(crate) struct ParentInfo<'tcx> {
1015 pub num: usize,
1016 pub descr: &'tcx str,
1017 pub parent_descr: &'tcx str,
1018 #[primary_span]
1019 pub span: Span,
1020}
1021
1022#[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)]
1023#[note(passes_ignored_derived_impls)]
1024pub(crate) struct IgnoredDerivedImpls {
1025 pub name: Symbol,
1026 pub trait_list: DiagSymbolList,
1027 pub trait_list_len: usize,
1028}
1029
1030#[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)]
1031pub(crate) enum ChangeFields {
1032 #[multipart_suggestion(
1033 passes_change_fields_to_be_of_unit_type,
1034 applicability = "has-placeholders"
1035 )]
1036 ChangeToUnitTypeOrRemove {
1037 num: usize,
1038 #[suggestion_part(code = "()")]
1039 spans: Vec<Span>,
1040 },
1041 #[help(passes_remove_fields)]
1042 Remove { num: usize },
1043}
1044
1045#[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)]
1046#[diag(passes_proc_macro_bad_sig)]
1047pub(crate) struct ProcMacroBadSig {
1048 #[primary_span]
1049 pub span: Span,
1050 pub kind: ProcMacroKind,
1051}
1052
1053#[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)]
1054#[diag(passes_unnecessary_stable_feature)]
1055pub(crate) struct UnnecessaryStableFeature {
1056 pub feature: Symbol,
1057 pub since: Symbol,
1058}
1059
1060#[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)]
1061#[diag(passes_unnecessary_partial_stable_feature)]
1062pub(crate) struct UnnecessaryPartialStableFeature {
1063 #[suggestion(code = "{implies}", applicability = "maybe-incorrect")]
1064 pub span: Span,
1065 #[suggestion(passes_suggestion_remove, code = "", applicability = "maybe-incorrect")]
1066 pub line: Span,
1067 pub feature: Symbol,
1068 pub since: Symbol,
1069 pub implies: Symbol,
1070}
1071
1072#[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)]
1073#[diag(passes_ineffective_unstable_impl)]
1074#[note]
1075pub(crate) struct IneffectiveUnstableImpl;
1076
1077#[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)]
1079#[diag(passes_sanitize_attribute_not_allowed)]
1080pub(crate) struct SanitizeAttributeNotAllowed {
1081 #[primary_span]
1082 pub attr_span: Span,
1083 #[label(passes_not_fn_impl_mod)]
1085 pub not_fn_impl_mod: Option<Span>,
1086 #[label(passes_no_body)]
1088 pub no_body: Option<Span>,
1089 #[help]
1091 pub help: (),
1092}
1093
1094#[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)]
1096#[diag(passes_rustc_const_stable_indirect_pairing)]
1097pub(crate) struct RustcConstStableIndirectPairing {
1098 #[primary_span]
1099 pub span: Span,
1100}
1101
1102#[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)]
1103#[diag(passes_unsupported_attributes_in_where)]
1104#[help]
1105pub(crate) struct UnsupportedAttributesInWhere {
1106 #[primary_span]
1107 pub span: MultiSpan,
1108}
1109
1110#[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)]
1111pub(crate) enum UnexportableItem<'a> {
1112 #[diag(passes_unexportable_item)]
1113 Item {
1114 #[primary_span]
1115 span: Span,
1116 descr: &'a str,
1117 },
1118
1119 #[diag(passes_unexportable_generic_fn)]
1120 GenericFn(#[primary_span] Span),
1121
1122 #[diag(passes_unexportable_fn_abi)]
1123 FnAbi(#[primary_span] Span),
1124
1125 #[diag(passes_unexportable_type_repr)]
1126 TypeRepr(#[primary_span] Span),
1127
1128 #[diag(passes_unexportable_type_in_interface)]
1129 TypeInInterface {
1130 #[primary_span]
1131 span: Span,
1132 desc: &'a str,
1133 ty: &'a str,
1134 #[label]
1135 ty_span: Span,
1136 },
1137
1138 #[diag(passes_unexportable_priv_item)]
1139 PrivItem {
1140 #[primary_span]
1141 span: Span,
1142 #[note]
1143 vis_note: Span,
1144 vis_descr: &'a str,
1145 },
1146
1147 #[diag(passes_unexportable_adt_with_private_fields)]
1148 AdtWithPrivFields {
1149 #[primary_span]
1150 span: Span,
1151 #[note]
1152 vis_note: Span,
1153 field_name: &'a str,
1154 },
1155}
1156
1157#[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)]
1158#[diag(passes_repr_align_should_be_align)]
1159pub(crate) struct ReprAlignShouldBeAlign {
1160 #[primary_span]
1161 #[help]
1162 pub span: Span,
1163 pub item: &'static str,
1164}
1165
1166#[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)]
1167#[diag(passes_repr_align_should_be_align_static)]
1168pub(crate) struct ReprAlignShouldBeAlignStatic {
1169 #[primary_span]
1170 #[help]
1171 pub span: Span,
1172 pub item: &'static str,
1173}
1174
1175#[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)]
1176#[diag(passes_custom_mir_phase_requires_dialect)]
1177pub(crate) struct CustomMirPhaseRequiresDialect {
1178 #[primary_span]
1179 pub attr_span: Span,
1180 #[label]
1181 pub phase_span: Span,
1182}
1183
1184#[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)]
1185#[diag(passes_custom_mir_incompatible_dialect_and_phase)]
1186pub(crate) struct CustomMirIncompatibleDialectAndPhase {
1187 pub dialect: MirDialect,
1188 pub phase: MirPhase,
1189 #[primary_span]
1190 pub attr_span: Span,
1191 #[label]
1192 pub dialect_span: Span,
1193 #[label]
1194 pub phase_span: Span,
1195}
1196
1197#[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)]
1198#[diag(passes_eii_impl_not_function)]
1199pub(crate) struct EiiImplNotFunction {
1200 #[primary_span]
1201 pub span: Span,
1202}
1203
1204#[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)]
1205#[diag(passes_eii_impl_requires_unsafe)]
1206pub(crate) struct EiiImplRequiresUnsafe {
1207 #[primary_span]
1208 pub span: Span,
1209 pub name: Symbol,
1210 #[subdiagnostic]
1211 pub suggestion: EiiImplRequiresUnsafeSuggestion,
1212}
1213
1214#[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)]
1215#[multipart_suggestion(
1216 passes_eii_impl_requires_unsafe_suggestion,
1217 applicability = "machine-applicable"
1218)]
1219pub(crate) struct EiiImplRequiresUnsafeSuggestion {
1220 #[suggestion_part(code = "unsafe(")]
1221 pub left: Span,
1222 #[suggestion_part(code = ")")]
1223 pub right: Span,
1224}
1225
1226#[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)]
1227#[diag(passes_eii_fn_with_track_caller)]
1228pub(crate) struct EiiWithTrackCaller {
1229 #[primary_span]
1230 pub attr_span: Span,
1231 pub name: Symbol,
1232 #[label]
1233 pub sig_span: Span,
1234}
1235
1236#[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)]
1237#[diag(passes_eii_without_impl)]
1238pub(crate) struct EiiWithoutImpl {
1239 #[primary_span]
1240 #[label]
1241 pub span: Span,
1242 pub name: Symbol,
1243
1244 pub current_crate_name: Symbol,
1245 pub decl_crate_name: Symbol,
1246 #[help]
1247 pub help: (),
1248}
1249
1250#[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)]
1251#[diag(passes_duplicate_eii_impls)]
1252pub(crate) struct DuplicateEiiImpls {
1253 pub name: Symbol,
1254
1255 #[primary_span]
1256 #[label(passes_first)]
1257 pub first_span: Span,
1258 pub first_crate: Symbol,
1259
1260 #[label(passes_second)]
1261 pub second_span: Span,
1262 pub second_crate: Symbol,
1263
1264 #[note]
1265 pub additional_crates: Option<()>,
1266
1267 pub num_additional_crates: usize,
1268 pub additional_crate_names: String,
1269
1270 #[help]
1271 pub help: (),
1272}
1273
1274#[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)]
1275#[diag(passes_function_not_have_default_implementation)]
1276pub(crate) struct FunctionNotHaveDefaultImplementation {
1277 #[primary_span]
1278 pub span: Span,
1279 #[note]
1280 pub note_span: Span,
1281}
1282
1283#[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)]
1284#[diag(passes_must_implement_not_function)]
1285pub(crate) struct MustImplementNotFunction {
1286 #[primary_span]
1287 pub span: Span,
1288 #[subdiagnostic]
1289 pub span_note: MustImplementNotFunctionSpanNote,
1290 #[subdiagnostic]
1291 pub note: MustImplementNotFunctionNote,
1292}
1293
1294#[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)]
1295#[note(passes_must_implement_not_function_span_note)]
1296pub(crate) struct MustImplementNotFunctionSpanNote {
1297 #[primary_span]
1298 pub span: Span,
1299}
1300
1301#[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)]
1302#[note(passes_must_implement_not_function_note)]
1303pub(crate) struct MustImplementNotFunctionNote {}
1304
1305#[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)]
1306#[diag(passes_function_not_found_in_trait)]
1307pub(crate) struct FunctionNotFoundInTrait {
1308 #[primary_span]
1309 pub span: Span,
1310}
1311
1312#[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)]
1313#[diag(passes_functions_names_duplicated)]
1314#[note]
1315pub(crate) struct FunctionNamesDuplicated {
1316 #[primary_span]
1317 pub spans: Vec<Span>,
1318}