diff --git a/src/Init/Prelude.lean b/src/Init/Prelude.lean index b38de8f039..fbcb598ac9 100644 --- a/src/Init/Prelude.lean +++ b/src/Init/Prelude.lean @@ -166,6 +166,7 @@ structure Subtype {α : Sort u} (p : α → Prop) where @[reducible] def namedPattern {α : Sort u} (x a : α) : α := a /- Auxiliary axiom used to implement `sorry`. -/ +@[extern "lean_sorry", neverExtract] axiom sorryAx (α : Sort u) (synthetic := true) : α theorem eqFalseOfNeTrue : {b : Bool} → Not (Eq b true) → Eq b false diff --git a/src/library/compiler/compiler.cpp b/src/library/compiler/compiler.cpp index 04f3fe1ccb..fcb2fbe5d0 100644 --- a/src/library/compiler/compiler.cpp +++ b/src/library/compiler/compiler.cpp @@ -10,7 +10,6 @@ Author: Leonardo de Moura #include "kernel/kernel_exception.h" #include "library/max_sharing.h" #include "library/trace.h" -#include "library/sorry.h" #include "library/time_task.h" #include "library/compiler/util.h" #include "library/compiler/lcnf.h" @@ -158,10 +157,6 @@ bool is_main_fn_type(expr const & type) { } } -static bool has_synthetic_sorry(constant_info const & cinfo) { - return cinfo.is_definition() && has_synthetic_sorry(cinfo.get_value()); -} - #define trace_compiler(k, ds) lean_trace(k, trace_comp_decls(ds);); environment compile(environment const & env, options const & opts, names cs) { @@ -190,7 +185,6 @@ environment compile(environment const & env, options const & opts, names cs) { lean_assert(!is_extern_constant(env, get_real_name(c))); constant_info cinfo = env.get(c); if (!cinfo.is_definition() && !cinfo.is_opaque()) return env; - if (has_synthetic_sorry(cinfo)) return env; } time_task t("compilation", opts); diff --git a/src/runtime/object.cpp b/src/runtime/object.cpp index 93e0842df3..c921c4bd1e 100644 --- a/src/runtime/object.cpp +++ b/src/runtime/object.cpp @@ -58,6 +58,10 @@ extern "C" object * lean_panic_fn(object * default_val, object * msg) { return default_val; } +extern "C" object * lean_sorry(uint8) { + lean_panic("executing sorry"); +} + extern "C" size_t lean_object_byte_size(lean_object * o) { if (lean_is_mt(o) || lean_is_st(o) || lean_is_persistent(o)) { /* Recall that multi-threaded, single-threaded and persistent objects are stored in the heap.