8 #![allow(unused_attributes)]
9 #![feature(auto_traits, lang_items, no_core, start, intrinsics, track_caller)]
18 // Because we don't have core yet.
26 impl Copy for isize {}
27 impl Copy for *mut i32 {}
28 impl Copy for usize {}
38 pub(crate) unsafe auto trait Freeze {}
40 #[lang = "panic_location"]
41 struct PanicLocation {
50 pub fn puts(s: *const u8) -> i32;
51 pub fn fflush(stream: *mut i32) -> i32;
52 pub fn printf(format: *const i8, ...) -> i32;
54 pub static STDOUT: *mut i32;
59 extern "rust-intrinsic" {
67 pub fn panic(_msg: &str) -> ! {
69 libc::puts("Panicking\0" as *const str as *const u8);
70 libc::fflush(libc::STDOUT);
76 trait Add<RHS = Self> {
79 fn add(self, rhs: RHS) -> Self::Output;
85 fn add(self, rhs: Self) -> Self {
93 fn add(self, rhs: Self) -> Self {
101 fn add(self, rhs: Self) -> Self {
109 fn add(self, rhs: Self) -> Self {
117 fn add(self, rhs: Self) -> Self {
126 fn inc_ref(num: &mut isize) -> isize {
131 fn inc(num: isize) -> isize {
137 fn main(mut argc: isize, _argv: *const *const u8) -> isize {
140 libc::printf(b"%ld\n\0" as *const u8 as *const i8, argc);
143 let b = inc_ref(&mut argc);
145 libc::printf(b"%ld %ld\n\0" as *const u8 as *const i8, argc, b);
150 libc::printf(b"%ld\n\0" as *const u8 as *const i8, argc);