Skip to content

universal-regions table not populated with late bound lifetimes from parent functions #52113

Description

@nikomatsakis

This example:

#![allow(warnings)]
#![feature(nll)]

trait Bazinga { }

impl<F> Bazinga for F { }

fn produce<'a>(data: &'a u32) -> impl Bazinga + 'a {
    let x = move || {
        let _data: &'a u32 = data;
    };
    x
}

fn main() { }

causes an ICE:

error: internal compiler error: librustc_mir/borrow_check/nll/universal_regions.rs:825: cannot convert `ReFree(DefId(0/0:5 ~ playground[f23d]::produce[0]), BrNamed(crate0:DefIndex(1:10), 'a))` to a region vid

This is split off from #51351 and I think retains the spirit of the original example better.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️NLL-completeWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions