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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
pub mod testtypes {
use std::any::TypeId;
pub fn type_ids() -> Vec<TypeId> {
vec![
TypeId::of::<FooBool>(),
TypeId::of::<FooInt>(),
TypeId::of::<FooUint>(),
TypeId::of::<FooFloat>(),
TypeId::of::<FooStr>(),
TypeId::of::<FooArray>(),
TypeId::of::<FooSlice>(),
TypeId::of::<FooBox>(),
TypeId::of::<FooPtr>(),
TypeId::of::<FooRef>(),
TypeId::of::<FooFnPtr>(),
TypeId::of::<FooNil>(),
TypeId::of::<FooTuple>(),
TypeId::of::<FooTrait>(),
TypeId::of::<FooStruct>(),
TypeId::of::<FooEnum>()
]
}
// Tests Bool
pub type FooBool = bool;
// Tests Char
pub type FooChar = char;
// Tests Int (does not test all variants of IntTy)
pub type FooInt = isize;
// Tests Uint (does not test all variants of UintTy)
pub type FooUint = usize;
// Tests Float (does not test all variants of FloatTy)
pub type FooFloat = f64;
// Tests Str
pub type FooStr = str;
// Tests Array
pub type FooArray = [u8; 1];
// Tests Slice
pub type FooSlice = [u8];
// Tests Box (of u8)
pub type FooBox = Box<u8>;
// Tests RawPtr
pub type FooPtr = *const u8;
// Tests Ref
pub type FooRef = &'static u8;
// Tests FnPtr
pub type FooFnPtr = fn(u8) -> bool;
// Tests Dynamic
pub trait FooTrait {
fn foo_method(&self) -> usize;
}
// Tests struct
pub struct FooStruct {
pub pub_foo_field: usize,
foo_field: usize
}
// Tests enum
pub enum FooEnum {
VarA(usize),
VarB(usize, usize)
}
// Tests Tuple
pub type FooNil = ();
pub type FooTuple = (u8, i8, bool);
// Skipping Param
// Skipping Infer
// Skipping Error
}
|