Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wrapped BoxFuture type with must_use #1375

Open
nlordell opened this issue Aug 28, 2020 · 0 comments
Open

Use wrapped BoxFuture type with must_use #1375

nlordell opened this issue Aug 28, 2020 · 0 comments
Labels
cleanup PRs that don't add new functionality but clean or improve the codebase

Comments

@nlordell
Copy link
Contributor

nlordell commented Aug 28, 2020

#1372 (review)

@fleupold

Nice catch!

rust-lang/futures-rs#1691 has a proposal on how this could be worked around (by wrapping the actual BoxFuture in a struct and marking it must_use).

I'd be in favour of using such a type in our codebase wherever we return BoxFuture as these bugs can be really nasty to find (not caught by unit tests) and I really like the rust compiler warnings in these cases.

@nlordell nlordell added the cleanup PRs that don't add new functionality but clean or improve the codebase label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup PRs that don't add new functionality but clean or improve the codebase
Projects
None yet
Development

No branches or pull requests

1 participant