1
Fork 0

Migrate derivable diagnostics in lang_items.rs

This commit is contained in:
rdvdev2 2022-09-02 00:11:44 +02:00 committed by Nathan Stocks
parent 2f74d1d14f
commit 17a4a68ab0
3 changed files with 37 additions and 22 deletions

View file

@ -1,4 +1,5 @@
use rustc_errors::{Applicability, MultiSpan};
use rustc_hir::Target;
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
use rustc_span::{Span, Symbol};
@ -682,3 +683,23 @@ pub struct MissingAllocErrorHandler;
pub struct MissingLangItem {
pub name: Symbol,
}
#[derive(Diagnostic)]
#[diag(passes::lang_item_on_incorrect_target, code = "E0718")]
pub struct LangItemOnIncorrectTarget {
#[primary_span]
#[label]
pub span: Span,
pub name: Symbol,
pub expected_target: Target,
pub actual_target: Target,
}
#[derive(Diagnostic)]
#[diag(passes::unknown_lang_item, code = "E0522")]
pub struct UnknownLangItem {
#[primary_span]
#[label]
pub span: Span,
pub name: Symbol,
}