2022-08-22 08:28:50 +02:00
|
|
|
use std::num::NonZeroU32;
|
|
|
|
|
2022-08-19 15:34:13 +02:00
|
|
|
use crate as rustc_session;
|
|
|
|
use crate::cgu_reuse_tracker::CguReuse;
|
2022-08-22 08:28:50 +02:00
|
|
|
use rustc_errors::MultiSpan;
|
2022-08-19 15:34:13 +02:00
|
|
|
use rustc_macros::SessionDiagnostic;
|
2022-08-22 08:28:50 +02:00
|
|
|
use rustc_span::{Span, Symbol};
|
2022-08-19 15:34:13 +02:00
|
|
|
|
|
|
|
#[derive(SessionDiagnostic)]
|
2022-08-22 08:28:50 +02:00
|
|
|
#[diag(session::incorrect_cgu_reuse_type)]
|
2022-08-19 15:34:13 +02:00
|
|
|
pub struct IncorrectCguReuseType<'a> {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
pub cgu_user_name: &'a str,
|
|
|
|
pub actual_reuse: CguReuse,
|
|
|
|
pub expected_reuse: CguReuse,
|
2022-08-24 17:15:08 +02:00
|
|
|
pub at_least: u8,
|
2022-08-19 15:34:13 +02:00
|
|
|
}
|
|
|
|
|
2022-08-24 17:15:08 +02:00
|
|
|
#[derive(SessionDiagnostic)]
|
|
|
|
#[diag(session::cgu_not_recorded)]
|
|
|
|
pub struct CguNotRecorded<'a> {
|
|
|
|
pub cgu_user_name: &'a str,
|
|
|
|
pub cgu_name: &'a str,
|
|
|
|
}
|
2022-08-22 08:28:50 +02:00
|
|
|
|
|
|
|
#[derive(SessionDiagnostic)]
|
|
|
|
#[diag(session::feature_gate_error, code = "E0658")]
|
|
|
|
pub struct FeatureGateError<'a> {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: MultiSpan,
|
|
|
|
pub explain: &'a str,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(SessionSubdiagnostic)]
|
|
|
|
#[note(session::feature_diagnostic_for_issue)]
|
|
|
|
pub struct FeatureDiagnosticForIssue {
|
|
|
|
pub n: NonZeroU32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(SessionSubdiagnostic)]
|
|
|
|
#[help(session::feature_diagnostic_help)]
|
|
|
|
pub struct FeatureDiagnosticHelp {
|
|
|
|
pub feature: Symbol,
|
|
|
|
}
|