about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-10 05:54:26 +0000
committerbors <bors@rust-lang.org>2020-09-10 05:54:26 +0000
commit961f18317dcb427277ac89a89936781fdef31a17 (patch)
treea164a95b7ba07660068331c92ead686f4643b75d /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent3ffe9f843c1709bce254f98dcb0a08a04ac3fe8d (diff)
parentf23670ed68c4871a3048bf24f7ad2aa426555b6e (diff)
downloadrust-961f18317dcb427277ac89a89936781fdef31a17.tar.gz
rust-961f18317dcb427277ac89a89936781fdef31a17.zip
Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk
Add CONST_ITEM_MUTATION lint

Fixes #74053
Fixes #55721

This PR adds a new lint `CONST_ITEM_MUTATION`.
Given an item `const FOO: SomeType = ..`, this lint fires on:

* Attempting to write directly to a field (`FOO.field = some_val`) or
  array entry (`FOO.array_field[0] = val`)
* Taking a mutable reference to the `const` item (`&mut FOO`), including
  through an autoderef `FOO.some_mut_self_method()`

The lint message explains that since each use of a constant creates a
new temporary, the original `const` item will not be modified.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions