async-rs / async-rs/async-std

Book: explain statically checked unreachable

Open
#87 2 comments 0 reactions 1 assignee Claimed by @matklad View on GitHub
documentation
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

The [current version](https://github.com/async-rs/async-std/blob/0156dc879bc67e313ef123978a8edfb24ae36fae/docs/src/tutorial/handling_disconnection.md) of the Handling Disconnects section of the book states:

> In the shutdown case we use match void {} as a statically-checked unreachable!().

Please explain the significance of this statement. In how far is this a statically checked version of `unreachable!`?

This is the first time I am encountering this pattern and I am confused by the statement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.