diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-06 03:17:04 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-06 03:17:04 +0000 |
| commit | cd65cd27db8a8fc11f3191d3e461d331ed0db968 (patch) | |
| tree | be633afbccffdd6805cfb66f81adb3e89862bfdc /tests | |
| parent | 3560a2b399ea30b8cd62d9c91a326f03a728e92a (diff) | |
| download | rust-cd65cd27db8a8fc11f3191d3e461d331ed0db968.tar.gz rust-cd65cd27db8a8fc11f3191d3e461d331ed0db968.zip | |
Improve find_self_call with reborrowed receiver
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/lint/lint-const-item-mutation.stderr | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/ui/lint/lint-const-item-mutation.stderr b/tests/ui/lint/lint-const-item-mutation.stderr index 747c38b8007..0e405c306fe 100644 --- a/tests/ui/lint/lint-const-item-mutation.stderr +++ b/tests/ui/lint/lint-const-item-mutation.stderr @@ -75,10 +75,15 @@ warning: taking a mutable reference to a `const` item --> $DIR/lint-const-item-mutation.rs:42:5 | LL | (&mut MY_STRUCT).use_mut(); - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item +note: mutable reference created due to call to this method + --> $DIR/lint-const-item-mutation.rs:9:5 + | +LL | fn use_mut(&mut self) {} + | ^^^^^^^^^^^^^^^^^^^^^ note: `const` item defined here --> $DIR/lint-const-item-mutation.rs:27:1 | |
