Should we have another non-type never?

fn uh_oh<T: Default>(_: fn() -> T) -> T {
    T::default()
}

fn just_panics() -> impl Default {
    panic!()
}

fn main() {
    uh_oh(just_panics); // what impl does this use?
}

The problem is that it's still possible to use the return type even if the function is never called.

12 Likes