Skip to content

Commit 14557dd

Browse files
committed
Update Unsafe to 1.9
- Update the contents. - Change the comment style to use the same style to other pages.
1 parent 32cc4ab commit 14557dd

File tree

2 files changed

+5
-37
lines changed

2 files changed

+5
-37
lines changed

1.9/ja/book/unsafe.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- checks are conservative by nature: there are some programs that are actually -->
55
<!-- safe, but the compiler is not able to verify this is true. To write these kinds -->
66
<!-- of programs, we need to tell the compiler to relax its restrictions a bit. For -->
7-
<!-- this, Rust has a keyword, `unsafe`. Code using `unsafe` has less restrictions -->
7+
<!-- this, Rust has a keyword, `unsafe`. Code using `unsafe` has fewer restrictions -->
88
<!-- than normal code does. -->
99
Rustの主たる魅力は、プログラムの動作についての強力で静的な保証です。
1010
しかしながら、安全性検査は本来保守的なものです。
@@ -56,8 +56,8 @@ unsafe impl Scary for i32 {}
5656
```
5757

5858
<!-- It’s important to be able to explicitly delineate code that may have bugs that -->
59-
<!-- cause big problems. If a Rust program segfaults, you can be sure it’s somewhere -->
60-
<!-- in the sections marked `unsafe`. -->
59+
<!-- cause big problems. If a Rust program segfaults, you can be sure the cause is -->
60+
<!-- related to something marked `unsafe`. -->
6161
大きな問題を引き起こすバグがあるかもしれないコードを明示できるのは重要なことです。
6262
もしRustのプログラムがセグメンテーション違反を起こしても、バグは `unsafe` で印付けられた区間のどこかにあると確信できます。
6363

@@ -166,11 +166,11 @@ Rustでバグのあるコードを書くことはできますし、実際に書
166166

167167
<!-- That’s it. It’s important that `unsafe` does not, for example, ‘turn off the -->
168168
<!-- borrow checker’. Adding `unsafe` to some random Rust code doesn’t change its -->
169-
<!-- semantics, it won’t just start accepting anything. But it will let you write -->
169+
<!-- semantics, it won’t start accepting anything. But it will let you write -->
170170
<!-- things that _do_ break some of the rules. -->
171171
以上です。
172172
重要なのは、 `unsafe` が、たとえば「借用チェッカをオフにする」といったことを行わないことです。
173-
Rustのコードの適当な位置に `unsafe` を加えてもセマンティクスは変わらず、何でもただ受理するようになるということにはなりません
173+
Rustのコードの適当な位置に `unsafe` を加えてもセマンティクスは変わらず、何でも受理するようになるということにはなりません
174174
それでも、`unsafe` はルールのいくつかを破るコードを書けるようにはするのです。
175175

176176
<!-- You will also encounter the `unsafe` keyword when writing bindings to foreign -->

diff-1.6.0..1.9.0/src/doc/book/unsafe.md

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

0 commit comments

Comments
 (0)