-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code: here
struct Add<const N1: usize, const N2: usize>;
impl<const N1: usize, const N2: usize> Foo<N1, N2> {
const SUM: usize = N1 + N2;
}
fn foo() -> [(); Add<10, 12>::SUM] {
todo!()
}
The current output is:
error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> src/lib.rs:5:24
|
5 | fn foo() -> [(); Add<10, 12>::SUM] {
| ^ expected one of `.`, `?`, `]`, or an operator
error: aborting due to previous error
error: could not compile `playground`
Ideally the output should mention that the user needs to use a turbofish here:
Add::<10, 12>::SUM
cc @lcnr
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.