#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::any::{Any, TypeId}; fn main() { let boxed: Box = Box::new(3_i32); let actual_id = (&*boxed).type_id(); let boxed_id = boxed.type_id(); assert_eq!(actual_id, TypeId::of::< i32 > ()); assert_eq!(boxed_id, TypeId::of::< Box < dyn Any >> ()); }