rosefromthedead / effing-mad

Algebraic effects for Rust
579 stars 19 forks source link

Use the real never type #7

Closed Jules-Bertholet closed 1 year ago

Jules-Bertholet commented 1 year ago

The docs currently imply that ! has not yet been stabilized. This is false. This PR changes Never to use the real, stable !.

rosefromthedead commented 1 year ago

Hmm, the docs say it's still unstable, so I guess they stabilised it for return types only? In that case I'm not sure I want to merge this. Surely if it's unstable outside of return position, cheating like this will only reveal why it's unstable... either way, it's messy, and the current state works fine.

Jules-Bertholet commented 1 year ago

The type itself is fully stable to use in any position. For example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=4fd415a79202594552205601102ea67a

What's unstable is:

Another option is to make Never an alias for core::convert::Infallible instead.

rosefromthedead commented 1 year ago

Ah, good to know. The intention was to remove Never once users are able to use the real type, so I don't want to merge this as it just makes the temporary solution more complicated. Thanks for the info though.