Skip to content

Commit 27e9daa

Browse files
committed
update TranslationTable and fix a translation
1 parent d89cbe3 commit 27e9daa

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

1.6/ja/book/trait-objects.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ For example, functions inlined too eagerly will bloat the instruction cache
9999
(cache rules everything around us). This is part of the reason that `#[inline]`
100100
and `#[inline(always)]` should be used carefully, and one reason why using a
101101
dynamic dispatch is sometimes more efficient. -->
102-
その上、コンパイラは完璧ではなく、「最適化」したコードが遅くなってしまうこともあります。 例えば、あまりにも熱心にインライン化された関数は命令キャッシュを膨張させてしまいます(コンピュータ内ではキャッシュが全てです)。それが `#[inline]``#[inline(always)]` を慎重に使うべきである理由の1つであり、時として動的ディスパッチが静的ディスパッチよりも効率的である1つの理由なのです。
102+
その上、コンパイラは完璧ではなく、「最適化」したコードが遅くなってしまうこともあります。 例えば、あまりにも熱心にインライン化された関数は命令キャッシュを膨張させてしまいます(地獄の沙汰もキャッシュ次第)。それが `#[inline]``#[inline(always)]` を慎重に使うべきである理由の1つであり、時として動的ディスパッチが静的ディスパッチよりも効率的である1つの理由なのです。
103103

104104
<!-- However, the common case is that it is more efficient to use static dispatch,
105105
and one can always have a thin statically-dispatched wrapper function that does
@@ -119,7 +119,7 @@ reason. -->
119119
objects, like `&Foo` or `Box<Foo>`, are normal values that store a value of
120120
*any* type that implements the given trait, where the precise type can only be
121121
known at runtime. -->
122-
Rustは「トレイトオブジェクト」(trait objects)と呼ばれる機能によって動的ディスパッチを提供しています。トレイトオブジェクトは `&Foo``Box<Foo>` の様に記述され、指定されたトレイトを実装する *あらゆる* 型の値を保持する通常の値です。ただし、その正確な型は実行時になって初めて判明します。
122+
Rustは「トレイトオブジェクト」と呼ばれる機能によって動的ディスパッチを提供しています。トレイトオブジェクトは `&Foo``Box<Foo>` の様に記述され、指定されたトレイトを実装する *あらゆる* 型の値を保持する通常の値です。ただし、その正確な型は実行時になって初めて判明します。
123123

124124
<!-- A trait object can be obtained from a pointer to a concrete type that
125125
implements the trait by *casting* it (e.g. `&x as &Foo`) or *coercing* it
@@ -372,16 +372,16 @@ let o = &v as &Clone;
372372
<!-- The error says that `Clone` is not ‘object-safe’. Only traits that are
373373
object-safe can be made into trait objects. A trait is object-safe if both of
374374
these are true: -->
375-
エラーは `Clone` が「object-safeでないと言っています。トレイトオブジェクトにできるのはobject-safeなトレイトのみです。以下の両方が真であるならばトレイトはobject-safeであるといえます
375+
エラーは `Clone` が「オブジェクト安全」(object-safe)でないと言っています。トレイトオブジェクトにできるのはオブジェクト安全なトレイトのみです。以下の両方が真であるならばトレイトはオブジェクト安全であるといえます
376376

377377
<!-- * the trait does not require that `Self: Sized` -->
378378
<!-- * all of its methods are object-safe -->
379379
* トレイトが `Self: Sized` を要求しないこと
380-
* トレイトのメソッド全てがobject-safeであること
380+
* トレイトのメソッド全てがオブジェクト安全であること
381381

382382
<!-- So what makes a method object-safe? Each method must require that `Self: Sized`
383383
or all of the following: -->
384-
では何がメソッドをobject-safeにするのでしょう?各メソッドは `Self: Sized` を要求するか、以下の全てを満足しなければなりません。
384+
では何がメソッドをオブジェクト安全にするのでしょう?各メソッドは `Self: Sized` を要求するか、以下の全てを満足しなければなりません。
385385

386386
<!-- * must not have any type parameters -->
387387
<!-- * must not use `Self` -->
@@ -391,4 +391,4 @@ or all of the following: -->
391391
<!-- Whew! As we can see, almost all of these rules talk about `Self`. A good intuition
392392
is “except in special circumstances, if your trait’s method uses `Self`, it is not
393393
object-safe.” -->
394-
ひゃー!見ての通り、これらルールのほとんどは `Self` について話しています。「特別な状況を除いて、トレイトのメソッドで `Self` を使うとobject-safeではなくなる」と考えるのが良いでしょう。
394+
ひゃー!見ての通り、これらルールのほとんどは `Self` について話しています。「特別な状況を除いて、トレイトのメソッドで `Self` を使うとオブジェクト安全ではなくなる」と考えるのが良いでしょう。

TranslationTable.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
| channel | チャネル
3535
| closure | クロージャ
3636
| coercion | 型強制
37+
| code bloat | コードの膨張
3738
| combinator | コンビネータ
3839
| comma | カンマ
3940
| command line | コマンドライン
@@ -117,6 +118,7 @@
117118
| mutable binding | ミュータブルな束縛
118119
| mutual-exclusion | 相互排他
119120
| null | ヌル
121+
| object-safe | オブジェクト安全
120122
| offline | オフライン
121123
| opaque | オペーク
122124
| open source | オープンソース
@@ -159,6 +161,7 @@
159161
| signed | 符号付き
160162
| slice | スライス
161163
| slicing | スライシング
164+
| specialized | 特殊化された
162165
| standard library | 標準ライブラリ
163166
| string | 文字列
164167
| string interpolation | 文字列インターポーレーション
@@ -178,11 +181,12 @@
178181
| tuple | タプル
179182
| token trees | トークン木
180183
| type alias | 型エイリアス
184+
| type erasure | 型消去
181185
| type family | 型族
182186
| type inference | 型推論
183187
| type parameter | 型パラメータ
184188
| uninstall | アンインストール
185-
| unit 注: `()` の読み | ユニット
189+
| unit 注: `()` の読み | ユニット
186190
| Universal Function Call Syntax | 共通の関数呼び出し構文
187191
| unsafe | アンセーフ
188192
| unsigned | 符号無し

0 commit comments

Comments
 (0)