diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-01-24 23:34:34 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-01-24 23:34:34 +0000 |
| commit | 1dfc437aaf09185c9830b6b5214bc2a089fd297f (patch) | |
| tree | a330ef95579442f315dbab845305b76b8c223357 /library/std/src | |
| parent | 8231e8599e238ff4e717639bd68c6abb8579fe8d (diff) | |
| download | rust-1dfc437aaf09185c9830b6b5214bc2a089fd297f.tar.gz rust-1dfc437aaf09185c9830b6b5214bc2a089fd297f.zip | |
Account for mutable borrow in argument suggestion
```
error: value assigned to `object` is never read
--> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:21:5
|
LL | object = &mut object2;
| ^^^^^^
|
help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding
|
LL ~ fn change_object3(object: &mut Object) {
LL |
LL | let object2 = Object;
LL ~ *object = object2;
|
```
instead of
```
error: value assigned to `object` is never read
--> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:21:5
|
LL | object = &mut object2;
| ^^^^^^
|
help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding
|
LL ~ fn change_object3(object: &mut mut Object) {
LL |
LL | let object2 = Object;
LL ~ *object = object2;
|
```
Fix #136028.
Diffstat (limited to 'library/std/src')
0 files changed, 0 insertions, 0 deletions
