We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32ee368 commit e3b19e5Copy full SHA for e3b19e5
1 file changed
library/core/tests/any.rs
@@ -114,3 +114,16 @@ fn any_unsized() {
114
fn is_any<T: Any + ?Sized>() {}
115
is_any::<[i32]>();
116
}
117
+
118
+#[test]
119
+fn distinct_type_names() {
120
+ // https://github.com/rust-lang/rust/issues/84666
121
122
+ struct Velocity(f32, f32);
123
124
+ fn type_name_of_val<T>(_: T) -> &'static str {
125
+ type_name::<T>()
126
+ }
127
128
+ assert_ne!(type_name_of_val(Velocity), type_name_of_val(Velocity(0.0, -9.8)),);
129
+}
0 commit comments