Closed
Description
cc @varkor @rust-lang/wg-diagnostics
Say we have:
#![feature(const_generics)]
fn foo<const N: usize>() {}
fn bar() {
foo::<1 + 1>();
}
the parser now greets you with:
error: expected one of `,` or `>`, found `+`
--> src/lib.rs:6:13
|
6 | foo::<1 + 1>();
| ^ expected one of `,` or `>` here
It would be good if you got:
error: expected one of `,` or `>`, found `+`
--> src/lib.rs:6:13
|
6 | foo::<1 + 1>();
| ^ expected one of `,` or `>` here
|
| help: wrap the expression in a block:
6 | foo::<{1 + 1}>();
or some such.
Metadata
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Category: An issue proposing an enhancement or a PR with one.`#![feature(const_generics)]`Relevant to the compiler team, which will review and decide on the PR/issue.An error is correctly emitted, but is confusing, for `min_const_generics`.This issue requires a nightly compiler in some way.