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
Closed

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

snakehand opened this issue Feb 28, 2019 · 1 comment

Comments

@snakehand
Copy link

@snakehand 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
Copy link
Member

@cramertj 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants