Ambiguous error reporting when trying to infer const generic type #93750
Labels
A-const-generics
Area: const generics (parameters and arguments)
A-diagnostics
Area: Messages for errors, warnings, and lints
F-generic_const_exprs
`#![feature(generic_const_exprs)]`
requires-incomplete-features
This issue requires the use of incomplete features.
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=659888b8e5f59352118b3c7b39187f29
The current output is:
The error message being
cannot satisfy 'the constant 'Led::<{_: Colour}>::new::{constant#0}' can be evaluated'
doesn't explain the error at all, and is confusing in the way it is reported. I'm not entirely sure what is going on internally, but getting the compiler to emit a proper error message explaining that the const generic type cannot be inferred would be useful.The text was updated successfully, but these errors were encountered: