Revise paragraph in "ライフタイムの省略" #144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ライフタイムの省略の最初の段落が意味を取りにくかったので相談です.
こんな感じで改善してみようかと思うのですが,いかがでしょうか.
訳にはあまり自信がありません.
もしOKそうなら適用してプルリクエストをちゃんと作ります.
Rust は関数本体の部分では強力なローカル型推論をサポートします。しかし要素のシグネチャの部分では、型が要素のシグネチャだけでわかるようにするため,(型推論が)許されていません。
とはいえ、人間工学的な理由により(訳注:人間が読みやすいように)"ライフタイムの省略"と呼ばれている、非常に制限された第二の推論アルゴリズムはシグネチャの部分に適用されます。
その推論はシグネチャのコンポーネントだけに基づき、関数本体には基づかず、ライフタイムパラメータだけを推論します。そしてたった3つの覚えやすく明確なルールに従って行います。
ライフタイムの省略で要素のシグネチャを短く書くことができます。しかしローカル型推論が適用されるときのように実際の型を隠すことはできません。