File: typeid-intrinsic-aux2.rs

package info (click to toggle)
rustc 1.85.0%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 893,176 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (29 lines) | stat: -rw-r--r-- 967 bytes parent folder | download | duplicates (46)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use std::any::{Any, TypeId};

pub struct A;
pub struct B(Option<A>);
pub struct C(Option<isize>);
pub struct D(Option<&'static str>);
pub struct E(Result<&'static str, isize>);

pub type F = Option<isize>;
pub type G = usize;
pub type H = &'static str;
pub type I = Box<Fn()>;
pub type I32Iterator = Iterator<Item=i32>;
pub type U32Iterator = Iterator<Item=u32>;

pub fn id_A() -> TypeId { TypeId::of::<A>() }
pub fn id_B() -> TypeId { TypeId::of::<B>() }
pub fn id_C() -> TypeId { TypeId::of::<C>() }
pub fn id_D() -> TypeId { TypeId::of::<D>() }
pub fn id_E() -> TypeId { TypeId::of::<E>() }
pub fn id_F() -> TypeId { TypeId::of::<F>() }
pub fn id_G() -> TypeId { TypeId::of::<G>() }
pub fn id_H() -> TypeId { TypeId::of::<H>() }
pub fn id_I() -> TypeId { TypeId::of::<I>() }

pub fn foo<T: Any>() -> TypeId { TypeId::of::<T>() }

pub fn id_i32_iterator() -> TypeId { TypeId::of::<I32Iterator>() }
pub fn id_u32_iterator() -> TypeId { TypeId::of::<U32Iterator>() }