rust/compiler
katelyn a. martin df45c579de rustc_target: add "unwind" payloads to `Abi`
### Overview

    This commit begins the implementation work for RFC 2945. For more
    information, see the rendered RFC [1] and tracking issue [2].

    A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`,
    and `Thiscall` variants, marking whether unwinding across FFI
    boundaries is acceptable. The cases where each of these variants'
    `unwind` member is true correspond with the `C-unwind`,
    `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings
    introduced in RFC 2945 [3].

 ### Feature Gate and Unstable Book

    This commit adds a `c_unwind` feature gate for the new ABI strings.
    Tests for this feature gate are included in `src/test/ui/c-unwind/`,
    which ensure that this feature gate works correctly for each of the
    new ABIs.

    A new language features entry in the unstable book is added as well.

 ### Further Work To Be Done

    This commit does not proceed to implement the new unwinding ABIs,
    and is intentionally scoped specifically to *defining* the ABIs and
    their feature flag.

 ### One Note on Test Churn

    This will lead to some test churn, in re-blessing hash tests, as the
    deleted comment in `src/librustc_target/spec/abi.rs` mentioned,
    because we can no longer guarantee the ordering of the `Abi`
    variants.

    While this is a downside, this decision was made bearing in mind
    that RFC 2945 states the following, in the "Other `unwind` Strings"
    section [3]:

    >  More unwind variants of existing ABI strings may be introduced,
    >  with the same semantics, without an additional RFC.

    Adding a new variant for each of these cases, rather than specifying
    a payload for a given ABI, would quickly become untenable, and make
    working with the `Abi` enum prone to mistakes.

    This approach encodes the unwinding information *into* a given ABI,
    to account for the future possibility of other `-unwind` ABI
    strings.

 ### Ignore Directives

    `ignore-*` directives are used in two of our `*-unwind` ABI test
    cases.

    Specifically, the `stdcall-unwind` and `thiscall-unwind` test cases
    ignore architectures that do not support `stdcall` and
    `thiscall`, respectively.

    These directives are cribbed from
    `src/test/ui/c-variadic/variadic-ffi-1.rs` for `stdcall`, and
    `src/test/ui/extern/extern-thiscall.rs` for `thiscall`.

    This would otherwise fail on some targets, see:
    fcf697f902

 ### Footnotes

