Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions compiler/rustc_mir/src/transform/check_consts/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ pub trait NonConstOp: std::fmt::Debug {
#[derive(Debug)]
pub struct Abort;
impl NonConstOp for Abort {
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
mcf_status_in_item(ccx)
}

fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
mcf_build_error(ccx, span, "abort is not stable in const fn")
struct_span_err!(
ccx.tcx.sess,
span,
E0723,
"unwind strategies besides the default are not allowed in {}s",
ccx.const_kind(),
)
}
}

Expand Down