You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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
Copy file name to clipboardExpand all lines: src/lifetime-mismatch.md
+7-4
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,9 @@ would expect `foo.share()` to succeed as `foo` shouldn't be mutably borrowed.
32
32
-->
33
33
34
34
このコードはコンパイルを通ると思うかもしれません。
35
-
`mutate_and_share` は、`foo`を一時的に変更可能に借り入れますが、
36
-
共有リファレンスを返します。
37
-
そうすると、`foo`は変更可能には借りられていないので、
35
+
`mutate_and_share` は、`foo`を一時的に変更可能に借用しますが、
36
+
共有参照を返します。
37
+
そうすると、`foo`は変更可能には借用されていないので、
38
38
`foo.share()` は成功すると思うでしょう。
39
39
40
40
<!--
@@ -45,12 +45,15 @@ However when we try to compile it:
45
45
46
46
```text
47
47
<anon>:11:5: 11:8 error: cannot borrow `foo` as immutable because it is also borrowed as mutable
48
+
(エラー: `foo`は可変で借用されているので、不変で借用できません)
48
49
<anon>:11 foo.share();
49
50
^~~
50
51
<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
0 commit comments