diff options
Diffstat (limited to 'tests/ui/issues/auxiliary/issue-13507.rs')
-rw-r--r-- | tests/ui/issues/auxiliary/issue-13507.rs | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/ui/issues/auxiliary/issue-13507.rs b/tests/ui/issues/auxiliary/issue-13507.rs new file mode 100644 index 000000000..c91013043 --- /dev/null +++ b/tests/ui/issues/auxiliary/issue-13507.rs @@ -0,0 +1,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 +} |