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

async-trait should add must_use declaration #75

Closed
matthauck opened this issue Mar 23, 2020 · 2 comments · Fixed by #76
Closed

async-trait should add must_use declaration #75

matthauck opened this issue Mar 23, 2020 · 2 comments · Fixed by #76

Comments

@matthauck
Copy link

async-trait should add #[must_use] declarations on async trait functions. This compiler warning is rather important -- pretty easy to forget to call .await and then have a function call not actually execute that looks like it should be executing.

@matthauck
Copy link
Author

Repro: https://gist.github.com/matthauck/9743152133266c50d5593a90867b34c1

I would have expected both do_trait and do_direct calls to fail with a warning.

@dtolnay
Copy link
Owner

dtolnay commented Mar 23, 2020

Relevant upstream feature request: rust-lang/rust#67387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants