diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-25 21:12:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-25 21:12:17 +0200 |
| commit | 60c825f1e17603e5b5cccd0524a86d6e5770bd22 (patch) | |
| tree | 1c80ec65f00a962f43f90262992915ce5053a5cb /compiler/rustc_mir_transform/src/coverage/mod.rs | |
| parent | 9e6c4fddda9d3e5d6cf1b20a0fb82c128efe27ef (diff) | |
| parent | 64a4cdcfd4db72b7fc9b24521111f4f0edac3531 (diff) | |
| download | rust-60c825f1e17603e5b5cccd0524a86d6e5770bd22.tar.gz rust-60c825f1e17603e5b5cccd0524a86d6e5770bd22.zip | |
Rollup merge of #124313 - estebank:split-at-mut, r=fee1-dead
Detect borrow error involving sub-slices and suggest `split_at_mut` ``` error[E0499]: cannot borrow `foo` as mutable more than once at a time --> $DIR/suggest-split-at-mut.rs:13:18 | LL | let a = &mut foo[..2]; | --- first mutable borrow occurs here LL | let b = &mut foo[2..]; | ^^^ second mutable borrow occurs here LL | a[0] = 5; | ---- first borrow later used here | = help: use `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices ``` Address most of #58792. For follow up work, we should emit a structured suggestion for cases where we can identify the exact `let (a, b) = foo.split_at_mut(2);` call that is needed.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions
