Skip to content

Commit 3778767

Browse files
authored
Merge pull request #187 from tatsuya6502/update-appendix-05
付録E:エディションを最新版にアップデート
2 parents cd24387 + 6f5ead0 commit 3778767

File tree

3 files changed

+31
-26
lines changed

3 files changed

+31
-26
lines changed

TranslationTable.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
| documentation comment | ドキュメンテーションコメント
7272
| documentation test | ドキュメンテーションテスト
7373
| early return | 早期リターン
74+
| edition | エディション
7475
| empty tuple | 空タプル
7576
| encode | エンコード
7677
| entry point | エントリポイント

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,6 @@
293293
- [付録B:演算子と記号](appendix-02-operators.md)
294294
- [付録C:導出可能なトレイト](appendix-03-derivable-traits.md)
295295
- [付録D:便利な開発ツール](appendix-04-useful-development-tools.md)
296-
- [付録E:Edition](appendix-05-editions.md)
296+
- [付録E:エディション](appendix-05-editions.md)
297297
- [付録F:本の翻訳](appendix-06-translation.md)
298298
- [付録G:Rustの作られ方と“Nightly Rust”](appendix-07-nightly-rust.md)

src/appendix-05-editions.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<!--
22
## Appendix E - Editions
33
-->
4-
## 付録E - Edition
4+
## 付録E:エディション
55

66
<!--
77
In Chapter 1, you saw that `cargo new` adds a bit of metadata to your
88
*Cargo.toml* file about an edition. This appendix talks about what that means!
99
-->
10-
1章で`cargo new`がeditionに関するちょっとしたメタデータを *Cargo.toml* に追加しているのを見ましたね。
10+
第1章で`cargo new`が エディションに関するちょっとしたメタデータを *Cargo.toml* に追加しているのを見ましたね。
1111
この付録ではその意味についてお話します!
1212

1313
<!--
@@ -18,8 +18,8 @@ while, all of these tiny changes add up. But from release to release, it can be
1818
difficult to look back and say, “Wow, between Rust 1.10 and Rust 1.31, Rust has
1919
changed a lot!”
2020
-->
21-
Rust言語とコンパイラは6週間のリリースサイクルを採用しています。つまり、ユーザーにはコンスタントに新しい機能が流れてくるというわけです
22-
他のプログラミング言語は、より少ない回数、より大きなリリースを行いますが、Rustは小さなアップデートをより頻繁に行います
21+
Rust言語とコンパイラは6週間のリリースサイクルを採用しています。つまり、ユーザにはコンスタントに新しい機能が流れてくるというわけです
22+
他のプログラミング言語は、より少ない回数で、より大きなリリースを行いますが、Rustは小さなアップデートを頻繁に行います
2323
しばらくすると、これらの小さな変更が溜まっていきます。
2424
しかし、これらを振り返って、「Rust 1.10とRust 1.31を比較すると、すごく変わったねえ!」などとリリースごとに言うのは難しいです。
2525

@@ -29,14 +29,14 @@ edition brings together the features that have landed into a clear package with
2929
fully updated documentation and tooling. New editions ship as part of the usual
3030
six-week release process.
3131
-->
32-
2、3年ごとに、RustチームはRustの新しい *edition* を作ります。
33-
それぞれのeditionには、それまでにRustにやってきた新しい機能が、完全に更新されたドキュメントとツール群とともに、まとまったパッケージとなってまとめられています
34-
新しいeditionは通常の6週間ごとのリリースの一部として配布されます
32+
2、3年ごとに、RustチームはRustの新しい *エディション* を作ります。
33+
それぞれのエディションには、それまでにRustにやってきた新しい機能が、完全に更新されたドキュメントとツール群とともに、一つのパッケージとなってまとめられています
34+
新しいエディションは通常の6週間ごとのリリースの一部として配布されます
3535

3636
<!--
3737
Editions serve different purposes for different people:
3838
-->
39-
それぞれの人々にとってeditionは異なる意味を持ちます:
39+
それぞれの人々にとってエディションは異なる意味を持ちます。
4040

4141
<!--
4242
* For active Rust users, a new edition brings together incremental changes into
@@ -46,24 +46,25 @@ Editions serve different purposes for different people:
4646
* For those developing Rust, a new edition provides a rallying point for the
4747
project as a whole.
4848
-->
49-
* アクティブなRustユーザにとっては、新しいeditionは、少しずつ増えてきた変更点を理解しやすいパッケージにしてまとめるものです。
50-
* Rustユーザでない人にとっては、新しいeditionは、何かしら大きな達成がなされたことを示します。Rustには今一度目を向ける価値があると感じさせるかもしれません。
51-
* Rustを開発している人にとっては、新しいeditionは、プロジェクト全体の目標地点となります。
49+
* アクティブなRustユーザにとっては、新しいエディションは、少しずつ増えてきた変更点を理解しやすいパッケージにしてまとめるものです。
50+
* Rustユーザでない人にとっては、新しいエディションは、何かしら大きな達成がなされたことを示します。Rustには今一度目を向ける価値があると感じさせるかもしれません。
51+
* Rustを開発している人にとっては、新しいエディションは、プロジェクト全体の目標地点となります。
5252

