rust/tests/ui/mut
Esteban Küber 130b0d294a Tweak &mut self suggestion span
```
error[E0596]: cannot borrow `*self.s` as mutable, as it is behind a `&` reference
  --> $DIR/issue-38147-1.rs:17:9
   |
LL |         self.s.push('x');
   |         ^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn f(&mut self) {
   |           +++
```

Note the suggestion to add `mut` instead of replacing the entire `&self` with `&mut self`.
2025-01-28 19:35:51 +00:00
..
mut-cant-alias.rs
mut-cant-alias.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
mut-cross-borrowing.rs
mut-cross-borrowing.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
mut-pattern-internal-mutability.rs
mut-pattern-internal-mutability.stderr Better span for "make binding mutable" suggestion 2024-07-04 02:02:21 +00:00
mut-pattern-mismatched.rs
mut-pattern-mismatched.stderr
mut-ref.rs Feature gate 2024-03-27 11:20:28 -04:00
mut-suggestion.rs
mut-suggestion.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
mutable-class-fields-2.rs
mutable-class-fields-2.stderr Tweak &mut self suggestion span 2025-01-28 19:35:51 +00:00
mutable-class-fields.rs
mutable-class-fields.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
mutable-enum-indirect.rs
mutable-enum-indirect.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
no-mut-lint-for-desugared-mut.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00