Migrate rustc_hir_analysis
to session diagnostic
Part 4: Finishing `check/mod.rs` file
This commit is contained in:
parent
fa4cc63a6b
commit
06ff310cf9
5 changed files with 253 additions and 84 deletions
|
@ -631,3 +631,141 @@ pub(crate) struct SIMDFFIHighlyExperimental {
|
|||
pub span: Span,
|
||||
pub snip: String,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
pub enum ImplNotMarkedDefault {
|
||||
#[diag(hir_analysis_impl_not_marked_default, code = "E0520")]
|
||||
#[note]
|
||||
Ok {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
span: Span,
|
||||
#[label(hir_analysis_ok_label)]
|
||||
ok_label: Span,
|
||||
ident: Symbol,
|
||||
},
|
||||
#[diag(hir_analysis_impl_not_marked_default_err, code = "E0520")]
|
||||
#[note]
|
||||
Err {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
span: Span,
|
||||
cname: Symbol,
|
||||
ident: Symbol,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_missing_trait_item, code = "E0046")]
|
||||
pub(crate) struct MissingTraitItem {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[subdiagnostic]
|
||||
pub missing_trait_item_label: Vec<MissingTraitItemLabel>,
|
||||
#[subdiagnostic]
|
||||
pub missing_trait_item: Vec<MissingTraitItemSuggestion>,
|
||||
#[subdiagnostic]
|
||||
pub missing_trait_item_none: Vec<MissingTraitItemSuggestionNone>,
|
||||
pub missing_items_msg: String,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(hir_analysis_missing_trait_item_label)]
|
||||
pub(crate) struct MissingTraitItemLabel {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub item: Symbol,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[suggestion(
|
||||
hir_analysis_missing_trait_item_suggestion,
|
||||
style = "tool-only",
|
||||
applicability = "has-placeholders",
|
||||
code = "{code}"
|
||||
)]
|
||||
pub(crate) struct MissingTraitItemSuggestion {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub code: String,
|
||||
pub snippet: String,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[suggestion(
|
||||
hir_analysis_missing_trait_item_suggestion,
|
||||
style = "hidden",
|
||||
applicability = "has-placeholders",
|
||||
code = "{code}"
|
||||
)]
|
||||
pub(crate) struct MissingTraitItemSuggestionNone {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub code: String,
|
||||
pub snippet: String,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_missing_one_of_trait_item, code = "E0046")]
|
||||
pub(crate) struct MissingOneOfTraitItem {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[note]
|
||||
pub note: Option<Span>,
|
||||
pub missing_items_msg: String,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_missing_trait_item_unstable, code = "E0046")]
|
||||
#[note]
|
||||
pub(crate) struct MissingTraitItemUnstable {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[note(hir_analysis_some_note)]
|
||||
pub some_note: bool,
|
||||
#[note(hir_analysis_none_note)]
|
||||
pub none_note: bool,
|
||||
pub missing_item_name: Symbol,
|
||||
pub feature: Symbol,
|
||||
pub reason: String,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_transparent_enum_variant, code = "E0731")]
|
||||
pub(crate) struct TransparentEnumVariant {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[label(hir_analysis_multi_label)]
|
||||
pub spans: Vec<Span>,
|
||||
#[label(hir_analysis_many_label)]
|
||||
pub many: Option<Span>,
|
||||
pub number: usize,
|
||||
pub path: String,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_transparent_non_zero_sized_enum, code = "E0690")]
|
||||
pub(crate) struct TransparentNonZeroSizedEnum<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[label(hir_analysis_labels)]
|
||||
pub spans: Vec<Span>,
|
||||
pub field_count: usize,
|
||||
pub desc: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_transparent_non_zero_sized, code = "E0690")]
|
||||
pub(crate) struct TransparentNonZeroSized<'a> {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[label(hir_analysis_labels)]
|
||||
pub spans: Vec<Span>,
|
||||
pub field_count: usize,
|
||||
pub desc: &'a str,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue