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

False syntax errors with associated_const_equality #11965

Closed
thorjelly opened this issue Apr 12, 2022 · 3 comments · Fixed by #12013
Closed

False syntax errors with associated_const_equality #11965

thorjelly opened this issue Apr 12, 2022 · 3 comments · Fixed by #12013
Labels
A-parser parser issues C-feature Category: feature request E-has-instructions Issue has some instructions and pointers to code to get started S-actionable Someone could pick this issue up and work on it right now

Comments

@thorjelly
Copy link

The following code works in nightly with cargo check but rust-analyzer reports HasCount<COUNT = {N}> as containing syntax errors:

#![feature(associated_const_equality)]

trait HasCount {
    const COUNT: usize;
}

trait Foo {}

impl<T, const N: usize> Foo for T where T: HasCount<COUNT = {N}> {}

Using pre-release VSCode extension. The official Rust plugin works fine.

@memoryruins
Copy link
Contributor

The rustc tracking issue is rust-lang/rust#92827. It doesn't currently link to a doc/mcp/rfc describing the feature, but I imagine the syntax could be handled by r-a even before implementing lowering/analysis for them.

In the meantime, rust-analyzer syntax's built-in diagnostics can be configured/disabled by users until the syntax is handled (if the current diagnostic is distracting for anyone).

syn similarly updated to handle this case recently dtolnay/syn@99560af.

@lnicola lnicola added S-actionable Someone could pick this issue up and work on it right now A-parser parser issues C-feature Category: feature request labels Apr 12, 2022
@Veykril
Copy link
Member

Veykril commented Apr 12, 2022

@Veykril Veykril added the E-has-instructions Issue has some instructions and pointers to code to get started label Apr 12, 2022
@xffxff
Copy link
Contributor

xffxff commented Apr 17, 2022

I'm working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser parser issues C-feature Category: feature request E-has-instructions Issue has some instructions and pointers to code to get started S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants