mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
23 lines
417 B
Rust
23 lines
417 B
Rust
|
#![feature(transmutability)]
|
||
|
|
||
|
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||
|
pub struct Context;
|
||
|
|
||
|
#[repr(C)]
|
||
|
struct W<'a>(&'a ());
|
||
|
|
||
|
fn test<'a>()
|
||
|
where
|
||
|
W<'a>: BikeshedIntrinsicFrom<
|
||
|
(),
|
||
|
Context,
|
||
|
{ Assume { alignment: true, lifetimes: true, safety: true, validity: true } },
|
||
|
>,
|
||
|
{
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
test();
|
||
|
//~^ ERROR `()` cannot be safely transmuted into `W<'_>`
|
||
|
}
|