Skip to content

Commit 5d52040

Browse files
authored
Merge pull request #149 from roger-sato/translate-chap-23
Translate untranslated files for '23. Compatibility'
2 parents fc6c2e7 + 901dd57 commit 5d52040

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

TranslationTable.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
| r-value | 右辺値
167167
| range | レンジ
168168
| raw pointer | 生ポインタ
169+
| raw identifier | 生識別子
169170
| re-assignment | 再代入
170171
| rebind | 再束縛
171172
| reference count | 参照カウント

src/SUMMARY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,12 @@
445445
- [安全でない操作](unsafe.md)
446446
- [Inline assembly](unsafe/asm.md)
447447

448+
<!--
448449
- [Compatibility](compatibility.md)
449450
- [Raw identifiers](compatibility/raw_identifiers.md)
451+
-->
452+
- [互換性](compatibility.md)
453+
- [生識別子](compatibility/raw_identifiers.md)
450454

451455
<!--
452456
- [Meta](meta.md)

src/compatibility.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
<!--
12
# Compatibility
3+
-->
4+
# 互換性
25

6+
<!--
37
The Rust language is fastly evolving, and because of this certain compatibility
48
issues can arise, despite efforts to ensure forwards-compatibility wherever
59
possible.
10+
-->
11+
Rust言語は急速に進化しており、可能な限り前方互換性を確保する努力にも関わらず、特定の互換性の問題が生じることがあります。
612

13+
<!--
714
* [Raw identifiers](compatibility/raw_identifiers.md)
15+
-->
16+
* [生識別子](compatibility/raw_identifiers.md)

src/compatibility/raw_identifiers.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
1+
<!--
12
# Raw identifiers
3+
-->
4+
# 生識別子
25

6+
<!--
37
Rust, like many programming languages, has the concept of "keywords".
48
These identifiers mean something to the language, and so you cannot use them in
59
places like variable names, function names, and other places.
610
Raw identifiers let you use keywords where they would not normally be allowed.
711
This is particularly useful when Rust introduces new keywords, and a library
812
using an older edition of Rust has a variable or function with the same name
913
as a keyword introduced in a newer edition.
14+
-->
15+
Rustは多くのプログラミング言語と同様に、「キーワード」の概念を持っています。
16+
これらの識別子は言語にとって何かしらの意味を持ちますので、変数名や関数名、その他の場所で使用することはできません。
17+
生識別子は、通常は許されない状況でキーワードを使用することを可能にします。
18+
これは、新しいキーワードを導入したRustと、古いエディションのRustを使用したライブラリが同じ名前の変数や関数を持つ場合に特に便利です。
1019

20+
<!--
1121
For example, consider a crate `foo` compiled with the 2015 edition of Rust that
1222
exports a function named `try`. This keyword is reserved for a new feature in
1323
the 2018 edition, so without raw identifiers, we would have no way to name the
1424
function.
25+
-->
26+
例えば、2015年エディションのRustでコンパイルされたクレート`foo``try`という名前の関数をエクスポートしているとします。
27+
このキーワードは2018年エディションで新機能として予約されていますので、生識別子がなければ、この関数を名付ける方法がありません。
28+
1529

1630
```rust,ignore
1731
extern crate foo;
@@ -21,7 +35,10 @@ fn main() {
2135
}
2236
```
2337

38+
<!--
2439
You'll get this error:
40+
-->
41+
このエラーが出ます:
2542

2643
```text
2744
error: expected identifier, found keyword `try`
@@ -31,7 +48,10 @@ error: expected identifier, found keyword `try`
3148
| ^^^ expected identifier, found keyword
3249
```
3350

51+
<!--
3452
You can write this with a raw identifier:
53+
-->
54+
これは生識別子を使って書くことができます:
3555

3656
```rust,ignore
3757
extern crate foo;

0 commit comments

Comments
 (0)