rust/tests/ui/unsafe/ranged-ctor-as-fn-ptr.rs
Michael Goulet bf66723c0e Test and note unsafe ctor to fn ptr coercion
Also remove a note that I don't consider to be very useful in context.
2023-08-30 15:09:40 -07:00

11 lines
218 B
Rust

#![feature(rustc_attrs)]
#[derive(Debug)]
#[rustc_layout_scalar_valid_range_start(2)]
struct NonZeroAndOneU8(u8);
fn main() {
let x: fn(u8) -> NonZeroAndOneU8 = NonZeroAndOneU8;
//~^ ERROR mismatched types
}