rust/compiler
bors 88197214b8 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.
2020-09-10 05:54:26 +00:00
..
2020-09-09 17:32:23 +10:00
2020-09-04 18:28:20 +02:00
2020-09-04 17:47:51 +02:00
2020-09-09 23:05:43 +03:00
2020-09-04 17:47:51 +02:00
2020-09-04 17:47:51 +02:00
2020-09-09 16:32:55 +02:00
2020-09-04 19:17:57 -04:00
2020-09-04 17:47:51 +02:00