mirror of
https://git.proxmox.com/git/rustc
synced 2025-10-15 18:44:56 +00:00
17 lines
321 B
Rust
17 lines
321 B
Rust
//! Check that const eval can use the size of opaque types.
|
|
// check-pass
|
|
use std::mem;
|
|
fn returns_opaque() -> impl Sized {
|
|
0u8
|
|
}
|
|
|
|
struct NamedOpaqueType {
|
|
data: [mem::MaybeUninit<u8>; size_of_fut(returns_opaque)],
|
|
}
|
|
|
|
const fn size_of_fut<FUT>(x: fn() -> FUT) -> usize {
|
|
mem::size_of::<FUT>()
|
|
}
|
|
|
|
fn main() {}
|