-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)C-bugCategory: This is a bug.Category: This is a bug.F-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.
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.
Metadata
Metadata
Assignees
Labels
A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)C-bugCategory: This is a bug.Category: This is a bug.F-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.