]>
git.proxmox.com Git - rustc.git/blob - src/test/auxiliary/issue13507.rs
22ccb3dfacdf1285912e6bbab1083ca38e17d73d
1 // Copyright 2012-2014 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.
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.
16 pub fn type_ids() -> Vec
<TypeId
> {
18 ids
.push(TypeId
::of
::<FooNil
>());
19 ids
.push(TypeId
::of
::<FooBool
>());
20 ids
.push(TypeId
::of
::<FooInt
>());
21 ids
.push(TypeId
::of
::<FooUint
>());
22 ids
.push(TypeId
::of
::<FooFloat
>());
23 ids
.push(TypeId
::of
::<FooEnum
>());
24 ids
.push(TypeId
::of
::<FooUniq
>());
25 ids
.push(TypeId
::of
::<FooPtr
>());
26 ids
.push(TypeId
::of
::<&'
static FooTrait
>());
27 ids
.push(TypeId
::of
::<FooStruct
>());
28 ids
.push(TypeId
::of
::<FooTuple
>());
38 pub type FooBool
= bool
;
41 pub type FooChar
= char;
43 // Tests ty_int (does not test all variants of IntTy)
44 pub type FooInt
= isize;
46 // Tests ty_uint (does not test all variants of UintTy)
47 pub type FooUint
= usize;
49 // Tests ty_float (does not test all variants of FloatTy)
50 pub type FooFloat
= f64;
52 // For ty_str, what kind of string should I use? &'static str? String? Raw str?
60 // Tests ty_uniq (of u8)
61 pub type FooUniq
= Box
<u8>;
63 // As with ty_str, what type should be used for ty_vec?
66 pub type FooPtr
= *const u8;
70 // Skipping ty_bare_fn (how do you get a bare function type, rather than proc or closure?)
74 fn foo_method(&self) -> usize;
75 fn foo_static_method() -> usize;
79 pub struct FooStruct
{
80 pub pub_foo_field
: usize,
85 pub type FooTuple
= (u8, i8, bool
);