Skip to content

ICE when using a generator borrowing data with feature(nll) #47055

Closed
@daboross

Description

@daboross

Hi! Ran into this earlier today when trying out #![feature(nll)] on a program which already uses generators.

Simplest test case:

#![crate_type = "lib"]
#![feature(conservative_impl_trait, generators, generator_trait, nll)]
use std::ops::Generator;

pub fn render<'a>(input: &'a str) -> impl Generator<Yield = (), Return = ()> + 'a {
    move || {
        let _t = input;
        yield ();
    }
}

Error:

error: internal compiler error: /checkout/src/librustc_mir/borrow_check/nll/universal_regions.rs:805: cannot convert `ReFree(DefId(0/0:252 ~ screeps_rs_ui[35dd]::rendering[0]::map_view[0]::render[0]), BrNamed(crate0:DefIndex(1:69), 'a))` to a region vid

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.24.0-nightly (77e189cd7 2017-12-28) running on x86_64-unknown-linux-gnu

Using rustc 1.24.0-nightly (77e189cd7 2017-12-28)

Reproduction on playpen: https://play.rust-lang.org/?gist=8973ce56db9aa1731173889ea012b8d9&version=nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-coroutinesArea: CoroutinesC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions