File tree 7 files changed +22
-6
lines changed
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 {
138
138
}
139
139
}
140
140
141
+ impl Mul for i32 {
142
+ type Output = Self ;
143
+
144
+ fn mul ( self , rhs : Self ) -> Self :: Output {
145
+ self * rhs
146
+ }
147
+ }
148
+
141
149
impl Mul for usize {
142
150
type Output = Self ;
143
151
@@ -248,6 +256,14 @@ impl Sub for i16 {
248
256
}
249
257
}
250
258
259
+ impl Sub for i32 {
260
+ type Output = Self ;
261
+
262
+ fn sub ( self , rhs : Self ) -> Self {
263
+ self - rhs
264
+ }
265
+ }
266
+
251
267
#[ lang = "rem" ]
252
268
pub trait Rem < RHS = Self > {
253
269
type Output ;
Original file line number Diff line number Diff line change 3
3
// Run-time:
4
4
// status: signal
5
5
6
- #![ feature( no_core, start ) ]
6
+ #![ feature( no_core) ]
7
7
#![ no_std]
8
8
#![ no_core]
9
9
#![ no_main]
Original file line number Diff line number Diff line change 3
3
// Run-time:
4
4
// status: signal
5
5
6
- #![ feature( no_core, start ) ]
6
+ #![ feature( no_core) ]
7
7
#![ no_std]
8
8
#![ no_core]
9
9
#![ no_main]
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ fn inc(num: isize) -> isize {
23
23
}
24
24
25
25
#[ 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 {
27
27
argc = inc ( argc) ;
28
28
unsafe {
29
29
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;
17
17
use mini_core:: * ;
18
18
19
19
#[ 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 {
21
21
let string = "Arg: %d\n \0 " ;
22
22
let mut closure = || unsafe {
23
23
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) {
27
27
}
28
28
29
29
#[ 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 {
31
31
let mut test = test ( argc) ;
32
32
unsafe {
33
33
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 };
34
34
static mut WITH_REF : WithRef = WithRef { refe : unsafe { & TEST } } ;
35
35
36
36
#[ 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 {
38
38
unsafe {
39
39
libc:: printf ( b"%ld\n \0 " as * const u8 as * const i8 , CONSTANT ) ;
40
40
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