]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_session/src/errors.rs
Auto merge of #100395 - Dylan-DPC:rollup-ajrwo1s, r=Dylan-DPC
[rust.git] / compiler / rustc_session / src / errors.rs
1 use std::num::NonZeroU32;
2
3 use crate as rustc_session;
4 use crate::cgu_reuse_tracker::CguReuse;
5 use rustc_errors::MultiSpan;
6 use rustc_macros::SessionDiagnostic;
7 use rustc_span::{Span, Symbol};
8
9 #[derive(SessionDiagnostic)]
10 #[diag(session::incorrect_cgu_reuse_type)]
11 pub struct IncorrectCguReuseType<'a> {
12     #[primary_span]
13     pub span: Span,
14     pub cgu_user_name: &'a str,
15     pub actual_reuse: CguReuse,
16     pub expected_reuse: CguReuse,
17     pub at_least: u8,
18 }
19
20 #[derive(SessionDiagnostic)]
21 #[diag(session::cgu_not_recorded)]
22 pub struct CguNotRecorded<'a> {
23     pub cgu_user_name: &'a str,
24     pub cgu_name: &'a str,
25 }
26
27 #[derive(SessionDiagnostic)]
28 #[diag(session::feature_gate_error, code = "E0658")]
29 pub struct FeatureGateError<'a> {
30     #[primary_span]
31     pub span: MultiSpan,
32     pub explain: &'a str,
33 }
34
35 #[derive(SessionSubdiagnostic)]
36 #[note(session::feature_diagnostic_for_issue)]
37 pub struct FeatureDiagnosticForIssue {
38     pub n: NonZeroU32,
39 }
40
41 #[derive(SessionSubdiagnostic)]
42 #[help(session::feature_diagnostic_help)]
43 pub struct FeatureDiagnosticHelp {
44     pub feature: Symbol,
45 }