Skip to content

ICE in github build #80998

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
xoviat opened this issue Jan 14, 2021 · 4 comments · Fixed by #81008
Closed

ICE in github build #80998

xoviat opened this issue Jan 14, 2021 · 4 comments · Fixed by #81008
Labels
A-async-await Area: Async & Await A-coroutines Area: Coroutines C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@xoviat
Copy link

xoviat commented Jan 14, 2021

See below:

https://github.com/akiles/embassy/runs/1699580405?check_suite_focus=true

@xoviat xoviat added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 14, 2021
@hellow554
Copy link
Contributor

Reduced to only use the task proc-macro:

use embassy::executor::task;

#[task]
async fn run() {
    let a = Foo ;
}

It seems important, that Foo isn't defined, if I define a struct Foo, the ICE goes away.

@hellow554
Copy link
Contributor

searched nightlies: from nightly-2020-06-01 to nightly-2021-01-01
regressed nightly: nightly-2020-10-27
searched commits: from 4760b8f to fd54259
regressed commit: b9a94c9

bisected with cargo-bisect-rustc v0.6.0

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc 2020-06-01 --regress ice --access github -- check

I'm pretty sure that #78324 isn't at fault here, but instead it just uncovers the problem.

@hellow554
Copy link
Contributor

MCVE:

#![feature(type_alias_impl_trait)]

use std::future::Future;

pub struct Task<F: Future>(F);
impl<F: Future> Task<F> {
    fn new() -> Self {
        todo!()
    }
    fn spawn(&self, _: impl FnOnce() -> F) {
        todo!()
    }
}

fn main() {
    async fn cb() {
        let a = Foo;
    }

    type F = impl Future;
    static POOL: Task<F> = Task::new();
    Task::spawn(&POOL, || cb());
}

@jonas-schievink jonas-schievink added the F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` label Jan 14, 2021
@jonas-schievink
Copy link
Contributor

Panic location:

pub fn generator_layout(self, def_id: DefId) -> &'tcx GeneratorLayout<'tcx> {
self.optimized_mir(def_id).generator_layout.as_ref().unwrap()
}

@jonas-schievink jonas-schievink added A-async-await Area: Async & Await A-coroutines Area: Coroutines labels Jan 14, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jan 15, 2021
…ndry

Don't ICE when computing a layout of a generator tainted by errors

Fixes rust-lang#80998.
@bors bors closed this as completed in ce06df2 Jan 15, 2021
@oli-obk oli-obk moved this from Todo to Done in type alias impl trait stabilization Sep 9, 2022
@tmandry tmandry moved this to Done in wg-async work Dec 8, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-async-await Area: Async & Await A-coroutines Area: Coroutines C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants