Compiler error when using const generics #89146
Labels
A-const-generics
Area: const generics (parameters and arguments)
C-bug
Category: This is a bug.
F-generic_const_exprs
`#![feature(generic_const_exprs)]`
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When using a trait function that uses an associated generic constant, the compiler requests a bound to the function using
If we use that, the code compiles fine. The way I reached to this error is by, instead, using the following bound:
This case works well if the "deepness" of calls of such functions is one. However, if we have such a bounded function, that calls another bounded function as such, we get the compiler error. Playground example.
Code
Here is the WORKING example:
And here is the NON-WORKING example
Note that in the NON-WORKING version, we bound
bar
withinstead of
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: