Skip to content

Revise paragraph in "ライフタイムの省略" #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 1.6/ja/book/lifetimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ let x: &'static i32 = &FOO;
<!-- this with only three easily memorizable and unambiguous rules. This makes -->
<!-- lifetime elision a shorthand for writing an item signature, while not hiding -->
<!-- away the actual types involved as full local inference would if applied to it. -->
Rustは関数本文での強力なローカルの型推論をサポートします。しかし、要素のシグネチャでは要素のシグネチャだけで型が分かるように、型についての推論が許されていません
しかし、人間工学的な推論のために、非常に制限された「ライフタイムの省略」と呼ばれる2番目の推論アルゴリズムが関数のシグネチャでは適用されます
それはシグネチャのコンポーネントだけに基づき、関数本文には基づかずに、ライフタイムパラメータだけを推論します。そしてそのアルゴリズムはこれをたった3つの覚えやすく明確なルールに従って行います
これはライフタイムの省略を要素のシグネチャを書くための省略表現にします。しかし、完全なローカルの推論が適用されたときに得られるであろう全ての型を隠すことはできません
Rustは関数本体の部分では強力なローカル型推論をサポートします。しかし要素のシグネチャの部分では、型が要素のシグネチャだけでわかるようにするため、(型推論が)許されていません
とはいえ、エルゴノミック(人間にとっての扱いやすさ)の理由により、"ライフタイムの省略"と呼ばれている、非常に制限された第二の推論アルゴリズムがシグネチャの部分に適用されます
その推論はシグネチャのコンポーネントだけに基づき、関数本体には基づかず、ライフタイムパラメータだけを推論します。そしてたった3つの覚えやすく明確なルールに従って行います
ライフタイムの省略で要素のシグネチャを短く書くことができます。しかしローカル型推論が適用されるときのように実際の型を隠すことはできません

<!-- When talking about lifetime elision, we use the term *input lifetime* and -->
<!-- *output lifetime*. An *input lifetime* is a lifetime associated with a parameter -->
Expand Down