diff options
| author | bors <bors@rust-lang.org> | 2022-12-31 08:43:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-31 08:43:24 +0000 |
| commit | 96c1f338bb5ba7bae2285fc48f249aa5015e542a (patch) | |
| tree | 4a41272bed63737b93988fe2705640567ffe5a19 /src/test/ui/array-slice-vec | |
| parent | 247e44e61d934e1927db0ff557fe17f131a2379c (diff) | |
| parent | b9439ebf1240e75e8f110298bbfe868169f16ebe (diff) | |
| download | rust-96c1f338bb5ba7bae2285fc48f249aa5015e542a.tar.gz rust-96c1f338bb5ba7bae2285fc48f249aa5015e542a.zip | |
Auto merge of #106245 - estebank:mutability-suggestions, r=jyn514
Use verbose suggestions for mutability errors
Diffstat (limited to 'src/test/ui/array-slice-vec')
| -rw-r--r-- | src/test/ui/array-slice-vec/slice-mut-2.stderr | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/ui/array-slice-vec/slice-mut-2.stderr b/src/test/ui/array-slice-vec/slice-mut-2.stderr index bad0268772b..5b040d3e4d3 100644 --- a/src/test/ui/array-slice-vec/slice-mut-2.stderr +++ b/src/test/ui/array-slice-vec/slice-mut-2.stderr @@ -1,11 +1,13 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/slice-mut-2.rs:7:18 | -LL | let x: &[isize] = &[1, 2, 3, 4, 5]; - | ---------------- help: consider changing this to be a mutable reference: `&mut [1, 2, 3, 4, 5]` -... LL | let _ = &mut x[2..4]; | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable + | +help: consider changing this to be a mutable reference + | +LL | let x: &[isize] = &mut [1, 2, 3, 4, 5]; + | ~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error |
