rust/compiler/rustc_ty_utils/src
bors dfa88b328f Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkin
Implement intrinsics with fallback bodies

fixes #93145 (though we can port many more intrinsics)
cc #63585

The way this works is that the backend logic for generating custom code for intrinsics has been made fallible. The only failure path is "this intrinsic is unknown". The `Instance` (that was `InstanceDef::Intrinsic`) then gets converted to `InstanceDef::Item`, which represents the fallback body. A regular function call to that body is then codegenned. This is currently implemented for

* codegen_ssa (so llvm and gcc)
* codegen_cranelift

other backends will need to adjust, but they can just keep doing what they were doing if they prefer (though adding new intrinsics to the compiler will then require them to implement them, instead of getting the fallback body).

cc `@scottmcm` `@WaffleLapkin`

### todo

* [ ] miri support
* [x] default intrinsic name to name of function instead of requiring it to be specified in attribute
* [x] make sure that the bodies are always available (must be collected for metadata)
2024-02-16 09:53:01 +00:00
..
abi.rs Dejargnonize subst 2024-02-12 15:46:35 +09:00
assoc.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
common_traits.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
consts.rs Rollup merge of #119307 - compiler-errors:pat-lifetimes, r=Nadrieril 2023-12-26 13:29:14 -05:00
errors.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
implied_bounds.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
instance.rs Make is_intrinsic query return the intrinsic name 2024-02-12 09:33:52 +00:00
layout.rs Dejargnonize subst 2024-02-12 15:46:35 +09:00
layout_sanity_check.rs fix failure to detect a too-big-type after adding padding 2023-10-27 18:07:53 +02:00
lib.rs Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
needs_drop.rs Dejargnonize subst 2024-02-12 15:46:35 +09:00
opaque_types.rs Dejargnonize subst 2024-02-12 15:46:35 +09:00
representability.rs Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obk 2024-02-12 23:18:54 +01:00
sig_types.rs Stop using hir_ty_to_ty in rustc_privacy 2024-02-07 14:59:26 +00:00
structural_match.rs remove StructuralEq trait 2024-01-24 07:56:23 +01:00
ty.rs Stop calling impl_polarity when impl_trait_ref was also called 2024-02-12 09:44:09 +00:00