bors
fd127a3a84
Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk
...
rustc_intrinsic: support functions without body
We synthesize a HIR body `loop {}` but such bodyless intrinsics.
Most of the diff is due to turning `ItemKind::Fn` into a brace (named-field) enum variant, because it carries a `bool`-typed field now. This is to remember whether the function has a body. MIR building panics to avoid ever translating the fake `loop {}` body, and the intrinsic logic uses the lack of a body to implicitly mark that intrinsic as must-be-overridden.
I first tried actually having no body rather than generating the fake body, but there's a *lot* of code that assumes that all function items have HIR and MIR, so this didn't work very well. Then I noticed that even `rustc_intrinsic_must_be_overridden` intrinsics have MIR generated (they are filled with an `Unreachable` terminator) so I guess I am not the first to discover this. ;)
r? `@oli-obk`
2025-01-04 12:50:38 +00:00
..
2024-12-07 21:26:20 +00:00
2024-07-22 22:51:53 +00:00
2024-12-07 21:26:20 +00:00
2025-01-04 12:50:38 +00:00
2024-12-03 04:39:48 +00:00
2024-10-24 01:48:44 +00:00
2024-11-02 03:08:04 +00:00
2024-12-07 21:37:13 +00:00
2024-12-07 21:37:13 +00:00
2024-11-26 11:45:01 +01:00
2024-12-22 21:57:57 +00:00
2024-12-18 16:35:06 +01:00
2024-12-24 23:37:30 +08:00
2024-11-21 01:35:34 +00:00
2024-11-30 12:56:51 +08:00
2024-11-21 03:27:05 -08:00
2024-12-27 19:58:16 +11:00
2024-10-18 12:34:56 +08:00
2024-10-10 01:13:29 +02:00
2024-12-18 16:35:06 +01:00
2024-10-07 16:30:48 +00:00
2024-11-26 02:50:48 +08:00
2024-12-07 21:37:13 +00:00
2024-11-23 18:54:08 +00:00
2024-11-23 18:54:08 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-02 03:08:04 +00:00
2024-11-26 02:50:48 +08:00
2024-12-07 21:26:20 +00:00
2024-12-07 21:37:15 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-12-20 16:57:14 +01:00
2024-12-20 16:57:14 +01:00
2024-12-20 16:57:14 +01:00
2024-10-29 16:26:57 +00:00
2024-11-21 01:35:34 +00:00
2024-11-21 01:35:34 +00:00
2024-10-18 00:33:50 +02:00
2024-10-17 20:43:31 +02:00
2024-10-18 00:33:50 +02:00
2024-10-18 00:33:50 +02:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-10-21 11:45:19 +03:00
2024-10-21 11:45:19 +03:00
2024-06-03 13:21:17 +00:00
2024-06-03 13:21:17 +00:00
2024-10-07 16:30:48 +00:00
2024-11-02 22:17:46 +09:00
2024-11-02 22:17:46 +09:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-07-06 23:29:58 +08:00
2024-09-13 14:10:56 +03:00
2024-09-13 14:10:56 +03:00
2024-09-24 10:12:05 -04:00
2024-09-24 10:12:05 -04:00
2024-10-29 16:26:57 +00:00
2024-09-25 13:26:48 +02:00
2024-12-07 21:26:20 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-09-25 13:26:48 +02:00
2024-11-23 18:54:08 +00:00
2024-11-23 18:54:08 +00:00
2024-07-05 20:58:33 +00:00
2024-09-25 13:26:48 +02:00
2024-09-25 13:26:48 +02:00
2024-12-07 21:29:58 +00:00
2024-10-29 16:26:57 +00:00
2024-10-29 16:26:57 +00:00
2024-09-25 13:26:48 +02:00
2024-12-24 19:00:57 +01:00
2024-12-24 19:00:57 +01:00
2024-11-21 01:35:34 +00:00
2024-12-13 15:40:37 +00:00
2024-05-30 22:52:33 +02:00
2024-06-03 08:14:03 +00:00
2024-10-29 16:26:57 +00:00
2024-07-12 21:16:09 -04:00
2024-07-12 21:16:09 -04:00
2024-10-29 16:26:57 +00:00
2024-10-15 13:11:00 +02:00
2024-10-15 13:11:00 +02:00
2024-10-11 17:36:04 +02:00
2024-10-11 17:36:04 +02:00
2024-09-25 13:26:48 +02:00
2024-07-25 20:53:33 +03:00
2024-07-25 20:53:33 +03:00
2024-07-26 16:35:05 +03:00
2024-07-26 16:35:05 +03:00
2024-05-20 19:21:30 -04:00
2024-10-04 22:59:03 +00:00
2024-10-11 17:36:04 +02:00
2024-10-11 17:36:04 +02:00
2024-11-26 02:50:48 +08:00
2024-05-06 10:48:39 -04:00
2024-12-27 19:58:16 +11:00
2024-11-26 02:50:48 +08:00
2024-10-29 16:26:57 +00:00
2024-11-23 05:27:45 +00:00
2024-11-23 05:27:45 +00:00
2024-09-11 00:17:38 -05:00
2024-11-21 01:35:34 +00:00
2024-11-21 01:35:34 +00:00
2024-11-26 02:50:48 +08:00
2024-09-25 13:26:48 +02:00
2024-09-24 22:20:46 +02:00
2024-09-24 22:20:46 +02:00
2024-06-21 21:13:10 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2025-01-03 05:22:14 +00:00
2024-10-29 16:26:57 +00:00
2024-09-25 13:26:48 +02:00
2024-10-18 12:34:56 +08:00
2024-09-24 23:12:02 +02:00
2024-09-24 23:12:02 +02:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-07-05 20:58:33 +00:00