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

Playing with async triggers compiler bug "TLS Waker not set" #58814

Closed
snakehand opened this Issue Feb 28, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@snakehand
Copy link

snakehand commented Feb 28, 2019

#![feature(futures_api,async_await,gen_future)]

extern crate core;
use std::future::Future;
use core::{pin::Pin, task::Poll};

async fn tst() -> i32 {
    42
}

fn main() {
    println!("Hi");
    let mut a = tst();
    let b = std::future::poll_with_tls_waker(unsafe { Pin::new_unchecked(&mut a) });
    println!("{:?}", b);
}

rustc 1.34.0-nightly (aadbc45 2019-02-23)

Causes:

Hi
thread 'main' panicked at 'TLS Waker not set. This is a rustc bug. Please file an issue on https://github.com/rust-lang/rust.', src/libcore/option.rs:1038:5
@cramertj

This comment has been minimized.

Copy link
Member

cramertj commented Mar 1, 2019

This is intended. Those functions aren't designed to be stable, ever-- they're compiler implementation details.

@cramertj cramertj closed this Mar 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.