-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add fn type_name_of_val #65961
add fn type_name_of_val #65961
Conversation
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
One alternative is |
Ping from Triage: any updates @shepmaster @lcnr? |
Pinging again from triage: Thanks! |
This seems reasonable enough to add an unstable method. Would you open a tracking issue and update the attribute to refer to it? |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Great! Now, please squash the commits and we can merge! |
@bors r+ rollup |
📌 Commit 985e663 has been approved by |
add fn type_name_of_val This function is often useful during testing and mirrors `align_of_val` and `size_of_val`. # Example Showing the default type of integers. ```rust let x = 7; println!("per default, integers have the type: {}", std::any::type_name_of_val(&x)); ``` To my knowledge this can currently not be done without defining a function similar to `type_name_of_val`.
This function is often useful during testing and mirrors
align_of_val
andsize_of_val
.Example
Showing the default type of integers.
To my knowledge this can currently not be done without defining a function similar to
type_name_of_val
.