Skip to content

Commit 0bb5a86

Browse files
committed
2 parents 7d2916c + f7c78ff commit 0bb5a86

File tree

118 files changed

+10802
-5124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+10802
-5124
lines changed

1.6/ja/book/SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* [はじめる](getting-started.md)
44
* [Rustを学ぶ](learn-rust.md)
55
* [数当てゲーム](guessing-game.md)
6-
* [晩餐する哲学者](dining-philosophers.md)
6+
* [食事する哲学者](dining-philosophers.md)
77
* [他言語と共存する](rust-inside-other-languages.md)
88
* [シンタックスとセマンティクス](syntax-and-semantics.md)
99
* [変数束縛](variable-bindings.md)
@@ -15,7 +15,7 @@
1515
* [所有権](ownership.md)
1616
* [参照と借用](references-and-borrowing.md)
1717
* [ライフタイム](lifetimes.md)
18-
* [可変性](mutability.md)
18+
* [ミュータビリティ](mutability.md)
1919
* [構造体](structs.md)
2020
* [列挙型](enums.md)
2121
* [マッチ](match.md)

1.6/ja/book/advanced-linking.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Rustにおけるリンクの一般的なケースについては本書の前の
1414
<!-- the `link_args` attribute. This attribute is applied to `extern` blocks and -->
1515
<!-- specifies raw flags which need to get passed to the linker when producing an -->
1616
<!-- artifact. An example usage would be: -->
17-
どのようにリンクをカスタマイズするかを`rustc`に指示するために、1つの方法があります。それは、`link_args`アトリビュートを使うことです。
18-
このアトリビュートは`extern`ブロックに適用され、生成物を作るときにリンカに渡したいフラグをそのまま指定します。
17+
どのようにリンクをカスタマイズするかを `rustc` に指示するために、1つの方法があります。それは、 `link_args` アトリビュートを使うことです。
18+
このアトリビュートは `extern` ブロックに適用され、生成物を作るときにリンカに渡したいフラグをそのまま指定します。
1919
使い方の例は次のようになります。
2020

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

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

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

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

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

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

148148
```text
@@ -171,5 +171,5 @@ thread '<main>' panicked at 'failed', example.rs:1
171171
<!-- `cargo build` also permits the `--target` option so you should be able to build -->
172172
<!-- your crates as normal. However, you may need to recompile your native libraries -->
173173
<!-- against `musl` before they can be linked against. -->
174-
`cargo build``--target`オプションを受け付けるので、あなたのクレートも普通にビルドできるはずです。
175-
ただし、リンクする前にネイティブライブラリを`musl`向けにリコンパイルする必要はあるかもしれません。
174+
`cargo build``--target` オプションを受け付けるので、あなたのクレートも普通にビルドできるはずです。
175+
ただし、リンクする前にネイティブライブラリを `musl` 向けにリコンパイルする必要はあるかもしれません。

1.6/ja/book/associated-constants.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
% Associated Constants
1+
% 関連定数
2+
<!-- % Associated Constants -->
23

3-
With the `associated_consts` feature, you can define constants like this:
4+
<!-- With the `associated_consts` feature, you can define constants like this: -->
5+
`associated_consts` フィーチャを使うと、以下のように定数を定義することができます。
46

57
```rust
68
#![feature(associated_consts)]
@@ -18,7 +20,8 @@ fn main() {
1820
}
1921
```
2022

21-
Any implementor of `Foo` will have to define `ID`. Without the definition:
23+
<!-- Any implementor of `Foo` will have to define `ID`. Without the definition: -->
24+
`Foo` を実装する場合、必ず `ID` を定義しなければなりません。もし以下のように定義がなかった場合
2225

2326
```rust,ignore
2427
#![feature(associated_consts)]
@@ -31,15 +34,18 @@ impl Foo for i32 {
3134
}
3235
```
3336

34-
gives
37+
<!-- gives -->
38+
このようになります。
3539

3640
```text
3741
error: not all trait items implemented, missing: `ID` [E0046]
42+
(訳注: エラー。トレイトの全ての要素が実装されていません。 `ID` が未実装です。)
3843
impl Foo for i32 {
3944
}
4045
```
4146

42-
A default value can be implemented as well:
47+
<!-- A default value can be implemented as well: -->
48+
既定値についても以下のように実装できます。
4349

4450
```rust
4551
#![feature(associated_consts)]
@@ -61,12 +67,14 @@ fn main() {
6167
}
6268
```
6369

64-
As you can see, when implementing `Foo`, you can leave it unimplemented, as
65-
with `i32`. It will then use the default value. But, as in `i64`, we can also
66-
add our own definition.
70+
<!-- As you can see, when implementing `Foo`, you can leave it unimplemented, as -->
71+
<!-- with `i32`. It will then use the default value. But, as in `i64`, we can also -->
72+
<!-- add our own definition. -->
73+
上記の通り、 `Foo` トレイトを実装する際、 `i32` のように未実装のままにすることができます。この場合、既定値が使われます。一方 `i64` のように独自の定義を追加することもできます。
6774

68-
Associated constants don’t have to be associated with a trait. An `impl` block
69-
for a `struct` or an `enum` works fine too:
75+
<!-- Associated constants don’t have to be associated with a trait. An `impl` block -->
76+
<!-- for a `struct` or an `enum` works fine too: -->
77+
関連定数は必ずしもトレイトに関連付けられる必要はありません。 `struct``enum``impl` ブロックにおいても使うことができます。
7078

7179
```rust
7280
#![feature(associated_consts)]

0 commit comments

Comments
 (0)