mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
23ab1bda92
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
21 lines
376 B
Rust
21 lines
376 B
Rust
#![feature(transmutability)]
|
|
|
|
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
|
|
|
#[repr(C)]
|
|
struct W<'a>(&'a ());
|
|
|
|
fn test<'a>()
|
|
where
|
|
W<'a>: BikeshedIntrinsicFrom<
|
|
(),
|
|
{ Assume { alignment: true, lifetimes: true, safety: true, validity: true } },
|
|
>,
|
|
{
|
|
}
|
|
|
|
fn main() {
|
|
test();
|
|
//~^ ERROR `()` cannot be safely transmuted into `W<'_>`
|
|
}
|