Open
Description
#![feature(lazy_normalization_consts)]
struct P<T: ?Sized>([u8; 1 + 4], T);
fn main() {
let x: Box<P<[u8; 0]>> = Box::new(P(Default::default(), [0; 0]));
let _: Box<P<[u8]>> = x;
}
This works on stable but fails with the following error when using lazy_normalization_consts
error[E0308]: mismatched types
--> src/main.rs:6:27
|
6 | let _: Box<P<[u8]>> = x;
| ------------ ^ expected slice `[u8]`, found array `[u8; 0]`
| |
| expected due to this
|
= note: expected struct `Box<P<[u8]>>`
found struct `Box<P<[u8; 0]>>`
For this to fail the struct has to contain a type referencing an unevaluated constant, struct P<T: ?Sized>([u8; 5], T)
does work.
assigning to myself, but won't get to this right away. If you are interested in working on this before that feel free to do so.