rust/compiler
bors 2b681ac06b Auto merge of #92259 - Aaron1011:normal-mod-hashing, r=michaelwoerister
Remove special-cased stable hashing for HIR module

All other 'containers' (e.g. `impl` blocks) hashed their contents
in the normal, order-dependent way. However, `Mod` was hashing
its contents in a (sort-of) order-independent way. However, the
exact order is exposed to consumers through `Mod.item_ids`,
and through query results like `hir_module_items`. Therefore,
stable hashing needs to take the order of items into account,
to avoid fingerprint ICEs.

Unforuntately, I was unable to directly build a reproducer
for the ICE, due to the behavior of `Fingerprint::combine_commutative`.
This operation swaps the upper and lower `u64` when constructing the
result, which makes the function non-associative. Since we start
the hashing of module items by combining `Fingerprint::ZERO` with
the first item, it's difficult to actually build an example where
changing the order of module items leaves the final hash unchanged.

However, this appears to have been hit in practice in #92218
While we're not able to reproduce it, the fact that proc-macros
are involved (which can give an entire module the same span, preventing
any span-related invalidations) makes me confident that the root
cause of that issue is our method of hashing module items.

This PR removes all of the special handling for `Mod`, instead deriving
a `HashStable` implementation. This makes `Mod` consistent with other
'contains' like `Impl`, which hash their contents through the typical
derive of `HashStable`.
2022-01-04 00:25:23 +00:00
..
rustc Remove useless #[global_allocator] from rustc and rustdoc. 2021-12-23 17:23:21 +11:00
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #92294 - Kobzol:rustdoc-meta-kind, r=GuillaumeGomez 2022-01-01 02:03:23 +00:00
rustc_ast_lowering Move PatKind::Lit checking from ast_validation to ast lowering 2022-01-01 15:10:43 -05:00
rustc_ast_passes Move PatKind::Lit checking from ast_validation to ast lowering 2022-01-01 15:10:43 -05:00
rustc_ast_pretty Rollup merge of #92418 - dtolnay:emptystructpat, r=michaelwoerister 2022-01-03 14:44:20 +01:00
rustc_attr
rustc_borrowck Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_builtin_macros Auto merge of #92066 - Smittyvb:concat_bytes-repeat, r=nagisa 2022-01-02 12:38:41 +00:00
rustc_codegen_cranelift Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_codegen_gcc Update references to -Z symbol-mangling-version to use -C 2022-01-01 15:53:11 -08:00
rustc_codegen_llvm Auto merge of #92419 - erikdesjardins:coldland, r=nagisa 2022-01-01 13:28:13 +00:00
rustc_codegen_ssa Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_const_eval Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_data_structures Rustdoc: use ThinVec for GenericArgs bindings 2022-01-01 11:29:14 +01:00
rustc_driver Upgrade tracing-subscriber 2021-12-22 10:47:36 -06:00
rustc_error_codes docs(error-codes): Add long error explanation for E0227 2021-12-28 15:46:20 +03:00
rustc_errors
rustc_expand Rollup merge of #91519 - petrochenkov:cratexp2, r=Aaron1011 2021-12-30 13:12:33 +01:00
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir Remove special-cased stable hashing for HIR module 2021-12-24 12:38:29 -05:00
rustc_hir_pretty Rollup merge of #92418 - dtolnay:emptystructpat, r=michaelwoerister 2022-01-03 14:44:20 +01:00
rustc_incremental Add #[rustc_clean(loaded_from_disk)] to assert loading of query result 2021-12-21 16:34:12 -05:00
rustc_index Introduce IntervalSet 2021-12-30 22:33:44 -05:00
rustc_infer Refactor variance diagnostics to work with more types 2021-12-29 18:53:40 -05:00
rustc_interface Auto merge of #90128 - joshtriplett:stabilize-symbol-mangling-version, r=wesleywiser 2022-01-02 15:49:23 +00:00
rustc_lexer
rustc_lint Rollup merge of #91770 - TaKO8Ki:suggest-adding-cfg-test, r=joshtriplett 2021-12-21 08:33:39 +01:00
rustc_lint_defs Rollup merge of #91770 - TaKO8Ki:suggest-adding-cfg-test, r=joshtriplett 2021-12-21 08:33:39 +01:00
rustc_llvm Auto merge of #92419 - erikdesjardins:coldland, r=nagisa 2022-01-01 13:28:13 +00:00
rustc_macros Rollup merge of #92011 - Aaron1011:decode-span, r=michaelwoerister 2022-01-03 14:44:16 +01:00
rustc_metadata Auto merge of #90128 - joshtriplett:stabilize-symbol-mangling-version, r=wesleywiser 2022-01-02 15:49:23 +00:00
rustc_middle Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_mir_build Store a DefId instead of an AdtDef in AggregateKind::Adt 2021-12-22 14:36:34 -05:00
rustc_mir_dataflow Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_mir_transform Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_monomorphize Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
rustc_parse Parse and suggest moving where clauses after equals for type aliases 2021-12-28 14:20:15 -05:00
rustc_parse_format
rustc_passes Add Attribute::meta_kind 2021-12-26 16:56:34 +01:00
rustc_plugin_impl
rustc_privacy Rollup merge of #90586 - jswrenn:relax-privacy-lints, r=petrochenkov 2021-12-27 21:42:25 +01:00
rustc_query_impl Import SourceFiles from crate before decoding foreign Span 2021-12-23 12:56:12 -05:00
rustc_query_system Auto merge of #92259 - Aaron1011:normal-mod-hashing, r=michaelwoerister 2022-01-04 00:25:23 +00:00
rustc_resolve Rollup merge of #92402 - pr2502:while-let-typo, r=oli-obk 2022-01-03 14:44:18 +01:00
rustc_save_analysis Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_serialize Do not use LEB128 for encoding u16 and i16 2021-12-28 09:29:08 +01:00
rustc_session Update references to -Z symbol-mangling-version to use -C 2022-01-01 15:53:11 -08:00
rustc_span Auto merge of #92179 - Aaron1011:incr-loaded-from-disk, r=michaelwoerister 2022-01-03 11:20:08 +00:00
rustc_symbol_mangling Update references to -Z symbol-mangling-version to use -C 2022-01-01 15:53:11 -08:00
rustc_target Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgr 2021-12-19 12:36:56 +00:00
rustc_trait_selection Auto merge of #92244 - petrochenkov:alltraits, r=cjgillot 2021-12-29 19:22:33 +00:00
rustc_traits Auto merge of #91929 - anuvratsingh:remove_in_band_lifetimes_compiler_rustc_traits, r=jackh726 2021-12-31 05:08:24 +00:00
rustc_ty_utils Use a const ParamEnv when in default_method_body_is_const 2021-12-17 20:42:48 +08:00
rustc_type_ir
rustc_typeck Auto merge of #92294 - Kobzol:rustdoc-meta-kind, r=GuillaumeGomez 2022-01-01 02:03:23 +00:00