5353
<!--
54-
At the time of this writing, two Rust editions are available: Rust 2015 and
55-
Rust 2018. This book is written using Rust 2018 edition idioms.
54+
At the time of this writing, three Rust editions are available: Rust 2015, Rust
55+
2018, and Rust 2021. This book is written using Rust 2021 edition idioms.
5656
-->
57-
この文書を書いている時点(訳注:原文のコミットは2019-03-01)では、2つのRustのeditionが利用できます:Rust 2015とRust 2018です。
58-
この本はRust 2018の慣例に従って書かれています。
57+
この文書を書いている時点(訳注:原文のコミットは2021年12月23日)では、3つのRustのエディションが利用できます。
58+
Rust 2015、Rust 2018、Rest 2021です。
59+
この本はRust 2021エディションの慣例に従って書かれています。
5960

6061
<!--
6162
The `edition` key in *Cargo.toml* indicates which edition the compiler should
6263
use for your code. If the key doesn’t exist, Rust uses `2015` as the edition
6364
value for backward compatibility reasons.
6465
-->
6566
*Cargo.toml* における`edition`キーは、コードに対してコンパイラがどのエディションを適用すべきかを示しています。
66-
もしキーが存在しなければ、Rustは後方互換性のため`2015`をeditionの値として使います
67+
もしキーが存在しなければ、Rustは後方互換性のため`2015`をエディションの値として使います
6768

6869
<!--
6970
Each project can opt in to an edition other than the default 2015 edition.
@@ -72,8 +73,8 @@ conflicts with identifiers in code. However, unless you opt in to those
7273
changes, your code will continue to compile even as you upgrade the Rust
7374
compiler version you use.
7475
-->
75-
標準の2015 edition以外のeditionを使うという選択はそれぞれのプロジェクトですることができます
76-
editionには、コード内の識別子と衝突してしまう新しいキーワードの導入など、互換性のない変更が含まれる可能性があります。
76+
標準の2015エディション以外のエディションを使うという選択はそれぞれのプロジェクトですることができます
77+
エディションには、コード内の識別子と衝突してしまう新しいキーワードの導入など、互換性のない変更が含まれる可能性があります。
7778
しかし、それらの変更を選択しない限り、Rustのコンパイラのバージョンを更新しても、コードは変わらずコンパイルできます。
7879

7980
<!--
@@ -85,8 +86,8 @@ Rust 2018, your project will compile and be able to use that dependency. The
8586
opposite situation, where your project uses Rust 2018 and a dependency uses
8687
Rust 2015, works as well.
8788
-->
88-
Rustコンパイラは全バージョンにおいて、そのコンパイラのリリースまでに存在したすべてのeditionをサポートしており、またサポートされているeditionのクレートはすべてリンクできます
89-
editionの変更はコンパイラが最初にコードを構文解析するときにのみ影響します
89+
Rustコンパイラは全バージョンにおいて、そのコンパイラのリリースまでに存在したすべてのエディションをサポートしており、またサポートされているエディションのクレートはすべてリンクできます
90+
エディションの変更はコンパイラが最初にコードを構文解析するときにのみ影響します
9091
なので、あなたがRust 2015を使っていて、依存先にRust 2018を使うものがあったとしても、あなたのプロジェクトはコンパイルでき、その依存先を使うことができます。
9192
逆に、あなたのプロジェクトがRust 2018を、依存先がRust 2015を使っていても、同じく問題はありません。
9293

@@ -97,15 +98,18 @@ made. However, in some cases, mainly when new keywords are added, some new
9798
features might only be available in later editions. You will need to switch
9899
editions if you want to take advantage of such features.
99100
-->
100-
まあ実のところ、ほとんどの機能はすべてのeditionで利用可能でしょう
101-
どのRust editionを使っている開発者も、新しい安定リリースが出ると、改善したなと感じるのは変わらないでしょう
102-
しかし、場合によっては――多くは新しいキーワードが追加された時――新機能が新しいeditionでしか利用できないということがあるかもしれません
103-
そのような機能を利用したいなら、editionを切り替える必要があるでしょう
101+
まあ実のところ、ほとんどの機能はすべてのエディションで利用可能でしょう
102+
どのRustエディションを使っている開発者も、新しい安定リリースが出ると改善したなと感じるのは変わらないでしょう
103+
しかし、場合によって(多くは新しいキーワードが追加されたとき)は、新機能が新しいエディションでしか利用できないことがあるかもしれません
104+
そのような機能を利用したいなら、エディションを切り替える必要があるでしょう
104105

105106
<!--
106107
For more details, the [*Edition
107108
Guide*](https://doc.rust-lang.org/stable/edition-guide/) is a complete book
108109
about editions that enumerates the differences between editions and explains
109110
how to automatically upgrade your code to a new edition via `cargo fix`.
110111
-->
111-
より詳しく知りたいなら、[*Editionガイド*](https://doc.rust-lang.org/stable/edition-guide/) という、editionに関するすべてを説明している本があります。edition同士の違いや、`cargo fix`を使って自動的にコードを新しいeditionにアップグレードする方法が書かれています。
112+
より詳しく知りたいなら、[*エディションガイド*](https://doc.rust-lang.org/stable/edition-guide/)という、エディションに関するすべてを説明している本があります。
113+
エディション同士の違いや、`cargo fix`を使って自動的にコードを新しいエディションにアップグレードする方法が書かれています。
114+
115+
> 訳注:日本語版のエディションガイドは[こちら](https://doc.rust-jp.rs/edition-guide/)にあります。

0 commit comments

Comments
 (0)