1 use rustc_hir::ConstContext;
2 use rustc_macros::SessionDiagnostic;
5 #[derive(SessionDiagnostic)]
6 #[error(const_eval::unstable_in_stable)]
7 pub(crate) struct UnstableInStable {
12 const_eval::unstable_sugg,
13 code = "#[rustc_const_unstable(feature = \"...\", issue = \"...\")]\n",
14 applicability = "has-placeholders"
17 const_eval::bypass_sugg,
18 code = "#[rustc_allow_const_fn_unstable({gate})]\n",
19 applicability = "has-placeholders"
24 #[derive(SessionDiagnostic)]
25 #[error(const_eval::thread_local_access, code = "E0625")]
26 pub(crate) struct NonConstOpErr {
31 #[derive(SessionDiagnostic)]
32 #[error(const_eval::static_access, code = "E0013")]
34 pub(crate) struct StaticAccessErr {
37 pub kind: ConstContext,
38 #[note(const_eval::teach_note)]
39 #[help(const_eval::teach_help)]
40 pub teach: Option<()>,
43 #[derive(SessionDiagnostic)]
44 #[error(const_eval::raw_ptr_to_int)]
46 #[note(const_eval::note2)]
47 pub(crate) struct RawPtrToIntErr {
52 #[derive(SessionDiagnostic)]
53 #[error(const_eval::raw_ptr_comparison)]
55 pub(crate) struct RawPtrComparisonErr {
60 #[derive(SessionDiagnostic)]
61 #[error(const_eval::panic_non_str)]
62 pub(crate) struct PanicNonStrErr {
67 #[derive(SessionDiagnostic)]
68 #[error(const_eval::mut_deref, code = "E0658")]
69 pub(crate) struct MutDerefErr {
72 pub kind: ConstContext,
75 #[derive(SessionDiagnostic)]
76 #[error(const_eval::transient_mut_borrow, code = "E0658")]
77 pub(crate) struct TransientMutBorrowErr {
80 pub kind: ConstContext,
83 #[derive(SessionDiagnostic)]
84 #[error(const_eval::transient_mut_borrow_raw, code = "E0658")]
85 pub(crate) struct TransientMutBorrowErrRaw {
88 pub kind: ConstContext,