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

Remove TLS dependency from async/await #62918

Open
cavedweller opened this issue Jul 23, 2019 · 6 comments

Comments

@cavedweller
Copy link

commented Jul 23, 2019

Futures currently have a dependency on TLS for storing a pointer to Context<'_>.
https://github.com/rust-lang/rust/blob/master/src/libstd/future.rs#L116

This makes usage in no_std environments quite difficult.

@cavedweller

This comment has been minimized.

Copy link
Author

commented Jul 23, 2019

I would like to tackle this since it's blocking a personal project.

cc/ @cramertj @eddyb @nikomatsakis @Zoxc

@cramertj cramertj changed the title Remove TLS dependency from Futures Remove TLS dependency from async/await Jul 23, 2019

@xurtis

This comment has been minimized.

Copy link

commented Jul 24, 2019

Duplicate of rustasync/team#42

@xurtis

This comment has been minimized.

Copy link

commented Jul 24, 2019

There's also some additional background discussion on the rust-internals discourse.

@cramertj

This comment has been minimized.

Copy link
Member

commented Jul 24, 2019

Duplicate of rustasync/team#42

Not sure if you were suggesting this, but I don't think we should be using other repo's issues to track changes to rustc.

@xurtis

This comment has been minimized.

Copy link

commented Jul 24, 2019

I mean, nor do I but that is where most of the existing discussion is. It may be worth closing the other thread to try and avoid splitting the discussion over two issues on separate repos.

@TomCrypto

This comment has been minimized.

Copy link

commented Jul 25, 2019

I'm running into this as well. You can work around it and get things working using a hack akin to this https://github.com/SunriseOS/core-futures-tls but it requires overriding libcore for every crate that needs #![feature(async_await)] which makes it difficult to do in library crates. TLS-free async fns would be cool.

(I'm sure this workaround is well-known but just posting for future readers that might come across this issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.