Skip to content

Commit bda7dae

Browse files
authored
Fix lifetime-mismatch.md (#23)
* Obey to translation table * Translate error messages In the Japanese version of "The Rust Programming Language", error messages are translated into Japanese. * Obey to translation table
1 parent 28921b1 commit bda7dae

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/lifetime-mismatch.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ would expect `foo.share()` to succeed as `foo` shouldn't be mutably borrowed.
3232
-->
3333

3434
このコードはコンパイルを通ると思うかもしれません。
35-
`mutate_and_share` は、`foo` を一時的に変更可能に借り入れますが
36-
共有リファレンスを返します
37-
そうすると、`foo` は変更可能には借りられていないので
35+
`mutate_and_share` は、`foo` を一時的に変更可能に借用しますが
36+
共有参照を返します
37+
そうすると、`foo` は変更可能には借用されていないので
3838
`foo.share()` は成功すると思うでしょう。
3939

4040
<!--
@@ -45,12 +45,15 @@ However when we try to compile it:
4545

4646
```text
4747
<anon>:11:5: 11:8 error: cannot borrow `foo` as immutable because it is also borrowed as mutable
48+
(エラー: `foo`は可変で借用されているので、不変で借用できません)
4849
<anon>:11 foo.share();
4950
^~~
5051
<anon>:10:16: 10:19 note: previous borrow of `foo` occurs here; the mutable borrow prevents subsequent moves, borrows, or modification of `foo` until the borrow ends
52+
(注釈: 以前の`foo`の借用はここで起きています。可変での借用は、その借用が終わるまで、その後のムーブや、借用、`foo`の変更を防ぎます)
5153
<anon>:10 let loan = foo.mutate_and_share();
5254
^~~
5355
<anon>:12:2: 12:2 note: previous borrow ends here
56+
(注釈: 以前の借用はここで終了しています)
5457
<anon>:8 fn main() {
5558
<anon>:9 let mut foo = Foo;
5659
<anon>:10 let loan = foo.mutate_and_share();
@@ -106,7 +109,7 @@ This program is clearly correct according to the reference semantics we actually
106109
care about, but the lifetime system is too coarse-grained to handle that.
107110
-->
108111

109-
このプログラムは、私たちにとって重要なリファレンスの意味的には全く正しいのですが
112+
このプログラムは、私たちにとって重要な参照の意味的には全く正しいのですが
110113
ライフタイムシステムはこのプログラムを処理するには粗すぎるのです。
111114

112115
<!--

0 commit comments

Comments
 (0)