summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/lib.rs b/core/src/lib.rs
index c31a8da7..d5c221ac 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -84,3 +84,12 @@ pub use vector::Vector;
pub use widget::Widget;
pub use smol_str::SmolStr;
+
+/// A function that can _never_ be called.
+///
+/// This is useful to turn generic types into anything
+/// you want by coercing them into a type with no possible
+/// values.
+pub fn never<T>(never: std::convert::Infallible) -> T {
+ match never {}
+}