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
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug.

Comments

@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
@sfackler sfackler added C-bug Category: This is a bug. A-async-await Area: Async & Await labels Feb 28, 2019
@cramertj
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 as completed Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants