23ab1bda92
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
20 lines
465 B
Rust
20 lines
465 B
Rust
// An unknown source type should be gracefully handled.
|
|
|
|
#![crate_type = "lib"]
|
|
#![feature(transmutability)]
|
|
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
|
|
|
mod assert {
|
|
use std::mem::BikeshedIntrinsicFrom;
|
|
|
|
pub fn is_transmutable<Src, Dst>()
|
|
where
|
|
Dst: BikeshedIntrinsicFrom<Src>
|
|
{}
|
|
}
|
|
|
|
fn should_gracefully_handle_unknown_src() {
|
|
#[repr(C)] struct Dst;
|
|
assert::is_transmutable::<Src, Dst>(); //~ cannot find type
|
|
}
|