]> git.lizzy.rs Git - rust.git/blob - src/test/ui/auxiliary/typeid-intrinsic-aux2.rs
Auto merge of #91094 - inquisitivecrystal:rustdoc-top-mod, r=jyn514
[rust.git] / src / test / ui / auxiliary / typeid-intrinsic-aux2.rs
1 use std::any::{Any, TypeId};
2
3 pub struct A;
4 pub struct B(Option<A>);
5 pub struct C(Option<isize>);
6 pub struct D(Option<&'static str>);
7 pub struct E(Result<&'static str, isize>);
8
9 pub type F = Option<isize>;
10 pub type G = usize;
11 pub type H = &'static str;
12 pub type I = Box<Fn()>;
13 pub type I32Iterator = Iterator<Item=i32>;
14 pub type U32Iterator = Iterator<Item=u32>;
15
16 pub fn id_A() -> TypeId { TypeId::of::<A>() }
17 pub fn id_B() -> TypeId { TypeId::of::<B>() }
18 pub fn id_C() -> TypeId { TypeId::of::<C>() }
19 pub fn id_D() -> TypeId { TypeId::of::<D>() }
20 pub fn id_E() -> TypeId { TypeId::of::<E>() }
21 pub fn id_F() -> TypeId { TypeId::of::<F>() }
22 pub fn id_G() -> TypeId { TypeId::of::<G>() }
23 pub fn id_H() -> TypeId { TypeId::of::<H>() }
24 pub fn id_I() -> TypeId { TypeId::of::<I>() }
25
26 pub fn foo<T: Any>() -> TypeId { TypeId::of::<T>() }
27
28 pub fn id_i32_iterator() -> TypeId { TypeId::of::<I32Iterator>() }
29 pub fn id_u32_iterator() -> TypeId { TypeId::of::<U32Iterator>() }