That means ->! in Rust?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
21 views
Example of source text:
pub unsafe extern fn kstart(args_ptr: *const KernelArgs) -> ! {

What type a function returns and what it means: "-> !"
by | 21 views

2 Answers

0 like 0 dislike
For obscure pieces of syntax there is a great page - https://doc.rust-lang.org/book/first-edition/synta...

There easily is a paragraph "!: always empty Never type. See Diverging Functions", referring to details in the first edition of the Book:

- https://doc.rust-lang.org/book/first-edition/funct...
- https://rurust.github.io/rust_book_ru/src/function...

If it is very short, so the return type of a function means that it will never return.
by
0 like 0 dislike
Function or when not completed that allows her to call as if it returns any specified type.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked May 21, 2019 by Zanak
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
3 answers
asked Apr 9, 2019 by dimka11
110,608 questions
257,187 answers
0 comments
40,796 users