Skip to content

マークアップ前後のスペースの追加 #73

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

Merged
merged 2 commits into from
Feb 13, 2016
Merged
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
30 changes: 15 additions & 15 deletions 1.6/ja/book/advanced-linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Rustにおけるリンクの一般的なケースについては本書の前の
<!-- the `link_args` attribute. This attribute is applied to `extern` blocks and -->
<!-- specifies raw flags which need to get passed to the linker when producing an -->
<!-- artifact. An example usage would be: -->
どのようにリンクをカスタマイズするかを`rustc`に指示するために、1つの方法があります。それは、`link_args`アトリビュートを使うことです。
このアトリビュートは`extern`ブロックに適用され、生成物を作るときにリンカに渡したいフラグをそのまま指定します。
どのようにリンクをカスタマイズするかを `rustc` に指示するために、1つの方法があります。それは、 `link_args` アトリビュートを使うことです。
このアトリビュートは `extern` ブロックに適用され、生成物を作るときにリンカに渡したいフラグをそのまま指定します。
使い方の例は次のようになります。

``` no_run
Expand All @@ -34,14 +34,14 @@ extern {}
<!-- LLVM directly to link native libraries, in which case `link_args` will have no -->
<!-- meaning. You can achieve the same effect as the `link_args` attribute with the -->
<!-- `-C link-args` argument to `rustc`. -->
これはリンクを実行するための認められた方法ではないため、この機能は現在`feature(link_args)`ゲートによって隠されているということに注意しましょう。
今は`rustc`がシステムリンカ(多くのシステムでは`gcc`、MSVCでは`link.exe`)に渡すので、追加のコマンドライン引数を提供することには意味がありますが、それが今後もそうだとは限りません。
将来、`rustc`がネイティブライブラリをリンクするためにLLVMを直接使うようになるかもしれませんし、そのような場合には`link_args`は意味がなくなるでしょう。
`rustc``-C link-args`引数をつけることで、`link_args`アトリビュートと同じような効果を得ることができます。
これはリンクを実行するための認められた方法ではないため、この機能は現在 `feature(link_args)` ゲートによって隠されているということに注意しましょう。
今は `rustc` がシステムリンカ(多くのシステムでは `gcc` 、MSVCでは `link.exe` )に渡すので、追加のコマンドライン引数を提供することには意味がありますが、それが今後もそうだとは限りません。
将来、 `rustc` がネイティブライブラリをリンクするためにLLVMを直接使うようになるかもしれませんし、そのような場合には `link_args` は意味がなくなるでしょう。
`rustc``-C link-args` 引数をつけることで、 `link_args` アトリビュートと同じような効果を得ることができます。

<!-- It is highly recommended to *not* use this attribute, and rather use the more -->
<!-- formal `#[link(...)]` attribute on `extern` blocks instead. -->
このアトリビュートは使わ *ない* ことが強く推奨されているので、代わりにもっと正式な`#[link(...)]`アトリビュートを`extern`ブロックに使いましょう。
このアトリビュートは使わ *ない* ことが強く推奨されているので、代わりにもっと正式な `#[link(...)]` アトリビュートを `extern` ブロックに使いましょう。

<!-- # Static linking -->
# スタティックリンク
Expand All @@ -55,7 +55,7 @@ extern {}
<!-- change this and statically link them as well. -->
スタティックリンクとは全ての必要なライブラリを含めた成果物を生成する手順のことで、そうすればコンパイルされたプロジェクトを使いたいシステム全てにライブラリをインストールする必要がなくなります。
Rustのみで構築された依存関係はデフォルトでスタティックリンクされます。そのため、Rustをインストールしなくても、作成されたバイナリやライブラリを使うことができます。
対照的に、ネイティブライブラリ(例えば`libc``libm`)はダイナミックリンクされるのが普通です。しかし、これを変更してそれらを同様にスタティックリンクすることも可能です。
対照的に、ネイティブライブラリ(例えば `libc``libm` )はダイナミックリンクされるのが普通です。しかし、これを変更してそれらを同様にスタティックリンクすることも可能です。

<!-- Linking is a very platform-dependent topic, and static linking may not even be -->
<!-- possible on some platforms! This section assumes some basic familiarity with -->
Expand All @@ -69,8 +69,8 @@ Rustのみで構築された依存関係はデフォルトでスタティック
<!-- By default, all Rust programs on Linux will link to the system `libc` along with -->
<!-- a number of other libraries. Let's look at an example on a 64-bit Linux machine -->
<!-- with GCC and `glibc` (by far the most common `libc` on Linux): -->
デフォルトでは、Linux上の全てのRustのプログラムはシステムの`libc`とその他のいくつものライブラリとリンクされます。
GCCと`glibc`(Linuxにおける最も一般的な`libc`)を使った64ビットLinuxマシンでの例を見てみましょう。
デフォルトでは、Linux上の全てのRustのプログラムはシステムの `libc` とその他のいくつものライブラリとリンクされます。
GCCと `glibc` (Linuxにおける最も一般的な `libc` )を使った64ビットLinuxマシンでの例を見てみましょう。

