10 #![allow(unused_attributes)]
11 #![feature(auto_traits, lang_items, no_core, start, intrinsics, track_caller)]
20 // Because we don't have core yet.
28 impl Copy for isize {}
29 impl Copy for *mut i32 {}
30 impl Copy for usize {}
40 pub(crate) unsafe auto trait Freeze {}
42 #[lang = "panic_location"]
43 struct PanicLocation {
52 pub fn puts(s: *const u8) -> i32;
53 pub fn fflush(stream: *mut i32) -> i32;
54 pub fn printf(format: *const i8, ...) -> i32;
56 pub static STDOUT: *mut i32;
61 extern "rust-intrinsic" {
69 pub fn panic(_msg: &str) -> ! {
71 libc::puts("Panicking\0" as *const str as *const u8);
72 libc::fflush(libc::STDOUT);
78 trait Add<RHS = Self> {
81 fn add(self, rhs: RHS) -> Self::Output;
87 fn add(self, rhs: Self) -> Self {
95 fn add(self, rhs: Self) -> Self {
103 fn add(self, rhs: Self) -> Self {
111 fn add(self, rhs: Self) -> Self {
119 fn add(self, rhs: Self) -> Self {
132 fn test(num: isize) -> Test {
138 fn update_num(num: &mut isize) {
143 fn main(mut argc: isize, _argv: *const *const u8) -> isize {
144 let mut test = test(argc);
146 libc::printf(b"%ld\n\0" as *const u8 as *const i8, test.field);
148 update_num(&mut test.field);
150 libc::printf(b"%ld\n\0" as *const u8 as *const i8, test.field);
153 update_num(&mut argc);
155 libc::printf(b"%ld\n\0" as *const u8 as *const i8, argc);
158 let refe = &mut argc;
161 libc::printf(b"%ld\n\0" as *const u8 as *const i8, argc);