Skip to content

Commit

Permalink
Switched errors to diags according to latest PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
nidnogg committed Aug 22, 2022
1 parent 0a58b26 commit 13abae2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions compiler/rustc_const_eval/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,31 +89,31 @@ pub(crate) struct TransientMutBorrowErrRaw {
}

#[derive(SessionDiagnostic)]
#[error(const_eval::max_num_nodes_in_const)]
#[diag(const_eval::max_num_nodes_in_const)]
pub(crate) struct MaxNumNodesInConstErr {
#[primary_span]
pub span: Span,
pub s: String,
}

#[derive(SessionDiagnostic)]
#[error(const_eval::unallowed_fn_pointer_call)]
#[diag(const_eval::unallowed_fn_pointer_call)]
pub(crate) struct UnallowedFnPointerCall {
#[primary_span]
pub span: Span,
pub kind: ConstContext,
}

#[derive(SessionDiagnostic)]
#[error(const_eval::unstable_const_fn)]
#[diag(const_eval::unstable_const_fn)]
pub(crate) struct UnstableConstFn {
#[primary_span]
pub span: Span,
pub def_path: String,
}

#[derive(SessionDiagnostic)]
#[error(const_eval::unallowed_mutable_refs, code = "E0764")]
#[diag(const_eval::unallowed_mutable_refs, code = "E0764")]
pub(crate) struct UnallowedMutableRefs {
#[primary_span]
pub span: Span,
Expand All @@ -123,7 +123,7 @@ pub(crate) struct UnallowedMutableRefs {
}

#[derive(SessionDiagnostic)]
#[error(const_eval::unallowed_mutable_refs_raw, code = "E0764")]
#[diag(const_eval::unallowed_mutable_refs_raw, code = "E0764")]
pub(crate) struct UnallowedMutableRefsRaw {
#[primary_span]
pub span: Span,
Expand All @@ -132,15 +132,15 @@ pub(crate) struct UnallowedMutableRefsRaw {
pub teach: Option<()>,
}
#[derive(SessionDiagnostic)]
#[error(const_eval::non_const_fmt_macro_call, code = "E0015")]
#[diag(const_eval::non_const_fmt_macro_call, code = "E0015")]
pub(crate) struct NonConstFmtMacroCall {
#[primary_span]
pub span: Span,
pub kind: ConstContext,
}

#[derive(SessionDiagnostic)]
#[error(const_eval::non_const_fn_call, code = "E0015")]
#[diag(const_eval::non_const_fn_call, code = "E0015")]
pub(crate) struct NonConstFnCall {
#[primary_span]
pub span: Span,
Expand All @@ -149,15 +149,15 @@ pub(crate) struct NonConstFnCall {
}

#[derive(SessionDiagnostic)]
#[error(const_eval::unallowed_op_in_const_context)]
#[diag(const_eval::unallowed_op_in_const_context)]
pub(crate) struct UnallowedOpInConstContext {
#[primary_span]
pub span: Span,
pub msg: String,
}

#[derive(SessionDiagnostic)]
#[error(const_eval::unallowed_heap_allocations, code = "E0010")]
#[diag(const_eval::unallowed_heap_allocations, code = "E0010")]
pub(crate) struct UnallowedHeapAllocations {
#[primary_span]
#[label]
Expand All @@ -168,15 +168,15 @@ pub(crate) struct UnallowedHeapAllocations {
}

#[derive(SessionDiagnostic)]
#[error(const_eval::unallowed_inline_asm, code = "E0015")]
#[diag(const_eval::unallowed_inline_asm, code = "E0015")]
pub(crate) struct UnallowedInlineAsm {
#[primary_span]
pub span: Span,
pub kind: ConstContext,
}

#[derive(SessionDiagnostic)]
#[error(const_eval::interior_mutable_data_refer, code = "E0492")]
#[diag(const_eval::interior_mutable_data_refer, code = "E0492")]
pub(crate) struct InteriorMutableDataRefer {
#[primary_span]
#[label]
Expand All @@ -189,7 +189,7 @@ pub(crate) struct InteriorMutableDataRefer {
}

#[derive(SessionDiagnostic)]
#[error(const_eval::interior_mutability_borrow)]
#[diag(const_eval::interior_mutability_borrow)]
pub(crate) struct InteriorMutabilityBorrow {
#[primary_span]
pub span: Span,
Expand Down

0 comments on commit 13abae2

Please sign in to comment.