mirror of https://github.com/rust-lang/rust
21 lines
360 B
Rust
21 lines
360 B
Rust
#![feature(transmutability)]
|
|
|
|
use std::mem::{Assume, TransmuteFrom};
|
|
|
|
#[repr(C)]
|
|
struct W<'a>(&'a ());
|
|
|
|
fn test<'a>()
|
|
where
|
|
W<'a>: TransmuteFrom<
|
|
(),
|
|
{ Assume { alignment: true, lifetimes: true, safety: true, validity: true } },
|
|
>,
|
|
{
|
|
}
|
|
|
|
fn main() {
|
|
test();
|
|
//~^ ERROR `()` cannot be safely transmuted into `W<'_>`
|
|
}
|