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_valandsize_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.