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

std: Don't fail the task when a Future is dropped #14941

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

It's a benign failure that no one needs to know about.

Closes #14892

}

// Make sure the future didn't fail the task.
assert_eq!(unsafe { FOO.load(atomics::SeqCst) }, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever use of TLS. I didn't realize you could use it that way to find out if the task exited due to failure or not.

Seems to me you can skip the atomics though, and just use a separate channel. Have Bomb send task::failing() across a channel and read it on the other side.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea!

It's a benign failure that no one needs to know about.

Closes rust-lang#14892
@alexcrichton alexcrichton deleted the issue-14892 branch June 17, 2014 04:37
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
Shrink `DefMap`, share crate level items with block def maps
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 this pull request may close these issues.

"failed at 'sending on a closed channel'" when using Future
2 participants