]>
Commit | Line | Data |
---|---|---|
f2b60f7d FG |
1 | //! Errors emitted by ty_utils |
2 | ||
2b03887a | 3 | use rustc_macros::{Diagnostic, Subdiagnostic}; |
f2b60f7d FG |
4 | use rustc_middle::ty::Ty; |
5 | use rustc_span::Span; | |
6 | ||
2b03887a FG |
7 | #[derive(Diagnostic)] |
8 | #[diag(ty_utils_needs_drop_overflow)] | |
f2b60f7d FG |
9 | pub struct NeedsDropOverflow<'tcx> { |
10 | pub query_ty: Ty<'tcx>, | |
11 | } | |
12 | ||
2b03887a FG |
13 | #[derive(Diagnostic)] |
14 | #[diag(ty_utils_generic_constant_too_complex)] | |
f2b60f7d FG |
15 | #[help] |
16 | pub struct GenericConstantTooComplex { | |
17 | #[primary_span] | |
18 | pub span: Span, | |
2b03887a | 19 | #[note(maybe_supported)] |
f2b60f7d FG |
20 | pub maybe_supported: Option<()>, |
21 | #[subdiagnostic] | |
22 | pub sub: GenericConstantTooComplexSub, | |
23 | } | |
24 | ||
2b03887a | 25 | #[derive(Subdiagnostic)] |
f2b60f7d | 26 | pub enum GenericConstantTooComplexSub { |
2b03887a | 27 | #[label(ty_utils_borrow_not_supported)] |
f2b60f7d | 28 | BorrowNotSupported(#[primary_span] Span), |
2b03887a | 29 | #[label(ty_utils_address_and_deref_not_supported)] |
f2b60f7d | 30 | AddressAndDerefNotSupported(#[primary_span] Span), |
2b03887a | 31 | #[label(ty_utils_array_not_supported)] |
f2b60f7d | 32 | ArrayNotSupported(#[primary_span] Span), |
2b03887a | 33 | #[label(ty_utils_block_not_supported)] |
f2b60f7d | 34 | BlockNotSupported(#[primary_span] Span), |
2b03887a | 35 | #[label(ty_utils_never_to_any_not_supported)] |
f2b60f7d | 36 | NeverToAnyNotSupported(#[primary_span] Span), |
2b03887a | 37 | #[label(ty_utils_tuple_not_supported)] |
f2b60f7d | 38 | TupleNotSupported(#[primary_span] Span), |
2b03887a | 39 | #[label(ty_utils_index_not_supported)] |
f2b60f7d | 40 | IndexNotSupported(#[primary_span] Span), |
2b03887a | 41 | #[label(ty_utils_field_not_supported)] |
f2b60f7d | 42 | FieldNotSupported(#[primary_span] Span), |
2b03887a | 43 | #[label(ty_utils_const_block_not_supported)] |
f2b60f7d | 44 | ConstBlockNotSupported(#[primary_span] Span), |
2b03887a | 45 | #[label(ty_utils_adt_not_supported)] |
f2b60f7d | 46 | AdtNotSupported(#[primary_span] Span), |
2b03887a | 47 | #[label(ty_utils_pointer_not_supported)] |
f2b60f7d | 48 | PointerNotSupported(#[primary_span] Span), |
2b03887a | 49 | #[label(ty_utils_yield_not_supported)] |
f2b60f7d | 50 | YieldNotSupported(#[primary_span] Span), |
2b03887a | 51 | #[label(ty_utils_loop_not_supported)] |
f2b60f7d | 52 | LoopNotSupported(#[primary_span] Span), |
2b03887a | 53 | #[label(ty_utils_box_not_supported)] |
f2b60f7d | 54 | BoxNotSupported(#[primary_span] Span), |
2b03887a | 55 | #[label(ty_utils_binary_not_supported)] |
f2b60f7d | 56 | BinaryNotSupported(#[primary_span] Span), |
2b03887a | 57 | #[label(ty_utils_logical_op_not_supported)] |
f2b60f7d | 58 | LogicalOpNotSupported(#[primary_span] Span), |
2b03887a | 59 | #[label(ty_utils_assign_not_supported)] |
f2b60f7d | 60 | AssignNotSupported(#[primary_span] Span), |
2b03887a | 61 | #[label(ty_utils_closure_and_return_not_supported)] |
f2b60f7d | 62 | ClosureAndReturnNotSupported(#[primary_span] Span), |
2b03887a | 63 | #[label(ty_utils_control_flow_not_supported)] |
f2b60f7d | 64 | ControlFlowNotSupported(#[primary_span] Span), |
2b03887a | 65 | #[label(ty_utils_inline_asm_not_supported)] |
f2b60f7d | 66 | InlineAsmNotSupported(#[primary_span] Span), |
2b03887a | 67 | #[label(ty_utils_operation_not_supported)] |
f2b60f7d FG |
68 | OperationNotSupported(#[primary_span] Span), |
69 | } |