* gnu/packages/rust.scm (rust-void): New variable.
---
gnu/packages/rust.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 674570c7d..fe133c084 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -453,3 +453,29 @@ For many system APIs, Nix provides a safe alternative to
the unsafe API
exposed by the libc crate. This is done by wrapping the libc
functionality with types/abstractions that enforce legal/safe usage.")
(license license:expat)))
+
+(define-public rust-void
+ (package
+ (name "rust-void")
+ (version "1.0.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (crate-uri "void" version))
+ (file-name
+ (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0zc8f0ksxvmhvgx4fdg0zyn6vdnbxd2xv9hfx4nhzg6kbs4f80ka"))))
+ (build-system cargo-build-system)
+ (home-page "https://github.com/reem/rust-void.git")
+ (synopsis "Uninhabited void type for use in statically impossible cases")
+ (description
+ "The uninhabited type, @code{enum Void { }} is useful in dealing
+with cases you know to be impossible. If you are implementing a trait
+which allows for error checking, but your case always succeeds, you can
+mark the error case or type as Void, signaling to the compiler it can
+never happen.
+This crate also comes packed with a few traits offering extension
+methods to @code{Result<T, Void>} and @code{Result<Void, T>}.")
+ (license license:expat)))
--
2.11.0