lean4-htt/src/runtime
Eric Wieser 848832dd61
chore: demote a panic to an exception in saveModuleData (#9127)
This PR makes `saveModuleData` throw an IO.Error instead of panicking,
if given something that cannot be serialized. This doesn't really matter
for saving modules, but is handy when writing tools to save auxiliary
date in olean files via Batteries' `pickle`.

The caller of this C++ function already is guarded in a `try`/`catch`
that promotes from a `lean::exception` to an `IO.userError`.

A simple test of this in the web editor is
```
import Batteries

#eval pickle "/tmp/foo.txt" fun x : Nat => x
```
which crashes before this change.

---------

Co-authored-by: Laurent Sartran <lsartran@google.com>
2025-09-02 12:25:45 +00:00
..
uv fix: handle NUL bytes in IO functions (#9616) 2025-08-01 06:12:53 +00:00
alloc.cpp fix: heartbeats from realizeConst should be ignored (#7473) 2025-03-13 15:10:29 +00:00
alloc.h fix: heartbeats from realizeConst should be ignored (#7473) 2025-03-13 15:10:29 +00:00
allocprof.cpp
allocprof.h
apply.cpp chore: update script/apply.lean semantics 2022-11-07 19:47:04 -08:00
apply.h fix: split libInit_shared out of libleanshared (#3421) 2024-02-22 19:16:32 +00:00
array_ref.h perf: fix implementation of move constructors and move assignment ope… (#4700) 2024-08-02 17:55:03 +00:00
buffer.h chore: re-land "perf: use C23's free_sized when available" (#6844) 2025-02-04 12:43:56 +00:00
CMakeLists.txt feat: add system information functions to the standard library (#8109) 2025-06-27 16:31:34 +00:00
compact.cpp chore: demote a panic to an exception in saveModuleData (#9127) 2025-09-02 12:25:45 +00:00
compact.h chore: lean --stats gives number of imported bytes (#8725) 2025-06-12 08:29:42 +00:00
debug.cpp feat: reimplement assert without system headers 2021-11-18 09:42:35 +01:00
debug.h fix: split libInit_shared out of libleanshared (#3421) 2024-02-22 19:16:32 +00:00
exception.cpp
exception.h fix: split libInit_shared out of libleanshared (#3421) 2024-02-22 19:16:32 +00:00
flet.h
hash.cpp chore: replace all hashes by murmurhash 2022-12-01 20:18:14 -08:00
hash.h feat: define Int8 (#5790) 2024-10-25 06:06:40 +00:00
init_module.cpp feat: implement basic async IO with timers (#6505) 2025-01-13 18:11:04 +00:00
init_module.h fix: split libInit_shared out of libleanshared (#3421) 2024-02-22 19:16:32 +00:00
int.h feat: define ISize and basic operations on it (#5961) 2024-11-05 15:08:19 +00:00
interrupt.cpp refactor: port more of shell.cpp to Lean (#10086) 2025-08-26 20:02:42 +00:00
interrupt.h fix: Windows build (#4628) 2024-07-02 20:32:00 +00:00
io.cpp refactor: implement IO.waitAny using Lean (#9732) 2025-08-06 13:09:15 +00:00
io.h fix: handle NUL bytes in IO functions (#9616) 2025-08-01 06:12:53 +00:00
libuv.cpp feat: add lean_setup_libuv for initializing required LIBUV components (#8636) 2025-06-27 11:11:17 +00:00
libuv.h feat: add DNS resolution functions to the standard library (#8072) 2025-06-27 11:11:47 +00:00
list_ref.h perf: fix implementation of move constructors and move assignment ope… (#4700) 2024-08-02 17:55:03 +00:00
memory.cpp refactor: port more of shell.cpp to Lean (#10086) 2025-08-26 20:02:42 +00:00
memory.h fix: split libInit_shared out of libleanshared (#3421) 2024-02-22 19:16:32 +00:00
mpn.cpp feat: add mpn module 2021-10-25 15:57:19 -07:00
mpn.h feat: add mpn module 2021-10-25 15:57:19 -07:00
mpz.cpp fix: undefined symbol without LEAN_USE_GMP (#9106) 2025-07-03 16:50:21 +00:00
mpz.h feat: optimized division without remainder for Int and Nat (#8089) 2025-04-29 07:23:35 +00:00
mutex.cpp feat: add Std.SharedMutex (#7770) 2025-04-03 08:30:54 +00:00
mutex.h feat: Mutex, Condvar 2022-09-05 08:52:46 -07:00
object.cpp refactor: implement IO.waitAny using Lean (#9732) 2025-08-06 13:09:15 +00:00
object.h refactor: implement IO.waitAny using Lean (#9732) 2025-08-06 13:09:15 +00:00
object_ref.cpp
object_ref.h perf: add lean_instantiate_level_mvars (#4910) 2024-08-04 18:31:44 +00:00
option_ref.h perf: add lean_instantiate_level_mvars (#4910) 2024-08-04 18:31:44 +00:00
optional.h perf: fix implementation of move constructors and move assignment ope… (#4700) 2024-08-02 17:55:03 +00:00
pair_ref.h perf: add missing std::moves (#9107) 2025-07-01 12:39:12 +00:00
platform.cpp feat: ignore lean -R if module name is in setup (#8874) 2025-06-23 17:55:52 +00:00
platform.h
process.cpp feat: IO.Process.SpawnArgs.inheritEnv (#6081) 2025-04-16 00:25:32 +00:00
process.h
sharecommon.cpp feat: support mpz in the shareCommon APIs (#7838) 2025-04-06 19:52:50 +00:00
sharecommon.h perf: use mimalloc with important C++ hash maps (#7868) 2025-04-11 16:23:33 +00:00
sstream.h
stack_overflow.cpp fix: Do not overwrite existing signal handlers (#5062) 2024-08-19 09:11:38 +00:00
stack_overflow.h
stackinfo.cpp fix: make the stack handling more robust to sanitizers and -O3 (#6143) 2024-11-22 15:10:20 +00:00
stackinfo.h fix: split libInit_shared out of libleanshared (#3421) 2024-02-22 19:16:32 +00:00
string_ref.h perf: fix implementation of move constructors and move assignment ope… (#4700) 2024-08-02 17:55:03 +00:00
thread.cpp chore: remove old LEAN_AUTO_THREAD_FINALIZATION workaround (#8885) 2025-06-20 08:52:17 +00:00
thread.h feat: add Std.SharedMutex (#7770) 2025-04-03 08:30:54 +00:00
utf8.cpp fix: validate UTF-8 at C++ -> Lean boundary (#3963) 2024-06-19 14:05:48 +00:00
utf8.h fix: validate UTF-8 at C++ -> Lean boundary (#3963) 2024-06-19 14:05:48 +00:00