rust/library/core/src
Jubilee cea081e980
Rollup merge of #133050 - tgross35:inline-f16-f128, r=saethlin
Always inline functions signatures containing `f16` or `f128`

There are a handful of tier 2 and tier 3 targets that cause a LLVM crash or linker error when generating code that contains `f16` or `f128`. The cranelift backend also does not support these types. To work around this, every function in `std` or `core` that contains these types must be marked `#[inline]` in order to avoid sending any code to the backend unless specifically requested.

However, this is inconvenient and easy to forget. Introduce a check for these types in the frontend that automatically inlines any function signatures that take or return `f16` or `f128`.

Note that this is not a perfect fix because it does not account for the types being passed by reference or as members of aggregate types, but this is sufficient for what is currently needed in the standard library.

Fixes: https://github.com/rust-lang/rust/issues/133035
Closes: https://github.com/rust-lang/rust/pull/133037
2024-11-14 17:55:27 -08:00
..
alloc make const_alloc_layout feature gate only about functions that are already stable 2024-11-01 14:32:59 +01:00
array Auto merge of #132458 - RalfJung:rustc-const-unstable, r=Amanieu 2024-11-03 02:32:48 +00:00
ascii Add more precondition check tests 2024-10-09 19:34:27 -04:00
async_iter Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
cell Re-do recursive const stability checks 2024-10-25 20:31:40 +02:00
char Auto merge of #132709 - programmerjake:optimize-charto_digit, r=joshtriplett 2024-11-14 14:14:40 +00:00
clone CloneToUninit: use a private specialization trait 2024-07-29 20:44:43 +03:00
cmp Use generic NonZero everywhere in core. 2024-02-22 15:17:33 +01:00
convert Fix doc nits 2024-07-26 13:26:33 +01:00
ffi add const_eval_select macro to reduce redundancy 2024-11-05 09:26:08 +01:00
fmt Auto merge of #133026 - workingjubilee:rollup-q8ig6ah, r=workingjubilee 2024-11-14 07:07:53 +00:00
future rustdoc-search: simplify rules for generics and type params 2024-10-30 12:27:48 -07:00
hash remove const_hash feature leftovers 2024-11-02 11:27:14 +01:00
intrinsics Rollup merge of #132907 - BLANKatGITHUB:intrinsic, r=saethlin 2024-11-13 22:43:36 -08:00
io Fix doc nits 2024-07-26 13:26:33 +01:00
iter Remove do_not_const_check from Iterator methods 2024-10-30 19:24:34 +00:00
macros add const_eval_select macro to reduce redundancy 2024-11-05 09:26:08 +01:00
mem get rid of a whole bunch of unnecessary rustc_const_unstable attributes 2024-11-02 09:59:55 +01:00
net get rid of a whole bunch of unnecessary rustc_const_unstable attributes 2024-11-02 09:59:55 +01:00
num Rollup merge of #133050 - tgross35:inline-f16-f128, r=saethlin 2024-11-14 17:55:27 -08:00
ops Rollup merge of #132144 - adetaylor:receiver-trait-itself, r=wesleywiser 2024-11-11 21:58:29 +01:00
panic stabilize const_arguments_as_str 2024-11-03 07:49:24 +01:00
prelude Avoid comments that describe multiple use items. 2024-07-17 08:02:46 +10:00
ptr use &raw in {read, write}_unaligned documentation 2024-11-14 21:04:30 +01:00
range Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
slice Auto merge of #132883 - LaihoE:vectorized_is_sorted, r=thomcc 2024-11-13 03:43:59 +00:00
str docs: Fix missing colon in methods for primitive types 2024-11-14 10:39:33 +09:00
sync get rid of a whole bunch of unnecessary rustc_const_unstable attributes 2024-11-02 09:59:55 +01:00
task get rid of a whole bunch of unnecessary rustc_const_unstable attributes 2024-11-02 09:59:55 +01:00
unicode stabilize const_unicode_case_lookup 2024-11-12 15:13:31 +01:00
any.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
arch.rs update bootstrap configs 2024-10-15 20:30:23 -07:00
ascii.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
asserting.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
bool.rs [Clippy] Swap filter_map_bool_then to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
borrow.rs Suggest borrowing on fn argument that is impl AsRef 2024-05-09 23:25:31 +00:00
cell.rs Update grammar in std::cell docs. 2024-11-11 13:22:03 -05:00
clone.rs Make CloneToUninit dyn-compatible 2024-11-12 15:08:41 -06:00
cmp.rs library: consistently use American spelling for 'behavior' 2024-10-25 12:02:47 +02:00
default.rs update cfgs 2024-09-05 17:24:01 +01:00
error.md Mention core's PanicInfo in error.md. 2024-06-11 15:47:00 +02:00
error.rs Library: Rename "object safe" to "dyn compatible" 2024-10-09 18:48:29 +02:00
escape.rs Optimize escape_ascii 2024-10-09 17:17:50 -04:00
hint.rs Re-do recursive const stability checks 2024-10-25 20:31:40 +02:00
internal_macros.rs Fix doc nits 2024-07-26 13:26:33 +01:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Rollup merge of #132966 - RalfJung:const_option_ext, r=jhpratt 2024-11-12 23:26:45 +01:00
marker.rs Auto merge of #131284 - dingxiangfei2009:rename-smart-ptr-to-coerce-referent, r=compiler-errors 2024-10-27 17:04:12 +00:00
option.rs stabilize const_option_ext 2024-11-12 21:42:15 +01:00
panic.rs const_panic: don't wrap it in a separate function 2024-11-13 09:53:42 +01:00
panicking.rs add const_eval_select macro to reduce redundancy 2024-11-05 09:26:08 +01:00
pat.rs Add tracking issue to core-pattern-type 2024-08-07 20:43:05 -04:00
pin.rs Rename Receiver -> LegacyReceiver 2024-10-22 12:55:16 +00:00
primitive.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
primitive_docs.rs Rollup merge of #132136 - RalfJung:target-feature-abi-compat, r=Mark-Simulacrum 2024-11-10 10:09:52 +01:00
random.rs random: add tracking issue, address other comments 2024-09-23 10:36:16 +02:00
range.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
result.rs rustdoc-search: simplify rules for generics and type params 2024-10-30 12:27:48 -07:00
time.rs get rid of a whole bunch of unnecessary rustc_const_unstable attributes 2024-11-02 09:59:55 +01:00
tuple.rs update cfgs 2024-09-05 17:24:01 +01:00
ub_checks.rs add const_eval_select macro to reduce redundancy 2024-11-05 09:26:08 +01:00
unit.rs Import the 2021 prelude in the core crate 2024-03-25 13:12:06 -07:00