Skip to content

[WIP] 4.36. Unsafe (1.9) #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 1.9/ja/book/unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- checks are conservative by nature: there are some programs that are actually -->
<!-- safe, but the compiler is not able to verify this is true. To write these kinds -->
<!-- of programs, we need to tell the compiler to relax its restrictions a bit. For -->
<!-- this, Rust has a keyword, `unsafe`. Code using `unsafe` has less restrictions -->
<!-- this, Rust has a keyword, `unsafe`. Code using `unsafe` has fewer restrictions -->
<!-- than normal code does. -->
Rustの主たる魅力は、プログラムの動作についての強力で静的な保証です。
しかしながら、安全性検査は本来保守的なものです。
Expand Down Expand Up @@ -56,8 +56,8 @@ unsafe impl Scary for i32 {}
```

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

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

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

<!-- You will also encounter the `unsafe` keyword when writing bindings to foreign -->
Expand Down
32 changes: 0 additions & 32 deletions diff-1.6.0..1.9.0/src/doc/book/unsafe.md

This file was deleted.