rustc_monomorphize/
errors.rs
1use std::path::PathBuf;
2
3use rustc_macros::{Diagnostic, LintDiagnostic};
4use rustc_span::{Span, Symbol};
5
6#[derive(Diagnostic)]
7#[diag(monomorphize_recursion_limit)]
8pub(crate) struct RecursionLimit {
9 #[primary_span]
10 pub span: Span,
11 pub shrunk: String,
12 #[note]
13 pub def_span: Span,
14 pub def_path_str: String,
15 #[note(monomorphize_written_to_path)]
16 pub was_written: bool,
17 pub path: PathBuf,
18}
19
20#[derive(Diagnostic)]
21#[diag(monomorphize_no_optimized_mir)]
22pub(crate) struct NoOptimizedMir {
23 #[note]
24 pub span: Span,
25 pub crate_name: Symbol,
26}
27
28#[derive(LintDiagnostic)]
29#[diag(monomorphize_large_assignments)]
30#[note]
31pub(crate) struct LargeAssignmentsLint {
32 #[label]
33 pub span: Span,
34 pub size: u64,
35 pub limit: u64,
36}
37
38#[derive(Diagnostic)]
39#[diag(monomorphize_symbol_already_defined)]
40pub(crate) struct SymbolAlreadyDefined {
41 #[primary_span]
42 pub span: Option<Span>,
43 pub symbol: String,
44}
45
46#[derive(Diagnostic)]
47#[diag(monomorphize_couldnt_dump_mono_stats)]
48pub(crate) struct CouldntDumpMonoStats {
49 pub error: String,
50}
51
52#[derive(Diagnostic)]
53#[diag(monomorphize_encountered_error_while_instantiating)]
54pub(crate) struct EncounteredErrorWhileInstantiating {
55 #[primary_span]
56 pub span: Span,
57 pub formatted_item: String,
58}
59
60#[derive(Diagnostic)]
61#[diag(monomorphize_start_not_found)]
62#[help]
63pub(crate) struct StartNotFound;
64
65#[derive(Diagnostic)]
66#[diag(monomorphize_unknown_cgu_collection_mode)]
67pub(crate) struct UnknownCguCollectionMode<'a> {
68 pub mode: &'a str,
69}
70
71#[derive(LintDiagnostic)]
72#[diag(monomorphize_abi_error_disabled_vector_type_def)]
73#[help]
74pub(crate) struct AbiErrorDisabledVectorTypeDef<'a> {
75 #[label]
76 pub span: Span,
77 pub required_feature: &'a str,
78}
79
80#[derive(LintDiagnostic)]
81#[diag(monomorphize_abi_error_disabled_vector_type_call)]
82#[help]
83pub(crate) struct AbiErrorDisabledVectorTypeCall<'a> {
84 #[label]
85 pub span: Span,
86 pub required_feature: &'a str,
87}
88
89#[derive(LintDiagnostic)]
90#[diag(monomorphize_abi_error_unsupported_vector_type_def)]
91pub(crate) struct AbiErrorUnsupportedVectorTypeDef {
92 #[label]
93 pub span: Span,
94}
95
96#[derive(LintDiagnostic)]
97#[diag(monomorphize_abi_error_unsupported_vector_type_call)]
98pub(crate) struct AbiErrorUnsupportedVectorTypeCall {
99 #[label]
100 pub span: Span,
101}