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
..
rustc cleanup: Remove duplicate library names from Cargo.tomls 2020-08-30 22:57:54 +03:00
rustc_apfloat mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_arena mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_ast Revert "Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov" 2020-09-10 02:18:46 +00:00
rustc_ast_lowering mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_ast_passes Implementation of incompatible features error 2020-09-04 22:17:28 +08:00
rustc_ast_pretty Auto merge of #76170 - matklad:notrivia, r=petrochenkov 2020-09-02 03:19:38 +00:00
rustc_attr mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_builtin_macros Improve recovery on malformed format call 2020-09-02 13:18:19 +02:00
rustc_codegen_llvm Rollup merge of #74787 - petrochenkov:rustllvm, r=cuviper 2020-09-09 21:02:24 -07:00
rustc_codegen_ssa Add -Z combine_cgu flag 2020-09-09 17:32:23 +10:00
rustc_data_structures Capitalize safety comments 2020-09-08 22:37:18 -04:00
rustc_driver Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_error_codes Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasper 2020-09-09 15:05:45 -07:00
rustc_errors rustc_{errors,session}: add delay_good_path_bug 2020-09-02 10:43:17 +03:00
rustc_expand Revert "Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov" 2020-09-10 02:18:46 +00:00
rustc_feature Implementation of incompatible features error 2020-09-04 22:17:28 +08:00
rustc_fs_util mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_graphviz Also fixed monospace font for d3-graphviz engine 2020-09-09 14:49:32 -07:00
rustc_hir add track_caller to local_def_id_to_hir_id 2020-09-04 09:24:44 +02:00
rustc_hir_pretty mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_incremental mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_index Improve BitSet APIs 2020-08-30 11:13:18 -07:00
rustc_infer ty.flags -> ty.flags() 2020-09-04 18:28:20 +02:00
rustc_interface Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_lexer lexer: Tiny improvement to shebang detection 2020-09-02 00:40:19 +03:00
rustc_lint Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_llvm Move rustllvm into rustc_llvm 2020-09-09 23:05:43 +03:00
rustc_macros Fix non-determinism in generated format string. 2020-09-09 21:23:25 +10:00
rustc_metadata Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_middle Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk 2020-09-10 05:54:26 +00:00
rustc_mir Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk 2020-09-10 05:54:26 +00:00
rustc_mir_build Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk 2020-09-10 05:54:26 +00:00
rustc_parse Revert "Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov" 2020-09-10 02:18:46 +00:00
rustc_parse_format mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_passes Auto merge of #75888 - GuillaumeGomez:trait-impl-assoc-const-doc-alias, r=ollie27 2020-09-05 09:35:17 +00:00
rustc_plugin_impl mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_privacy Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_query_system mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_resolve Rollup merge of #76522 - matthiaskrgr:redundant_clone, r=jonas-schievink 2020-09-09 15:06:05 -07:00
rustc_save_analysis Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_serialize mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_session Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk 2020-09-10 05:54:26 +00:00
rustc_span Adds two source span utility functions used in source-based coverage 2020-08-31 18:41:57 -07:00
rustc_symbol_mangling Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_target remove redundant clones 2020-09-09 16:32:55 +02:00
rustc_trait_selection add tracking issue, fix rebase 2020-09-08 16:39:12 +02:00
rustc_traits kind -> kind() 2020-09-04 19:17:57 -04:00
rustc_ty Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_typeck Rollup merge of #76401 - JulianKnodt:i68366, r=lcnr 2020-09-09 01:35:20 +02:00