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

must_use for JoinHandle::abort_handle #6761

Closed
incker opened this issue Aug 9, 2024 · 1 comment · Fixed by #6762
Closed

must_use for JoinHandle::abort_handle #6761

incker opened this issue Aug 9, 2024 · 1 comment · Fixed by #6762
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. M-task Module: tokio/task

Comments

@incker
Copy link

incker commented Aug 9, 2024

Hello !

Can you please make #[must_use] macro for function JoinHandle::abort_handle(..)

Because sometimes i mix up functions JoinHandle::abort_handle(..) and JoinHandle::abort(..)

Forward thank you!

@incker incker added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Aug 9, 2024
@Darksonn Darksonn added E-easy Call for participation: Experience needed to fix: Easy / not much M-task Module: tokio/task E-help-wanted Call for participation: Help is requested to fix this issue. labels Aug 9, 2024
@sainad2222
Copy link
Contributor

Hey @Darksonn @incker, I can give it a go. Can you help me understand the expected behavior? From what I understood we just need to put must_use macro on abort_handle so that it gives warning whenever we are not using the value returned from abort_handle and the issue here is there is a case of mixup when folks are using abort_handle instead of abort and ignoring the return value?

sainad2222 added a commit to sainad2222/tokio that referenced this issue Aug 9, 2024
if the return value of abort_handle is unused then abort will never be called for that JoinHandle

Fixes: tokio-rs#6761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. M-task Module: tokio/task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants