2 ms·
I thought ! in Rust indicates a macro.
by fanf2 12y ago
I thought ! in Rust indicates a macro.
- burntsushi 12y agoA `!` followed by an identifier does, yes. But a `!` also lets you define diverging functions: fn diverging() -> ! { unreachable!() } The two `!` in that code are completely orthogonal things. See the manual on diverging functions: http://doc.rust-lang.org/rust.html#diverging-functions http://doc.rust-lang.org/rust.html#diverging-functions