Skip to content

Unstable feature generic_const_items syntax is not recognized #19516

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

Closed
gastrodon opened this issue Apr 4, 2025 · 0 comments · Fixed by #19643
Closed

Unstable feature generic_const_items syntax is not recognized #19516

gastrodon opened this issue Apr 4, 2025 · 0 comments · Fixed by #19643
Labels
A-parser parser issues C-bug Category: bug

Comments

@gastrodon
Copy link

gastrodon commented Apr 4, 2025

Not so sure if this fits better as a bug or a feature request ( since, rust-analyzer isn't guaranteed to work with unstable features ), but I figure I'd put this here since no other issues mention it.

The syntax for generic_const_items appears as a syntax error when code is looked at by rust-analyzer.

A reproducible example: This compiles with the latest nightly rustc 1.87.0-nightly (227690a25 2025-03-16), but rust-analyzer ( in vscodium ) complains about syntax errors on lines 6 expected SEMICOLON and 7 expected an item

#![feature(generic_const_exprs)]
#![feature(generic_const_items)]

trait A {
    const NUMBER: usize;
    const ARRAY: [u64; Self::NUMBER]
        where [(); Self::NUMBER]:;
}

fn main() {}
@gastrodon gastrodon added the C-bug Category: bug label Apr 4, 2025
@Veykril Veykril added the A-parser parser issues label Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser parser issues C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants