Open
Description
For example, I expected the following code to succeed compilation:
#![feature(generic_const_exprs)]
#![feature(associated_const_equality)]
trait Trait {
const C: usize;
}
fn f<T: Trait<C = 1>>()
where
[(); T::C]:
{
let _: [(); T::C] = [()];
}
Since (I'm pretty sure that) the ParamEnv contains the projection predicate <T as Trait>::C == 1
, the const projection <T as Trait>::C
inside the function body should be able to get normalized to 1
. That however doesn't seem to happen:
error[E0308]: mismatched types
--> src/lib.rs:12:25
|
12 | let _: [(); T::C] = [()];
| ^^^^ expected `T::C`, found `1`
|
= note: expected constant `T::C`
found constant `1`
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
To Do