Closed
Description
Consider this code:
#![feature(dyn_star)]
#![allow(incomplete_features)]
use std::fmt::Debug;
fn main() {
let _dyn_i: dyn* Debug = [0u8; std::mem::size_of::<usize>()];
}
This raises an error:
error[E0277]: `[u8; 8]` needs to be a pointer-sized type
However, it is a pointer-sized type. Looks like somehow that's still not good enough?
On a related note, I am surprised that this PointerSize
marker trait (according to its documentation) cares only about size and not alignment. I think things would go very wrong if we had a type that had ptr size but larger alignment than a ptr, and then turned that into a dyn*
...