File tree Expand file tree Collapse file tree 7 files changed +22
-6
lines changed Expand file tree Collapse file tree 7 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,14 @@ impl Mul for u8 {
138138 }
139139}
140140
141+ impl Mul for i32 {
142+ type Output = Self ;
143+
144+ fn mul ( self , rhs : Self ) -> Self :: Output {
145+ self * rhs
146+ }
147+ }
148+
141149impl Mul for usize {
142150 type Output = Self ;
143151
@@ -248,6 +256,14 @@ impl Sub for i16 {
248256 }
249257}
250258
259+ impl Sub for i32 {
260+ type Output = Self ;
261+
262+ fn sub ( self , rhs : Self ) -> Self {
263+ self - rhs
264+ }
265+ }
266+
251267#[ lang = "rem" ]
252268pub trait Rem < RHS = Self > {
253269 type Output ;
Original file line number Diff line number Diff line change 33// Run-time:
44// status: signal
55
6- #![ feature( no_core, start ) ]
6+ #![ feature( no_core) ]
77#![ no_std]
88#![ no_core]
99#![ no_main]
Original file line number Diff line number Diff line change 33// Run-time:
44// status: signal
55
6- #![ feature( no_core, start ) ]
6+ #![ feature( no_core) ]
77#![ no_std]
88#![ no_core]
99#![ no_main]
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ fn inc(num: isize) -> isize {
2323}
2424
2525#[ no_mangle]
26- extern "C" fn main ( mut argc : i32 , _argv : * const * const u8 ) -> i32 {
26+ extern "C" fn main ( mut argc : isize , _argv : * const * const u8 ) -> i32 {
2727 argc = inc ( argc) ;
2828 unsafe {
2929 libc:: printf ( b"%ld\n \0 " as * const u8 as * const i8 , argc) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ extern crate mini_core;
1717use mini_core:: * ;
1818
1919#[ no_mangle]
20- extern "C" fn main ( argc : i32 , _argv : * const * const u8 ) -> i32 {
20+ extern "C" fn main ( argc : isize , _argv : * const * const u8 ) -> i32 {
2121 let string = "Arg: %d\n \0 " ;
2222 let mut closure = || unsafe {
2323 libc:: printf ( string as * const str as * const i8 , argc) ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ fn update_num(num: &mut isize) {
2727}
2828
2929#[ no_mangle]
30- extern "C" fn main ( argc : i32 , _argv : * const * const u8 ) -> i32 {
30+ extern "C" fn main ( mut argc : isize , _argv : * const * const u8 ) -> i32 {
3131 let mut test = test ( argc) ;
3232 unsafe {
3333 libc:: printf ( b"%ld\n \0 " as * const u8 as * const i8 , test. field ) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ static mut TEST2: Test = Test { field: 14 };
3434static mut WITH_REF : WithRef = WithRef { refe : unsafe { & TEST } } ;
3535
3636#[ no_mangle]
37- extern "C" fn main ( argc : i32 , _argv : * const * const u8 ) -> i32 {
37+ extern "C" fn main ( argc : isize , _argv : * const * const u8 ) -> i32 {
3838 unsafe {
3939 libc:: printf ( b"%ld\n \0 " as * const u8 as * const i8 , CONSTANT ) ;
4040 libc:: printf ( b"%ld\n \0 " as * const u8 as * const i8 , TEST2 . field ) ;
You can’t perform that action at this time.
0 commit comments