]>
git.proxmox.com Git - rustc.git/blob - 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.
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.
13 #![feature(lang_items)]
16 pub trait PhantomFn
<A
:?Sized
,R
:?Sized
=()> { }
17 impl<A
:?Sized
, R
:?Sized
, U
:?Sized
> PhantomFn
<A
,R
> for U { }
20 pub trait Sized
: PhantomFn
<Self> {}
23 fn panic(_
: &(&'
static str, &'
static str, usize)) -> ! { loop {}
}
25 #[lang = "stack_exhausted"]
26 extern fn stack_exhausted() {}
28 #[lang = "eh_personality"]
29 extern fn eh_personality() {}
32 pub trait Copy
: PhantomFn
<Self> {
37 pub trait Rem
<RHS
=Self> {
39 fn rem(self, rhs
: RHS
) -> Self::Output
;
46 fn rem(self, other
: isize) -> isize {
47 // if you use `self % other` here, as one would expect, you
48 // get back an error because of potential failure/overflow,
49 // which tries to invoke error fns that don't have the
50 // appropriate signatures anymore. So...just return 0.