]> git.proxmox.com Git - rustc.git/blame - src/test/auxiliary/typeid-intrinsic.rs
Imported Upstream version 1.8.0+dfsg1
[rustc.git] / src / test / auxiliary / typeid-intrinsic.rs
CommitLineData
1a4d82fc
JJ
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
c34b1796
AL
11#![feature(core)]
12
13use std::any::{Any, TypeId};
1a4d82fc
JJ
14
15pub struct A;
16pub struct B(Option<A>);
c34b1796 17pub struct C(Option<isize>);
1a4d82fc 18pub struct D(Option<&'static str>);
c34b1796 19pub struct E(Result<&'static str, isize>);
1a4d82fc 20
c34b1796
AL
21pub type F = Option<isize>;
22pub type G = usize;
1a4d82fc
JJ
23pub type H = &'static str;
24
85aaf69f
SL
25pub unsafe fn id_A() -> TypeId { TypeId::of::<A>() }
26pub unsafe fn id_B() -> TypeId { TypeId::of::<B>() }
27pub unsafe fn id_C() -> TypeId { TypeId::of::<C>() }
28pub unsafe fn id_D() -> TypeId { TypeId::of::<D>() }
29pub unsafe fn id_E() -> TypeId { TypeId::of::<E>() }
30pub unsafe fn id_F() -> TypeId { TypeId::of::<F>() }
31pub unsafe fn id_G() -> TypeId { TypeId::of::<G>() }
32pub unsafe fn id_H() -> TypeId { TypeId::of::<H>() }
1a4d82fc 33
c34b1796 34pub unsafe fn foo<T: Any>() -> TypeId { TypeId::of::<T>() }