diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-08-10 07:16:30 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-09-07 08:44:35 -0400 |
| commit | f422ef141a1185f721093205fabc6f5a57e3dcc0 (patch) | |
| tree | f5440928a210034703a295cdbe7b8c2f03179176 /library/std/src/sys/unix/process/process_unix.rs | |
| parent | d2454643e137bde519786ee9e650c455d7ad6f34 (diff) | |
| download | rust-f422ef141a1185f721093205fabc6f5a57e3dcc0.tar.gz rust-f422ef141a1185f721093205fabc6f5a57e3dcc0.zip | |
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 'library/std/src/sys/unix/process/process_unix.rs')
0 files changed, 0 insertions, 0 deletions
