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

inline const test for elided lifetimes being infer vars #110934

Closed
BoxyUwU opened this issue Apr 28, 2023 · 4 comments · Fixed by #112147
Closed

inline const test for elided lifetimes being infer vars #110934

BoxyUwU opened this issue Apr 28, 2023 · 4 comments · Fixed by #112147
Labels
A-lifetimes Area: Lifetimes / regions A-resolve Area: Name resolution E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-inline_const Inline constants (aka: const blocks, const expressions, anonymous constants)

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented Apr 28, 2023

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
    };
}
@BoxyUwU BoxyUwU added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-resolve Area: Name resolution A-lifetimes Area: Lifetimes / regions F-inline_const Inline constants (aka: const blocks, const expressions, anonymous constants) labels Apr 28, 2023
@Noratrieb Noratrieb added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 28, 2023
@agaraman0
Copy link

@rustbot claim

@HarrisonHemstreet
Copy link

@agaraman0 are you still working on this? If not, I would be happy to claim 🙂

@Dylan-DPC
Copy link
Member

@HarrisonHemstreet there is no activity from them for almost a month, so you are free to claim it now

@ghost
Copy link

ghost commented May 31, 2023

@rustbot claim

@rustbot rustbot assigned ghost May 31, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 1, 2023
…er-errors

add inline-const test for elided lifetimes being infer vars

Fixes rust-lang#110934
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 1, 2023
…er-errors

add inline-const test for elided lifetimes being infer vars

Fixes rust-lang#110934
@bors bors closed this as completed in 20b25d2 Jun 2, 2023
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-resolve Area: Name resolution E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-inline_const Inline constants (aka: const blocks, const expressions, anonymous constants)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants