bors
17a07d71bf
Auto merge of #76570 - cratelyn:implement-rfc-2945-c-unwind-abi, r=Amanieu
...
Implement RFC 2945: "C-unwind" ABI
## Implement RFC 2945: "C-unwind" ABI
This branch implements [RFC 2945]. The tracking issue for this RFC is #74990 .
The feature gate for the issue is `#![feature(c_unwind)]`.
This RFC was created as part of the ffi-unwind project group tracked at rust-lang/lang-team#19 .
### Changes
Further details will be provided in commit messages, but a high-level overview
of the changes follows:
* 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].
* 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.
* We adjust the `rustc_middle::ty::layout::fn_can_unwind` function,
used to compute whether or not a `FnAbi` object represents a function that
should be able to unwind when `panic=unwind` is in use.
* Changes are also made to
`rustc_mir_build::build::should_abort_on_panic` so that the function ABI is
used to determind whether it should abort, assuming that the `panic=unwind`
strategy is being used, and no explicit unwind attribute was provided.
[RFC 2945]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
2021-03-10 16:44:04 +00:00
..
2018-12-25 21:08:33 -07:00
2020-10-31 21:06:29 +01:00
2020-11-22 17:11:41 -05:00
2020-12-31 10:53:37 +01:00
2021-03-10 12:21:43 +02:00
2020-04-02 14:13:19 -07:00
2021-01-13 07:49:16 -05:00
2020-11-29 18:36:30 +10:00
2020-10-14 15:09:51 -07:00
2021-03-09 14:38:29 -05:00
2020-11-12 14:39:47 +01:00
2020-06-04 12:02:03 +01:00
2020-01-07 21:28:22 +01:00
2021-01-30 00:49:10 +02:00
2020-06-04 12:02:03 +01:00
2018-12-25 21:08:33 -07:00
2020-06-04 12:02:03 +01:00
2019-09-13 19:25:05 +03:00
2020-05-16 17:15:24 -07:00
2020-05-16 17:15:24 -07:00
2019-09-28 07:13:53 +08:00
2020-11-30 01:21:47 -05:00
2020-06-20 11:12:42 -07:00
2020-05-18 14:41:32 +01:00
2021-02-06 15:18:37 +02:00
2020-06-24 15:08:59 -07:00
2020-06-24 15:08:59 -07:00
2020-07-17 00:00:00 +00:00
2020-01-07 21:28:22 +01:00
2019-05-20 10:44:02 +02:00
2019-06-17 16:04:49 -07:00
2019-06-17 16:04:49 -07:00
2020-04-15 05:45:21 -04:00
2021-01-13 07:49:16 -05:00
2018-12-25 21:08:33 -07:00
2020-06-04 12:15:26 +01:00
2020-06-15 09:40:56 +01:00
2020-07-14 15:27:42 +01:00
2020-07-14 15:27:42 +01:00
2020-07-14 15:27:42 +01:00
2020-07-14 15:27:42 +01:00
2018-12-25 21:08:33 -07:00
2020-09-20 09:09:56 +02:00
2021-01-13 07:49:16 -05:00
2020-02-26 21:45:34 +01:00
2021-01-13 07:49:16 -05:00
2021-02-20 15:56:36 +02:00
2021-01-13 07:49:45 -05:00
2020-10-04 07:54:01 -04:00
2020-08-31 08:19:15 +02:00
2020-08-31 08:19:15 +02:00
2020-08-31 08:19:15 +02:00
2020-04-14 12:44:41 -07:00
2020-04-14 12:44:41 -07:00
2020-04-14 12:44:41 -07:00
2020-04-14 12:44:41 -07:00
2020-11-29 00:55:55 -05:00
2021-01-13 07:49:45 -05:00
2020-06-15 09:40:56 +01:00
2019-10-16 17:06:48 -07:00
2020-06-04 12:02:03 +01:00
2018-12-25 21:08:33 -07:00
2020-11-23 00:00:00 +00:00
2021-01-13 07:49:16 -05:00
2021-01-13 07:49:16 -05:00
2021-01-13 07:49:16 -05:00
2021-01-13 07:49:16 -05:00
2018-12-25 21:08:33 -07:00
2019-03-31 20:09:30 -04:00
2017-04-12 19:12:50 -05:00
2020-04-14 12:44:41 -07:00
2020-11-12 14:39:47 +01:00
2021-02-28 10:19:44 +01:00
2019-12-04 20:15:21 -08:00
2020-06-24 15:08:59 -07:00
2020-06-24 15:08:59 -07:00
2019-04-23 11:42:14 +01:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2019-05-07 11:09:39 -04:00
2019-05-13 17:04:59 -04:00
2019-01-24 20:13:51 +02:00
2020-10-26 14:09:27 +00:00
2020-11-17 00:00:00 +00:00
2020-04-14 12:44:41 -07:00
2019-08-29 03:52:18 +00:00
2020-05-24 16:20:02 -04:00
2020-11-12 00:00:00 +00:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2020-08-28 01:16:20 +02:00
2018-12-25 21:08:33 -07:00
2018-12-25 21:08:33 -07:00
2020-09-20 11:15:00 +02:00
2019-09-28 07:13:53 +08:00
2020-11-12 00:00:00 +00:00
2020-07-09 10:41:33 -07:00
2020-02-08 18:47:41 -05:00
2019-07-15 16:56:43 +02:00
2020-10-23 01:15:08 +02:00
2021-01-13 07:49:45 -05:00
2018-12-25 21:08:33 -07:00
2018-11-29 00:37:38 +02:00
2018-11-28 00:31:03 +01:00
2020-11-29 00:55:55 -05:00
2019-03-31 17:37:37 +00:00
2021-03-05 17:13:57 -03:00
2020-07-20 00:40:42 +02:00
2021-03-07 17:56:09 -05:00
2020-09-14 22:19:48 -04:00
2020-10-17 13:18:29 +02:00
2021-03-05 16:01:46 +01:00
2021-03-07 17:56:09 -05:00
2020-10-01 16:02:32 +02:00
2021-03-07 17:56:09 -05:00
2020-10-26 10:48:28 +01:00
2019-10-16 17:06:48 -07:00
2019-05-31 18:24:53 +03:00
2020-10-26 10:48:28 +01:00
2019-05-31 18:24:53 +03:00
2018-12-25 21:08:33 -07:00
2019-07-09 21:55:29 +02:00
2019-07-09 21:55:29 +02:00
2018-12-25 21:08:33 -07:00
2019-11-21 20:05:16 +01:00
2018-12-25 21:08:33 -07:00
2020-11-25 00:00:00 +00:00
2021-03-05 17:13:57 -03:00
2018-12-25 21:08:33 -07:00
2019-02-12 15:10:29 +01:00
2020-03-26 15:49:22 +00:00
2018-12-25 21:08:33 -07:00
2019-04-23 11:42:14 +01:00
2019-04-23 11:42:14 +01:00
2019-04-22 16:57:01 +01:00
2020-05-17 10:24:06 -07:00
2019-11-11 20:57:26 -05:00
2021-02-28 10:19:44 +01:00
2020-11-22 17:11:41 -05:00
2019-10-25 15:16:36 -07:00
2019-07-15 14:01:26 +02:00
2019-08-26 20:40:30 +02:00
2020-10-26 10:48:28 +01:00
2020-03-14 14:05:26 +01:00
2021-02-28 10:19:44 +01:00
2021-02-28 10:19:44 +01:00
2021-02-28 10:19:44 +01:00
2020-01-07 21:28:22 +01:00
2021-01-13 07:49:45 -05:00
2020-06-13 14:24:30 +02:00
2021-03-05 17:13:57 -03:00
2020-12-10 19:06:29 -05:00
2020-06-25 18:52:41 -07:00
2020-08-22 13:44:54 -07:00
2019-12-06 00:10:01 +01:00
2021-01-16 14:52:48 -08:00
2018-12-25 21:08:33 -07:00
2019-06-15 21:15:25 -07:00
2018-12-25 21:08:33 -07:00
2020-12-26 06:43:51 +00:00
2020-10-07 16:17:01 +03:00
2020-08-08 10:45:15 +02:00
2018-12-25 21:08:33 -07:00
2021-01-14 22:49:16 -05:00
2020-06-15 09:40:56 +01:00
2019-12-02 11:36:21 -08:00
2019-07-15 16:56:43 +02:00
2021-01-13 07:49:45 -05:00
2020-05-11 02:04:53 +03:00
2018-12-25 21:08:33 -07:00
2020-11-22 22:22:03 +00:00
2020-12-10 13:24:47 +02:00
2021-03-05 17:13:57 -03:00
2020-03-05 17:36:50 +00:00
2020-10-05 07:50:44 +08:00
2020-08-30 14:58:03 -04:00
2020-07-22 15:05:05 -07:00
2020-11-29 20:08:00 -05:00
2021-01-13 07:49:45 -05:00
2021-01-13 07:49:16 -05:00
2019-09-06 16:57:20 +03:00
2020-06-16 16:01:30 -04:00
2019-09-28 07:13:53 +08:00
2020-06-16 16:01:30 -04:00
2021-01-26 19:25:37 +01:00
2021-01-14 19:31:56 +01:00
2019-04-23 11:42:14 +01:00
2020-07-02 09:32:09 +02:00
2020-07-28 10:17:11 -07:00
2019-05-07 11:09:39 -04:00
2019-05-13 17:04:59 -04:00
2018-12-25 21:08:33 -07:00
2020-08-30 14:58:03 -04:00