1use rustc_errors::codes::*;
2use rustc_errors::{
3 Applicability, Diag, DiagCtxtHandle, DiagMessage, Diagnostic, ElidedLifetimeInPathSubdiag,
4 EmissionGuarantee, IntoDiagArg, Level, LintDiagnostic, MultiSpan, Subdiagnostic,
5};
6use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
7use rustc_span::source_map::Spanned;
8use rustc_span::{Ident, Span, Symbol};
9
10use crate::late::PatternSource;
11use crate::{Res, fluent_generated as fluent};
12
13#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GenericParamsFromOuterItem where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericParamsFromOuterItem {
span: __binding_0,
label: __binding_1,
refer_to_type_directly: __binding_2,
sugg: __binding_3,
static_or_const: __binding_4,
is_self: __binding_5,
item: __binding_6 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_generic_params_from_outer_item);
diag.code(E0401);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("is_self", __binding_5);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
if let Some(__binding_4) = __binding_4 {
diag.subdiagnostic(__binding_4);
}
if let Some(__binding_6) = __binding_6 {
diag.subdiagnostic(__binding_6);
}
diag
}
}
}
}
};Diagnostic)]
14#[diag(resolve_generic_params_from_outer_item, code = E0401)]
15#[note]
16pub(crate) struct GenericParamsFromOuterItem {
17 #[primary_span]
18 #[label]
19 pub(crate) span: Span,
20 #[subdiagnostic]
21 pub(crate) label: Option<GenericParamsFromOuterItemLabel>,
22 #[subdiagnostic]
23 pub(crate) refer_to_type_directly: Option<UseTypeDirectly>,
24 #[subdiagnostic]
25 pub(crate) sugg: Option<GenericParamsFromOuterItemSugg>,
26 #[subdiagnostic]
27 pub(crate) static_or_const: Option<GenericParamsFromOuterItemStaticOrConst>,
28 pub(crate) is_self: bool,
29 #[subdiagnostic]
30 pub(crate) item: Option<GenericParamsFromOuterItemInnerItem>,
31}
32
33#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
GenericParamsFromOuterItemInnerItem {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
GenericParamsFromOuterItemInnerItem {
span: __binding_0, descr: __binding_1 } => {
diag.store_args();
diag.arg("descr", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_generic_params_from_outer_item_inner_item);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
34#[label(resolve_generic_params_from_outer_item_inner_item)]
35pub(crate) struct GenericParamsFromOuterItemInnerItem {
36 #[primary_span]
37 pub(crate) span: Span,
38 pub(crate) descr: String,
39}
40
41#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
GenericParamsFromOuterItemStaticOrConst {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
GenericParamsFromOuterItemStaticOrConst::Static => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_generic_params_from_outer_item_static);
diag.note(__message);
diag.restore_args();
}
GenericParamsFromOuterItemStaticOrConst::Const => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_generic_params_from_outer_item_const);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
42pub(crate) enum GenericParamsFromOuterItemStaticOrConst {
43 #[note(resolve_generic_params_from_outer_item_static)]
44 Static,
45 #[note(resolve_generic_params_from_outer_item_const)]
46 Const,
47}
48
49#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for GenericParamsFromOuterItemLabel {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
GenericParamsFromOuterItemLabel::SelfTyParam(__binding_0) =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_generic_params_from_outer_item_self_ty_param);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
GenericParamsFromOuterItemLabel::SelfTyAlias(__binding_0) =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_generic_params_from_outer_item_self_ty_alias);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
GenericParamsFromOuterItemLabel::TyParam(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_generic_params_from_outer_item_ty_param);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
GenericParamsFromOuterItemLabel::ConstParam(__binding_0) =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_generic_params_from_outer_item_const_param);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
50pub(crate) enum GenericParamsFromOuterItemLabel {
51 #[label(resolve_generic_params_from_outer_item_self_ty_param)]
52 SelfTyParam(#[primary_span] Span),
53 #[label(resolve_generic_params_from_outer_item_self_ty_alias)]
54 SelfTyAlias(#[primary_span] Span),
55 #[label(resolve_generic_params_from_outer_item_ty_param)]
56 TyParam(#[primary_span] Span),
57 #[label(resolve_generic_params_from_outer_item_const_param)]
58 ConstParam(#[primary_span] Span),
59}
60
61#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for GenericParamsFromOuterItemSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
GenericParamsFromOuterItemSugg {
span: __binding_0, snippet: __binding_1 } => {
let __code_0 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("snippet", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_suggestion);
diag.span_suggestions_with_style(__binding_0, __message,
__code_0, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
62#[suggestion(
63 resolve_suggestion,
64 code = "{snippet}",
65 applicability = "maybe-incorrect",
66 style = "verbose"
67)]
68pub(crate) struct GenericParamsFromOuterItemSugg {
69 #[primary_span]
70 pub(crate) span: Span,
71 pub(crate) snippet: String,
72}
73#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UseTypeDirectly {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UseTypeDirectly { span: __binding_0, snippet: __binding_1 }
=> {
let __code_1 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("snippet", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_refer_to_type_directly);
diag.span_suggestions_with_style(__binding_0, __message,
__code_1, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
74#[suggestion(
75 resolve_refer_to_type_directly,
76 code = "{snippet}",
77 applicability = "maybe-incorrect",
78 style = "verbose"
79)]
80pub(crate) struct UseTypeDirectly {
81 #[primary_span]
82 pub(crate) span: Span,
83 pub(crate) snippet: String,
84}
85
86#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NameAlreadyUsedInParameterList where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NameAlreadyUsedInParameterList {
span: __binding_0,
first_use_span: __binding_1,
name: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_name_is_already_used_as_generic_parameter);
diag.code(E0403);
;
diag.arg("name", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::resolve_first_use_of_name);
diag
}
}
}
}
};Diagnostic)]
87#[diag(resolve_name_is_already_used_as_generic_parameter, code = E0403)]
88pub(crate) struct NameAlreadyUsedInParameterList {
89 #[primary_span]
90 #[label]
91 pub(crate) span: Span,
92 #[label(resolve_first_use_of_name)]
93 pub(crate) first_use_span: Span,
94 pub(crate) name: Ident,
95}
96
97#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MethodNotMemberOfTrait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MethodNotMemberOfTrait {
span: __binding_0,
method: __binding_1,
trait_: __binding_2,
sub: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_method_not_member_of_trait);
diag.code(E0407);
;
diag.arg("method", __binding_1);
diag.arg("trait_", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
98#[diag(resolve_method_not_member_of_trait, code = E0407)]
99pub(crate) struct MethodNotMemberOfTrait {
100 #[primary_span]
101 #[label]
102 pub(crate) span: Span,
103 pub(crate) method: Ident,
104 pub(crate) trait_: String,
105 #[subdiagnostic]
106 pub(crate) sub: Option<AssociatedFnWithSimilarNameExists>,
107}
108
109#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AssociatedFnWithSimilarNameExists
{
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AssociatedFnWithSimilarNameExists {
span: __binding_0, candidate: __binding_1 } => {
let __code_2 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("candidate", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_associated_fn_with_similar_name_exists);
diag.span_suggestions_with_style(__binding_0, __message,
__code_2, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
110#[suggestion(
111 resolve_associated_fn_with_similar_name_exists,
112 code = "{candidate}",
113 applicability = "maybe-incorrect"
114)]
115pub(crate) struct AssociatedFnWithSimilarNameExists {
116 #[primary_span]
117 pub(crate) span: Span,
118 pub(crate) candidate: Symbol,
119}
120
121#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TypeNotMemberOfTrait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TypeNotMemberOfTrait {
span: __binding_0,
type_: __binding_1,
trait_: __binding_2,
sub: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_type_not_member_of_trait);
diag.code(E0437);
;
diag.arg("type_", __binding_1);
diag.arg("trait_", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
122#[diag(resolve_type_not_member_of_trait, code = E0437)]
123pub(crate) struct TypeNotMemberOfTrait {
124 #[primary_span]
125 #[label]
126 pub(crate) span: Span,
127 pub(crate) type_: Ident,
128 pub(crate) trait_: String,
129 #[subdiagnostic]
130 pub(crate) sub: Option<AssociatedTypeWithSimilarNameExists>,
131}
132
133#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
AssociatedTypeWithSimilarNameExists {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AssociatedTypeWithSimilarNameExists {
span: __binding_0, candidate: __binding_1 } => {
let __code_3 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("candidate", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_associated_type_with_similar_name_exists);
diag.span_suggestions_with_style(__binding_0, __message,
__code_3, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
134#[suggestion(
135 resolve_associated_type_with_similar_name_exists,
136 code = "{candidate}",
137 applicability = "maybe-incorrect"
138)]
139pub(crate) struct AssociatedTypeWithSimilarNameExists {
140 #[primary_span]
141 pub(crate) span: Span,
142 pub(crate) candidate: Symbol,
143}
144
145#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ConstNotMemberOfTrait where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ConstNotMemberOfTrait {
span: __binding_0,
const_: __binding_1,
trait_: __binding_2,
sub: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_const_not_member_of_trait);
diag.code(E0438);
;
diag.arg("const_", __binding_1);
diag.arg("trait_", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
146#[diag(resolve_const_not_member_of_trait, code = E0438)]
147pub(crate) struct ConstNotMemberOfTrait {
148 #[primary_span]
149 #[label]
150 pub(crate) span: Span,
151 pub(crate) const_: Ident,
152 pub(crate) trait_: String,
153 #[subdiagnostic]
154 pub(crate) sub: Option<AssociatedConstWithSimilarNameExists>,
155}
156
157#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
AssociatedConstWithSimilarNameExists {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AssociatedConstWithSimilarNameExists {
span: __binding_0, candidate: __binding_1 } => {
let __code_4 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("candidate", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_associated_const_with_similar_name_exists);
diag.span_suggestions_with_style(__binding_0, __message,
__code_4, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
158#[suggestion(
159 resolve_associated_const_with_similar_name_exists,
160 code = "{candidate}",
161 applicability = "maybe-incorrect"
162)]
163pub(crate) struct AssociatedConstWithSimilarNameExists {
164 #[primary_span]
165 pub(crate) span: Span,
166 pub(crate) candidate: Symbol,
167}
168
169#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
VariableBoundWithDifferentMode where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
VariableBoundWithDifferentMode {
span: __binding_0,
first_binding_span: __binding_1,
variable_name: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_variable_bound_with_different_mode);
diag.code(E0409);
;
diag.arg("variable_name", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::resolve_first_binding_span);
diag
}
}
}
}
};Diagnostic)]
170#[diag(resolve_variable_bound_with_different_mode, code = E0409)]
171pub(crate) struct VariableBoundWithDifferentMode {
172 #[primary_span]
173 #[label]
174 pub(crate) span: Span,
175 #[label(resolve_first_binding_span)]
176 pub(crate) first_binding_span: Span,
177 pub(crate) variable_name: Ident,
178}
179
180#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IdentifierBoundMoreThanOnceInParameterList where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IdentifierBoundMoreThanOnceInParameterList {
span: __binding_0, identifier: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_ident_bound_more_than_once_in_parameter_list);
diag.code(E0415);
;
diag.arg("identifier", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
181#[diag(resolve_ident_bound_more_than_once_in_parameter_list, code = E0415)]
182pub(crate) struct IdentifierBoundMoreThanOnceInParameterList {
183 #[primary_span]
184 #[label]
185 pub(crate) span: Span,
186 pub(crate) identifier: Ident,
187}
188
189#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IdentifierBoundMoreThanOnceInSamePattern where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IdentifierBoundMoreThanOnceInSamePattern {
span: __binding_0, identifier: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_ident_bound_more_than_once_in_same_pattern);
diag.code(E0416);
;
diag.arg("identifier", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
190#[diag(resolve_ident_bound_more_than_once_in_same_pattern, code = E0416)]
191pub(crate) struct IdentifierBoundMoreThanOnceInSamePattern {
192 #[primary_span]
193 #[label]
194 pub(crate) span: Span,
195 pub(crate) identifier: Ident,
196}
197
198#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UndeclaredLabel where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UndeclaredLabel {
span: __binding_0,
name: __binding_1,
sub_reachable: __binding_2,
sub_reachable_suggestion: __binding_3,
sub_unreachable: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_undeclared_label);
diag.code(E0426);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
if let Some(__binding_4) = __binding_4 {
diag.subdiagnostic(__binding_4);
}
diag
}
}
}
}
};Diagnostic)]
199#[diag(resolve_undeclared_label, code = E0426)]
200pub(crate) struct UndeclaredLabel {
201 #[primary_span]
202 #[label]
203 pub(crate) span: Span,
204 pub(crate) name: Symbol,
205 #[subdiagnostic]
206 pub(crate) sub_reachable: Option<LabelWithSimilarNameReachable>,
207 #[subdiagnostic]
208 pub(crate) sub_reachable_suggestion: Option<TryUsingSimilarlyNamedLabel>,
209 #[subdiagnostic]
210 pub(crate) sub_unreachable: Option<UnreachableLabelWithSimilarNameExists>,
211}
212
213#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for LabelWithSimilarNameReachable {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
LabelWithSimilarNameReachable(__binding_0) => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_label_with_similar_name_reachable);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
214#[label(resolve_label_with_similar_name_reachable)]
215pub(crate) struct LabelWithSimilarNameReachable(#[primary_span] pub(crate) Span);
216
217#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for TryUsingSimilarlyNamedLabel {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
TryUsingSimilarlyNamedLabel {
span: __binding_0, ident_name: __binding_1 } => {
let __code_5 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("ident_name", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_try_using_similarly_named_label);
diag.span_suggestions_with_style(__binding_0, __message,
__code_5, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
218#[suggestion(
219 resolve_try_using_similarly_named_label,
220 code = "{ident_name}",
221 applicability = "maybe-incorrect"
222)]
223pub(crate) struct TryUsingSimilarlyNamedLabel {
224 #[primary_span]
225 pub(crate) span: Span,
226 pub(crate) ident_name: Symbol,
227}
228
229#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
UnreachableLabelWithSimilarNameExists {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnreachableLabelWithSimilarNameExists {
ident_span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unreachable_label_with_similar_name_exists);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
230#[label(resolve_unreachable_label_with_similar_name_exists)]
231pub(crate) struct UnreachableLabelWithSimilarNameExists {
232 #[primary_span]
233 pub(crate) ident_span: Span,
234}
235
236#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SelfImportCanOnlyAppearOnceInTheList where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SelfImportCanOnlyAppearOnceInTheList { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_self_import_can_only_appear_once_in_the_list);
diag.code(E0430);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
237#[diag(resolve_self_import_can_only_appear_once_in_the_list, code = E0430)]
238pub(crate) struct SelfImportCanOnlyAppearOnceInTheList {
239 #[primary_span]
240 #[label]
241 pub(crate) span: Span,
242}
243
244#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SelfImportOnlyInImportListWithNonEmptyPrefix where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SelfImportOnlyInImportListWithNonEmptyPrefix {
span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_self_import_only_in_import_list_with_non_empty_prefix);
diag.code(E0431);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
245#[diag(resolve_self_import_only_in_import_list_with_non_empty_prefix, code = E0431)]
246pub(crate) struct SelfImportOnlyInImportListWithNonEmptyPrefix {
247 #[primary_span]
248 #[label]
249 pub(crate) span: Span,
250}
251
252#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotCaptureDynamicEnvironmentInFnItem where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotCaptureDynamicEnvironmentInFnItem { span: __binding_0
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_capture_dynamic_environment_in_fn_item);
diag.code(E0434);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
253#[diag(resolve_cannot_capture_dynamic_environment_in_fn_item, code = E0434)]
254#[help]
255pub(crate) struct CannotCaptureDynamicEnvironmentInFnItem {
256 #[primary_span]
257 pub(crate) span: Span,
258}
259
260#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
AttemptToUseNonConstantValueInConstant<'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 {
AttemptToUseNonConstantValueInConstant {
span: __binding_0,
with: __binding_1,
with_label: __binding_2,
without: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_attempt_to_use_non_constant_value_in_constant);
diag.code(E0435);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
261#[diag(resolve_attempt_to_use_non_constant_value_in_constant, code = E0435)]
262pub(crate) struct AttemptToUseNonConstantValueInConstant<'a> {
263 #[primary_span]
264 pub(crate) span: Span,
265 #[subdiagnostic]
266 pub(crate) with: Option<AttemptToUseNonConstantValueInConstantWithSuggestion<'a>>,
267 #[subdiagnostic]
268 pub(crate) with_label: Option<AttemptToUseNonConstantValueInConstantLabelWithSuggestion>,
269 #[subdiagnostic]
270 pub(crate) without: Option<AttemptToUseNonConstantValueInConstantWithoutSuggestion<'a>>,
271}
272
273#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for
AttemptToUseNonConstantValueInConstantWithSuggestion<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AttemptToUseNonConstantValueInConstantWithSuggestion {
span: __binding_0,
suggestion: __binding_1,
type_span: __binding_2,
current: __binding_3 } => {
let mut suggestions = Vec::new();
let __code_6 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0} ", __binding_1))
});
let __code_7 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(": /* Type */"))
});
suggestions.push((__binding_0, __code_6));
if let Some(__binding_2) = __binding_2 {
suggestions.push((__binding_2, __code_7));
}
diag.store_args();
diag.arg("suggestion", __binding_1);
diag.arg("current", __binding_3);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_attempt_to_use_non_constant_value_in_constant_with_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
274#[multipart_suggestion(
275 resolve_attempt_to_use_non_constant_value_in_constant_with_suggestion,
276 style = "verbose",
277 applicability = "has-placeholders"
278)]
279pub(crate) struct AttemptToUseNonConstantValueInConstantWithSuggestion<'a> {
280 #[suggestion_part(code = "{suggestion} ")]
282 pub(crate) span: Span,
283 pub(crate) suggestion: &'a str,
284 #[suggestion_part(code = ": /* Type */")]
285 pub(crate) type_span: Option<Span>,
286 pub(crate) current: &'a str,
287}
288
289#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
AttemptToUseNonConstantValueInConstantLabelWithSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AttemptToUseNonConstantValueInConstantLabelWithSuggestion {
span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_attempt_to_use_non_constant_value_in_constant_label_with_suggestion);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
290#[label(resolve_attempt_to_use_non_constant_value_in_constant_label_with_suggestion)]
291pub(crate) struct AttemptToUseNonConstantValueInConstantLabelWithSuggestion {
292 #[primary_span]
293 pub(crate) span: Span,
294}
295
296#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for
AttemptToUseNonConstantValueInConstantWithoutSuggestion<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AttemptToUseNonConstantValueInConstantWithoutSuggestion {
ident_span: __binding_0, suggestion: __binding_1 } => {
diag.store_args();
diag.arg("suggestion", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_attempt_to_use_non_constant_value_in_constant_without_suggestion);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
297#[label(resolve_attempt_to_use_non_constant_value_in_constant_without_suggestion)]
298pub(crate) struct AttemptToUseNonConstantValueInConstantWithoutSuggestion<'a> {
299 #[primary_span]
300 pub(crate) ident_span: Span,
301 pub(crate) suggestion: &'a str,
302}
303
304#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SelfImportsOnlyAllowedWithin where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SelfImportsOnlyAllowedWithin {
span: __binding_0,
suggestion: __binding_1,
mpart_suggestion: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_self_imports_only_allowed_within);
diag.code(E0429);
;
diag.span(__binding_0);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
305#[diag(resolve_self_imports_only_allowed_within, code = E0429)]
306pub(crate) struct SelfImportsOnlyAllowedWithin {
307 #[primary_span]
308 pub(crate) span: Span,
309 #[subdiagnostic]
310 pub(crate) suggestion: Option<SelfImportsOnlyAllowedWithinSuggestion>,
311 #[subdiagnostic]
312 pub(crate) mpart_suggestion: Option<SelfImportsOnlyAllowedWithinMultipartSuggestion>,
313}
314
315#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
SelfImportsOnlyAllowedWithinSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
SelfImportsOnlyAllowedWithinSuggestion { span: __binding_0 }
=> {
let __code_8 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_self_imports_only_allowed_within_suggestion);
diag.span_suggestions_with_style(__binding_0, __message,
__code_8, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
316#[suggestion(
317 resolve_self_imports_only_allowed_within_suggestion,
318 code = "",
319 applicability = "machine-applicable"
320)]
321pub(crate) struct SelfImportsOnlyAllowedWithinSuggestion {
322 #[primary_span]
323 pub(crate) span: Span,
324}
325
326#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
SelfImportsOnlyAllowedWithinMultipartSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
SelfImportsOnlyAllowedWithinMultipartSuggestion {
multipart_start: __binding_0, multipart_end: __binding_1 }
=> {
let mut suggestions = Vec::new();
let __code_9 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{{"))
});
let __code_10 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("}}"))
});
suggestions.push((__binding_0, __code_9));
suggestions.push((__binding_1, __code_10));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_self_imports_only_allowed_within_multipart_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
327#[multipart_suggestion(
328 resolve_self_imports_only_allowed_within_multipart_suggestion,
329 applicability = "machine-applicable"
330)]
331pub(crate) struct SelfImportsOnlyAllowedWithinMultipartSuggestion {
332 #[suggestion_part(code = "{{")]
333 pub(crate) multipart_start: Span,
334 #[suggestion_part(code = "}}")]
335 pub(crate) multipart_end: Span,
336}
337
338#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
BindingShadowsSomethingUnacceptable<'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 {
BindingShadowsSomethingUnacceptable {
span: __binding_0,
shadowing_binding: __binding_1,
shadowed_binding: __binding_2,
article: __binding_3,
sub_suggestion: __binding_4,
shadowed_binding_span: __binding_5,
participle: __binding_6,
name: __binding_7 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_binding_shadows_something_unacceptable);
diag.code(E0530);
;
diag.arg("shadowing_binding", __binding_1);
diag.arg("shadowed_binding", __binding_2);
diag.arg("article", __binding_3);
diag.arg("participle", __binding_6);
diag.arg("name", __binding_7);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_4) = __binding_4 {
diag.subdiagnostic(__binding_4);
}
diag.span_label(__binding_5,
crate::fluent_generated::resolve_label_shadowed_binding);
diag
}
}
}
}
};Diagnostic)]
339#[diag(resolve_binding_shadows_something_unacceptable, code = E0530)]
340pub(crate) struct BindingShadowsSomethingUnacceptable<'a> {
341 #[primary_span]
342 #[label]
343 pub(crate) span: Span,
344 pub(crate) shadowing_binding: PatternSource,
345 pub(crate) shadowed_binding: Res,
346 pub(crate) article: &'a str,
347 #[subdiagnostic]
348 pub(crate) sub_suggestion: Option<BindingShadowsSomethingUnacceptableSuggestion>,
349 #[label(resolve_label_shadowed_binding)]
350 pub(crate) shadowed_binding_span: Span,
351 pub(crate) participle: &'a str,
352 pub(crate) name: Symbol,
353}
354
355#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
BindingShadowsSomethingUnacceptableSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
BindingShadowsSomethingUnacceptableSuggestion {
span: __binding_0, name: __binding_1 } => {
let __code_11 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}(..)", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("name", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_binding_shadows_something_unacceptable_suggestion);
diag.span_suggestions_with_style(__binding_0, __message,
__code_11, rustc_errors::Applicability::Unspecified,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
356#[suggestion(
357 resolve_binding_shadows_something_unacceptable_suggestion,
358 code = "{name}(..)",
359 applicability = "unspecified"
360)]
361pub(crate) struct BindingShadowsSomethingUnacceptableSuggestion {
362 #[primary_span]
363 pub(crate) span: Span,
364 pub(crate) name: Symbol,
365}
366
367#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ForwardDeclaredGenericParam where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ForwardDeclaredGenericParam {
span: __binding_0, param: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_forward_declared_generic_param);
diag.code(E0128);
;
diag.arg("param", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
368#[diag(resolve_forward_declared_generic_param, code = E0128)]
369pub(crate) struct ForwardDeclaredGenericParam {
370 #[primary_span]
371 #[label]
372 pub(crate) span: Span,
373 pub(crate) param: Symbol,
374}
375
376#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ForwardDeclaredGenericInConstParamTy where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ForwardDeclaredGenericInConstParamTy {
span: __binding_0, param: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_forward_declared_generic_in_const_param_ty);
;
diag.arg("param", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
377#[diag(resolve_forward_declared_generic_in_const_param_ty)]
378pub(crate) struct ForwardDeclaredGenericInConstParamTy {
379 #[primary_span]
380 #[label]
381 pub(crate) span: Span,
382 pub(crate) param: Symbol,
383}
384
385#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ParamInTyOfConstParam where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ParamInTyOfConstParam { span: __binding_0, name: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_param_in_ty_of_const_param);
diag.code(E0770);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
386#[diag(resolve_param_in_ty_of_const_param, code = E0770)]
387pub(crate) struct ParamInTyOfConstParam {
388 #[primary_span]
389 #[label]
390 pub(crate) span: Span,
391 pub(crate) name: Symbol,
392}
393
394#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SelfInGenericParamDefault where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SelfInGenericParamDefault { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_self_in_generic_param_default);
diag.code(E0735);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
395#[diag(resolve_self_in_generic_param_default, code = E0735)]
396pub(crate) struct SelfInGenericParamDefault {
397 #[primary_span]
398 pub(crate) span: Span,
399}
400
401#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
SelfInConstGenericTy where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
SelfInConstGenericTy { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_self_in_const_generic_ty);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
402#[diag(resolve_self_in_const_generic_ty)]
403pub(crate) struct SelfInConstGenericTy {
404 #[primary_span]
405 pub(crate) span: Span,
406}
407
408#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ParamInNonTrivialAnonConst where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ParamInNonTrivialAnonConst {
span: __binding_0,
name: __binding_1,
param_kind: __binding_2,
help: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_param_in_non_trivial_anon_const);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.subdiagnostic(__binding_2);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
diag
}
}
}
}
};Diagnostic)]
409#[diag(resolve_param_in_non_trivial_anon_const)]
410pub(crate) struct ParamInNonTrivialAnonConst {
411 #[primary_span]
412 #[label]
413 pub(crate) span: Span,
414 pub(crate) name: Symbol,
415 #[subdiagnostic]
416 pub(crate) param_kind: ParamKindInNonTrivialAnonConst,
417 #[subdiagnostic]
418 pub(crate) help: Option<ParamInNonTrivialAnonConstHelp>,
419}
420
421#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ParamInNonTrivialAnonConstHelp {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ParamInNonTrivialAnonConstHelp => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_param_in_non_trivial_anon_const_help);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
422#[help(resolve_param_in_non_trivial_anon_const_help)]
423pub(crate) struct ParamInNonTrivialAnonConstHelp;
424
425#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ParamKindInNonTrivialAnonConst {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
ParamKindInNonTrivialAnonConst::Type =>
::core::fmt::Formatter::write_str(f, "Type"),
ParamKindInNonTrivialAnonConst::Const { name: __self_0 } =>
::core::fmt::Formatter::debug_struct_field1_finish(f, "Const",
"name", &__self_0),
ParamKindInNonTrivialAnonConst::Lifetime =>
::core::fmt::Formatter::write_str(f, "Lifetime"),
}
}
}Debug)]
426#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ParamKindInNonTrivialAnonConst {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ParamKindInNonTrivialAnonConst::Type => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_type_param_in_non_trivial_anon_const);
diag.note(__message);
diag.restore_args();
}
ParamKindInNonTrivialAnonConst::Const { name: __binding_0 }
=> {
diag.store_args();
diag.arg("name", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_const_param_in_non_trivial_anon_const);
diag.help(__message);
diag.restore_args();
}
ParamKindInNonTrivialAnonConst::Lifetime => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_lifetime_param_in_non_trivial_anon_const);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
427pub(crate) enum ParamKindInNonTrivialAnonConst {
428 #[note(resolve_type_param_in_non_trivial_anon_const)]
429 Type,
430 #[help(resolve_const_param_in_non_trivial_anon_const)]
431 Const { name: Symbol },
432 #[note(resolve_lifetime_param_in_non_trivial_anon_const)]
433 Lifetime,
434}
435
436#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnreachableLabel where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnreachableLabel {
span: __binding_0,
name: __binding_1,
definition_span: __binding_2,
sub_suggestion: __binding_3,
sub_suggestion_label: __binding_4,
sub_unreachable_label: __binding_5 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_unreachable_label);
diag.code(E0767);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_2,
crate::fluent_generated::resolve_label_definition_span);
if let Some(__binding_3) = __binding_3 {
diag.subdiagnostic(__binding_3);
}
if let Some(__binding_4) = __binding_4 {
diag.subdiagnostic(__binding_4);
}
if let Some(__binding_5) = __binding_5 {
diag.subdiagnostic(__binding_5);
}
diag
}
}
}
}
};Diagnostic)]
437#[diag(resolve_unreachable_label, code = E0767)]
438#[note]
439pub(crate) struct UnreachableLabel {
440 #[primary_span]
441 #[label]
442 pub(crate) span: Span,
443 pub(crate) name: Symbol,
444 #[label(resolve_label_definition_span)]
445 pub(crate) definition_span: Span,
446 #[subdiagnostic]
447 pub(crate) sub_suggestion: Option<UnreachableLabelSubSuggestion>,
448 #[subdiagnostic]
449 pub(crate) sub_suggestion_label: Option<UnreachableLabelSubLabel>,
450 #[subdiagnostic]
451 pub(crate) sub_unreachable_label: Option<UnreachableLabelSubLabelUnreachable>,
452}
453
454#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnreachableLabelSubSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnreachableLabelSubSuggestion {
span: __binding_0, ident_name: __binding_1 } => {
let __code_12 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("ident_name", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unreachable_label_suggestion_use_similarly_named);
diag.span_suggestions_with_style(__binding_0, __message,
__code_12, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
455#[suggestion(
456 resolve_unreachable_label_suggestion_use_similarly_named,
457 code = "{ident_name}",
458 applicability = "maybe-incorrect"
459)]
460pub(crate) struct UnreachableLabelSubSuggestion {
461 #[primary_span]
462 pub(crate) span: Span,
463 pub(crate) ident_name: Symbol,
464}
465
466#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for UnreachableLabelSubLabel {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnreachableLabelSubLabel { ident_span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unreachable_label_similar_name_reachable);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
467#[label(resolve_unreachable_label_similar_name_reachable)]
468pub(crate) struct UnreachableLabelSubLabel {
469 #[primary_span]
470 pub(crate) ident_span: Span,
471}
472
473#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
UnreachableLabelSubLabelUnreachable {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnreachableLabelSubLabelUnreachable {
ident_span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unreachable_label_similar_name_unreachable);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
474#[label(resolve_unreachable_label_similar_name_unreachable)]
475pub(crate) struct UnreachableLabelSubLabelUnreachable {
476 #[primary_span]
477 pub(crate) ident_span: Span,
478}
479
480#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InvalidAsmSym
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
InvalidAsmSym { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_invalid_asm_sym);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
481#[diag(resolve_invalid_asm_sym)]
482#[help]
483pub(crate) struct InvalidAsmSym {
484 #[primary_span]
485 #[label]
486 pub(crate) span: Span,
487}
488
489#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LowercaseSelf
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LowercaseSelf { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_lowercase_self);
let __code_13 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("Self"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_13,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::HideCodeInline);
diag
}
}
}
}
};Diagnostic)]
490#[diag(resolve_lowercase_self)]
491pub(crate) struct LowercaseSelf {
492 #[primary_span]
493 #[suggestion(code = "Self", applicability = "maybe-incorrect", style = "short")]
494 pub(crate) span: Span,
495}
496
497#[derive(#[automatically_derived]
impl ::core::fmt::Debug for BindingInNeverPattern {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"BindingInNeverPattern", "span", &&self.span)
}
}Debug)]
498#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
BindingInNeverPattern where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
BindingInNeverPattern { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_binding_in_never_pattern);
let __code_14 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("_"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_14,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::HideCodeInline);
diag
}
}
}
}
};Diagnostic)]
499#[diag(resolve_binding_in_never_pattern)]
500pub(crate) struct BindingInNeverPattern {
501 #[primary_span]
502 #[suggestion(code = "_", applicability = "machine-applicable", style = "short")]
503 pub(crate) span: Span,
504}
505
506#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitImplDuplicate where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitImplDuplicate {
span: __binding_0,
old_span: __binding_1,
trait_item_span: __binding_2,
name: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_trait_impl_duplicate);
diag.code(E0201);
;
diag.arg("name", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_1,
crate::fluent_generated::resolve_old_span_label);
diag.span_label(__binding_2,
crate::fluent_generated::resolve_trait_item_span);
diag
}
}
}
}
};Diagnostic)]
507#[diag(resolve_trait_impl_duplicate, code = E0201)]
508pub(crate) struct TraitImplDuplicate {
509 #[primary_span]
510 #[label]
511 pub(crate) span: Span,
512 #[label(resolve_old_span_label)]
513 pub(crate) old_span: Span,
514 #[label(resolve_trait_item_span)]
515 pub(crate) trait_item_span: Span,
516 pub(crate) name: Ident,
517}
518
519#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for Relative2018
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
Relative2018 {
span: __binding_0,
path_span: __binding_1,
path_str: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_relative_2018);
let __code_15 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("crate::{0}",
__binding_2))
})].into_iter();
;
diag.arg("path_str", __binding_2);
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_15,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
520#[diag(resolve_relative_2018)]
521pub(crate) struct Relative2018 {
522 #[primary_span]
523 pub(crate) span: Span,
524 #[suggestion(code = "crate::{path_str}", applicability = "maybe-incorrect")]
525 pub(crate) path_span: Span,
526 pub(crate) path_str: String,
527}
528
529#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AncestorOnly
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AncestorOnly(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_ancestor_only);
diag.code(E0742);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
530#[diag(resolve_ancestor_only, code = E0742)]
531pub(crate) struct AncestorOnly(#[primary_span] pub(crate) Span);
532
533#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExpectedModuleFound where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExpectedModuleFound {
span: __binding_0, res: __binding_1, path_str: __binding_2 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_expected_module_found);
diag.code(E0577);
;
diag.arg("res", __binding_1);
diag.arg("path_str", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
534#[diag(resolve_expected_module_found, code = E0577)]
535pub(crate) struct ExpectedModuleFound {
536 #[primary_span]
537 #[label]
538 pub(crate) span: Span,
539 pub(crate) res: Res,
540 pub(crate) path_str: String,
541}
542
543#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for Indeterminate
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
Indeterminate(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_indeterminate);
diag.code(E0578);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
544#[diag(resolve_indeterminate, code = E0578)]
545pub(crate) struct Indeterminate(#[primary_span] pub(crate) Span);
546
547#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ToolModuleImported where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ToolModuleImported { span: __binding_0, import: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_tool_module_imported);
;
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
548#[diag(resolve_tool_module_imported)]
549pub(crate) struct ToolModuleImported {
550 #[primary_span]
551 pub(crate) span: Span,
552 #[note]
553 pub(crate) import: Span,
554}
555
556#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ModuleOnly
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ModuleOnly(__binding_0) => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_module_only);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
557#[diag(resolve_module_only)]
558pub(crate) struct ModuleOnly(#[primary_span] pub(crate) Span);
559
560#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
MacroExpectedFound<'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 {
MacroExpectedFound {
span: __binding_0,
found: __binding_1,
article: __binding_2,
expected: __binding_3,
macro_path: __binding_4,
remove_surrounding_derive: __binding_5,
add_as_non_derive: __binding_6 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_macro_expected_found);
;
diag.arg("found", __binding_1);
diag.arg("article", __binding_2);
diag.arg("expected", __binding_3);
diag.arg("macro_path", __binding_4);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_5) = __binding_5 {
diag.subdiagnostic(__binding_5);
}
if let Some(__binding_6) = __binding_6 {
diag.subdiagnostic(__binding_6);
}
diag
}
}
}
}
};Diagnostic)]
561#[diag(resolve_macro_expected_found)]
562pub(crate) struct MacroExpectedFound<'a> {
563 #[primary_span]
564 #[label]
565 pub(crate) span: Span,
566 pub(crate) found: &'a str,
567 pub(crate) article: &'static str,
568 pub(crate) expected: &'a str,
569 pub(crate) macro_path: &'a str,
570 #[subdiagnostic]
571 pub(crate) remove_surrounding_derive: Option<RemoveSurroundingDerive>,
572 #[subdiagnostic]
573 pub(crate) add_as_non_derive: Option<AddAsNonDerive<'a>>,
574}
575
576#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for RemoveSurroundingDerive {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
RemoveSurroundingDerive { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_remove_surrounding_derive);
diag.span_help(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
577#[help(resolve_remove_surrounding_derive)]
578pub(crate) struct RemoveSurroundingDerive {
579 #[primary_span]
580 pub(crate) span: Span,
581}
582
583#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for AddAsNonDerive<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AddAsNonDerive { macro_path: __binding_0 } => {
diag.store_args();
diag.arg("macro_path", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_add_as_non_derive);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
584#[help(resolve_add_as_non_derive)]
585pub(crate) struct AddAsNonDerive<'a> {
586 pub(crate) macro_path: &'a str,
587}
588
589#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ProcMacroSameCrate where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ProcMacroSameCrate { span: __binding_0, is_test: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_proc_macro_same_crate);
;
diag.span(__binding_0);
if __binding_1 {
diag.help(crate::fluent_generated::_subdiag::help);
}
diag
}
}
}
}
};Diagnostic)]
590#[diag(resolve_proc_macro_same_crate)]
591pub(crate) struct ProcMacroSameCrate {
592 #[primary_span]
593 pub(crate) span: Span,
594 #[help]
595 pub(crate) is_test: bool,
596}
597
598#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
ProcMacroDeriveResolutionFallback {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
ProcMacroDeriveResolutionFallback {
span: __binding_0, ns_descr: __binding_1, ident: __binding_2
} => {
diag.primary_message(crate::fluent_generated::resolve_proc_macro_derive_resolution_fallback);
;
diag.arg("ns_descr", __binding_1);
diag.arg("ident", __binding_2);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
};
}
}
};LintDiagnostic)]
599#[diag(resolve_proc_macro_derive_resolution_fallback)]
600pub(crate) struct ProcMacroDeriveResolutionFallback {
601 #[label]
602 pub span: Span,
603 pub ns_descr: &'static str,
604 pub ident: Symbol,
605}
606
607#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
MacroExpandedMacroExportsAccessedByAbsolutePaths {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MacroExpandedMacroExportsAccessedByAbsolutePaths {
definition: __binding_0 } => {
diag.primary_message(crate::fluent_generated::resolve_macro_expanded_macro_exports_accessed_by_absolute_paths);
;
diag.span_note(__binding_0,
crate::fluent_generated::_subdiag::note);
diag
}
};
}
}
};LintDiagnostic)]
608#[diag(resolve_macro_expanded_macro_exports_accessed_by_absolute_paths)]
609pub(crate) struct MacroExpandedMacroExportsAccessedByAbsolutePaths {
610 #[note]
611 pub definition: Span,
612}
613
614#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CrateImported
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CrateImported { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_imported_crate);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
615#[diag(resolve_imported_crate)]
616pub(crate) struct CrateImported {
617 #[primary_span]
618 pub(crate) span: Span,
619}
620
621#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroUseExternCrateSelf where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroUseExternCrateSelf { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_macro_use_extern_crate_self);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
622#[diag(resolve_macro_use_extern_crate_self)]
623pub(crate) struct MacroUseExternCrateSelf {
624 #[primary_span]
625 pub(crate) span: Span,
626}
627
628#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CfgAccessibleUnsure where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CfgAccessibleUnsure { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_accessible_unsure);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
629#[diag(resolve_accessible_unsure)]
630#[note]
631pub(crate) struct CfgAccessibleUnsure {
632 #[primary_span]
633 pub(crate) span: Span,
634}
635
636#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ParamInEnumDiscriminant {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"ParamInEnumDiscriminant", "span", &self.span, "name", &self.name,
"param_kind", &&self.param_kind)
}
}Debug)]
637#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ParamInEnumDiscriminant where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ParamInEnumDiscriminant {
span: __binding_0,
name: __binding_1,
param_kind: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_param_in_enum_discriminant);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.subdiagnostic(__binding_2);
diag
}
}
}
}
};Diagnostic)]
638#[diag(resolve_param_in_enum_discriminant)]
639pub(crate) struct ParamInEnumDiscriminant {
640 #[primary_span]
641 #[label]
642 pub(crate) span: Span,
643 pub(crate) name: Symbol,
644 #[subdiagnostic]
645 pub(crate) param_kind: ParamKindInEnumDiscriminant,
646}
647
648#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ParamKindInEnumDiscriminant {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
ParamKindInEnumDiscriminant::Type => "Type",
ParamKindInEnumDiscriminant::Const => "Const",
ParamKindInEnumDiscriminant::Lifetime => "Lifetime",
})
}
}Debug)]
649#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ParamKindInEnumDiscriminant {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ParamKindInEnumDiscriminant::Type => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_type_param_in_enum_discriminant);
diag.note(__message);
diag.restore_args();
}
ParamKindInEnumDiscriminant::Const => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_const_param_in_enum_discriminant);
diag.note(__message);
diag.restore_args();
}
ParamKindInEnumDiscriminant::Lifetime => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_lifetime_param_in_enum_discriminant);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
650pub(crate) enum ParamKindInEnumDiscriminant {
651 #[note(resolve_type_param_in_enum_discriminant)]
652 Type,
653 #[note(resolve_const_param_in_enum_discriminant)]
654 Const,
655 #[note(resolve_lifetime_param_in_enum_discriminant)]
656 Lifetime,
657}
658
659#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ChangeImportBinding {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ChangeImportBinding { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_change_import_binding);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
660#[label(resolve_change_import_binding)]
661pub(crate) struct ChangeImportBinding {
662 #[primary_span]
663 pub(crate) span: Span,
664}
665
666#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ChangeImportBindingSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ChangeImportBindingSuggestion {
span: __binding_0, suggestion: __binding_1 } => {
let __code_16 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("suggestion", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_change_import_binding);
diag.span_suggestions_with_style(__binding_0, __message,
__code_16, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
667#[suggestion(
668 resolve_change_import_binding,
669 code = "{suggestion}",
670 applicability = "maybe-incorrect"
671)]
672pub(crate) struct ChangeImportBindingSuggestion {
673 #[primary_span]
674 pub(crate) span: Span,
675 pub(crate) suggestion: String,
676}
677
678#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
ImportsCannotReferTo<'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 {
ImportsCannotReferTo { span: __binding_0, what: __binding_1
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_imports_cannot_refer_to);
;
diag.arg("what", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
679#[diag(resolve_imports_cannot_refer_to)]
680pub(crate) struct ImportsCannotReferTo<'a> {
681 #[primary_span]
682 pub(crate) span: Span,
683 pub(crate) what: &'a str,
684}
685
686#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
CannotFindIdentInThisScope<'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 {
CannotFindIdentInThisScope {
span: __binding_0, expected: __binding_1, ident: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_find_ident_in_this_scope);
;
diag.arg("expected", __binding_1);
diag.arg("ident", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
687#[diag(resolve_cannot_find_ident_in_this_scope)]
688pub(crate) struct CannotFindIdentInThisScope<'a> {
689 #[primary_span]
690 pub(crate) span: Span,
691 pub(crate) expected: &'a str,
692 pub(crate) ident: Ident,
693}
694
695#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ExplicitUnsafeTraits {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ExplicitUnsafeTraits { span: __binding_0, ident: __binding_1
} => {
diag.store_args();
diag.arg("ident", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_explicit_unsafe_traits);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
696#[note(resolve_explicit_unsafe_traits)]
697pub(crate) struct ExplicitUnsafeTraits {
698 #[primary_span]
699 pub(crate) span: Span,
700 pub(crate) ident: Ident,
701}
702
703#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MacroDefinedLater {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MacroDefinedLater { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_macro_defined_later);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
704#[note(resolve_macro_defined_later)]
705pub(crate) struct MacroDefinedLater {
706 #[primary_span]
707 pub(crate) span: Span,
708}
709
710#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MacroSuggMovePosition {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MacroSuggMovePosition {
span: __binding_0, ident: __binding_1 } => {
diag.store_args();
diag.arg("ident", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_consider_move_macro_position);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
711#[label(resolve_consider_move_macro_position)]
712pub(crate) struct MacroSuggMovePosition {
713 #[primary_span]
714 pub(crate) span: Span,
715 pub(crate) ident: Ident,
716}
717
718#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MacroRulesNot {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MacroRulesNot::Func { span: __binding_0, ident: __binding_1
} => {
diag.store_args();
diag.arg("ident", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_macro_cannot_use_as_fn_like);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
MacroRulesNot::Attr { span: __binding_0, ident: __binding_1
} => {
diag.store_args();
diag.arg("ident", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_macro_cannot_use_as_attr);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
MacroRulesNot::Derive {
span: __binding_0, ident: __binding_1 } => {
diag.store_args();
diag.arg("ident", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_macro_cannot_use_as_derive);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
719pub(crate) enum MacroRulesNot {
720 #[label(resolve_macro_cannot_use_as_fn_like)]
721 Func {
722 #[primary_span]
723 span: Span,
724 ident: Ident,
725 },
726 #[label(resolve_macro_cannot_use_as_attr)]
727 Attr {
728 #[primary_span]
729 span: Span,
730 ident: Ident,
731 },
732 #[label(resolve_macro_cannot_use_as_derive)]
733 Derive {
734 #[primary_span]
735 span: Span,
736 ident: Ident,
737 },
738}
739
740#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for MaybeMissingMacroRulesName {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
MaybeMissingMacroRulesName { spans: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_missing_macro_rules_name);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
741#[note(resolve_missing_macro_rules_name)]
742pub(crate) struct MaybeMissingMacroRulesName {
743 #[primary_span]
744 pub(crate) spans: MultiSpan,
745}
746
747#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for AddedMacroUse {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
AddedMacroUse => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_added_macro_use);
diag.help(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
748#[help(resolve_added_macro_use)]
749pub(crate) struct AddedMacroUse;
750
751#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ConsiderAddingADerive {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ConsiderAddingADerive {
span: __binding_0, suggestion: __binding_1 } => {
let __code_17 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("suggestion", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_consider_adding_a_derive);
diag.span_suggestions_with_style(__binding_0, __message,
__code_17, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
752#[suggestion(
753 resolve_consider_adding_a_derive,
754 code = "{suggestion}",
755 applicability = "maybe-incorrect"
756)]
757pub(crate) struct ConsiderAddingADerive {
758 #[primary_span]
759 pub(crate) span: Span,
760 pub(crate) suggestion: String,
761}
762
763#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotDetermineImportResolution where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotDetermineImportResolution { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_determine_import_resolution);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
764#[diag(resolve_cannot_determine_import_resolution)]
765pub(crate) struct CannotDetermineImportResolution {
766 #[primary_span]
767 pub(crate) span: Span,
768}
769
770#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotDetermineMacroResolution where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotDetermineMacroResolution {
span: __binding_0, kind: __binding_1, path: __binding_2 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_determine_macro_resolution);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("kind", __binding_1);
diag.arg("path", __binding_2);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
771#[diag(resolve_cannot_determine_macro_resolution)]
772#[note]
773pub(crate) struct CannotDetermineMacroResolution {
774 #[primary_span]
775 pub(crate) span: Span,
776 pub(crate) kind: &'static str,
777 pub(crate) path: String,
778}
779
780#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotBeReexportedPrivate where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotBeReexportedPrivate {
span: __binding_0, ident: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_be_reexported_private);
diag.code(E0364);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
781#[diag(resolve_cannot_be_reexported_private, code = E0364)]
782pub(crate) struct CannotBeReexportedPrivate {
783 #[primary_span]
784 pub(crate) span: Span,
785 pub(crate) ident: Ident,
786}
787
788#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotBeReexportedCratePublic where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotBeReexportedCratePublic {
span: __binding_0, ident: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_be_reexported_crate_public);
diag.code(E0364);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
789#[diag(resolve_cannot_be_reexported_crate_public, code = E0364)]
790pub(crate) struct CannotBeReexportedCratePublic {
791 #[primary_span]
792 pub(crate) span: Span,
793 pub(crate) ident: Ident,
794}
795
796#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotBeReexportedPrivateNS where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotBeReexportedPrivateNS {
span: __binding_0, ident: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_be_reexported_private);
diag.code(E0365);
diag.note(crate::fluent_generated::resolve_consider_declaring_with_pub);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::resolve_reexport_of_private);
diag
}
}
}
}
};Diagnostic)]
797#[diag(resolve_cannot_be_reexported_private, code = E0365)]
798#[note(resolve_consider_declaring_with_pub)]
799pub(crate) struct CannotBeReexportedPrivateNS {
800 #[primary_span]
801 #[label(resolve_reexport_of_private)]
802 pub(crate) span: Span,
803 pub(crate) ident: Ident,
804}
805
806#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotBeReexportedCratePublicNS where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotBeReexportedCratePublicNS {
span: __binding_0, ident: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_be_reexported_crate_public);
diag.code(E0365);
diag.note(crate::fluent_generated::resolve_consider_declaring_with_pub);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::resolve_reexport_of_crate_public);
diag
}
}
}
}
};Diagnostic)]
807#[diag(resolve_cannot_be_reexported_crate_public, code = E0365)]
808#[note(resolve_consider_declaring_with_pub)]
809pub(crate) struct CannotBeReexportedCratePublicNS {
810 #[primary_span]
811 #[label(resolve_reexport_of_crate_public)]
812 pub(crate) span: Span,
813 pub(crate) ident: Ident,
814}
815
816#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
PrivateExternCrateReexport {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
PrivateExternCrateReexport {
ident: __binding_0, sugg: __binding_1 } => {
diag.primary_message(crate::fluent_generated::resolve_private_extern_crate_reexport);
diag.code(E0365);
;
let __code_18 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("pub "))
})].into_iter();
diag.arg("ident", __binding_0);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_18,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
};
}
}
};LintDiagnostic)]
817#[diag(resolve_private_extern_crate_reexport, code = E0365)]
818pub(crate) struct PrivateExternCrateReexport {
819 pub ident: Ident,
820 #[suggestion(code = "pub ", style = "verbose", applicability = "maybe-incorrect")]
821 pub sugg: Span,
822}
823
824#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ConsiderAddingMacroExport {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ConsiderAddingMacroExport { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_consider_adding_macro_export);
diag.span_help(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
825#[help(resolve_consider_adding_macro_export)]
826pub(crate) struct ConsiderAddingMacroExport {
827 #[primary_span]
828 pub(crate) span: Span,
829}
830
831#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ConsiderMarkingAsPubCrate {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ConsiderMarkingAsPubCrate { vis_span: __binding_0 } => {
let __code_19 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("pub(crate)"))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_consider_marking_as_pub_crate);
diag.span_suggestions_with_style(__binding_0, __message,
__code_19, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
832#[suggestion(
833 resolve_consider_marking_as_pub_crate,
834 code = "pub(crate)",
835 applicability = "maybe-incorrect"
836)]
837pub(crate) struct ConsiderMarkingAsPubCrate {
838 #[primary_span]
839 pub(crate) vis_span: Span,
840}
841
842#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ConsiderMarkingAsPub {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ConsiderMarkingAsPub { span: __binding_0, ident: __binding_1
} => {
diag.store_args();
diag.arg("ident", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_consider_marking_as_pub);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
843#[note(resolve_consider_marking_as_pub)]
844pub(crate) struct ConsiderMarkingAsPub {
845 #[primary_span]
846 pub(crate) span: Span,
847 pub(crate) ident: Ident,
848}
849
850#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotGlobImportAllCrates where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotGlobImportAllCrates { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_glob_import_possible_crates);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
851#[diag(resolve_cannot_glob_import_possible_crates)]
852pub(crate) struct CannotGlobImportAllCrates {
853 #[primary_span]
854 pub(crate) span: Span,
855}
856
857#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
UnexpectedResChangeTyToConstParamSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnexpectedResChangeTyToConstParamSugg {
span: __binding_0, applicability: __binding_1 } => {
let __code_20 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("const "))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unexpected_res_change_ty_to_const_param_sugg);
diag.span_suggestions_with_style(__binding_0, __message,
__code_20, __binding_1,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
858#[suggestion(
859 resolve_unexpected_res_change_ty_to_const_param_sugg,
860 code = "const ",
861 style = "verbose"
862)]
863pub(crate) struct UnexpectedResChangeTyToConstParamSugg {
864 #[primary_span]
865 pub span: Span,
866 #[applicability]
867 pub applicability: Applicability,
868}
869
870#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
UnexpectedResChangeTyParamToConstParamSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnexpectedResChangeTyParamToConstParamSugg {
before: __binding_0, after: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_21 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("const "))
});
let __code_22 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!(": /* Type */"))
});
suggestions.push((__binding_0, __code_21));
suggestions.push((__binding_1, __code_22));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unexpected_res_change_ty_to_const_param_sugg);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
871#[multipart_suggestion(
872 resolve_unexpected_res_change_ty_to_const_param_sugg,
873 applicability = "has-placeholders",
874 style = "verbose"
875)]
876pub(crate) struct UnexpectedResChangeTyParamToConstParamSugg {
877 #[suggestion_part(code = "const ")]
878 pub before: Span,
879 #[suggestion_part(code = ": /* Type */")]
880 pub after: Span,
881}
882
883#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
UnexpectedResUseAtOpInSlicePatWithRangeSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnexpectedResUseAtOpInSlicePatWithRangeSugg {
span: __binding_0, ident: __binding_1, snippet: __binding_2
} => {
let __code_23 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
})].into_iter();
diag.store_args();
diag.arg("ident", __binding_1);
diag.arg("snippet", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unexpected_res_use_at_op_in_slice_pat_with_range_sugg);
diag.span_suggestions_with_style(__binding_0, __message,
__code_23, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
884#[suggestion(
885 resolve_unexpected_res_use_at_op_in_slice_pat_with_range_sugg,
886 code = "{snippet}",
887 applicability = "maybe-incorrect",
888 style = "verbose"
889)]
890pub(crate) struct UnexpectedResUseAtOpInSlicePatWithRangeSugg {
891 #[primary_span]
892 pub span: Span,
893 pub ident: Ident,
894 pub snippet: String,
895}
896
897#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExternCrateLoadingMacroNotAtCrateRoot where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternCrateLoadingMacroNotAtCrateRoot { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_extern_crate_loading_macro_not_at_crate_root);
diag.code(E0468);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
898#[diag(resolve_extern_crate_loading_macro_not_at_crate_root, code = E0468)]
899pub(crate) struct ExternCrateLoadingMacroNotAtCrateRoot {
900 #[primary_span]
901 pub(crate) span: Span,
902}
903
904#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExternCrateSelfRequiresRenaming where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExternCrateSelfRequiresRenaming { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_extern_crate_self_requires_renaming);
let __code_24 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("extern crate self as name;"))
})].into_iter();
;
diag.span(__binding_0);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_24,
rustc_errors::Applicability::HasPlaceholders,
rustc_errors::SuggestionStyle::ShowCode);
diag
}
}
}
}
};Diagnostic)]
905#[diag(resolve_extern_crate_self_requires_renaming)]
906pub(crate) struct ExternCrateSelfRequiresRenaming {
907 #[primary_span]
908 #[suggestion(code = "extern crate self as name;", applicability = "has-placeholders")]
909 pub(crate) span: Span,
910}
911
912#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroUseNameAlreadyInUse where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroUseNameAlreadyInUse {
span: __binding_0, name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_macro_use_name_already_in_use);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
913#[diag(resolve_macro_use_name_already_in_use)]
914#[note]
915pub(crate) struct MacroUseNameAlreadyInUse {
916 #[primary_span]
917 pub(crate) span: Span,
918 pub(crate) name: Symbol,
919}
920
921#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ImportedMacroNotFound where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ImportedMacroNotFound { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_imported_macro_not_found);
diag.code(E0469);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
922#[diag(resolve_imported_macro_not_found, code = E0469)]
923pub(crate) struct ImportedMacroNotFound {
924 #[primary_span]
925 pub(crate) span: Span,
926}
927
928#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroExternDeprecated where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroExternDeprecated {
span: __binding_0, inner_attribute: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_macro_extern_deprecated);
;
diag.span(__binding_0);
if __binding_1 {
diag.help(crate::fluent_generated::_subdiag::help);
}
diag
}
}
}
}
};Diagnostic)]
929#[diag(resolve_macro_extern_deprecated)]
930pub(crate) struct MacroExternDeprecated {
931 #[primary_span]
932 pub(crate) span: Span,
933 #[help]
934 pub inner_attribute: bool,
935}
936
937#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ArgumentsMacroUseNotAllowed where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ArgumentsMacroUseNotAllowed { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_arguments_macro_use_not_allowed);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
938#[diag(resolve_arguments_macro_use_not_allowed)]
939pub(crate) struct ArgumentsMacroUseNotAllowed {
940 #[primary_span]
941 pub(crate) span: Span,
942}
943
944#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnnamedCrateRootImport where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnnamedCrateRootImport { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_unnamed_crate_root_import);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
945#[diag(resolve_unnamed_crate_root_import)]
946pub(crate) struct UnnamedCrateRootImport {
947 #[primary_span]
948 pub(crate) span: Span,
949}
950
951#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
MacroExpandedExternCrateCannotShadowExternArguments where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
MacroExpandedExternCrateCannotShadowExternArguments {
span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_macro_expanded_extern_crate_cannot_shadow_extern_arguments);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
952#[diag(resolve_macro_expanded_extern_crate_cannot_shadow_extern_arguments)]
953pub(crate) struct MacroExpandedExternCrateCannotShadowExternArguments {
954 #[primary_span]
955 pub(crate) span: Span,
956}
957
958#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ElidedAnonymousLifetimeReportError where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ElidedAnonymousLifetimeReportError {
span: __binding_0, suggestion: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_elided_anonymous_lifetime_report_error);
diag.code(E0637);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
if let Some(__binding_1) = __binding_1 {
diag.subdiagnostic(__binding_1);
}
diag
}
}
}
}
};Diagnostic)]
959#[diag(resolve_elided_anonymous_lifetime_report_error, code = E0637)]
960pub(crate) struct ElidedAnonymousLifetimeReportError {
961 #[primary_span]
962 #[label]
963 pub(crate) span: Span,
964 #[subdiagnostic]
965 pub(crate) suggestion: Option<ElidedAnonymousLifetimeReportErrorSuggestion>,
966}
967
968#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
LendingIteratorReportError where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
LendingIteratorReportError {
lifetime: __binding_0, ty: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_lending_iterator_report_error);
;
diag.span(__binding_0);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
969#[diag(resolve_lending_iterator_report_error)]
970pub(crate) struct LendingIteratorReportError {
971 #[primary_span]
972 pub(crate) lifetime: Span,
973 #[note]
974 pub(crate) ty: Span,
975}
976
977#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AnonymousLifetimeNonGatReportError where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AnonymousLifetimeNonGatReportError {
lifetime: __binding_0, decl: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_anonymous_lifetime_non_gat_report_error);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_note(__binding_1,
crate::fluent_generated::_subdiag::note);
diag
}
}
}
}
};Diagnostic)]
978#[diag(resolve_anonymous_lifetime_non_gat_report_error)]
979pub(crate) struct AnonymousLifetimeNonGatReportError {
980 #[primary_span]
981 #[label]
982 pub(crate) lifetime: Span,
983 #[note]
984 pub(crate) decl: MultiSpan,
985}
986
987#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
ElidedAnonymousLifetimeReportErrorSuggestion {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ElidedAnonymousLifetimeReportErrorSuggestion {
lo: __binding_0, hi: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_25 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("for<\'a> "))
});
let __code_26 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("\'a "))
});
suggestions.push((__binding_0, __code_25));
suggestions.push((__binding_1, __code_26));
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_elided_anonymous_lifetime_report_error_suggestion);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
988#[multipart_suggestion(
989 resolve_elided_anonymous_lifetime_report_error_suggestion,
990 applicability = "machine-applicable"
991)]
992pub(crate) struct ElidedAnonymousLifetimeReportErrorSuggestion {
993 #[suggestion_part(code = "for<'a> ")]
994 pub(crate) lo: Span,
995 #[suggestion_part(code = "'a ")]
996 pub(crate) hi: Span,
997}
998
999#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ExplicitAnonymousLifetimeReportError where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ExplicitAnonymousLifetimeReportError { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_explicit_anonymous_lifetime_report_error);
diag.code(E0637);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1000#[diag(resolve_explicit_anonymous_lifetime_report_error, code = E0637)]
1001pub(crate) struct ExplicitAnonymousLifetimeReportError {
1002 #[primary_span]
1003 #[label]
1004 pub(crate) span: Span,
1005}
1006
1007#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ImplicitElidedLifetimeNotAllowedHere where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ImplicitElidedLifetimeNotAllowedHere {
span: __binding_0, subdiag: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_implicit_elided_lifetimes_not_allowed_here);
diag.code(E0726);
;
diag.span(__binding_0);
diag.subdiagnostic(__binding_1);
diag
}
}
}
}
};Diagnostic)]
1008#[diag(resolve_implicit_elided_lifetimes_not_allowed_here, code = E0726)]
1009pub(crate) struct ImplicitElidedLifetimeNotAllowedHere {
1010 #[primary_span]
1011 pub(crate) span: Span,
1012 #[subdiagnostic]
1013 pub(crate) subdiag: ElidedLifetimeInPathSubdiag,
1014}
1015
1016#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnderscoreLifetimeIsReserved where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnderscoreLifetimeIsReserved { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_underscore_lifetime_is_reserved);
diag.code(E0637);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1017#[diag(resolve_underscore_lifetime_is_reserved, code = E0637)]
1018#[help]
1019pub(crate) struct UnderscoreLifetimeIsReserved {
1020 #[primary_span]
1021 #[label]
1022 pub(crate) span: Span,
1023}
1024
1025#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
StaticLifetimeIsReserved where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
StaticLifetimeIsReserved {
span: __binding_0, lifetime: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_static_lifetime_is_reserved);
diag.code(E0262);
;
diag.arg("lifetime", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1026#[diag(resolve_static_lifetime_is_reserved, code = E0262)]
1027pub(crate) struct StaticLifetimeIsReserved {
1028 #[primary_span]
1029 #[label]
1030 pub(crate) span: Span,
1031 pub(crate) lifetime: Ident,
1032}
1033
1034#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
VariableIsNotBoundInAllPatterns where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
VariableIsNotBoundInAllPatterns {
multispan: __binding_0, name: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_variable_is_not_bound_in_all_patterns);
diag.code(E0408);
;
diag.arg("name", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1035#[diag(resolve_variable_is_not_bound_in_all_patterns, code = E0408)]
1036pub(crate) struct VariableIsNotBoundInAllPatterns {
1037 #[primary_span]
1038 pub(crate) multispan: MultiSpan,
1039 pub(crate) name: Ident,
1040}
1041
1042#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for PatternDoesntBindName {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
PatternDoesntBindName { span: __binding_0, name: __binding_1
} => {
diag.store_args();
diag.arg("name", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_pattern_doesnt_bind_name);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic, #[automatically_derived]
impl ::core::fmt::Debug for PatternDoesntBindName {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"PatternDoesntBindName", "span", &self.span, "name", &&self.name)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for PatternDoesntBindName {
#[inline]
fn clone(&self) -> PatternDoesntBindName {
PatternDoesntBindName {
span: ::core::clone::Clone::clone(&self.span),
name: ::core::clone::Clone::clone(&self.name),
}
}
}Clone)]
1043#[label(resolve_pattern_doesnt_bind_name)]
1044pub(crate) struct PatternDoesntBindName {
1045 #[primary_span]
1046 pub(crate) span: Span,
1047 pub(crate) name: Ident,
1048}
1049
1050#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for VariableNotInAllPatterns {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
VariableNotInAllPatterns { span: __binding_0 } => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_variable_not_in_all_patterns);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic, #[automatically_derived]
impl ::core::fmt::Debug for VariableNotInAllPatterns {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"VariableNotInAllPatterns", "span", &&self.span)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for VariableNotInAllPatterns {
#[inline]
fn clone(&self) -> VariableNotInAllPatterns {
VariableNotInAllPatterns {
span: ::core::clone::Clone::clone(&self.span),
}
}
}Clone)]
1051#[label(resolve_variable_not_in_all_patterns)]
1052pub(crate) struct VariableNotInAllPatterns {
1053 #[primary_span]
1054 pub(crate) span: Span,
1055}
1056
1057#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for PatternBindingTypo {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
PatternBindingTypo { spans: __binding_0, typo: __binding_1 }
=> {
let mut suggestions = Vec::new();
let __code_27 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
});
for __binding_0 in __binding_0 {
suggestions.push((__binding_0, __code_27.clone()));
}
diag.store_args();
diag.arg("typo", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_variable_is_a_typo);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1058#[multipart_suggestion(
1059 resolve_variable_is_a_typo,
1060 applicability = "maybe-incorrect",
1061 style = "verbose"
1062)]
1063pub(crate) struct PatternBindingTypo {
1064 #[suggestion_part(code = "{typo}")]
1065 pub(crate) spans: Vec<Span>,
1066 pub(crate) typo: Symbol,
1067}
1068
1069#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NameDefinedMultipleTime where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NameDefinedMultipleTime {
span: __binding_0,
name: __binding_1,
descr: __binding_2,
container: __binding_3,
label: __binding_4,
old_binding_label: __binding_5 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_name_defined_multiple_time);
diag.note(crate::fluent_generated::_subdiag::note);
;
diag.arg("name", __binding_1);
diag.arg("descr", __binding_2);
diag.arg("container", __binding_3);
diag.span(__binding_0);
diag.subdiagnostic(__binding_4);
if let Some(__binding_5) = __binding_5 {
diag.subdiagnostic(__binding_5);
}
diag
}
}
}
}
};Diagnostic)]
1070#[diag(resolve_name_defined_multiple_time)]
1071#[note]
1072pub(crate) struct NameDefinedMultipleTime {
1073 #[primary_span]
1074 pub(crate) span: Span,
1075 pub(crate) name: Symbol,
1076 pub(crate) descr: &'static str,
1077 pub(crate) container: &'static str,
1078 #[subdiagnostic]
1079 pub(crate) label: NameDefinedMultipleTimeLabel,
1080 #[subdiagnostic]
1081 pub(crate) old_binding_label: Option<NameDefinedMultipleTimeOldBindingLabel>,
1082}
1083
1084#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for NameDefinedMultipleTimeLabel {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
NameDefinedMultipleTimeLabel::Reimported { span: __binding_0
} => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_name_defined_multiple_time_reimported);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
NameDefinedMultipleTimeLabel::Redefined { span: __binding_0
} => {
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_name_defined_multiple_time_redefined);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1085pub(crate) enum NameDefinedMultipleTimeLabel {
1086 #[label(resolve_name_defined_multiple_time_reimported)]
1087 Reimported {
1088 #[primary_span]
1089 span: Span,
1090 },
1091 #[label(resolve_name_defined_multiple_time_redefined)]
1092 Redefined {
1093 #[primary_span]
1094 span: Span,
1095 },
1096}
1097
1098#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
NameDefinedMultipleTimeOldBindingLabel {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
NameDefinedMultipleTimeOldBindingLabel::Import {
span: __binding_0, old_kind: __binding_1 } => {
diag.store_args();
diag.arg("old_kind", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_name_defined_multiple_time_old_binding_import);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
NameDefinedMultipleTimeOldBindingLabel::Definition {
span: __binding_0, old_kind: __binding_1 } => {
diag.store_args();
diag.arg("old_kind", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_name_defined_multiple_time_old_binding_definition);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1099pub(crate) enum NameDefinedMultipleTimeOldBindingLabel {
1100 #[label(resolve_name_defined_multiple_time_old_binding_import)]
1101 Import {
1102 #[primary_span]
1103 span: Span,
1104 old_kind: &'static str,
1105 },
1106 #[label(resolve_name_defined_multiple_time_old_binding_definition)]
1107 Definition {
1108 #[primary_span]
1109 span: Span,
1110 old_kind: &'static str,
1111 },
1112}
1113
1114#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
IsPrivate<'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 {
IsPrivate {
span: __binding_0,
ident_descr: __binding_1,
ident: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_is_private);
diag.code(E0603);
;
diag.arg("ident_descr", __binding_1);
diag.arg("ident", __binding_2);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1115#[diag(resolve_is_private, code = E0603)]
1116pub(crate) struct IsPrivate<'a> {
1117 #[primary_span]
1118 #[label]
1119 pub(crate) span: Span,
1120 pub(crate) ident_descr: &'a str,
1121 pub(crate) ident: Ident,
1122}
1123
1124#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
GenericArgumentsInMacroPath where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
GenericArgumentsInMacroPath { span: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_generic_arguments_in_macro_path);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1125#[diag(resolve_generic_arguments_in_macro_path)]
1126pub(crate) struct GenericArgumentsInMacroPath {
1127 #[primary_span]
1128 pub(crate) span: Span,
1129}
1130
1131#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
AttributesStartingWithRustcAreReserved where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
AttributesStartingWithRustcAreReserved { span: __binding_0 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_attributes_starting_with_rustc_are_reserved);
;
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1132#[diag(resolve_attributes_starting_with_rustc_are_reserved)]
1133pub(crate) struct AttributesStartingWithRustcAreReserved {
1134 #[primary_span]
1135 pub(crate) span: Span,
1136}
1137
1138#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotUseThroughAnImport where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotUseThroughAnImport {
span: __binding_0,
article: __binding_1,
descr: __binding_2,
binding_span: __binding_3 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_use_through_an_import);
;
diag.arg("article", __binding_1);
diag.arg("descr", __binding_2);
diag.span(__binding_0);
if let Some(__binding_3) = __binding_3 {
diag.span_note(__binding_3,
crate::fluent_generated::_subdiag::note);
}
diag
}
}
}
}
};Diagnostic)]
1139#[diag(resolve_cannot_use_through_an_import)]
1140pub(crate) struct CannotUseThroughAnImport {
1141 #[primary_span]
1142 pub(crate) span: Span,
1143 pub(crate) article: &'static str,
1144 pub(crate) descr: &'static str,
1145 #[note]
1146 pub(crate) binding_span: Option<Span>,
1147}
1148
1149#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
NameReservedInAttributeNamespace where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
NameReservedInAttributeNamespace {
span: __binding_0, ident: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_name_reserved_in_attribute_namespace);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1150#[diag(resolve_name_reserved_in_attribute_namespace)]
1151pub(crate) struct NameReservedInAttributeNamespace {
1152 #[primary_span]
1153 pub(crate) span: Span,
1154 pub(crate) ident: Symbol,
1155}
1156
1157#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
CannotFindBuiltinMacroWithName where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CannotFindBuiltinMacroWithName {
span: __binding_0, ident: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_cannot_find_builtin_macro_with_name);
;
diag.arg("ident", __binding_1);
diag.span(__binding_0);
diag
}
}
}
}
};Diagnostic)]
1158#[diag(resolve_cannot_find_builtin_macro_with_name)]
1159pub(crate) struct CannotFindBuiltinMacroWithName {
1160 #[primary_span]
1161 pub(crate) span: Span,
1162 pub(crate) ident: Ident,
1163}
1164
1165#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ToolWasAlreadyRegistered where G: rustc_errors::EmissionGuarantee
{
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ToolWasAlreadyRegistered {
span: __binding_0,
tool: __binding_1,
old_ident_span: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_tool_was_already_registered);
;
diag.arg("tool", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_2,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1166#[diag(resolve_tool_was_already_registered)]
1167pub(crate) struct ToolWasAlreadyRegistered {
1168 #[primary_span]
1169 pub(crate) span: Span,
1170 pub(crate) tool: Ident,
1171 #[label]
1172 pub(crate) old_ident_span: Span,
1173}
1174
1175#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
ToolOnlyAcceptsIdentifiers where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
ToolOnlyAcceptsIdentifiers {
span: __binding_0, tool: __binding_1 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_tool_only_accepts_identifiers);
;
diag.arg("tool", __binding_1);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
}
}
}
};Diagnostic)]
1176#[diag(resolve_tool_only_accepts_identifiers)]
1177pub(crate) struct ToolOnlyAcceptsIdentifiers {
1178 #[primary_span]
1179 #[label]
1180 pub(crate) span: Span,
1181 pub(crate) tool: Symbol,
1182}
1183
1184#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for DefinedHere {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
DefinedHere::SimilarlyNamed {
span: __binding_0,
candidate_descr: __binding_1,
candidate: __binding_2 } => {
diag.store_args();
diag.arg("candidate_descr", __binding_1);
diag.arg("candidate", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_similarly_named_defined_here);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
DefinedHere::SingleItem {
span: __binding_0,
candidate_descr: __binding_1,
candidate: __binding_2 } => {
diag.store_args();
diag.arg("candidate_descr", __binding_1);
diag.arg("candidate", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_single_item_defined_here);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1185pub(crate) enum DefinedHere {
1186 #[label(resolve_similarly_named_defined_here)]
1187 SimilarlyNamed {
1188 #[primary_span]
1189 span: Span,
1190 candidate_descr: &'static str,
1191 candidate: Symbol,
1192 },
1193 #[label(resolve_single_item_defined_here)]
1194 SingleItem {
1195 #[primary_span]
1196 span: Span,
1197 candidate_descr: &'static str,
1198 candidate: Symbol,
1199 },
1200}
1201
1202#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for OuterIdentIsNotPubliclyReexported
{
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
OuterIdentIsNotPubliclyReexported {
span: __binding_0,
outer_ident_descr: __binding_1,
outer_ident: __binding_2 } => {
diag.store_args();
diag.arg("outer_ident_descr", __binding_1);
diag.arg("outer_ident", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_outer_ident_is_not_publicly_reexported);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1203#[label(resolve_outer_ident_is_not_publicly_reexported)]
1204pub(crate) struct OuterIdentIsNotPubliclyReexported {
1205 #[primary_span]
1206 pub(crate) span: Span,
1207 pub(crate) outer_ident_descr: &'static str,
1208 pub(crate) outer_ident: Ident,
1209}
1210
1211#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
ConstructorPrivateIfAnyFieldPrivate {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ConstructorPrivateIfAnyFieldPrivate { span: __binding_0 } =>
{
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_constructor_private_if_any_field_private);
diag.span_label(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1212#[label(resolve_constructor_private_if_any_field_private)]
1213pub(crate) struct ConstructorPrivateIfAnyFieldPrivate {
1214 #[primary_span]
1215 pub(crate) span: Span,
1216}
1217
1218#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ConsiderMakingTheFieldPublic {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ConsiderMakingTheFieldPublic {
spans: __binding_0, number_of_fields: __binding_1 } => {
let mut suggestions = Vec::new();
let __code_28 =
::alloc::__export::must_use({
::alloc::fmt::format(format_args!("pub "))
});
for __binding_0 in __binding_0 {
suggestions.push((__binding_0, __code_28.clone()));
}
diag.store_args();
diag.arg("number_of_fields", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_consider_making_the_field_public);
diag.multipart_suggestion_with_style(__message, suggestions,
rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1219#[multipart_suggestion(
1220 resolve_consider_making_the_field_public,
1221 applicability = "maybe-incorrect",
1222 style = "verbose"
1223)]
1224pub(crate) struct ConsiderMakingTheFieldPublic {
1225 #[suggestion_part(code = "pub ")]
1226 pub(crate) spans: Vec<Span>,
1227 pub(crate) number_of_fields: usize,
1228}
1229
1230#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ImportIdent {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ImportIdent::ThroughReExport {
span: __binding_0, ident: __binding_1, path: __binding_2 }
=> {
let __code_29 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
})].into_iter();
diag.store_args();
diag.arg("ident", __binding_1);
diag.arg("path", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_suggestion_import_ident_through_reexport);
diag.span_suggestions_with_style(__binding_0, __message,
__code_29, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
ImportIdent::Directly {
span: __binding_0, ident: __binding_1, path: __binding_2 }
=> {
let __code_30 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_2))
})].into_iter();
diag.store_args();
diag.arg("ident", __binding_1);
diag.arg("path", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_suggestion_import_ident_directly);
diag.span_suggestions_with_style(__binding_0, __message,
__code_30, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1231pub(crate) enum ImportIdent {
1232 #[suggestion(
1233 resolve_suggestion_import_ident_through_reexport,
1234 code = "{path}",
1235 applicability = "machine-applicable",
1236 style = "verbose"
1237 )]
1238 ThroughReExport {
1239 #[primary_span]
1240 span: Span,
1241 ident: Ident,
1242 path: String,
1243 },
1244 #[suggestion(
1245 resolve_suggestion_import_ident_directly,
1246 code = "{path}",
1247 applicability = "machine-applicable",
1248 style = "verbose"
1249 )]
1250 Directly {
1251 #[primary_span]
1252 span: Span,
1253 ident: Ident,
1254 path: String,
1255 },
1256}
1257
1258#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for
NoteAndRefersToTheItemDefinedHere<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
NoteAndRefersToTheItemDefinedHere {
span: __binding_0,
binding_descr: __binding_1,
binding_name: __binding_2,
first: __binding_3,
dots: __binding_4 } => {
diag.store_args();
diag.arg("binding_descr", __binding_1);
diag.arg("binding_name", __binding_2);
diag.arg("first", __binding_3);
diag.arg("dots", __binding_4);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_note_and_refers_to_the_item_defined_here);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1259#[note(resolve_note_and_refers_to_the_item_defined_here)]
1260pub(crate) struct NoteAndRefersToTheItemDefinedHere<'a> {
1261 #[primary_span]
1262 pub(crate) span: MultiSpan,
1263 pub(crate) binding_descr: &'a str,
1264 pub(crate) binding_name: Ident,
1265 pub(crate) first: bool,
1266 pub(crate) dots: bool,
1267}
1268
1269#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for RemoveUnnecessaryImport {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
RemoveUnnecessaryImport { span: __binding_0 } => {
let __code_31 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_remove_unnecessary_import);
diag.span_suggestions_with_style(__binding_0, __message,
__code_31, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::ShowCode);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1270#[suggestion(resolve_remove_unnecessary_import, code = "", applicability = "maybe-incorrect")]
1271pub(crate) struct RemoveUnnecessaryImport {
1272 #[primary_span]
1273 pub(crate) span: Span,
1274}
1275
1276#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for ToolOnlyRemoveUnnecessaryImport {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
ToolOnlyRemoveUnnecessaryImport { span: __binding_0 } => {
let __code_32 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.store_args();
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_remove_unnecessary_import);
diag.span_suggestions_with_style(__binding_0, __message,
__code_32, rustc_errors::Applicability::MaybeIncorrect,
rustc_errors::SuggestionStyle::CompletelyHidden);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1277#[suggestion(
1278 resolve_remove_unnecessary_import,
1279 code = "",
1280 applicability = "maybe-incorrect",
1281 style = "tool-only"
1282)]
1283pub(crate) struct ToolOnlyRemoveUnnecessaryImport {
1284 #[primary_span]
1285 pub(crate) span: Span,
1286}
1287
1288#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for
IdentImporterHereButItIsDesc<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
IdentImporterHereButItIsDesc {
span: __binding_0,
imported_ident: __binding_1,
imported_ident_desc: __binding_2 } => {
diag.store_args();
diag.arg("imported_ident", __binding_1);
diag.arg("imported_ident_desc", __binding_2);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_ident_imported_here_but_it_is_desc);
diag.span_note(__binding_0, __message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1289#[note(resolve_ident_imported_here_but_it_is_desc)]
1290pub(crate) struct IdentImporterHereButItIsDesc<'a> {
1291 #[primary_span]
1292 pub(crate) span: Span,
1293 pub(crate) imported_ident: Ident,
1294 pub(crate) imported_ident_desc: &'a str,
1295}
1296
1297#[derive(const _: () =
{
impl<'a> rustc_errors::Subdiagnostic for IdentInScopeButItIsDesc<'a> {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
IdentInScopeButItIsDesc {
imported_ident: __binding_0,
imported_ident_desc: __binding_1 } => {
diag.store_args();
diag.arg("imported_ident", __binding_0);
diag.arg("imported_ident_desc", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_ident_in_scope_but_it_is_desc);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1298#[note(resolve_ident_in_scope_but_it_is_desc)]
1299pub(crate) struct IdentInScopeButItIsDesc<'a> {
1300 pub(crate) imported_ident: Ident,
1301 pub(crate) imported_ident_desc: &'a str,
1302}
1303
1304pub(crate) struct FoundItemConfigureOut {
1305 pub(crate) span: Span,
1306 pub(crate) item_was: ItemWas,
1307}
1308
1309pub(crate) enum ItemWas {
1310 BehindFeature { feature: Symbol, span: Span },
1311 CfgOut { span: Span },
1312}
1313
1314impl Subdiagnostic for FoundItemConfigureOut {
1315 fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
1316 let mut multispan: MultiSpan = self.span.into();
1317 match self.item_was {
1318 ItemWas::BehindFeature { feature, span } => {
1319 let key = "feature".into();
1320 let value = feature.into_diag_arg(&mut None);
1321 let msg = diag.dcx.eagerly_translate_to_string(
1322 fluent::resolve_item_was_behind_feature,
1323 [(&key, &value)].into_iter(),
1324 );
1325 multispan.push_span_label(span, msg);
1326 }
1327 ItemWas::CfgOut { span } => {
1328 multispan.push_span_label(span, fluent::resolve_item_was_cfg_out);
1329 }
1330 }
1331 diag.span_note(multispan, fluent::resolve_found_an_item_configured_out);
1332 }
1333}
1334
1335#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
TraitImplMismatch where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
TraitImplMismatch {
span: __binding_0,
name: __binding_1,
kind: __binding_2,
trait_path: __binding_3,
trait_item_span: __binding_4 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::resolve_trait_impl_mismatch);
;
diag.arg("name", __binding_1);
diag.arg("kind", __binding_2);
diag.arg("trait_path", __binding_3);
diag.span(__binding_0);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_label(__binding_4,
crate::fluent_generated::resolve_trait_impl_mismatch_label_item);
diag
}
}
}
}
};Diagnostic)]
1336#[diag(resolve_trait_impl_mismatch)]
1337pub(crate) struct TraitImplMismatch {
1338 #[primary_span]
1339 #[label]
1340 pub(crate) span: Span,
1341 pub(crate) name: Ident,
1342 pub(crate) kind: &'static str,
1343 pub(crate) trait_path: String,
1344 #[label(resolve_trait_impl_mismatch_label_item)]
1345 pub(crate) trait_item_span: Span,
1346}
1347
1348#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
LegacyDeriveHelpers {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
LegacyDeriveHelpers { span: __binding_0 } => {
diag.primary_message(crate::fluent_generated::resolve_legacy_derive_helpers);
;
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
};
}
}
};LintDiagnostic)]
1349#[diag(resolve_legacy_derive_helpers)]
1350pub(crate) struct LegacyDeriveHelpers {
1351 #[label]
1352 pub span: Span,
1353}
1354
1355#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
UnusedExternCrate {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnusedExternCrate {
span: __binding_0, removal_span: __binding_1 } => {
diag.primary_message(crate::fluent_generated::resolve_unused_extern_crate);
;
let __code_33 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!(""))
})].into_iter();
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag.span_suggestions_with_style(__binding_1,
crate::fluent_generated::_subdiag::suggestion, __code_33,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
};
}
}
};LintDiagnostic)]
1356#[diag(resolve_unused_extern_crate)]
1357pub(crate) struct UnusedExternCrate {
1358 #[label]
1359 pub span: Span,
1360 #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
1361 pub removal_span: Span,
1362}
1363
1364#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
ReexportPrivateDependency {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
ReexportPrivateDependency {
name: __binding_0, kind: __binding_1, krate: __binding_2 }
=> {
diag.primary_message(crate::fluent_generated::resolve_reexport_private_dependency);
;
diag.arg("name", __binding_0);
diag.arg("kind", __binding_1);
diag.arg("krate", __binding_2);
diag
}
};
}
}
};LintDiagnostic)]
1365#[diag(resolve_reexport_private_dependency)]
1366pub(crate) struct ReexportPrivateDependency {
1367 pub name: Symbol,
1368 pub kind: &'static str,
1369 pub krate: Symbol,
1370}
1371
1372#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for UnusedLabel {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnusedLabel => {
diag.primary_message(crate::fluent_generated::resolve_unused_label);
;
diag
}
};
}
}
};LintDiagnostic)]
1373#[diag(resolve_unused_label)]
1374pub(crate) struct UnusedLabel;
1375
1376#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for UnusedMacroUse {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnusedMacroUse => {
diag.primary_message(crate::fluent_generated::resolve_unused_macro_use);
;
diag
}
};
}
}
};LintDiagnostic)]
1377#[diag(resolve_unused_macro_use)]
1378pub(crate) struct UnusedMacroUse;
1379
1380#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
MacroUseDeprecated {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MacroUseDeprecated => {
diag.primary_message(crate::fluent_generated::resolve_macro_use_deprecated);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag
}
};
}
}
};LintDiagnostic)]
1381#[diag(resolve_macro_use_deprecated)]
1382#[help]
1383pub(crate) struct MacroUseDeprecated;
1384
1385#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for MacroIsPrivate {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MacroIsPrivate { ident: __binding_0 } => {
diag.primary_message(crate::fluent_generated::resolve_macro_is_private);
;
diag.arg("ident", __binding_0);
diag
}
};
}
}
};LintDiagnostic)]
1386#[diag(resolve_macro_is_private)]
1387pub(crate) struct MacroIsPrivate {
1388 pub ident: Ident,
1389}
1390
1391#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
UnusedMacroDefinition {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnusedMacroDefinition { name: __binding_0 } => {
diag.primary_message(crate::fluent_generated::resolve_unused_macro_definition);
;
diag.arg("name", __binding_0);
diag
}
};
}
}
};LintDiagnostic)]
1392#[diag(resolve_unused_macro_definition)]
1393pub(crate) struct UnusedMacroDefinition {
1394 pub name: Symbol,
1395}
1396
1397#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
MacroRuleNeverUsed {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
MacroRuleNeverUsed { n: __binding_0, name: __binding_1 } =>
{
diag.primary_message(crate::fluent_generated::resolve_macro_rule_never_used);
;
diag.arg("n", __binding_0);
diag.arg("name", __binding_1);
diag
}
};
}
}
};LintDiagnostic)]
1398#[diag(resolve_macro_rule_never_used)]
1399pub(crate) struct MacroRuleNeverUsed {
1400 pub n: usize,
1401 pub name: Symbol,
1402}
1403
1404pub(crate) struct UnstableFeature {
1405 pub msg: DiagMessage,
1406}
1407
1408impl<'a> LintDiagnostic<'a, ()> for UnstableFeature {
1409 fn decorate_lint<'b>(self, diag: &'b mut Diag<'a, ()>) {
1410 diag.primary_message(self.msg);
1411 }
1412}
1413
1414#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
ExternCrateNotIdiomatic {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
ExternCrateNotIdiomatic {
span: __binding_0, code: __binding_1 } => {
diag.primary_message(crate::fluent_generated::resolve_extern_crate_not_idiomatic);
;
let __code_34 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.arg("code", __binding_1);
diag.span_suggestions_with_style(__binding_0,
crate::fluent_generated::_subdiag::suggestion, __code_34,
rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag
}
};
}
}
};LintDiagnostic)]
1415#[diag(resolve_extern_crate_not_idiomatic)]
1416pub(crate) struct ExternCrateNotIdiomatic {
1417 #[suggestion(style = "verbose", code = "{code}", applicability = "machine-applicable")]
1418 pub span: Span,
1419 pub code: &'static str,
1420}
1421
1422#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
OutOfScopeMacroCalls {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
OutOfScopeMacroCalls {
span: __binding_0, path: __binding_1, location: __binding_2
} => {
diag.primary_message(crate::fluent_generated::resolve_out_of_scope_macro_calls);
diag.help(crate::fluent_generated::_subdiag::help);
;
diag.arg("path", __binding_1);
diag.arg("location", __binding_2);
diag.span_label(__binding_0,
crate::fluent_generated::_subdiag::label);
diag
}
};
}
}
};LintDiagnostic)]
1423#[diag(resolve_out_of_scope_macro_calls)]
1424#[help]
1425pub(crate) struct OutOfScopeMacroCalls {
1426 #[label]
1427 pub span: Span,
1428 pub path: String,
1429 pub location: String,
1430}
1431
1432#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
RedundantImportVisibility {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
RedundantImportVisibility {
span: __binding_0,
help: __binding_1,
import_vis: __binding_2,
max_vis: __binding_3 } => {
diag.primary_message(crate::fluent_generated::resolve_redundant_import_visibility);
;
diag.arg("import_vis", __binding_2);
diag.arg("max_vis", __binding_3);
diag.span_note(__binding_0,
crate::fluent_generated::_subdiag::note);
diag.help(crate::fluent_generated::_subdiag::help);
diag
}
};
}
}
};LintDiagnostic)]
1433#[diag(resolve_redundant_import_visibility)]
1434pub(crate) struct RedundantImportVisibility {
1435 #[note]
1436 pub span: Span,
1437 #[help]
1438 pub help: (),
1439 pub import_vis: String,
1440 pub max_vis: String,
1441}
1442
1443#[derive(const _: () =
{
impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
UnknownDiagnosticAttribute {
#[track_caller]
fn decorate_lint<'__b>(self,
diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
match self {
UnknownDiagnosticAttribute { typo: __binding_0 } => {
diag.primary_message(crate::fluent_generated::resolve_unknown_diagnostic_attribute);
;
if let Some(__binding_0) = __binding_0 {
diag.subdiagnostic(__binding_0);
}
diag
}
};
}
}
};LintDiagnostic)]
1444#[diag(resolve_unknown_diagnostic_attribute)]
1445pub(crate) struct UnknownDiagnosticAttribute {
1446 #[subdiagnostic]
1447 pub typo: Option<UnknownDiagnosticAttributeTypoSugg>,
1448}
1449
1450#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for
UnknownDiagnosticAttributeTypoSugg {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
UnknownDiagnosticAttributeTypoSugg {
span: __binding_0, typo_name: __binding_1 } => {
let __code_35 =
[::alloc::__export::must_use({
::alloc::fmt::format(format_args!("{0}", __binding_1))
})].into_iter();
diag.store_args();
diag.arg("typo_name", __binding_1);
let __message =
diag.eagerly_translate(crate::fluent_generated::resolve_unknown_diagnostic_attribute_typo_sugg);
diag.span_suggestions_with_style(__binding_0, __message,
__code_35, rustc_errors::Applicability::MachineApplicable,
rustc_errors::SuggestionStyle::ShowAlways);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
1451#[suggestion(
1452 resolve_unknown_diagnostic_attribute_typo_sugg,
1453 style = "verbose",
1454 code = "{typo_name}",
1455 applicability = "machine-applicable"
1456)]
1457pub(crate) struct UnknownDiagnosticAttributeTypoSugg {
1458 #[primary_span]
1459 pub span: Span,
1460 pub typo_name: Symbol,
1461}
1462
1463pub(crate) struct Ambiguity {
1465 pub ident: Ident,
1466 pub ambig_vis: Option<String>,
1467 pub kind: &'static str,
1468 pub help: Option<&'static [&'static str]>,
1469 pub b1_note: Spanned<String>,
1470 pub b1_help_msgs: Vec<String>,
1471 pub b2_note: Spanned<String>,
1472 pub b2_help_msgs: Vec<String>,
1473}
1474
1475impl Ambiguity {
1476 fn decorate<'a>(self, diag: &mut Diag<'a, impl EmissionGuarantee>) {
1477 if let Some(ambig_vis) = self.ambig_vis {
1478 diag.primary_message(::alloc::__export::must_use({
::alloc::fmt::format(format_args!("ambiguous import visibility: {0}",
ambig_vis))
})format!("ambiguous import visibility: {ambig_vis}"));
1479 } else {
1480 diag.primary_message(::alloc::__export::must_use({
::alloc::fmt::format(format_args!("`{0}` is ambiguous", self.ident))
})format!("`{}` is ambiguous", self.ident));
1481 diag.span_label(self.ident.span, "ambiguous name");
1482 }
1483 diag.note(::alloc::__export::must_use({
::alloc::fmt::format(format_args!("ambiguous because of {0}",
self.kind))
})format!("ambiguous because of {}", self.kind));
1484 diag.span_note(self.b1_note.span, self.b1_note.node);
1485 if let Some(help) = self.help {
1486 for help in help {
1487 diag.help(*help);
1488 }
1489 }
1490 for help_msg in self.b1_help_msgs {
1491 diag.help(help_msg);
1492 }
1493 diag.span_note(self.b2_note.span, self.b2_note.node);
1494 for help_msg in self.b2_help_msgs {
1495 diag.help(help_msg);
1496 }
1497 }
1498}
1499
1500impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for Ambiguity {
1501 fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
1502 let mut diag = Diag::new(dcx, level, "").with_span(self.ident.span).with_code(E0659);
1503 self.decorate(&mut diag);
1504 diag
1505 }
1506}
1507
1508impl<'a> LintDiagnostic<'a, ()> for Ambiguity {
1509 fn decorate_lint<'b>(self, diag: &'b mut Diag<'a, ()>) {
1510 self.decorate(diag);
1511 }
1512}