Skip to content

Commit 6f885c3

Browse files
committed
Rollup merge of rust-lang#32591 - CryZe:patch-1, r=steveklabnik
Fix panic_fmt in the Book While implementing panic_fmt for the GameCube I noticed that the parameters given to it were completely broken. Turns out that panic_fmt requires the C ABI to work correctly. This should be fixed in the documentation, so that others don't make the same mistake. Thanks to mbrubeck in the IRC for helping me figure this out. Not specifying extern for lang_items correctly should potentially also be a compiler error.
2 parents 9f403ab + e9b1c3c commit 6f885c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/book/no-stdlib.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize {
3838
// for a bare-bones hello world. These are normally
3939
// provided by libstd.
4040
#[lang = "eh_personality"] extern fn eh_personality() {}
41-
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
41+
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
4242
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
4343
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
4444
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -65,7 +65,7 @@ pub extern fn main(argc: i32, argv: *const *const u8) -> i32 {
6565
}
6666

6767
#[lang = "eh_personality"] extern fn eh_personality() {}
68-
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
68+
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
6969
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
7070
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
7171
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}

0 commit comments

Comments
 (0)