I found a very fun Rust bug

348 points Nilstrieb

While investigating an ICE, I found this little bug caused by the same issue.

fn hi() -> impl Sized { std::ptr::null::<u8>() }

fn main() {
    let b: Box<dyn Fn() -> Box<u8>> = Box::new(hi);
    let boxed = b();
    let null = *boxed;  // SIGSEGV
    println!("{null:?}");
}

It can come in very handy if you ever need a transmute in forbid(unsafe_code) (do not do this).