2022-08-18 15:51:47 -06:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
use rustc_macros::{Diagnostic, LintDiagnostic};
|
2025-02-15 20:02:16 +01:00
|
|
|
use rustc_middle::ty::Ty;
|
2023-08-29 19:29:14 +02:00
|
|
|
use rustc_span::{Span, Symbol};
|
2022-08-18 15:51:47 -06:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(monomorphize_recursion_limit)]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct RecursionLimit {
|
2022-08-18 15:51:47 -06:00
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
pub shrunk: String,
|
|
|
|
#[note]
|
|
|
|
pub def_span: Span,
|
|
|
|
pub def_path_str: String,
|
2022-10-22 11:07:54 +02:00
|
|
|
#[note(monomorphize_written_to_path)]
|
2024-08-21 00:57:58 -04:00
|
|
|
pub was_written: bool,
|
2022-08-18 15:51:47 -06:00
|
|
|
pub path: PathBuf,
|
|
|
|
}
|
|
|
|
|
2023-08-29 19:29:14 +02:00
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(monomorphize_no_optimized_mir)]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct NoOptimizedMir {
|
2023-08-29 19:29:14 +02:00
|
|
|
#[note]
|
|
|
|
pub span: Span,
|
|
|
|
pub crate_name: Symbol,
|
|
|
|
}
|
|
|
|
|
2022-08-18 15:51:47 -06:00
|
|
|
#[derive(LintDiagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(monomorphize_large_assignments)]
|
2022-08-18 15:51:47 -06:00
|
|
|
#[note]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct LargeAssignmentsLint {
|
2022-08-18 15:51:47 -06:00
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
|
|
|
pub size: u64,
|
|
|
|
pub limit: u64,
|
|
|
|
}
|
2022-08-23 11:20:01 -06:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(monomorphize_symbol_already_defined)]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct SymbolAlreadyDefined {
|
2022-08-23 11:20:01 -06:00
|
|
|
#[primary_span]
|
|
|
|
pub span: Option<Span>,
|
|
|
|
pub symbol: String,
|
|
|
|
}
|
2022-12-08 19:21:08 +00:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(monomorphize_couldnt_dump_mono_stats)]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct CouldntDumpMonoStats {
|
2022-12-08 19:21:08 +00:00
|
|
|
pub error: String,
|
|
|
|
}
|
2022-08-19 14:48:15 +01:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(monomorphize_encountered_error_while_instantiating)]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct EncounteredErrorWhileInstantiating {
|
2022-08-19 14:48:15 +01:00
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
pub formatted_item: String,
|
|
|
|
}
|
|
|
|
|
2023-10-02 12:32:31 +00:00
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(monomorphize_start_not_found)]
|
|
|
|
#[help]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct StartNotFound;
|
2023-10-02 12:32:31 +00:00
|
|
|
|
2022-08-19 14:48:15 +01:00
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(monomorphize_unknown_cgu_collection_mode)]
|
2024-08-29 15:08:07 +10:00
|
|
|
pub(crate) struct UnknownCguCollectionMode<'a> {
|
2022-08-19 14:48:15 +01:00
|
|
|
pub mode: &'a str,
|
|
|
|
}
|
2024-07-13 19:35:05 +02:00
|
|
|
|
|
|
|
#[derive(LintDiagnostic)]
|
|
|
|
#[diag(monomorphize_abi_error_disabled_vector_type_def)]
|
|
|
|
#[help]
|
|
|
|
pub(crate) struct AbiErrorDisabledVectorTypeDef<'a> {
|
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
|
|
|
pub required_feature: &'a str,
|
2025-02-15 20:02:16 +01:00
|
|
|
pub ty: Ty<'a>,
|
2024-07-13 19:35:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(LintDiagnostic)]
|
|
|
|
#[diag(monomorphize_abi_error_disabled_vector_type_call)]
|
|
|
|
#[help]
|
|
|
|
pub(crate) struct AbiErrorDisabledVectorTypeCall<'a> {
|
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
|
|
|
pub required_feature: &'a str,
|
2025-02-15 20:02:16 +01:00
|
|
|
pub ty: Ty<'a>,
|
2024-07-13 19:35:05 +02:00
|
|
|
}
|
2024-11-10 11:36:50 +01:00
|
|
|
|
|
|
|
#[derive(LintDiagnostic)]
|
|
|
|
#[diag(monomorphize_abi_error_unsupported_vector_type_def)]
|
2025-02-15 20:02:16 +01:00
|
|
|
pub(crate) struct AbiErrorUnsupportedVectorTypeDef<'a> {
|
2024-11-10 11:36:50 +01:00
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
2025-02-15 20:02:16 +01:00
|
|
|
pub ty: Ty<'a>,
|
2024-11-10 11:36:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(LintDiagnostic)]
|
|
|
|
#[diag(monomorphize_abi_error_unsupported_vector_type_call)]
|
2025-02-15 20:02:16 +01:00
|
|
|
pub(crate) struct AbiErrorUnsupportedVectorTypeCall<'a> {
|
2024-11-10 11:36:50 +01:00
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
2025-02-15 20:02:16 +01:00
|
|
|
pub ty: Ty<'a>,
|
2024-11-10 11:36:50 +01:00
|
|
|
}
|