rust/compiler/rustc_borrowck/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
..
constraints Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
diagnostics Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obk 2024-02-12 23:18:54 +01:00
polonius remove a bunch of dead parameters in fn 2024-02-12 09:51:35 +08:00
region_infer Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obk 2024-02-12 23:18:54 +01:00
type_check Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkin 2024-02-16 09:53:01 +00:00
util Move some utils out of rustc_const_eval 2023-04-16 12:05:54 +02:00
borrow_set.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
borrowck_errors.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
consumers.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
dataflow.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
def_use.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
facts.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
lib.rs Bump indexmap 2024-02-13 21:03:34 +00:00
location.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
member_constraints.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
nll.rs Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
path_utils.rs remove a bunch of dead parameters in fn 2024-02-12 09:51:35 +08:00
place_ext.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
places_conflict.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
prefixes.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
renumber.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
session_diagnostics.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
universal_regions.rs clean up potential_query_instability with FxIndexMap and UnordMap 2024-02-14 18:36:37 +08:00
used_muts.rs Bump indexmap 2024-02-13 21:03:34 +00:00