``` text
$ cat example.rs
Expand All @@ -95,8 +95,8 @@ $ ldd example
<!-- Static linking is supported via an alternative `libc`, [`musl`](http://www.musl-libc.org). You can compile -->
<!-- your own version of Rust with `musl` enabled and install it into a custom -->
<!-- directory with the instructions below: -->
スタティックリンクは代わりの`libc`である[`musl`](http://www.musl-libc.org/)によってサポートされています。
以下の手順に従い、`musl`を有効にした独自バージョンのRustをコンパイルして独自のディレクトリにインストールすることができます。
スタティックリンクは代わりの `libc` である [`musl`](http://www.musl-libc.org/) によってサポートされています。
以下の手順に従い、 `musl` を有効にした独自バージョンのRustをコンパイルして独自のディレクトリにインストールすることができます。

```text
$ mkdir musldist
Expand Down Expand Up @@ -142,7 +142,7 @@ $ du -h musldist/bin/rustc
<!-- You now have a build of a `musl`-enabled Rust! Because we've installed it to a -->
<!-- custom prefix we need to make sure our system can find the binaries and appropriate -->
<!-- libraries when we try and run it: -->
これで`musl`が有効になったRustのビルドが手に入りました!
これで `musl` が有効になったRustのビルドが手に入りました!
独自のプレフィックスを付けてインストールしたので、試しに実行するときにはシステムがバイナリと適切なライブラリを見付けられることを確かめなければなりません。

```text
Expand Down Expand Up @@ -171,5 +171,5 @@ thread '<main>' panicked at 'failed', example.rs:1
<!-- `cargo build` also permits the `--target` option so you should be able to build -->
<!-- your crates as normal. However, you may need to recompile your native libraries -->
<!-- against `musl` before they can be linked against. -->
`cargo build``--target`オプションを受け付けるので、あなたのクレートも普通にビルドできるはずです。
ただし、リンクする前にネイティブライブラリを`musl`向けにリコンパイルする必要はあるかもしれません。
`cargo build``--target` オプションを受け付けるので、あなたのクレートも普通にビルドできるはずです。
ただし、リンクする前にネイティブライブラリを `musl` 向けにリコンパイルする必要はあるかもしれません。
12 changes: 6 additions & 6 deletions 1.6/ja/book/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let x = 5; // this is also a line comment.
<!-- The other kind of comment is a doc comment. Doc comments use `///` instead of -->
<!-- `//`, and support Markdown notation inside: -->
その他の種類のコメントはドキュメンテーションコメントです。
ドキュメンテーションコメントは`//`の代わりに`///`を使い、その中でMarkdown記法をサポートします。
ドキュメンテーションコメントは `//` の代わりに `///` を使い、その中でMarkdown記法をサポートします。

```rust
# /// Adds one to the number given.
Expand All @@ -52,7 +52,7 @@ fn add_one(x: i32) -> i32 {
<!-- There is another style of doc comment, `//!`, to comment containing items (e.g. -->
<!-- crates, modules or functions), instead of the items following it. Commonly used -->
<!-- inside crates root (lib.rs) or modules root (mod.rs): -->
もう1つのスタイルのドキュメンテーションコメントに`//!`があります。これは、その後に続く要素ではなく、それを含んでいる要素(例えばクレート、モジュール、関数)にコメントを付けます。
もう1つのスタイルのドキュメンテーションコメントに `//!` があります。これは、その後に続く要素ではなく、それを含んでいる要素(例えばクレート、モジュール、関数)にコメントを付けます。
一般的にはクレートルート(lib.rs)やモジュールルート(mod.rs)の中で使われます。

```
Expand All @@ -68,11 +68,11 @@ fn add_one(x: i32) -> i32 {
<!-- in documentation. There’s another macro, `assert!`, which `panic!`s if the -->
<!-- value passed to it is `false`. -->
ドキュメンテーションコメントを書いているとき、いくつかの使い方の例を提供することは非常に非常に有用です。
ここでは新しいマクロ、`assert_eq!`を使っていることに気付くでしょう。
これは2つの値を比較し、もしそれらが互いに等しくなければ`panic!`します。
ここでは新しいマクロ、 `assert_eq!` を使っていることに気付くでしょう。
これは2つの値を比較し、もしそれらが互いに等しくなければ `panic!` します。
これはドキュメントの中で非常に便利です。
もう1つのマクロ、`assert!`は、それに渡された値が`false`であれば`panic!`します。
もう1つのマクロ、 `assert!` は、それに渡された値が `false` であれば `panic!` します。

<!-- You can use the [`rustdoc`](documentation.html) tool to generate HTML documentation -->
<!-- from these doc comments, and also to run the code examples as tests! -->
それらのドキュメンテーションコメントからHTMLドキュメントを生成するため、そしてコード例をテストとして実行するためにも[`rustdoc`](documentation.html)ツールを使うことができます!
それらのドキュメンテーションコメントからHTMLドキュメントを生成するため、そしてコード例をテストとして実行するためにも [`rustdoc`](documentation.html) ツールを使うことができます!
Loading