// build-pass // compile-flags: -Z mir-opt-level=4 #![crate_type = "lib"] #![feature(lang_items)] #![no_std] struct NonNull(*const T); struct Unique(NonNull); #[lang = "owned_box"] pub struct Box(Unique); impl Drop for Box { fn drop(&mut self) {} } #[lang = "box_free"] #[inline(always)] unsafe fn box_free(ptr: Unique) { dealloc(ptr.0.0) } #[inline(never)] fn dealloc(_: *const T) {} pub struct Foo(T); pub fn foo(a: Option>>) -> usize { let f = match a { None => Foo(0), Some(vec) => *vec, }; f.0 }