rust/compiler
bors 3dbb4da042 Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin
Call FileEncoder::finish in rmeta encoding

Fixes https://github.com/rust-lang/rust/issues/117254

The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out.

I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths.

I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing.

r? `@WaffleLapkin`
2023-11-26 14:43:02 +00:00
..
rustc Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_abi Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_arena Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_ast Add Span to TraitBoundModifier 2023-11-24 14:32:05 +00:00
rustc_ast_lowering Rollup merge of #118158 - nnethercote:reduce-fluent-boilerplate, r=compiler-errors 2023-11-25 17:23:33 -05:00
rustc_ast_passes Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_ast_pretty Add Span to TraitBoundModifier 2023-11-24 14:32:05 +00:00
rustc_attr Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_baked_icu_data Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_borrowck Auto merge of #118256 - petrochenkov:nohir, r=compiler-errors 2023-11-26 10:43:41 +00:00
rustc_builtin_macros Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_codegen_cranelift Auto merge of #118279 - bjorn3:sync_cg_clif-2023-11-25, r=bjorn3 2023-11-25 13:08:29 +00:00
rustc_codegen_gcc Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_codegen_llvm Rollup merge of #118158 - nnethercote:reduce-fluent-boilerplate, r=compiler-errors 2023-11-25 17:23:33 -05:00
rustc_codegen_ssa Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin 2023-11-26 14:43:02 +00:00
rustc_const_eval rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_data_structures Enforce NonZeroUsize on thread count 2023-11-23 20:10:44 -05:00
rustc_driver Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_driver_impl Remove unnecessary dependencies. 2023-11-26 08:38:42 +11:00
rustc_error_codes Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_error_messages Remove rustc_error_messages/messages.ftl. 2023-11-26 08:37:27 +11:00
rustc_errors Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_expand Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_feature Add an experimental feature gate for function delegation 2023-11-23 17:27:31 +03:00
rustc_fluent_macro Add a useful comment. 2023-11-26 08:38:02 +11:00
rustc_fs_util Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_graphviz remove unused pub fn 2023-11-23 14:11:02 +03:00
rustc_hir Rollup merge of #118158 - nnethercote:reduce-fluent-boilerplate, r=compiler-errors 2023-11-25 17:23:33 -05:00
rustc_hir_analysis rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_hir_pretty Remove HirId from QPath::LangItem 2023-11-25 18:02:11 +00:00
rustc_hir_typeck rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_incremental Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin 2023-11-26 14:43:02 +00:00
rustc_index Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_index_macros Document newtype_index attributes. 2023-11-22 18:38:20 +11:00
rustc_infer rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_interface Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin 2023-11-26 14:43:02 +00:00
rustc_lexer Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_lint rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_lint_defs Remove --check-cfg checking of --cfg args 2023-11-18 12:21:58 +01:00
rustc_llvm remove unused pub fn 2023-11-23 14:11:02 +03:00
rustc_log rustc_log: provide a way to init logging based on the values, not names, of the env vars 2023-11-11 15:24:33 +01:00
rustc_macros Unify HashStable implementations 2023-11-21 05:49:45 +00:00
rustc_metadata Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin 2023-11-26 14:43:02 +00:00
rustc_middle Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin 2023-11-26 14:43:02 +00:00
rustc_mir_build rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_mir_dataflow Rollup merge of #118288 - compiler-errors:is_some_and, r=lqd,dtolnay 2023-11-25 17:23:34 -05:00
rustc_mir_transform rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_monomorphize Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_parse Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
rustc_parse_format Auto merge of #117819 - fmease:rustc_parse_format-stable-rustc, r=Nilstrieb 2023-11-15 14:55:35 +00:00
rustc_passes rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_privacy rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_query_impl rustc: Make def_kind mandatory for all DefIds 2023-11-25 14:49:43 +03:00
rustc_query_system Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin 2023-11-26 14:43:02 +00:00
rustc_resolve Rollup merge of #118288 - compiler-errors:is_some_and, r=lqd,dtolnay 2023-11-25 17:23:34 -05:00
rustc_serialize Call FileEncoder::finish in rmeta encoding 2023-11-22 22:49:22 -05:00
rustc_session Rollup merge of #118158 - nnethercote:reduce-fluent-boilerplate, r=compiler-errors 2023-11-25 17:23:33 -05:00
rustc_smir Reorder imports and remove re-export 2023-11-24 15:09:26 -08:00
rustc_span Rollup merge of #117871 - klensy:unused-pub, r=cjgillot 2023-11-25 19:51:54 +01:00
rustc_symbol_mangling Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_target Auto merge of #118127 - RalfJung:unadjusted-abi, r=compiler-errors 2023-11-25 17:06:22 +00:00
rustc_trait_selection Auto merge of #118267 - compiler-errors:ambiguity-causes, r=spastorino 2023-11-26 12:44:38 +00:00
rustc_traits Auto merge of #118120 - compiler-errors:closure-kind, r=lcnr 2023-11-22 21:09:01 +00:00
rustc_transmute Update itertools to 0.11. 2023-11-22 08:13:21 +11:00
rustc_ty_utils rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
rustc_type_ir Auto merge of #118120 - compiler-errors:closure-kind, r=lcnr 2023-11-22 21:09:01 +00:00
stable_mir is_{some,ok}_and 2023-11-25 18:47:16 +00:00