about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2016-03-30 10:16:54 -0700
committerSteve Klabnik <steve@steveklabnik.com>2016-03-30 10:16:54 -0700
commit6f885c3c15656c70aaff4ddfc8cb84d33f7115ac (patch)
treefadc770a9dfec8127a9c6ab9d63e9e4c1a7bc16f
parent9f403abba28b3a36dcaae197b294105004e32a55 (diff)
parente9b1c3ccb5fbae3d61d4ba0c1d650763dcda3923 (diff)
downloadrust-6f885c3c15656c70aaff4ddfc8cb84d33f7115ac.tar.gz
rust-6f885c3c15656c70aaff4ddfc8cb84d33f7115ac.zip
Rollup merge of #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.
-rw-r--r--src/doc/book/no-stdlib.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/book/no-stdlib.md b/src/doc/book/no-stdlib.md
index 610940cde95..43bd0507ebb 100644
--- a/src/doc/book/no-stdlib.md
+++ b/src/doc/book/no-stdlib.md
@@ -38,7 +38,7 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize {
 // for a bare-bones hello world. These are normally
 // provided by libstd.
 #[lang = "eh_personality"] extern fn eh_personality() {}
-#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
+#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
 # #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
 # #[no_mangle] pub extern fn rust_eh_register_frames () {}
 # #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -65,7 +65,7 @@ pub extern fn main(argc: i32, argv: *const *const u8) -> i32 {
 }
 
 #[lang = "eh_personality"] extern fn eh_personality() {}
-#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
+#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
 # #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
 # #[no_mangle] pub extern fn rust_eh_register_frames () {}
 # #[no_mangle] pub extern fn rust_eh_unregister_frames () {}