Skip to content

Commit 51d0779

Browse files
committed
Use the correct return type for puts
1 parent 9f602bf commit 51d0779

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

example/alloc_example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static ALLOC: System = System;
1313

1414
#[link(name = "c")]
1515
extern "C" {
16-
fn puts(s: *const u8);
16+
fn puts(s: *const u8) -> i32;
1717
}
1818

1919
#[panic_handler]

example/mini_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ pub mod intrinsics {
488488
pub mod libc {
489489
#[link(name = "c")]
490490
extern "C" {
491-
pub fn puts(s: *const u8);
491+
pub fn puts(s: *const u8) -> i32;
492492
pub fn printf(format: *const i8, ...) -> i32;
493493
pub fn malloc(size: usize) -> *mut u8;
494494
pub fn free(ptr: *mut u8);

src/trap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, impl cranelift_module::Backend>, ms
1212
&Signature {
1313
call_conv: CallConv::triple_default(fx.triple()),
1414
params: vec![AbiParam::new(pointer_ty(fx.tcx))],
15-
returns: vec![],
15+
returns: vec![AbiParam::new(types::I32)],
1616
},
1717
)
1818
.unwrap();

0 commit comments

Comments
 (0)