Commit Graph

9164 Commits

Author SHA1 Message Date
Guillaume Gomez
8929f8a180 Rollup merge of #136183 - hkBst:patch-25, r=Amanieu
Update iterator.rs to use arrays by value

Update examples to no longer avoid iterating arrays for #84513
2025-05-06 19:27:38 +02:00
Marijn Schouten
18a3599fe3 Update iterator.rs to use arrays by value
Update examples to no longer avoid iterating arrays for #84513
2025-05-06 12:19:24 +00:00
Stuart Cook
6238555e72 Rollup merge of #140598 - ShE3py:iter-misc-docs, r=workingjubilee
Steer docs to `utf8_chunks` and `Iterator::take`

- Adds `limit` as an alias of `take` (as this is [what Java calls this operation](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#limit-long-));
- Says that [`Utf8Chunks`](https://doc.rust-lang.org/std/str/struct.Utf8Chunks.html) comes from [`[u8]::utf8_chunks`](https://doc.rust-lang.org/std/primitive.slice.html#method.utf8_chunks).

``@rustbot`` label +A-docs
2025-05-06 16:28:41 +10:00
Trevor Gross
cac28ed674 Rollup merge of #140644 - the8472:revert-copy-clone-adapters, r=Mark-Simulacrum
Revert "Avoid unused clones in Cloned<I> and Copied<I>"

Per libs decision in https://github.com/rust-lang/rust/issues/140207#issuecomment-2842996190 this reverts commit ed5f31ab01 (#139745)
2025-05-05 00:20:58 -04:00
Trevor Gross
fcb9da597a Rollup merge of #137280 - RalfJung:const_swap_nonoverlapping, r=lcnr
stabilize ptr::swap_nonoverlapping in const

Closes https://github.com/rust-lang/rust/issues/133668

The blocking issue mentioned there is resolved by documentation. We may in the future actually support such code, but that is blocked on https://github.com/rust-lang/const-eval/issues/72 which is non-trivial to implement. Meanwhile, this completes stabilization of all `const fn` in `ptr`. :)

Here's a version of the problematic example to play around with:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=6c390452379fb593e109b8f8ee854d2a

Should be FCP'd with both `@rust-lang/libs-api`  and `@rust-lang/lang`  since  `swap_nonoverlapping` is documented to work as an "untyped" operation but due to the limitation mentioned above, that's not entirely true during const evaluation. I expect this limitation will only be hit in niche corner cases, so the benefits of having this function work most of the time outweigh the downsides of users running into this problem. (Note that unsafe code could already hit this limitation before this PR by doing cursed pointer casts, but having it hidden inside `swap_nonoverlapping` feels a bit different.)
2025-05-04 18:11:47 -04:00
The 8472
e6030468dd Revert "Avoid unused clones in Cloned<I> and Copied<I>"
This reverts commit ed5f31ab01.
2025-05-04 22:29:57 +02:00
Lieselotte
415a73e3eb docs: alias limit to Iterator::take, cite [u8]::utf8_chunks in Utf8Chunks 2025-05-02 23:41:52 +02:00
Matthias Krüger
15f21f43b3 Rollup merge of #140550 - Amanieu:stabilize_select_unpredictable, r=workingjubilee
Stabilize `select_unpredictable`

FCP completed in tracking issue #133962.
2025-05-02 19:37:59 +02:00
Stuart Cook
27d419a6b5 Rollup merge of #140389 - sayantn:avx512fp16, r=Amanieu
Remove `avx512dq` and `avx512vl` implication for `avx512fp16`

According to Intel, `avx512fp16` requires only `avx512bw`, but LLVM also enables `avx512vl` and `avx512dq` when `avx512fp16` is active. This is relic code, and will be fixed in LLVM soon. We should remove this from Rust too asap, especially before the stabilization of AVX512

Related:
 - llvm/llvm-project#136209
 - #138940
 - rust-lang/stdarch#1781
 - #111137

``@rustbot`` label O-x86_64 O-x86_32 A-SIMD A-target-feature T-compiler -T-libs
r? ``@Amanieu``

**Update: the LLVM fix has been merged**

cc ``@rust-lang/wg-llvm`` will it be possible to update the rustc llvm version to something after llvm/llvm-project#137450
2025-05-02 22:17:02 +10:00
Guillaume Gomez
6cb75d88eb Rollup merge of #140544 - m-ou-se:format-args-const-cleanup, r=fee1-dead
Clean up "const" situation in format_args!().

This cleans up the "const" situation in the format_args!() expansion/lowering.

Rather than marking the Argument::new_display etc. functions as non-const, this marks the Arguments::new_v1 functions as non-const.

Example expansion/lowering of format_args!() in const:

```rust
// Error: cannot call non-const formatting macro in constant functions
const {
    fmt::Arguments::new_v1( // Now the error is produced here.
        &["Hello, ", "!\n"],
        &[
            fmt::Argument::new_display(&world) // The error used to be produced here.
        ],
    )
}
```
2025-05-01 22:27:24 +02:00
Guillaume Gomez
5a25a7a020 Rollup merge of #140034 - RalfJung:simd_select_bitmask-padding, r=workingjubilee
simd_select_bitmask: the 'padding' bits in the mask are just ignored

Fixes https://github.com/rust-lang/rust/issues/137942: we documented simd_select_bitmask to require the 'padding' bits in the mask (the mask can sometimes be longer than the vector; I am referring to these extra bits as 'padding' here)  to be zero, mostly because nobody felt like doing the research for what should be done when they are non-zero. However, codegen is already perfectly happy just ignoring them, so in practice they can have any value. Some of the intrinsic wrappers in stdarch have trouble ensuring that they are zero. So let's just adjust the docs and Miri to permit non-zero 'padding' bits.

Cc ````@Amanieu```` ````@workingjubilee````
2025-05-01 22:27:22 +02:00
Guillaume Gomez
b867d20279 Rollup merge of #139802 - Lee-Janggun:fix-allocate-hyperlink, r=workingjubilee
Fix some grammar errors and hyperlinks in doc for `trait Allocator`

I was reading the allocator docs and noticed some weird sentences and missing hyperlink, so I fixed them and made this small PR.

* "while until either" could also be changed to "for a while until either", but I just deleted "while".
* fixed sentence with incorrect "at" and "has/have".
* linked [*currently allocated*] similar to other methods. All other hyperlinks are fine.
2025-05-01 22:27:21 +02:00
Guillaume Gomez
931735a1b1 Rollup merge of #139780 - ongardie:iterator-take-by_ref-example, r=workingjubilee
docs: Add example to `Iterator::take` with `by_ref`

If you want to logically split an iterator after `n` items, you might first discover `take`. Before this change, you'd find that `take` consumes the iterator, and you'd probably be stuck. The answer involves `by_ref`, but that's hard to discover, especially since `by_ref` is a bit abstract and `Iterator` has many methods.

After this change, you'd see the example showing `take` along with `by_ref`, which allows you to continue using the rest of the iterator. `by_ref` had a good example involving `take` already, so this change just duplicates that existing example under `take`.
2025-05-01 22:27:20 +02:00
Guillaume Gomez
bd68c36ee0 Rollup merge of #139186 - TDecking:float, r=workingjubilee
Refactor `diy_float`

The refactor replaces bespoke algorithms with functions already inside the standard library, improving both codegen and readability.
2025-05-01 22:27:20 +02:00
Guillaume Gomez
c02964f446 Rollup merge of #138703 - pudongair:master, r=workingjubilee
chore: remove redundant words in comment

remove redundant words in comment
2025-05-01 22:27:19 +02:00
sayantn
7443d039a5 Update stdarch 2025-05-01 20:01:43 +05:30
Amanieu d'Antras
72b110ada3 Stabilize select_unpredictable
FCP completed in tracking issue #133962.
2025-05-01 13:49:28 +01:00
Mara Bos
36c6633b0f Clean up "const" situation in format_args!().
Rather than marking the Argument::new_display etc. functions as
non-const, this marks the Arguments::new_v1 functions as non-const.
2025-05-01 11:55:23 +02:00
Mara Bos
3e969d433d Move core::fmt::Arguments::new_v1* to rt.rs. 2025-05-01 11:53:24 +02:00
Natrix
b735dce5a6 docs: Specify that common sort functions sort in an ascending direction 2025-04-30 20:25:47 +02:00
Mathis B
e83a0a4bbe Stabilize #![feature(non_null_from_ref)] 2025-04-30 17:54:07 +02:00
Matthias Krüger
bc99a045cb Rollup merge of #139624 - m-ou-se:unconst-format-args, r=jhpratt
Don't allow flattened format_args in const.

Fixes https://github.com/rust-lang/rust/issues/139136

Fixes https://github.com/rust-lang/rust/issues/139621

We allow `format_args!("a")` in const, but don't allow any format_args with arguments in const, such as `format_args!("{}", arg)`.

However, we accidentally allow `format_args!("hello {}", "world")` in const, as it gets flattened to `format_args!("hello world")`.

This also applies to panic in const.

This wasn't supposed to happen. I added protection against this in the format args flattening code, ~~but I accidentally marked a function as const that shouldn't have been const~~ but this was removed in https://github.com/rust-lang/rust/pull/135139.

This is a breaking change. The crater found no breakage, however.

This breaks things like:

```rust
const _: () = if false { panic!("a {}", "a") };
```

and

```rust
const F: std::fmt::Arguments<'static> = format_args!("a {}", "a");
```
2025-04-30 17:27:57 +02:00
Matthias Krüger
aeec053e1b Rollup merge of #139192 - lolbinarycat:docs-wrapping_offset-provenance-139008, r=RalfJung
mention provenance in the pointer::wrapping_offset docs

fixes https://github.com/rust-lang/rust/issues/139008
2025-04-30 10:18:25 +02:00
binarycat
851decdd4f mention provenance in the pointer::wrapping_offset docs
fixes https://github.com/rust-lang/rust/issues/139008
2025-04-29 14:29:08 -05:00
Ralf Jung
9f4abd313d stabilize ptr::swap_nonoverlapping in const 2025-04-29 10:40:56 +02:00
Chris Denton
fd95953d9c Rollup merge of #140391 - DaniPopes:sub-ptr-rename, r=RalfJung
Rename sub_ptr to offset_from_unsigned in docs

There are still a few mentions of `sub_ptr` in comments and doc comments, which were missed in https://github.com/rust-lang/rust/pull/137483.
2025-04-28 23:29:18 +00:00
Chris Denton
17495e0030 Rollup merge of #139656 - scottmcm:stabilize-slice-as-chunks, r=dtolnay
Stabilize `slice_as_chunks` library feature

~~Draft as this needs #139163 to land first.~~

FCP: https://github.com/rust-lang/rust/issues/74985#issuecomment-2769963395

Methods being stabilized are:
```rust
impl [T] {
    const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]);
    const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]);
    const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]];
    const fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]);
    const fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]);
    const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]];
}
```

~~(FCP's not done quite yet, but will in another day if I'm counting right.)~~ FCP Complete: https://github.com/rust-lang/rust/issues/74985#issuecomment-2797951535
2025-04-28 23:29:15 +00:00
bors
7d65abfe80 Auto merge of #123948 - azhogin:azhogin/async-drop, r=oli-obk
Async drop codegen

Async drop implementation using templated coroutine for async drop glue generation.

Scopes changes to generate `async_drop_in_place()` awaits, when async droppable objects are out-of-scope in async context.

Implementation details:
https://github.com/azhogin/posts/blob/main/async-drop-impl.md

New fields in Drop terminator (drop & async_fut). Processing in codegen/miri must validate that those fields are empty (in full version async Drop terminator will be expanded at StateTransform pass or reverted to sync version). Changes in terminator visiting to consider possible new successor (drop field).

ResumedAfterDrop messages for panic when coroutine is resumed after it is started to be async drop'ed.

Lang item for generated coroutine for async function async_drop_in_place. `async fn async_drop_in_place<T>()::{{closure0}}`.

Scopes processing for generate async drop preparations. Async drop is a hidden Yield, so potentially async drops require the same dropline preparation as for Yield terminators.

Processing in StateTransform: async drops are expanded into yield-point. Generation of async drop of coroutine itself added.

Shims for AsyncDropGlueCtorShim, AsyncDropGlue and FutureDropPoll.

```rust
#[lang = "async_drop"]
pub trait AsyncDrop {
    #[allow(async_fn_in_trait)]
    async fn drop(self: Pin<&mut Self>);
}

impl Drop for Foo {
    fn drop(&mut self) {
        println!("Foo::drop({})", self.my_resource_handle);
    }
}

impl AsyncDrop for Foo {
    async fn drop(self: Pin<&mut Self>) {
        println!("Foo::async drop({})", self.my_resource_handle);
    }
}
```

First async drop glue implementation re-worked to use the same drop elaboration code as for sync drop.
`async_drop_in_place` changed to be `async fn`. So both `async_drop_in_place` ctor and produced coroutine have their lang items (`AsyncDropInPlace`/`AsyncDropInPlacePoll`) and shim instances (`AsyncDropGlueCtorShim`/`AsyncDropGlue`).
```
pub async unsafe fn async_drop_in_place<T: ?Sized>(_to_drop: *mut T) {
}
```
AsyncDropGlue shim generation uses `elaborate_drops::elaborate_drop` to produce drop ladder (in the similar way as for sync drop glue) and then `coroutine::StateTransform` to convert function into coroutine poll.

AsyncDropGlue coroutine's layout can't be calculated for generic T, it requires known final dropee type to be generated (in StateTransform). So, `templated coroutine` was introduced here (`templated_coroutine_layout(...)` etc).

Such approach overrides the first implementation using mixing language-level futures in https://github.com/rust-lang/rust/pull/121801.
2025-04-28 14:14:26 +00:00
DaniPopes
f07cc409d3 Rename sub_ptr to offset_from_unsigned in docs 2025-04-28 13:58:27 +02:00
Andrew Zhogin
c366756a85 AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
bors
a932eb36f8 Auto merge of #123239 - Urgau:dangerous_implicit_autorefs, r=jdonszelmann,traviscross
Implement a lint for implicit autoref of raw pointer dereference - take 2

*[t-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097)*

This PR aims at implementing a lint for implicit autoref of raw pointer dereference, it is based on #103735 with suggestion and improvements from https://github.com/rust-lang/rust/pull/103735#issuecomment-1370420305.

The goal is to catch cases like this, where the user probably doesn't realise it just created a reference.

```rust
pub struct Test {
    data: [u8],
}

pub fn test_len(t: *const Test) -> usize {
    unsafe { (*t).data.len() }  // this calls <[T]>::len(&self)
}
```

Since #103735 already went 2 times through T-lang, where they T-lang ended-up asking for a more restricted version (which is what this PR does), I would prefer this PR to be reviewed first before re-nominating it for T-lang.

----

Compared to the PR it is as based on, this PR adds 3 restrictions on the outer most expression, which must either be:
   1. A deref followed by any non-deref place projection (that intermediate deref will typically be auto-inserted)
   2. A method call annotated with `#[rustc_no_implicit_refs]`.
   3. A deref followed by a `addr_of!` or `addr_of_mut!`. See bottom of post for details.

There are several points that are not 100% clear to me when implementing the modifications:
 - ~~"4. Any number of automatically inserted deref/derefmut calls." I as never able to trigger this. Am I missing something?~~ Fixed
 - Are "index" and "field" enough?

----

cc `@JakobDegen` `@WaffleLapkin`
r? `@RalfJung`

try-job: dist-various-1
try-job: dist-various-2
2025-04-28 08:25:23 +00:00
bors
0134651fb8 Auto merge of #136316 - GrigorenkoPV:generic_atomic, r=Mark-Simulacrum
Create `Atomic<T>` type alias (rebase)

Rebase of #130543.

Additional changes:
- Switch from `allow` to `expect` for `private_bounds` on `AtomicPrimitive`
- Unhide `AtomicPrimitive::AtomicInner` from docs, because rustdoc shows the definition `pub type Atomic<T> = <T as AtomicPrimitive>::AtomicInner;` and generated links for it.
  - `NonZero` did not have this issue, because they kept the new alias private before the direction was changed.
- Use `Atomic<_>` in more places, including inside `Once`'s `Futex`. This is possible thanks to https://github.com/rust-lang/rust-clippy/pull/14125

The rest will either get moved back to #130543 or #130543 will be closed in favor of this instead.

---

* ACP: https://github.com/rust-lang/libs-team/issues/443#event-14293381061
* Tracking issue: #130539
2025-04-28 05:12:59 +00:00
Chris Denton
0ae362bc19 Rollup merge of #140359 - DiuDiu777:str-fix, r=Noratrieb
specify explicit safety guidance for from_utf8_unchecked

The PR addresses missing safety guidelines in two APIs by adding explicit text to the cross-linked reference.
2025-04-28 01:58:51 +00:00
Matthias Krüger
3af00f0889 Rollup merge of #140297 - shepmaster:cstr-lossy, r=joboet
Update example to use CStr::to_string_lossy
2025-04-27 11:54:58 +02:00
Matthias Krüger
766340b26e Rollup merge of #139090 - yotamofek:pr/peekable-next-if-docs, r=tgross35
fix docs for `Peekable::next_if{_eq}`

These seem like copy-paste errors

(except `saves the value of` 👉 `retains` which just sounds better to me)
2025-04-27 11:54:58 +02:00
Matthias Krüger
2b0ce2cf92 Rollup merge of #139031 - DaniPopes:str-trim-closure, r=tgross35
Use char::is_whitespace directly in str::trim*

Use the method directly instead of wrapping it in a closure.
2025-04-27 11:54:57 +02:00
Matthias Krüger
9630242e5e Rollup merge of #137439 - clarfonthey:c-str-module, r=tgross35
Stabilise `std::ffi::c_str`

This finished FCP in #112134 but never actually got a stabilisation PR. Since the FCP in #120048 recently passed to add the `os_str` module, it would be nice to also merge this too, to ensure that both get added in the next version.

Note: The added stability attributes which *somehow* were able to be omitted before (rustc bug?) were added based on the fact that they were added in 302551388b, which ended up in 1.85.0.

Closes: https://github.com/rust-lang/rust/issues/112134

r? libs-api
2025-04-27 11:54:56 +02:00
LemonJ
0795b2d646 specify explicit safety guidance for from_utf8_unchecked 2025-04-27 16:56:31 +08:00
Pavel Grigorenko
df3dd876c9 Remove #[doc(hidden)] from AtomicPrimitive::AtomicInner 2025-04-27 02:18:08 +03:00
Christopher Durham
652998ba26 name ATOMIC_INIT without unstable alias 2025-04-27 02:18:08 +03:00
Christopher Durham
4d93f60568 use generic Atomic type where possible
in core/alloc/std only for now, and ignoring test files

Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
2025-04-27 02:18:08 +03:00
Christopher Durham
96b4ed90c6 add generic Atomic<T> type alias 2025-04-27 02:09:07 +03:00
Jake Goulding
9112c86f42 Update example to use CStr::to_string_lossy 2025-04-26 12:38:23 -04:00
bors
b4c8b0c3f0 Auto merge of #140298 - matthiaskrgr:rollup-5tc1gvb, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #137683 (Add a tidy check for GCC submodule version)
 - #138968 (Update the index of Result to make the summary more comprehensive)
 - #139572 (docs(std): mention const blocks in const keyword doc page)
 - #140152 (Unify the format of rustc cli flags)
 - #140193 (fix ICE in `#[naked]` attribute validation)
 - #140205 (Tidying up UI tests [2/N])
 - #140284 (remove expect() in `unnecessary_transmutes`)
 - #140290 (rustdoc: fix typo change from equivelent to equivalent)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-25 18:51:15 +00:00
Matthias Krüger
a35379654c Rollup merge of #138968 - Natural-selection1:update-Result-doc, r=Amanieu
Update the index of Result to make the summary more comprehensive

fix #138966

This PR and #138957 are twin PR

r? `@Amanieu`
2025-04-25 17:31:46 +02:00
Matthias Krüger
59191fa513 Rollup merge of #138957 - Natural-selection1:update-Option-doc, r=Amanieu
Update the index of Option to make the summary more comprehensive

fix: #138955

This PR and #138968 are twin PR

By the way, this is my first time contributing to rust, and I'm not a native English speaker, so any suggestions—whether about the wording in the docs or the contribution process itself—would be greatly appreciated!
2025-04-25 07:50:24 +02:00
Matthias Krüger
84a921d957 Rollup merge of #137653 - tgross35:deprecate-concat_idents, r=workingjubilee
Deprecate the unstable `concat_idents!`

`concat_idents` has been around unstably for a long time, but there is now a better (but still unstable) way to join identifiers using `${concat(...)}` syntax with `macro_metavar_expr_concat`. This resolves a lot of the problems with `concat_idents` and is on a better track toward stabilization, so there is no need to keep both versions around. `concat_idents!` still has a lot of use in the ecosystem so deprecate it before removing, as discussed in [1].

Link: https://github.com/rust-lang/rust/issues/124225

[1]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Removing.20.60concat_idents.60
2025-04-25 07:50:23 +02:00
Hegui Dai
cdc7298392 Solved suggestions 2025-04-25 11:06:53 +08:00
Trevor Gross
75a9be609e Deprecate the unstable concat_idents!
`concat_idents` has been around unstably for a long time, but there is
now a better (but still unstable) way to join identifiers using
`${concat(...)}` syntax with `macro_metavar_expr_concat`. This resolves
a lot of the problems with `concat_idents` and is on a better track
toward stabilization, so there is no need to keep both versions around.
`concat_idents!` still has a lot of use in the ecosystem so deprecate it
before removing, as discussed in [1].

Link: https://github.com/rust-lang/rust/issues/124225
[1]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Removing.20.60concat_idents.60
2025-04-24 22:14:23 +00:00
Matthias Krüger
cea6ba7a06 Rollup merge of #140172 - bjoernager:const-float-algebraic, r=RalfJung
Make algebraic functions into `const fn` items.

Tracking issue: #136469

This PR makes the algebraic intrinsics and the unstable, algebraic functions of `f16`, `f32`, `f64`, and `f128` into `const fn` items:

```rust
impl f16 {
    pub const fn algebraic_add(self, rhs: f16) -> f16;
    pub const fn algebraic_sub(self, rhs: f16) -> f16;
    pub const fn algebraic_mul(self, rhs: f16) -> f16;
    pub const fn algebraic_div(self, rhs: f16) -> f16;
    pub const fn algebraic_rem(self, rhs: f16) -> f16;
}

impl f32 {
    pub const fn algebraic_add(self, rhs: f32) -> f32;
    pub const fn algebraic_sub(self, rhs: f32) -> f32;
    pub const fn algebraic_mul(self, rhs: f32) -> f32;
    pub const fn algebraic_div(self, rhs: f32) -> f32;
    pub const fn algebraic_rem(self, rhs: f32) -> f32;
}

impl f64 {
    pub const fn algebraic_add(self, rhs: f64) -> f64;
    pub const fn algebraic_sub(self, rhs: f64) -> f64;
    pub const fn algebraic_mul(self, rhs: f64) -> f64;
    pub const fn algebraic_div(self, rhs: f64) -> f64;
    pub const fn algebraic_rem(self, rhs: f64) -> f64;
}

impl f128 {
    pub const fn algebraic_add(self, rhs: f128) -> f128;
    pub const fn algebraic_sub(self, rhs: f128) -> f128;
    pub const fn algebraic_mul(self, rhs: f128) -> f128;
    pub const fn algebraic_div(self, rhs: f128) -> f128;
    pub const fn algebraic_rem(self, rhs: f128) -> f128;
}

// core::intrinsics

pub const fn fadd_algebraic<T: Copy>(a: T, b: T) -> T;
pub const fn fsub_algebraic<T: Copy>(a: T, b: T) -> T;
pub const fn fmul_algebraic<T: Copy>(a: T, b: T) -> T;
pub const fn fdiv_algebraic<T: Copy>(a: T, b: T) -> T;
pub const fn frem_algebraic<T: Copy>(a: T, b: T) -> T;
```

This PR does not preserve the initial behaviour of these functions yielding non-deterministic output under Miri; it is most likely desired to reimplement this behaviour at some point.
2025-04-24 17:19:46 +02:00