1 #![feature(no_core, unboxed_closures)]
5 extern crate mini_core;
13 fn bcd(b: bool, a: u8) -> u8 {
21 // FIXME make calls work
37 fn option_unwrap_or(o: BoolOption, d: bool) -> bool {
39 BoolOption::Some(b) => b,
40 BoolOption::None => d,
49 fn return_str() -> &'static str {
53 fn promoted_val() -> &'static u8 {
57 fn cast_ref_to_raw_ptr(abc: &u8) -> *const u8 {
61 fn cmp_raw_ptr(a: *const u8, b: *const u8) -> bool {
65 /*fn int_cast(a: u16, b: i16) -> (u8, u16, u32, usize, i8, i16, i32, isize, u8, u32) {
67 a as u8, a as u16, a as u32, a as usize, a as i8, a as i16, a as i32, a as isize, b as u8,
72 fn char_cast(c: char) -> u8 {
76 struct DebugTuple(());
78 fn debug_tuple() -> DebugTuple {
82 fn size_of<T>() -> usize {
83 unsafe { intrinsics::size_of::<T>() }
86 fn use_size_of() -> usize {
90 /*unsafe fn use_copy_intrinsic(src: *const u8, dst: *mut u8) {
91 intrinsics::copy::<u8>(src, dst, 1);
94 /*unsafe fn use_copy_intrinsic_ref(src: *const u8, dst: *mut u8) {
95 let copy2 = ©::<u8>;
99 const Abc: u8 = 6 * 7;
101 fn use_const() -> u8 {
105 fn call_closure_3arg() {
106 (|_, _, _| {})(0u8, 42u16, 0u8)
109 fn call_closure_2arg() {
110 (|_, _| {})(0u8, 42u16)
115 impl<'a, 'b> FnOnce<(&'a &'b [u16],)> for IsNotEmpty {
119 extern "rust-call" fn call_once(mut self, arg: (&'a &'b [u16],)) -> bool {
124 impl<'a, 'b> FnMut<(&'a &'b [u16],)> for IsNotEmpty {
126 extern "rust-call" fn call_mut(&mut self, arg: (&'a &'b [u16],)) -> bool {
131 fn eq_char(a: char, b: char) -> bool {
135 unsafe fn transmute(c: char) -> u32 {
136 intrinsics::transmute(c)
139 unsafe fn call_uninit() -> u8 {
143 // TODO: enable when fat pointers are supported
144 unsafe fn deref_str_ptr(s: *const str) -> &'static str {
148 fn use_array(arr: [u8; 3]) -> u8 {
152 fn repeat_array() -> [u8; 3] {
156 fn array_as_slice(arr: &[u8; 3]) -> &[u8] {
160 /*unsafe fn use_ctlz_nonzero(a: u16) -> u16 {
161 intrinsics::ctlz_nonzero(a)
164 fn ptr_as_usize(ptr: *const u8) -> usize {
168 fn float_cast(a: f32, b: f64) -> (f64, f32) {
172 /*fn int_to_float(a: u8, b: i32) -> (f64, f32) {
176 fn make_array() -> [u8; 3] {
180 fn some_promoted_tuple() -> &'static (&'static str, &'static str) {
184 fn index_slice(s: &[u8]) -> u8 {
188 pub struct StrWrapper {
192 fn str_wrapper_get(w: &StrWrapper) -> &str {