7 #![allow(unused_attributes)]
8 #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
17 // Because we don't have core yet.
25 impl Copy for isize {}
26 impl Copy for *mut i32 {}
27 impl Copy for usize {}
37 pub(crate) unsafe auto trait Freeze {}
39 #[lang = "panic_location"]
40 struct PanicLocation {
49 pub fn puts(s: *const u8) -> i32;
50 pub fn fflush(stream: *mut i32) -> i32;
52 pub static stdout: *mut i32;
57 extern "rust-intrinsic" {
65 pub fn panic(_msg: &str) -> ! {
67 // Panicking is expected iff overflow checking is enabled.
68 #[cfg(debug_assertions)]
69 libc::puts("Success\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 {
127 fn main(mut argc: isize, _argv: *const *const u8) -> isize {
128 let int = 9223372036854775807isize;
129 let int = int + argc; // overflow
131 // If overflow checking is disabled, we should reach here.
132 #[cfg(not(debug_assertions))]
134 libc::puts("Success\0" as *const str as *const u8);
135 libc::fflush(libc::stdout);