]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_ty_utils/src/errors.rs
Rollup merge of #101146 - jackh726:borrowck-logging, r=compiler-errors
[rust.git] / compiler / rustc_ty_utils / src / errors.rs
1 //! Errors emitted by ty_utils
2
3 use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
4 use rustc_middle::ty::Ty;
5 use rustc_span::Span;
6
7 #[derive(SessionDiagnostic)]
8 #[diag(ty_utils::needs_drop_overflow)]
9 pub struct NeedsDropOverflow<'tcx> {
10     pub query_ty: Ty<'tcx>,
11 }
12
13 #[derive(SessionDiagnostic)]
14 #[diag(ty_utils::generic_constant_too_complex)]
15 #[help]
16 pub struct GenericConstantTooComplex {
17     #[primary_span]
18     pub span: Span,
19     #[note(ty_utils::maybe_supported)]
20     pub maybe_supported: Option<()>,
21     #[subdiagnostic]
22     pub sub: GenericConstantTooComplexSub,
23 }
24
25 #[derive(SessionSubdiagnostic)]
26 pub enum GenericConstantTooComplexSub {
27     #[label(ty_utils::borrow_not_supported)]
28     BorrowNotSupported(#[primary_span] Span),
29     #[label(ty_utils::address_and_deref_not_supported)]
30     AddressAndDerefNotSupported(#[primary_span] Span),
31     #[label(ty_utils::array_not_supported)]
32     ArrayNotSupported(#[primary_span] Span),
33     #[label(ty_utils::block_not_supported)]
34     BlockNotSupported(#[primary_span] Span),
35     #[label(ty_utils::never_to_any_not_supported)]
36     NeverToAnyNotSupported(#[primary_span] Span),
37     #[label(ty_utils::tuple_not_supported)]
38     TupleNotSupported(#[primary_span] Span),
39     #[label(ty_utils::index_not_supported)]
40     IndexNotSupported(#[primary_span] Span),
41     #[label(ty_utils::field_not_supported)]
42     FieldNotSupported(#[primary_span] Span),
43     #[label(ty_utils::const_block_not_supported)]
44     ConstBlockNotSupported(#[primary_span] Span),
45     #[label(ty_utils::adt_not_supported)]
46     AdtNotSupported(#[primary_span] Span),
47     #[label(ty_utils::pointer_not_supported)]
48     PointerNotSupported(#[primary_span] Span),
49     #[label(ty_utils::yield_not_supported)]
50     YieldNotSupported(#[primary_span] Span),
51     #[label(ty_utils::loop_not_supported)]
52     LoopNotSupported(#[primary_span] Span),
53     #[label(ty_utils::box_not_supported)]
54     BoxNotSupported(#[primary_span] Span),
55     #[label(ty_utils::binary_not_supported)]
56     BinaryNotSupported(#[primary_span] Span),
57     #[label(ty_utils::logical_op_not_supported)]
58     LogicalOpNotSupported(#[primary_span] Span),
59     #[label(ty_utils::assign_not_supported)]
60     AssignNotSupported(#[primary_span] Span),
61     #[label(ty_utils::closure_and_return_not_supported)]
62     ClosureAndReturnNotSupported(#[primary_span] Span),
63     #[label(ty_utils::control_flow_not_supported)]
64     ControlFlowNotSupported(#[primary_span] Span),
65     #[label(ty_utils::inline_asm_not_supported)]
66     InlineAsmNotSupported(#[primary_span] Span),
67     #[label(ty_utils::operation_not_supported)]
68     OperationNotSupported(#[primary_span] Span),
69 }