Skip to content

Compiler panic on type inference for impl Generator yielding a reference #52304

Closed
@bergus

Description

@bergus

I'm getting

error: internal compiler error: librustc/infer/error_reporting/mod.rs:184: ReEmpty
thread 'main' panicked at 'Box', librustc_errors/lib.rs:554:9

when trying to compile

#![feature(generators, generator_trait)]
use std::ops::Generator;
fn example() -> impl Generator {
    || { yield &1 }
}

on rustc 1.29.0-nightly (e5f6498 2018-07-10) - Playground demo.

This seems to happen when I yield a reference type and don't specify the exact type in impl Generator<Yield=&Whatever>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coroutinesArea: CoroutinesA-diagnosticsArea: Messages for errors, warnings, and lintsA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-coroutines`#![feature(coroutines)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions