Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Link dependent lifetimes in reborrowed slices #5739

Closed
nikomatsakis opened this issue Apr 5, 2013 · 0 comments
Closed

Link dependent lifetimes in reborrowed slices #5739

nikomatsakis opened this issue Apr 5, 2013 · 0 comments
Labels
A-lifetimes Area: Lifetimes / regions A-typesystem Area: The type system

Comments

@nikomatsakis
Copy link
Contributor

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.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions A-typesystem Area: The type system
Projects
None yet
Development

No branches or pull requests

1 participant