rust/compiler/rustc_codegen_ssa/src
Jubilee 8c9e3749a1
Rollup merge of #136985 - zachs18:backend-repr-remove-uninhabited, r=workingjubilee
Do not ignore uninhabited types for function-call ABI purposes. (Remove BackendRepr::Uninhabited)

Accepted MCP: https://github.com/rust-lang/compiler-team/issues/832

Fixes #135802

Do not consider the inhabitedness of a type for function call ABI purposes.

* Remove the [`rustc_abi::BackendRepr::Uninhabited`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/enum.BackendRepr.html) variant
  * Instead calculate the `BackendRepr` of uninhabited types "normally" (as though they were not uninhabited "at the top level", but still considering inhabitedness of variants to determine enum layout, etc)
* Add an `uninhabited: bool` field to [`rustc_abi::LayoutData`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/struct.LayoutData.html) so inhabitedness of a `LayoutData` can still be queried when necessary (e.g. when determining if an enum variant needs a tag value allocated to it).

This should not affect type layouts (size/align/field offset); this should only affect function call ABI, and only of uninhabited types.

cc ``@RalfJung``
2025-02-20 14:58:18 -08:00
..
back Rollup merge of #136608 - kulst:ptx_target_features, r=bjorn3 2025-02-20 14:58:17 -08:00
debuginfo Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
mir Add test that uninhabited repr(transparent) type has same function return ABI as wrapped type. 2025-02-20 13:41:11 -06:00
traits Rework OperandRef::extract_field to stop calling to_immediate_scalar on things which are already immediates 2025-02-19 12:03:40 -08:00
assert_module_sources.rs Change collect_and_partition_mono_items tuple return type to a struct 2025-01-27 09:38:12 +00:00
base.rs Rollup merge of #136608 - kulst:ptx_target_features, r=bjorn3 2025-02-20 14:58:17 -08:00
codegen_attrs.rs Rollup merge of #134090 - veluca93:stable-tf11, r=oli-obk 2025-02-12 20:09:56 -05:00
common.rs Test fixing raw-dylib 2024-09-24 10:10:31 -07:00
errors.rs Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
lib.rs Persist target features used for codegen beyond tcx 2025-02-16 21:57:03 +01:00
meth.rs More assertions, tests, and miri coverage 2025-01-30 17:44:28 +00:00
mono_item.rs Move some Map methods onto TyCtxt. 2025-02-17 13:21:02 +11:00
size_of_val.rs Set both nuw and nsw in slice size calculation 2025-02-13 21:26:48 -08:00
target_features.rs add dedicated type for ABI target feature constraints 2025-01-05 10:46:30 +01:00