]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/auxiliary/typeid-intrinsic-aux1.rs
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
[rust.git] / src / test / run-pass / auxiliary / typeid-intrinsic-aux1.rs
1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 use std::any::{Any, TypeId};
12
13 pub struct A;
14 pub struct B(Option<A>);
15 pub struct C(Option<isize>);
16 pub struct D(Option<&'static str>);
17 pub struct E(Result<&'static str, isize>);
18
19 pub type F = Option<isize>;
20 pub type G = usize;
21 pub type H = &'static str;
22 pub type I = Box<Fn()>;
23 pub type I32Iterator = Iterator<Item=i32>;
24 pub type U32Iterator = Iterator<Item=u32>;
25
26 pub fn id_A() -> TypeId { TypeId::of::<A>() }
27 pub fn id_B() -> TypeId { TypeId::of::<B>() }
28 pub fn id_C() -> TypeId { TypeId::of::<C>() }
29 pub fn id_D() -> TypeId { TypeId::of::<D>() }
30 pub fn id_E() -> TypeId { TypeId::of::<E>() }
31 pub fn id_F() -> TypeId { TypeId::of::<F>() }
32 pub fn id_G() -> TypeId { TypeId::of::<G>() }
33 pub fn id_H() -> TypeId { TypeId::of::<H>() }
34 pub fn id_I() -> TypeId { TypeId::of::<I>() }
35
36 pub fn foo<T: Any>() -> TypeId { TypeId::of::<T>() }
37
38 pub fn id_i32_iterator() -> TypeId { TypeId::of::<I32Iterator>() }
39 pub fn id_u32_iterator() -> TypeId { TypeId::of::<U32Iterator>() }