about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-29 15:29:49 +0100
committerGitHub <noreply@github.com>2025-01-29 15:29:49 +0100
commit1f6a9aaceed0790150de83c37692fe5b5dc4c7fe (patch)
tree79c68b02dc4485dabb38b11b87df547b8d1fb061 /src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
parentf614bfa6e249e6165beafb707bf022c652822a44 (diff)
parent130b0d294a3404b5827869de5712009f91724700 (diff)
downloadrust-1f6a9aaceed0790150de83c37692fe5b5dc4c7fe.tar.gz
rust-1f6a9aaceed0790150de83c37692fe5b5dc4c7fe.zip
Rollup merge of #136212 - estebank:span-tweak, r=petrochenkov
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`.
Diffstat (limited to 'src/doc/rustc-dev-guide/examples/rustc-driver-example.rs')
0 files changed, 0 insertions, 0 deletions