[1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
[2]: https://github.com/rust-lang/rust/issues/74990
[3]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
2021-03-09 14:38:29 -05:00
..
rustc Rollup merge of #82642 - sfackler:jemalloc-zone, r=pnkfelix 2021-03-08 13:13:22 +01:00
rustc_apfloat bumped smallvec deps 2021-02-14 18:03:11 +03:00
rustc_arena Update the bootstrap compiler 2021-02-20 17:19:30 -05:00
rustc_ast Rollup merge of #82841 - hvdijk:x32, r=joshtriplett 2021-03-09 09:05:24 +00:00
rustc_ast_lowering rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_ast_passes rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_ast_pretty Rollup merge of #82238 - petrochenkov:nocratemod, r=Aaron1011 2021-02-19 02:49:08 +01:00
rustc_attr Auto merge of #71481 - estebank:inherit-stability, r=nikomatsakis 2021-03-05 05:28:07 +00:00
rustc_builtin_macros Rollup merge of #82682 - petrochenkov:cfgeval, r=Aaron1011 2021-03-08 13:13:23 +01:00
rustc_codegen_cranelift rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_codegen_llvm Auto merge of #82285 - nhwn:nonzero-debug, r=nagisa 2021-03-07 20:23:23 +00:00
rustc_codegen_ssa Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix 2021-03-08 08:39:24 +00:00
rustc_data_structures Auto merge of #81635 - michaelwoerister:structured_def_path_hash, r=pnkfelix 2021-03-07 23:45:57 +00:00
rustc_driver Auto merge of #82304 - LeSeulArtichaut:unpretty-ast, r=spastorino 2021-03-04 05:46:43 +00:00
rustc_error_codes Rollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomez 2021-03-04 20:01:01 +09:00
rustc_errors Change x64 size checks to not apply to x32. 2021-03-06 16:02:48 +00:00
rustc_expand Rollup merge of #82682 - petrochenkov:cfgeval, r=Aaron1011 2021-03-08 13:13:23 +01:00
rustc_feature rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_fs_util Optimize away a `fs::metadata` call. 2021-01-06 08:33:15 -08:00
rustc_graphviz remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
rustc_hir Rollup merge of #82841 - hvdijk:x32, r=joshtriplett 2021-03-09 09:05:24 +00:00
rustc_hir_pretty Auto merge of #81611 - cjgillot:meowner, r=estebank 2021-02-16 22:14:32 +00:00
rustc_incremental Print -Ztime-passes (and misc stats/logs) on stderr, not stdout. 2021-02-18 14:13:38 +02:00
rustc_index Miscellaneous inlining improvements 2021-02-26 00:00:00 +00:00
rustc_infer Change x64 size checks to not apply to x32. 2021-03-06 16:02:48 +00:00
rustc_interface Rollup merge of #82415 - petrochenkov:modin3, r=davidtwco 2021-03-08 13:13:19 +01:00
rustc_lexer Return EOF_CHAR constant instead of magic char. 2021-01-07 13:20:04 +01:00
rustc_lint Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov 2021-03-09 09:05:20 +00:00
rustc_lint_defs Make invalid_doc_attribute lint plural 2021-03-05 14:44:31 +01:00
rustc_llvm Schedule ThinLTOBuffer passes again after sanitizer passes 2021-03-03 20:48:37 +01:00
rustc_macros replaced some map_or with map_or_else 2021-02-24 02:43:35 +03:00
rustc_metadata Auto merge of #81635 - michaelwoerister:structured_def_path_hash, r=pnkfelix 2021-03-07 23:45:57 +00:00
rustc_middle rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_mir rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_mir_build Rollup merge of #82841 - hvdijk:x32, r=joshtriplett 2021-03-09 09:05:24 +00:00
rustc_parse Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov 2021-03-09 09:05:20 +00:00
rustc_parse_format parse_format: treat r" as a literal 2021-02-06 15:01:07 +00:00
rustc_passes Rollup merge of #82651 - jyn514:rustdoc-warnings, r=GuillaumeGomez 2021-03-07 10:41:13 +09:00
rustc_plugin_impl Only store a LocalDefId in hir::Item. 2021-02-15 19:32:10 +01:00
rustc_privacy Rollup merge of #82066 - matthewjasper:trait-ref-fix, r=jackh726 2021-02-18 16:57:34 +01:00
rustc_query_impl Simplify hashing. 2021-02-21 12:22:22 +01:00
rustc_query_system Simplify hashing. 2021-02-21 12:22:22 +01:00
rustc_resolve diagnostics: Don't mention external crates when hitting import errors on crate imports in 2018 2021-03-07 15:15:19 -08:00
rustc_save_analysis Only store a LocalDefId in hir::ForeignItem. 2021-02-15 19:32:29 +01:00
rustc_serialize Update the bootstrap compiler 2021-02-20 17:19:30 -05:00
rustc_session Rollup merge of #82415 - petrochenkov:modin3, r=davidtwco 2021-03-08 13:13:19 +01:00
rustc_span rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_symbol_mangling rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_target rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00
rustc_trait_selection Rollup merge of #82841 - hvdijk:x32, r=joshtriplett 2021-03-09 09:05:24 +00:00
rustc_traits Fix tests 2021-03-03 11:22:44 +01:00
rustc_ty_utils Auto merge of #82159 - BoxyUwU:uwu, r=varkor 2021-02-24 21:54:52 +00:00
rustc_type_ir New pass to deduplicate blocks 2021-02-21 21:51:54 +01:00
rustc_typeck rustc_target: add "unwind" payloads to `Abi` 2021-03-09 14:38:29 -05:00