type-name 0.1.0

A safe wrapper around the type_name API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! A safe wrapper around the `type_name` API.

#![no_std]
#![feature(core_intrinsics)]

use core::intrinsics;

/// Get the type name of `T`.
pub fn get<T>() -> &'static str {
    unsafe {
        intrinsics::type_name::<T>()
    }
}