Skip to content

Commit 88d311b

Browse files
authored
Merge pull request #8 from ksato9700/what-are-editions
What are editions
2 parents 354d89a + dca625b commit 88d311b

4 files changed

+218
-2
lines changed

TranslationTable.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
| allocate | アロケートする
1818
| allocation | アロケーション
1919
| allocator | アロケータ
20+
| anonymous parameter | 無名パラメータ
2021
| antipattern | アンチパターン
2122
| application | アプリケーション
2223
| arity | アリティ
@@ -70,6 +71,7 @@
7071
| documentation comment | ドキュメンテーションコメント
7172
| documentation test | ドキュメンテーションテスト
7273
| early return | 早期リターン
74+
| edition | エディション
7375
| empty tuple | 空タプル
7476
| encode | エンコード
7577
| entry point | エントリポイント
@@ -215,6 +217,6 @@
215217
| variant | ヴァリアント
216218
| vector | ベクタ
217219
| version | バージョン
218-
| warning | ウォーニング
220+
| warning | 警告
219221
| wildcard | ワイルドカード
220222
| wrapper | ラッパ

src/editions/creating-a-new-project.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
<!--
12
# Creating a new project
23
34
When you create a new project with Cargo, it will automatically add
45
configuration for the latest edition:
6+
-->
7+
8+
# 新しいプロジェクトを作成する
9+
10+
Cargoは新たなプロジェクトを作成する際に自動で最新のエディションをコンフィギュレーションに追加します。
511

612
```console
713
> cargo +nightly new foo
@@ -16,11 +22,18 @@ edition = "2018"
1622
[dependencies]
1723
```
1824

25+
<!--
1926
That `edition = "2018"` setting will configure your package to use Rust 2018.
2027
No more configuration needed!
2128
2229
If you'd prefer to use an older edition, you can change the value in that
2330
key, for example:
31+
-->
32+
33+
この `edition = "2018"` によってあなたのパッケージが Rust 2018 を利用するように設定されます。
34+
これ以外は必要ありません。
35+
36+
もし、他の古いエディションを使いたい場合は、その設定の値を変更できます。例えば、
2437

2538
```toml
2639
[package]
@@ -32,4 +45,8 @@ edition = "2015"
3245
[dependencies]
3346
```
3447

48+
<!--
3549
This will build your package in Rust 2015.
50+
-->
51+
52+
とすると、あなたのパッケージは Rust 2015 でビルドされます。

src/editions/index.md

+48-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
1+
<!--
12
# What are Editions?
3+
-->
4+
# エディションとは?
25

6+
<!--
37
Rust ships releases on a six-week cycle. This means that users get a constant
48
stream of new features. This is much faster than updates for other languages,
59
but this also means that each update is smaller. After a while, all of those
610
tiny changes add up. But, from release to release, it can be hard to look back
711
and say *"Wow, between Rust 1.10 and Rust 1.20, Rust has changed a lot!"*
12+
-->
813

14+
Rustは6週間ごとにリリースを行います。
15+
これにより、ユーザーは新しい機能を常に手に入れることができます。
16+
これは他の言語よりも速いサイクルですが、アップデートのサイズは小さくなります。
17+
しばらくするとこれらの小変更が積み重なってきますが、いくつかのリリースを振り返って、「おお、バージョン1.10から1.20の間にRustは大きく変わったなぁ」と言うのは難しいかも知れません。
18+
19+
<!--
920
Every two or three years, we'll be producing a new *edition* of Rust. Each
1021
edition brings together the features that have landed into a clear package, with
1122
fully updated documentation and tooling. New editions ship through the usual
1223
release process.
24+
-->
25+
26+
2,3年に一度、Rustの新しい「エディション」を作成します。
27+
各エディションはそれまでRustに加えられた変更をまとめ上げたもので、最新のドキュメントとツールもそれに含まれます。
28+
新しいエディションは通常のリリースプロセスを経てリリースされます。
1329

30+
<!--
1431
This serves different purposes for different people:
1532
1633
- For active Rust users, it brings together incremental changes into an
@@ -21,9 +38,23 @@ This serves different purposes for different people:
2138
2239
- For those developing Rust itself, it provides a rallying point for the project as a
2340
whole.
41+
-->
42+
43+
エディションは様々な人の異なる要求を満たします。
44+
45+
- Rustのアクティブなユーザーにとっては、6週間ごとににリリースされた機能変更をわかりやすくまとめたパッケージとなります。
46+
47+
- Rustを使っていない人にとっては、大きな変更が施されたことを知らせる役割を果たし、それによってRustを使ってみようと思うようになるかも知れません。
2448

49+
- Rustの内部開発者にとっては、プロジェクト全体の長期的なゴールになります。
50+
51+
52+
<!--
2553
## Compatibility
54+
-->
55+
## 互換性
2656

57+
<!--
2758
When a new edition becomes available in the compiler, crates must explicitly opt
2859
in to it to take full advantage. This opt in enables editions to contain
2960
incompatible changes, like adding a new keyword that might conflict with
@@ -34,10 +65,26 @@ Edition changes only affect the way the compiler initially parses the code.
3465
Therefore, if you're using Rust 2015, and
3566
one of your dependencies uses Rust 2018, it all works just fine. The opposite
3667
situation works as well.
68+
-->
69+
70+
新しいエディションがコンパイラで利用可能になった際に、その利点を最大限に活かすためには、クレートは明示的にオプトインする必要があります。
71+
このオプトインはエディションに非互換の変更を加えるために必要で、例えば、既存のコードで使われている識別子と競合する新たなキーワードを導入したり、警告だったものをエラーにする、などの変更を加えることができるようになります。
72+
Rustのコンパイラはこれまでの全てのエディションをサポートしていて、複数のクレートが異なるエディションを使用していても一つにリンクできます。
73+
エディションの変更はコンパイラが最初にコードを構文解析する際の動作のみに影響します。
74+
従って、例ばあなたがRust 2015を使っていて、依存するクレートが Rust 2018を使っていても全く問題なく動作します。
75+
その逆の場合も同様です。
3776

77+
78+
<!--
3879
Just to be clear: most features will be available on all editions.
3980
People using any edition of Rust will continue to see improvements as new
4081
stable releases are made. In some cases however, mainly when new keywords are
4182
added, but sometimes for other reasons, there may be new features that are only
4283
available in later editions. You only need to upgrade if you want to take
43-
advantage of such features.
84+
advantage of such features.
85+
-->
86+
87+
念の為はっきりさせておきますが、ほとんどの機能は全てのエディションで利用可能です。
88+
どのエディションを利用していても、新たな安定板リリースが出た際には改善を見ることができます。
89+
時折、例えば新たなキーワードが導入されたりその他の理由で、あるエディション以降でしか利用できない機能追加があります。
90+
そのような機能を利用したい時にエディションのアップデートを検討するのが良いでしょう。

0 commit comments

Comments
 (0)