Skip to content

In-band lifetimes stop working when in a nested function #52532

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum
#![feature(rust_2018_preview)]

fn main() {}

struct Bar<'a>(&'a u32);

impl Bar<'a> {
    fn foo() {
        fn foo(_: &'a u32) { } // error: use of undeclared lifetime name `'a`
    }
}

https://play.rust-lang.org/?gist=d2b32bc0947a05fa0830a0d244dcb4fa&version=nightly&mode=debug&edition=2015

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language 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