Skip to content

Commit 1a5964f

Browse files
committed
Fix tests
1 parent 0e41f49 commit 1a5964f

File tree

7 files changed

+22
-6
lines changed

7 files changed

+22
-6
lines changed

example/mini_core.rs

+16
Original file line numberDiff line numberDiff 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+
141149
impl 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"]
252268
pub trait Rem<RHS = Self> {
253269
type Output;

tests/run/abort1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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]

tests/run/abort2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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]

tests/run/assign.rs

+1-1
Original file line numberDiff line numberDiff 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);

tests/run/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern crate mini_core;
1717
use 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);

tests/run/mut_ref.rs

+1-1
Original file line numberDiff line numberDiff 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);

tests/run/static.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static mut TEST2: Test = Test { field: 14 };
3434
static 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);

0 commit comments

Comments
 (0)