#infallible #derive #proc-macro #never #no-alloc #bottom-type

macro no-std nevermore

Derive macros for the bottom type core::convert::Infallible

2 releases

0.1.1 Sep 9, 2023
0.1.0 Sep 9, 2023

#7 in #infallible

46 downloads per month
Used in parsa

MIT/Apache

8KB

nevermore

crates.io version crates.io downloads docs.rs

Derive macros for Rust's bottom type core::convert::Infallible.

Features

FromNever

This derive macro automatically generates From<Infallible> implementation on the type:

#[derive(nevermore::FromNever)]
struct User {
    name: String,
    age: u8,
}

will generate something similar to

impl From<Infallible> for User {
    fn from(infallible: Infallible) {
        match infallible {}
    }
}

lib.rs:

Conveniences for the bottom type core::convert::Infallible.

This may become redundant if (hopefully once) never type is fully stabilized.

Dependencies

~0.3–0.8MB
~19K SLoC