|
1 | 1 | $ cargo run |
2 | 2 | Compiling unsafe-example v0.1.0 (file:///projects/unsafe-example) |
3 | | -error[E0499]: cannot borrow `*slice` as mutable more than once at a time |
4 | | - --> src/main.rs:6:30 |
| 3 | +error[E0499]: cannot borrow `*values` as mutable more than once at a time |
| 4 | +(エラー: 一度に2回以上、`*values`を可変で借用できません) |
| 5 | + --> src/main.rs:6:31 |
5 | 6 | | |
6 | | -1 | fn split_at_mut(slice: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) { |
7 | | - | - let's call the lifetime of this reference `'1` |
| 7 | +1 | fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) { |
| 8 | + | - let's call the lifetime of this reference `'1` |
| 9 | + | (この参照のライフタイムを`'1`とします) |
8 | 10 | ... |
9 | | -6 | (&mut slice[..mid], &mut slice[mid..]) |
10 | | - | -------------------------^^^^^-------- |
11 | | - | | | | |
12 | | - | | | second mutable borrow occurs here |
| 11 | +6 | (&mut values[..mid], &mut values[mid..]) |
| 12 | + | --------------------------^^^^^^-------- |
| 13 | + | | | | |
| 14 | + | | | second mutable borrow occurs here |
| 15 | + | | | (2回目の可変参照はここで発生します) |
13 | 16 | | | first mutable borrow occurs here |
14 | | - | returning this value requires that `*slice` is borrowed for `'1` |
15 | | - |
16 | | -error: aborting due to previous error |
| 17 | + | | (1回目の可変参照はここで発生します) |
| 18 | + | returning this value requires that `*values` is borrowed for `'1` |
| 19 | + | (この値を返すためには`*values`が`'1`の間借用されていることが必要です) |
17 | 20 |
|
18 | 21 | For more information about this error, try `rustc --explain E0499`. |
19 | | -error: could not compile `unsafe-example`. |
20 | | - |
21 | | -To learn more, run the command again with --verbose. |
| 22 | +error: could not compile `unsafe-example` (bin "unsafe-example") due to 1 previous error |
0 commit comments