Skip to content

Link dependent lifetimes in reborrowed slices #5739

Closed
@nikomatsakis

Description

@nikomatsakis

Issue #3184 had to do with inference failures around reborrowed pointers, but I neglected to handle reborrowed slices.

As a result, tests like this:

fn subslice<'r>(v: &'r fn()) -> &'r fn() { v }

fn both<'r>(v: &'r fn()) -> &'r fn() {
    subslice(subslice(v))
}

fn main() {
    both(main);
}

fail to compile. I have a patch coming soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions