4 #![feature(const_type_name)]
7 const fn type_name_wrapper<T>(_: &T) -> &'static str {
8 std::any::type_name::<T>()
11 struct Struct<TA, TB, TC> {
17 type StructInstantiation = Struct<i8, f64, bool>;
19 const CONST_STRUCT: StructInstantiation = StructInstantiation { a: 12, b: 13.7, c: false };
21 const CONST_STRUCT_NAME: &'static str = type_name_wrapper(&CONST_STRUCT);
24 let non_const_struct = StructInstantiation { a: 87, b: 65.99, c: true };
26 let non_const_struct_name = type_name_wrapper(&non_const_struct);
28 assert_eq!(CONST_STRUCT_NAME, non_const_struct_name);