rust/tests/ui/transmutability/region-infer.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
417 B
Rust
Raw Normal View History

#![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<'_>`
}