Skip to content

inline const test for elided lifetimes being infer vars #110934

Closed
@BoxyUwU

Description

@BoxyUwU

There should be a test for feature(inline_const) ensuring that it does not have the same bug as #110931 and #110933, that '_ inside of the const refers to 'static instead of inferring a lifetime. The following code is what passes and should be added as a test:

#![feature(inline_const)]

fn main() {
    let my_usize = const {
        let a = 10_usize;
        let b: &'_ usize = &a;
        *b
    };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-inline_constInline constants (aka: const blocks, const expressions, anonymous constants)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions