mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
22 lines
491 B
Rust
22 lines
491 B
Rust
#![feature(transmutability)]
|
|
|
|
mod assert {
|
|
use std::mem::BikeshedIntrinsicFrom;
|
|
|
|
pub fn is_transmutable<Src, Context, const ASSUME_ALIGNMENT: bool>()
|
|
where
|
|
Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope
|
|
//~^ the constant `ASSUME_ALIGNMENT` is not of type `Assume`
|
|
{
|
|
}
|
|
}
|
|
|
|
fn via_const() {
|
|
struct Context;
|
|
struct Src;
|
|
|
|
assert::is_transmutable::<Src, Context, false>();
|
|
}
|
|
|
|
fn main() {}
|