rust/compiler
bors 99ff5afeb8 Auto merge of #111329 - jyn514:metadata-ice, r=bjorn3
Load only the crate header for `locator::crate_matches`

Previously, we used the following info to determine whether to load the crate:
1. The METADATA_HEADER, which includes a METADATA_VERSION constant
2. The embedded rustc version
3. Various metadata in the `CrateRoot`, including the SVH

This worked ok most of the time. Unfortunately, when building locally the rustc version is always
the same because `omit-git-hash` is on by default. That meant that we depended only on 1 and 3, and
we are not very good about bumping METADATA_VERSION (it's currently at 7) so in practice we were
only depending on 3. `CrateRoot` is a very large struct and changes somewhat regularly, so this led
to a steady stream of crashes from trying to load it.

Change the logic to add an intermediate step between 2 and 3: introduce a new `CrateHeader` struct
that contains only the minimum info needed to decide whether the crate should be loaded or not. That
avoids having to load all of `CrateRoot`, which in practice means we should crash much less often.

Note that this works because the SVH should be different between any two dependencies, even if the
compiler has changed, because we use `-Zbinary-dep-depinfo` in bootstrap. See
https://github.com/rust-lang/rust/pull/111329#issuecomment-1538303474 for more details about how the
original crash happened.
2023-05-29 10:40:32 +00:00
..
rustc
rustc_abi Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
rustc_apfloat
rustc_arena Deny the unsafe_op_in_unsafe_fn lint in 2023-04-28 21:00:54 -07:00
rustc_ast Add warn-by-default lint for local binding shadowing exported glob re-export item 2023-05-27 18:49:07 +08:00
rustc_ast_lowering Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_ast_passes Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_ast_pretty Migrate offset_of from a macro to builtin # syntax 2023-05-05 21:44:13 +02:00
rustc_attr Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck Rollup merge of #111983 - compiler-errors:type-op-locally, r=lcnr 2023-05-27 13:38:32 +02:00
rustc_builtin_macros Auto merge of #111748 - nnethercote:Cow-DiagnosticMessage, r=WaffleLapkin 2023-05-29 07:10:44 +00:00
rustc_codegen_cranelift Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_codegen_gcc Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_codegen_llvm Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_codegen_ssa Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_const_eval Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_data_structures Add some comments 2023-05-28 15:54:52 +02:00
rustc_driver
rustc_driver_impl Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_error_codes Add details about unsafe_op_in_unsafe_fn to E0133 2023-05-28 13:11:30 +02:00
rustc_error_messages Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_errors Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_expand Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_feature Use is_some_and/is_ok_and in less obvious spots 2023-05-24 14:33:43 +00:00
rustc_fluent_macro Remove unused synstructure dep 2023-04-22 22:03:33 +01:00
rustc_fs_util
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
rustc_hir_analysis Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_hir_pretty Rip it out 2023-05-01 16:15:13 +08:00
rustc_hir_typeck Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_incremental Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_index Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth 2023-05-25 00:33:43 +00:00
rustc_infer Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_interface Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_lexer Don't try to eat non-existent decimal digits. 2023-05-15 18:33:12 +10:00
rustc_lint Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_lint_defs Add warn-by-default lint for local binding shadowing exported glob re-export item 2023-05-27 18:49:07 +08:00
rustc_llvm Add SafeStack support to rustc 2023-05-26 15:18:54 -04:00
rustc_log Stabilize IsTerminal 2023-04-10 17:24:23 +09:00
rustc_macros Merge query property modules into one 2023-05-18 09:45:12 +02:00
rustc_metadata Auto merge of #111329 - jyn514:metadata-ice, r=bjorn3 2023-05-29 10:40:32 +00:00
rustc_middle Auto merge of #111748 - nnethercote:Cow-DiagnosticMessage, r=WaffleLapkin 2023-05-29 07:10:44 +00:00
rustc_mir_build Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin 2023-05-27 13:38:31 +02:00
rustc_mir_dataflow Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin 2023-05-27 13:38:31 +02:00
rustc_mir_transform Auto merge of #111813 - scottmcm:pretty-mir, r=cjgillot 2023-05-28 21:53:56 +00:00
rustc_monomorphize Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_parse Auto merge of #111748 - nnethercote:Cow-DiagnosticMessage, r=WaffleLapkin 2023-05-29 07:10:44 +00:00
rustc_parse_format Fix typos in compiler 2023-04-10 22:02:52 +02:00
rustc_passes Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_plugin_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_privacy Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_query_impl Add comment 2023-05-21 11:25:07 +02:00
rustc_query_system Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_resolve Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_serialize Fix the FileEncoder buffer size. 2023-05-15 08:59:11 +10:00
rustc_session Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_smir Remove DesugaringKind::Replace. 2023-05-25 17:40:46 +00:00
rustc_span Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin 2023-05-27 13:38:31 +02:00
rustc_symbol_mangling Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_target compiler: update solaris and illumos spec to support TSAN. 2023-05-28 13:46:23 +01:00
rustc_trait_selection Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
rustc_traits Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_transmute Remove unused TypeFoldable/TypeVisitable impls. 2023-04-26 15:19:50 +10:00
rustc_ty_utils Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_type_ir Implement references VarDebugInfo. 2023-05-13 10:12:14 +00:00