rust-lang/rust — pull request #17601 by apoelstra (2014-09-27 23:35:02+00:00)
Title: Remove `Select` structure; implement inline `select!` macro

The old `Select` structure was very inefficient and required the user
to use unsafe code (and manually maintain a "this variable will never
move" invariant). Searching through several popular repositories, the
only instance I found of it being used was in servo --- to avoid the
setup cost of putting `select!` in a loop, which would create a new
`Select` on every iteration.

This commit deletes the `Select` structure entirely and moves all of
its code into the `select!` macro. The benefit of this is that there
is no more need for allocations, no more need for unsafe code, and
no setup costs (so servo can now use `select!` directly).

This also changes the interface to select! to fix #12902.

Fixes #12902.

[breaking-change]