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
17 lines
363 B
Rust
17 lines
363 B
Rust
//@ check-pass
|
|
#![crate_type = "lib"]
|
|
#![feature(transmutability)]
|
|
use std::mem::BikeshedIntrinsicFrom;
|
|
|
|
pub fn is_maybe_transmutable<Src, Dst>()
|
|
where
|
|
Dst: BikeshedIntrinsicFrom<Src>,
|
|
{
|
|
}
|
|
|
|
// The `T` here should not have any effect on checking
|
|
// if transmutability is allowed or not.
|
|
fn function_with_generic<T>() {
|
|
is_maybe_transmutable::<(), ()>();
|
|
}
|