Rollup merge of #129034 - henryksloan:coroutine-must-use, r=joboet · patricklam/verify-rust-std@b4bfc21 (original) (raw)

Rollup merge of rust-lang#129034 - henryksloan:coroutine-must-use, r=joboet

Add `#[must_use]` attribute to `Coroutine` trait [Coroutines tracking issue](rust-lang#43122) Like closures (`FnOnce`, `AsyncFn`, etc.), coroutines are lazy and do nothing unless called (resumed). Closure traits like `FnOnce` have `#[must_use = "closures are lazy and do nothing unless called"]` to catch likely bugs for users of APIs that produce them. This PR adds such a `#[must_use]` attribute to `trait Coroutine`.

2 parents b56fdcb + ac682f1 commit b4bfc21