]> git.proxmox.com Git - rustc.git/blob - src/test/auxiliary/lang-item-public.rs
b9cc20b63cc5640258ac6bc70afde33440a6d24a
[rustc.git] / src / test / auxiliary / lang-item-public.rs
1 // Copyright 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.
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 #![feature(no_std)]
12 #![no_std]
13 #![feature(lang_items)]
14
15 #[lang="phantom_fn"]
16 pub trait PhantomFn<A:?Sized,R:?Sized=()> { }
17 impl<A:?Sized, R:?Sized, U:?Sized> PhantomFn<A,R> for U { }
18
19 #[lang="sized"]
20 pub trait Sized : PhantomFn<Self> {}
21
22 #[lang="panic"]
23 fn panic(_: &(&'static str, &'static str, uint)) -> ! { loop {} }
24
25 #[lang = "stack_exhausted"]
26 extern fn stack_exhausted() {}
27
28 #[lang = "eh_personality"]
29 extern fn eh_personality() {}
30
31 #[lang="copy"]
32 pub trait Copy : PhantomFn<Self> {
33 // Empty.
34 }
35
36