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