Skip to content

Remove TLS dependency from async/await #62918

Closed
@benbrittain

Description

@benbrittain

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.

Activity

benbrittain

benbrittain commented on Jul 23, 2019

@benbrittain
Author

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

cc/ @cramertj @eddyb @nikomatsakis @Zoxc

added
AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.
on Jul 23, 2019
changed the title [-]Remove TLS dependency from Futures [/-] [+]Remove TLS dependency from async/await[/+] on Jul 23, 2019
xurtis

xurtis commented on Jul 24, 2019

@xurtis

Duplicate of rustasync/team#42

xurtis

xurtis commented on Jul 24, 2019

@xurtis

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

cramertj

cramertj commented on Jul 24, 2019

@cramertj
Member

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

xurtis commented on Jul 24, 2019

@xurtis

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

TomCrypto commented on Jul 25, 2019

@TomCrypto

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)

added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
and removed
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Aug 17, 2019
phil-opp

phil-opp commented on Sep 15, 2019

@phil-opp
Contributor

@cavedweller

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

Are you still working on this? I don't have much experience with the Rust compiler, but maybe there is still a way I can help?

6 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @benbrittain@phil-opp@jonas-schievink@TomCrypto@xurtis

        Issue actions

          Remove TLS dependency from async/await · Issue #62918 · rust-lang/rust