1 #![feature(no_core, unboxed_closures)]
5 extern crate mini_core;
13 fn bcd(b: bool, a: u8) -> u8 {
35 fn option_unwrap_or(o: BoolOption, d: bool) -> bool {
37 BoolOption::Some(b) => b,
38 BoolOption::None => d,
46 fn return_str() -> &'static str {
50 fn promoted_val() -> &'static u8 {
54 fn cast_ref_to_raw_ptr(abc: &u8) -> *const u8 {
58 fn cmp_raw_ptr(a: *const u8, b: *const u8) -> bool {
62 fn int_cast(a: u16, b: i16) -> (u8, u16, u32, usize, i8, i16, i32, isize, u8, u32) {
64 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,
69 fn char_cast(c: char) -> u8 {
73 pub struct DebugTuple(());
75 fn debug_tuple() -> DebugTuple {
79 fn size_of<T>() -> usize {
80 intrinsics::size_of::<T>()
83 fn use_size_of() -> usize {
87 unsafe fn use_copy_intrinsic(src: *const u8, dst: *mut u8) {
88 intrinsics::copy::<u8>(src, dst, 1);
91 unsafe fn use_copy_intrinsic_ref(src: *const u8, dst: *mut u8) {
92 let copy2 = &intrinsics::copy::<u8>;
96 const ABC: u8 = 6 * 7;
98 fn use_const() -> u8 {
102 pub fn call_closure_3arg() {
103 (|_, _, _| {})(0u8, 42u16, 0u8)
106 pub fn call_closure_2arg() {
107 (|_, _| {})(0u8, 42u16)
112 impl<'a, 'b> FnOnce<(&'a &'b [u16],)> for IsNotEmpty {
113 type Output = (u8, u8);
116 extern "rust-call" fn call_once(mut self, arg: (&'a &'b [u16],)) -> (u8, u8) {
121 impl<'a, 'b> FnMut<(&'a &'b [u16],)> for IsNotEmpty {
123 extern "rust-call" fn call_mut(&mut self, _arg: (&'a &'b [u16],)) -> (u8, u8) {
128 pub fn call_is_not_empty() {
129 IsNotEmpty.call_once((&(&[0u16] as &[_]),));
132 fn eq_char(a: char, b: char) -> bool {
136 unsafe fn transmute(c: char) -> u32 {
137 intrinsics::transmute(c)
140 unsafe fn call_uninit() -> u8 {
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 {
196 fn i16_as_i8(a: i16) -> i8 {
200 struct Unsized(u8, str);
202 fn get_sized_field_ref_from_unsized_type(u: &Unsized) -> &u8 {
206 fn get_unsized_field_ref_from_unsized_type(u: &Unsized) -> &str {