3 use std::boxed::ThinBox;
8 let thin_error: ThinBox<dyn Error> = ThinBox::new_unsize(Foo);
9 assert_eq!(mem::size_of::<*const i32>(), mem::size_of_val(&thin_error));
10 println!("{:?}", thin_error);
12 let thin = ThinBox::new(42i32);
13 assert_eq!(mem::size_of::<*const i32>(), mem::size_of_val(&thin));
14 println!("{:?}", thin);
16 let thin_slice = ThinBox::<[i32]>::new_unsize([1, 2, 3, 4]);
17 assert_eq!(mem::size_of::<*const i32>(), mem::size_of_val(&thin_slice));
18 println!("{:?}", thin_slice);
24 impl fmt::Display for Foo {
25 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {