Skip to content

Commit e0ec311

Browse files
authored
Merge pull request #190 from KeenS/1.9-no-stdlib
6.3 No Stdlib (1.9)
2 parents 5d6f91b + 1844fb1 commit e0ec311

File tree

2 files changed

+11
-50
lines changed

2 files changed

+11
-50
lines changed

1.9/ja/book/no-stdlib.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize {
4747
// これらの関数とトレイトは必要最小限のhello worldのようなプログラムが
4848
// 使うのではなく、コンパイラが使います。通常これらはlibstdにより提供されます。
4949
#[lang = "eh_personality"] extern fn eh_personality() {}
50-
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
50+
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
5151
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
5252
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
5353
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -77,7 +77,7 @@ pub extern fn main(argc: i32, argv: *const *const u8) -> i32 {
7777
}
7878

7979
#[lang = "eh_personality"] extern fn eh_personality() {}
80-
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
80+
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
8181
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
8282
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
8383
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -90,11 +90,12 @@ pub extern fn main(argc: i32, argv: *const *const u8) -> i32 {
9090
<!-- library, but without it you must define your own. -->
9191
今のところ、コンパイラは実行可能形式においていくつかのシンボルが呼び出し可能であるという前提を置いています。通常、これらの関数は標準ライブラリが提供しますが、それを使わない場合自分で定義しなければなりません。
9292

93-
<!-- The first of these two functions, `eh_personality`, is used by the -->
94-
<!-- failure mechanisms of the compiler. This is often mapped to GCC's -->
95-
<!-- personality function (see the -->
96-
<!-- [libstd implementation](../std/rt/unwind/index.html) for more -->
97-
<!-- information), but crates which do not trigger a panic can be assured -->
98-
<!-- that this function is never called. The second function, `panic_fmt`, is -->
99-
<!-- also used by the failure mechanisms of the compiler. -->
100-
2つある関数のうち1つ目は `eh_personality` で、コンパイラの失敗メカニズムに使われます。これはしばしばGCCのpersonality関数に割り当てられますが(詳細は[libstd実装](../std/rt/unwind/index.html)を参照してください)、パニックを発生させないクレートではこの関数は呼ばれないことが保証されています。2つ目の関数は `panic_fmt` で、こちらもコンパイラの失敗メカニズムのために使われます。
93+
<!-- The first of these two functions, `eh_personality`, is used by the failure -->
94+
<!-- mechanisms of the compiler. This is often mapped to GCC's personality function -->
95+
<!-- (see the [libstd implementation][unwind] for more information), but crates -->
96+
<!-- which do not trigger a panic can be assured that this function is never -->
97+
<!-- called. The second function, `panic_fmt`, is also used by the failure -->
98+
<!-- mechanisms of the compiler. -->
99+
2つある関数のうち1つ目は `eh_personality` で、コンパイラの失敗メカニズムに使われます。これはしばしばGCCのpersonality関数に割り当てられますが(詳細は[libstd実装][unwind]を参照してください)、パニックを発生させないクレートではこの関数は呼ばれないことが保証されています。2つ目の関数は `panic_fmt` で、こちらもコンパイラの失敗メカニズムのために使われます。
100+
101+
[unwind]: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/common/unwind/gcc.rs

diff-1.6.0..1.9.0/src/doc/book/no-stdlib.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)