Closed anatawa12 closed 2 years ago
The never type is allowed as direct return type since at least 1.0. The Rust Reference.
Using it as return type has been stable since rust 1.0, long before it was conceived as actual type. It was originally intended simply as marker of a diverging (never returning) function. Later an RFC was accepted to promote it to a regular type that can used in other contexts.
I tried this code:
According to API doc for never and [tracking issue] (B-unstable), I think
never_type
is not stabilized yet. However, I can use never type with stable rustc. Is it expected behavior? Ifnever_type
is already stabilized, can you document on tracking issue or rust stable book?Meta
rustc --version --verbose
:Backtrace
``` $ RUST_BACKTRACE=1 cargo build Compiling minecraft-world-backuper v0.1.0 (/Users/anatawa12/IdeaProjects/minecraft-world-backuper) Finished dev [unoptimized + debuginfo] target(s) in 0.24s ```