Skip to content

rustc claims that "array lengths can't depend on generic parameters" for exactly one type of expression, while various other far more complex expressions involving const generics work perfectly #63249

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
slightlyoutofphase opened this issue Aug 3, 2019 · 1 comment
Labels
A-const-generics Area: const generics (parameters and arguments) A-lazy-normalization Area: Lazy normalization (tracking issue: #60471) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@slightlyoutofphase
Copy link
Contributor

slightlyoutofphase commented Aug 3, 2019

Quite simply:

The fact that this playground link gives an error (which is literally the only syntactic way I'm aware of to get that error), while on the other hand I was able to write this fully-working-exactly-as-written crate that depends heavily on the error message in question being simply untrue, seems.... weird to me.

I don't intend to come off as abrasive or anything. Really my point here is that const generics actually work great! Really great! As it stands I rarely encounter any problems with them. Which makes me think this overly-specific error message that only surfaces with one exact (very simple) way you can use const generics is some kind of overlooked leftover from earlier development.

Of course I might be wrong, and absolutely disregard this issue if that's the case!

@Centril Centril added A-const-generics Area: const generics (parameters and arguments) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-lazy-normalization Area: Lazy normalization (tracking issue: #60471) labels Aug 4, 2019
@Centril
Copy link
Contributor

Centril commented Aug 4, 2019

Duplicate of #43408.

@Centril Centril closed this as completed Aug 4, 2019
@azriel91 azriel91 mentioned this issue Dec 31, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) A-lazy-normalization Area: Lazy normalization (tracking issue: #60471) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants