From a162bb8728aee1d65a7c357fb3ec4ede3e66e69b Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 2 Jul 2025 16:29:16 +0200 Subject: [PATCH] feat: add {.raises.} annotations Co-Authored-By: Dmitriy Ryajov --- groth16/files/container.nim | 6 ++++-- groth16/prover.nim | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/groth16/files/container.nim b/groth16/files/container.nim index d542764..28e2a0d 100644 --- a/groth16/files/container.nim +++ b/groth16/files/container.nim @@ -61,7 +61,8 @@ proc readSection[T] ( expectedMagic: string , stream: Stream , user: var T , callback: SectionCallback[T] - , filt: (int) -> bool ) = + , filt: proc(_: int): bool {.raises: [IOError, OSError].} + ) {.raises: [IOError, OSError].} = let sectId = int( stream.readUint32() ) let sectLen = int( stream.readUint64() ) @@ -77,7 +78,8 @@ proc parseContainer*[T] ( expectedMagic: string , fname: string , user: var T , callback: SectionCallback[T] - , filt: (int) -> bool ) = + , filt: proc(_: int): bool {.raises: [IOError, OSError].} + ) {.raises: [IOError, OSError].} = let stream = newFileStream(fname, mode = fmRead) defer: stream.close() diff --git a/groth16/prover.nim b/groth16/prover.nim index 010365f..8f1bb89 100644 --- a/groth16/prover.nim +++ b/groth16/prover.nim @@ -7,6 +7,8 @@ # See # +{.push raises:[].} + #[ import sugar import constantine/math/config/curves