diff --git a/blog/post/03-set-up-rust.md b/blog/post/03-set-up-rust.md index 3f7b078a..e383d685 100644 --- a/blog/post/03-set-up-rust.md +++ b/blog/post/03-set-up-rust.md @@ -57,7 +57,7 @@ Now we place our root source file in `src/lib.rs`: pub extern fn rust_main() {} #[lang = "eh_personality"] extern fn eh_personality() {} -#[lang = "panic_fmt"] #[no_mangle] extern fn panic_fmt() -> ! {loop{}} +#[lang = "panic_fmt"] #[no_mangle] pub extern fn panic_fmt() -> ! {loop{}} ``` Let's break it down: diff --git a/blog/post/05-allocating-frames.md b/blog/post/05-allocating-frames.md index f6de3ad9..ed2958d3 100644 --- a/blog/post/05-allocating-frames.md +++ b/blog/post/05-allocating-frames.md @@ -104,7 +104,7 @@ We used `expect` in the code above, which will panic if there is no memory map t ```rust #[lang = "panic_fmt"] #[no_mangle] -extern fn panic_fmt() -> ! { +pub extern fn panic_fmt() -> ! { println!("PANIC"); loop{} } @@ -114,7 +114,7 @@ Now we get a `PANIC` message. But we can do even better. The `panic_fmt` functio ```rust #[lang = "panic_fmt"] #[no_mangle] -extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, +pub extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line: u32) -> ! { println!("\n\nPANIC in {} at line {}:", file, line);