Help compiler understand that co_yield co_error() in a Task coroutine never returns
Summary: Mark the `await_resume()` method of the `final_suspend()` awaiter as `[[noreturn]]`. This helps the compiler to dead-code eliminate this code, and in particular helps the compiler to determine that code cannot continue execution after a `co_yield co_error(ex)` expression (which calls `final_suspend()`). This enables us to write code that has a `co_yield co_error()` statement as the last line in a non-void `Task` coroutine without the compiler emitting a warning about control running off the end of the coroutine. Reviewed By: yfeldblum Differential Revision: D22229020 fbshipit-source-id: b7a63b030cb42653198731d542ffa9bbf90daa83
Showing
Please register or sign in to comment