rust/compiler
Dylan DPC 43634675f6
Rollup merge of #103061 - Amanieu:rewrite_alloc_error_handler, r=bjorn3
Rewrite implementation of `#[alloc_error_handler]`

The new implementation doesn't use weak lang items and instead changes `#[alloc_error_handler]` to an attribute macro just like `#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom` function is defined in any crate then the compiler shim will call `__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with `default_alloc_error_handler`: `__rg_oom` was previously defined in the alloc crate and would attempt to reference the `oom` lang item, even if it didn't exist. This worked as long as `__rg_oom` was excluded from linking since it was not called.

This is a prerequisite for the stabilization of `default_alloc_error_handler` (#102318).
2022-11-01 14:12:25 +05:30
..
rustc
rustc_apfloat
rustc_arena
rustc_ast remove unused parser fn 2022-10-26 19:19:44 +00:00
rustc_ast_lowering Rollup merge of #93582 - WaffleLapkin:rpitirpit, r=compiler-errors 2022-10-30 11:50:26 +05:30
rustc_ast_passes Rollup merge of #95710 - fee1-dead-contrib:stabilize_arbitrary_enum_discriminant, r=joshtriplett 2022-10-26 17:32:53 +05:30
rustc_ast_pretty
rustc_attr Migrate all diagnostics 2022-10-23 10:09:44 +02:00
rustc_borrowck Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errors 2022-10-29 14:18:03 +02:00
rustc_builtin_macros Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_codegen_cranelift Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_codegen_gcc Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_codegen_llvm Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_codegen_ssa Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_const_eval Rollup merge of #103798 - RalfJung:type_name, r=oli-obk 2022-11-01 12:03:43 +09:00
rustc_data_structures Introduce UnordMap, UnordSet, and UnordBag (see MCP 533) 2022-10-27 13:23:26 +00:00
rustc_driver Remove rustc_driver::set_sigpipe_handler() 2022-10-25 19:13:23 +02:00
rustc_error_codes Update E0382.md 2022-10-31 00:41:12 -04:00
rustc_error_messages Rollup merge of #103061 - Amanieu:rewrite_alloc_error_handler, r=bjorn3 2022-11-01 14:12:25 +05:30
rustc_errors Allow specifying multiple alternative suggestions 2022-10-23 18:59:13 +02:00
rustc_expand Rollup merge of #103544 - Nilstrieb:no-recovery-pls, r=compiler-errors 2022-10-27 15:03:58 +02:00
rustc_feature Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #103061 - Amanieu:rewrite_alloc_error_handler, r=bjorn3 2022-11-01 14:12:25 +05:30
rustc_hir_analysis Rollup merge of #103603 - camsteffen:refactor-lang, r=oli-obk 2022-10-31 14:52:56 +05:30
rustc_hir_pretty
rustc_hir_typeck Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_incremental Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
rustc_index
rustc_infer Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
rustc_interface Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
rustc_lexer rustc_lexer::TokenKind improve docs 2022-10-26 23:32:14 +02:00
rustc_lint Rollup merge of #103338 - l4l:enum-unreachable-pub, r=nagisa 2022-10-31 14:52:55 +05:30
rustc_lint_defs Rollup merge of #102635 - lcnr:incoherent_auto_trait_objects, r=jackh726 2022-10-22 00:13:59 +02:00
rustc_llvm llvm-16: Don't initialize removed legacy passes 2022-10-25 15:03:21 -07:00
rustc_log
rustc_macros Allow specifying multiple alternative suggestions 2022-10-23 18:59:13 +02:00
rustc_metadata Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_middle Rollup merge of #103061 - Amanieu:rewrite_alloc_error_handler, r=bjorn3 2022-11-01 14:12:25 +05:30
rustc_mir_build Rollup merge of #103749 - est31:reduce_irrefutable_let_else_span, r=cjgillot 2022-11-01 12:03:41 +09:00
rustc_mir_dataflow Migrate all diagnostics 2022-10-23 10:09:44 +02:00
rustc_mir_transform Rollup merge of #101428 - JakobDegen:build-tests, r=oli-obk 2022-10-30 19:31:37 -07:00
rustc_monomorphize Use tcx.require_lang_item 2022-10-29 16:09:15 -05:00
rustc_parse Rollup merge of #103544 - Nilstrieb:no-recovery-pls, r=compiler-errors 2022-10-27 15:03:58 +02:00
rustc_parse_format
rustc_passes Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00
rustc_plugin_impl Migrate all diagnostics 2022-10-23 10:09:44 +02:00
rustc_privacy Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
rustc_query_impl Introduce UnordMap, UnordSet, and UnordBag (see MCP 533) 2022-10-27 13:23:26 +00:00
rustc_query_system Migrate all diagnostics 2022-10-23 10:09:44 +02:00
rustc_resolve Rollup merge of #103560 - zbyrn:issue-103358-fix, r=cjgillot 2022-10-30 11:50:26 +05:30
rustc_save_analysis Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
rustc_serialize
rustc_session Introduce dedicated -Zdylib-lto flag for enabling LTO on dylibs 2022-10-23 13:48:03 +02:00
rustc_smir
rustc_span Rollup merge of #97971 - Soveu:varargs, r=jackh726 2022-10-30 19:31:36 -07:00
rustc_symbol_mangling Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
rustc_target Rollup merge of #102689 - ayrtonm:master, r=cjgillot 2022-10-30 19:31:38 -07:00
rustc_trait_selection Rollup merge of #103603 - camsteffen:refactor-lang, r=oli-obk 2022-10-31 14:52:56 +05:30
rustc_traits
rustc_transmute fix #103783, fix ICE checking transmutability of NaughtyLenArray 2022-10-30 06:21:27 +08:00
rustc_ty_utils Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errors 2022-10-29 14:18:03 +02:00
rustc_type_ir