//@ 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 { #[inline(always)] fn drop(&mut self) { dealloc(self.0.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 }