We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f6f6050 + fe02bb5 commit 0f97fc8Copy full SHA for 0f97fc8
core/tests/any.rs
@@ -131,6 +131,24 @@ fn distinct_type_names() {
131
assert_ne!(type_name_of_val(Velocity), type_name_of_val(Velocity(0.0, -9.8)),);
132
}
133
134
+#[cfg(not(bootstrap))]
135
+#[test]
136
+fn dyn_type_name() {
137
+ trait Foo {
138
+ type Bar;
139
+ }
140
+
141
+ assert_eq!(
142
+ "dyn core::ops::function::Fn(i32, i32) -> i32",
143
+ std::any::type_name::<dyn Fn(i32, i32) -> i32>()
144
+ );
145
146
+ "dyn coretests::any::dyn_type_name::Foo<Bar = i32> \
147
+ + core::marker::Send + core::marker::Sync",
148
+ std::any::type_name::<dyn Foo<Bar = i32> + Send + Sync>()
149
150
+}
151
152
// Test the `Provider` API.
153
154
struct SomeConcreteType {
0 commit comments