rust/compiler
bors feb32c6546 Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee
Add a notion of "some ABIs require certain target features"

I think I finally found the right shape for the data and checks that I recently added in https://github.com/rust-lang/rust/pull/133099, https://github.com/rust-lang/rust/pull/133417, https://github.com/rust-lang/rust/pull/134337: we have a notion of "this ABI requires the following list of target features, and it is incompatible with the following list of target features". Both `-Ctarget-feature` and `#[target_feature]` are updated to ensure we follow the rules of the ABI.  This removes all the "toggleability" stuff introduced before, though we do keep the notion of a fully "forbidden" target feature -- this is needed to deal with target features that are actual ABI switches, and hence are needed to even compute the list of required target features.

We always explicitly (un)set all required and in-conflict features, just to avoid potential trouble caused by the default features of whatever the base CPU is. We do this *before* applying `-Ctarget-feature` to maintain backward compatibility; this poses a slight risk of missing some implicit feature dependencies in LLVM but has the advantage of not breaking users that deliberately toggle ABI-relevant target features. They get a warning but the feature does get toggled the way they requested.

For now, our logic supports x86, ARM, and RISC-V (just like the previous logic did). Unsurprisingly, RISC-V is the nicest. ;)

As a side-effect this also (unstably) allows *enabling* `x87` when that is harmless. I used the opportunity to mark SSE2 as required on x86-64, to better match the actual logic in LLVM and because all x86-64 chips do have SSE2. This infrastructure also prepares us for requiring SSE on x86-32 when we want to use that for our ABI (and for float semantics sanity), see https://github.com/rust-lang/rust/issues/133611, but no such change is happening in this PR.

r? `@workingjubilee`
2025-01-05 23:21:06 +00:00
..
rustc
rustc_abi compiler: Add a statement-of-intent to rustc_abi 2024-12-30 15:21:27 -08:00
rustc_arena
rustc_ast upstream rustc_codegen_llvm changes for enzyme/autodiff 2025-01-01 21:42:45 +01:00
rustc_ast_ir
rustc_ast_lowering Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
rustc_ast_passes rustc_intrinsic: support functions without body; they are implicitly marked as must-be-overridden 2025-01-04 11:41:51 +01:00
rustc_ast_pretty Rollup merge of #134834 - dtolnay:unnamedcall, r=compiler-errors 2024-12-27 18:43:05 -08:00
rustc_attr_data_structures rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
rustc_attr_parsing Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_baked_icu_data
rustc_borrowck turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_builtin_macros Rollup merge of #134877 - DavisRayM:129966-format-string-help-message, r=estebank 2025-01-01 16:35:30 +11:00
rustc_codegen_cranelift Merge commit '918acafef682d0d0ca30b47de4768210417ff362' into sync_cg_clif-2025-01-05 2025-01-05 15:44:46 +00:00
rustc_codegen_gcc Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee 2025-01-05 23:21:06 +00:00
rustc_codegen_llvm Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee 2025-01-05 23:21:06 +00:00
rustc_codegen_ssa Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee 2025-01-05 23:21:06 +00:00
rustc_const_eval rustc_intrinsic: support functions without body; they are implicitly marked as must-be-overridden 2025-01-04 11:41:51 +01:00
rustc_data_structures MatchBranchSimplification: Consider empty-unreachable otherwise branch 2024-12-27 10:57:46 +00:00
rustc_driver
rustc_driver_impl Rollup merge of #131439 - mu001999-contrib:cleanup/static-mut, r=estebank 2025-01-01 16:35:29 +11:00
rustc_error_codes Rewrite the error-code docs for coverage attributes [E0788] 2024-12-25 19:23:48 +11:00
rustc_error_messages Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
rustc_errors Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
rustc_expand Rollup merge of #131522 - c410-f3r:unlock-rfc-2011, r=chenyukang 2024-12-26 21:56:47 -05:00
rustc_feature Rollup merge of #135046 - RalfJung:rustc_box_intrinsic, r=compiler-errors 2025-01-04 07:57:33 -08:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
rustc_hir_analysis Rollup merge of #135046 - RalfJung:rustc_box_intrinsic, r=compiler-errors 2025-01-04 07:57:33 -08:00
rustc_hir_pretty turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_hir_typeck Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
rustc_incremental turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_index improve bit_set assertion 2024-12-29 17:47:30 +00:00
rustc_index_macros update rustc_index_macros feature handling 2024-12-19 20:32:12 +03:00
rustc_infer Simplify declared_generic_bounds_from_env 2025-01-02 01:30:55 +00:00
rustc_interface Rollup merge of #134514 - bjorn3:more_driver_refactors, r=jieyouxu 2024-12-20 21:47:00 +08:00
rustc_lexer
rustc_lint turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_lint_defs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_llvm Auto merge of #133990 - Walnut356:static_const, r=workingjubilee 2025-01-04 23:56:29 +00:00
rustc_log
rustc_macros Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_metadata Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
rustc_middle Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee 2025-01-05 23:21:06 +00:00
rustc_mir_build Rollup merge of #135046 - RalfJung:rustc_box_intrinsic, r=compiler-errors 2025-01-04 07:57:33 -08:00
rustc_mir_dataflow Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk 2024-12-24 00:51:51 +00:00
rustc_mir_transform Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
rustc_monomorphize rustc_intrinsic: support functions without body; they are implicitly marked as must-be-overridden 2025-01-04 11:41:51 +01:00
rustc_next_trait_solver Also in the new solver 2025-01-03 05:22:14 +00:00
rustc_parse Rollup merge of #134884 - calciumbe:patch1, r=jieyouxu 2024-12-29 21:18:07 +01:00
rustc_parse_format add suggestion for wrongly ordered format parameters 2024-12-30 06:14:26 -08:00
rustc_passes turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_pattern_analysis Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
rustc_privacy turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_query_impl
rustc_query_system Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
rustc_resolve Fix spacing of markdown code block fences in compiler rustdoc 2024-12-22 10:16:31 -08:00
rustc_sanitizers Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
rustc_serialize
rustc_session Make the test cfg a "userspace" check-cfg 2025-01-02 16:49:55 +01:00
rustc_smir Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk 2024-12-24 00:51:51 +00:00
rustc_span turn rustc_box into an intrinsic 2025-01-03 12:01:31 +01:00
rustc_symbol_mangling Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
rustc_target Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee 2025-01-05 23:21:06 +00:00
rustc_trait_selection Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
rustc_traits
rustc_transmute add comment explaining why ty_and_layout_field is not used 2024-12-18 11:01:54 +01:00
rustc_ty_utils nit: Make get_infer_ret_ty name more consistent with is_suggestable_infer_ty 2025-01-02 23:39:16 +00:00
rustc_type_ir Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
rustc_type_ir_macros
stable_mir make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00