@@ -18,24 +18,24 @@ macro_rules! check {
18
18
} ;
19
19
}
20
20
21
+ /// Tests that [`std::any::type_name`] supports unsized types.
21
22
#[ test]
22
- fn issue_21058 ( ) {
23
- // type_name should support unsized types
23
+ fn type_name_unsized ( ) {
24
24
check ! ( [ u8 ] , "[u8]" ) ;
25
25
check ! ( str , "str" ) ;
26
26
check ! ( dyn Send , "dyn core::marker::Send" ) ;
27
- check ! ( NT , "issue_21058 ::NT" ) ;
28
- check ! ( DST , "issue_21058 ::DST" ) ;
27
+ check ! ( NT , "type_name_unsized ::NT" ) ;
28
+ check ! ( DST , "type_name_unsized ::DST" ) ;
29
29
check ! ( & i32 , "&i32" ) ;
30
30
check ! ( & ' static i32 , "&i32" ) ;
31
31
check ! ( ( i32 , u32 ) , "(i32, u32)" ) ;
32
- check ! ( val: foo( ) , "issue_21058 ::Foo" ) ;
33
- check ! ( val: Foo :: new, "issue_21058 ::Foo::new" ) ;
32
+ check ! ( val: foo( ) , "type_name_unsized ::Foo" ) ;
33
+ check ! ( val: Foo :: new, "type_name_unsized ::Foo::new" ) ;
34
34
check ! ( val:
35
35
<Foo as Debug >:: fmt,
36
- "<issue_21058 ::Foo as core::fmt::Debug>::fmt"
36
+ "<type_name_unsized ::Foo as core::fmt::Debug>::fmt"
37
37
) ;
38
- check ! ( val: || { } , "issue_21058::issue_21058 ::{{closure}}" ) ;
38
+ check ! ( val: || { } , "type_name_unsized::type_name_unsized ::{{closure}}" ) ;
39
39
bar :: < i32 > ( ) ;
40
40
}
41
41
0 commit comments