-
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 lintsF-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`T-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.const-generics-bad-diagnosticsAn error is correctly emitted, but is confusing, for `min_const_generics`.An error is correctly emitted, but is confusing, for `min_const_generics`.
Description
Code
#![feature(generic_const_exprs)]
fn bb<const N: bool>() {}
fn b<const N: bool>() {
bb::<{!N}>();
}
fn main() {}
Current output
help: try adding a `where` bound using this expression: `where [(); {!N}]:`
Desired output
`where [(); !N as usize]:`
Rationale and extra context
The well-formedness shouldn't be written as where [(); {!N}]:
when !N
is a bool, which doesn't compile. Should cast it to an integral type.
Other cases
No response
Rust Version
1.78.0-nightly (2024-03-11 4a0cc881dcc4d800f106)
Anything else?
No response
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 lintsF-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`T-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.const-generics-bad-diagnosticsAn error is correctly emitted, but is confusing, for `min_const_generics`.An error is correctly emitted, but is confusing, for `min_const_generics`.