File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -132,22 +132,25 @@ fn main() {
132
132
133
133
``` text
134
134
<anon>:12:28: 12:32 error: `days` does not live long enough
135
+ (エラー: `days` は十分長生きしません)
135
136
<anon>:12 inspector = Inspector(&days);
136
137
^~~~
137
138
<anon>:9:11: 15:2 note: reference must be valid for the block at 9:10...
139
+ (注釈: 参照は 9:10 にあるブロックに対して有効でなければなりません)
138
140
<anon>:9 fn main() {
139
141
<anon>:10 let (inspector, days);
140
142
<anon>:11 days = Box::new(1);
141
143
<anon>:12 inspector = Inspector(&days);
142
- <anon>:13 // Let's say `days` happens to get dropped first.
143
- <anon>:14 // Then when Inspector is dropped, it will try to read free'd memory !
144
+ <anon>:13 // `days` が先にドロップするとしましょう。
145
+ <anon>:14 // すると、 Inspector がドロップされる時、解放されたメモリを読もうとします !
144
146
...
145
147
<anon>:10:27: 15:2 note: ...but borrowed value is only valid for the block suffix following statement 0 at 10:26
148
+ (注釈: ...しかし、借用された値は 10:26 にある、文 0 に続くブロックサフィックスに対してのみ有効です)
146
149
<anon>:10 let (inspector, days);
147
150
<anon>:11 days = Box::new(1);
148
151
<anon>:12 inspector = Inspector(&days);
149
- <anon>:13 // Let's say `days` happens to get dropped first.
150
- <anon>:14 // Then when Inspector is dropped, it will try to read free'd memory !
152
+ <anon>:13 // `days` が先にドロップするとしましょう。
153
+ <anon>:14 // すると、 Inspector がドロップされる時、解放されたメモリを読もうとします !
151
154
<anon>:15 }
152
155
```
153
156
You can’t perform that action at this time.
0 commit comments