rust/compiler/rustc_hir_analysis/src
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
..
check Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
coherence Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
collect Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
errors Clarify implicit captures for RPITIT 2024-10-10 11:46:51 -07:00
hir_ty_lowering turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
impl_wf_check Fix const specialization 2024-12-02 22:21:53 +00:00
outlives Implement const effect predicate in new solver 2024-10-24 09:46:36 +00:00
variance Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
autoderef.rs Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
bounds.rs Merge HostPolarity and BoundConstness 2024-10-30 16:23:16 +00:00
check_unused.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
collect.rs Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
constrained_generic_params.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
delegation.rs Effects cleanup 2024-10-26 10:19:07 +08:00
errors.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
hir_wf_check.rs uplift fold_regions to rustc_type_ir 2024-11-28 10:40:58 +01:00
impl_wf_check.rs Do not project when there are unconstrained impl params 2025-01-03 05:01:14 +00:00
lib.rs Do not project when there are unconstrained impl params 2025-01-03 05:01:14 +00:00