]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-21058.rs
7 struct DST { a: u32, b: str }
10 (val
: $ty_of
:expr
, $expected
:expr
) => {
11 assert_eq
!(type_name_of_val($ty_of
), $expected
);
13 ($ty
:ty
, $expected
:expr
) => {
14 assert_eq
!(std
::any
::type_name
::<$ty
>(), $expected
);
19 // type_name should support unsized types
22 check
!(dyn Send
, "dyn core::marker::Send");
23 check
!(NT
, "issue_21058::NT");
24 check
!(DST
, "issue_21058::DST");
26 check
!(&'
static i32, "&i32");
27 check
!((i32, u32), "(i32, u32)");
28 check
!(val
: foo(), "issue_21058::Foo");
29 check
!(val
: Foo
::new
, "issue_21058::Foo::new");
32 "<issue_21058::Foo as core::fmt::Debug>::fmt"
34 check
!(val
: || {}
, "issue_21058::main::{{closure}}");
47 check
!(T
::Assoc
, "alloc::string::String");
51 fn type_name_of_val
<T
>(_
: T
) -> &'
static str {
52 std
::any
::type_name
::<T
>()
59 fn new() -> Self { Foo }
62 fn foo() -> impl Debug
{