Skip to content

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

@snakehand

Description

@snakehand
#![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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions