Commit Graph

16094 Commits

Author SHA1 Message Date
Matthias Krüger 25e3b66410
Rollup merge of #129754 - alexcrichton:fix-wasi-long-sleep, r=workingjubilee
wasi: Fix sleeping for `Duration::MAX`

This commit fixes an assert in the WASI-specific implementation of thread sleep to ensure that sleeping for a very large period of time blocks instead of panicking. This can come up when testing programs that sleep "forever", for example.

I'll note that I haven't included a test for this since it's sort of difficult to test. I've tested this locally though that long sleeps do indeed block and short sleeps still only sleep for a short amount of time.
2024-08-31 10:08:59 +02:00
Matthias Krüger 10fb626958
Rollup merge of #129675 - lolbinarycat:bufreader_peek_unsized, r=workingjubilee
allow BufReader::peek to be called on unsized types

#128405
2024-08-31 10:08:55 +02:00
Matthias Krüger fbf74dfb00
Rollup merge of #129642 - workingjubilee:bump-backtrace-fc37b22, r=workingjubilee
Bump backtrace to 0.3.74~ish

Commit: https://github.com/rust-lang/backtrace-rs/commit/230570f

This should help with backtraces on Android, QNX NTO 7.0, and Windows.
It addresses a case of backtrace incurring undefined behavior on Android.
2024-08-31 10:08:55 +02:00
Matthias Krüger 385ffaedbf
Rollup merge of #129640 - saethlin:unignore-android-in-alloc, r=tgross35
Re-enable android tests/benches in alloc/core

This is basically a revert of https://github.com/rust-lang/rust/pull/73729. These tests better work on android now; it's been 4 years and we don't use dlmalloc on that target anymore.

And I've validated that they should pass now with a try-build :)
2024-08-31 10:08:54 +02:00
Jubilee Young 518b41c2bd Try latest backtrace 2024-08-29 12:13:19 -07:00
Alex Crichton c824c1ada7 wasi: Fix sleeping for `Duration::MAX`
This commit fixes an assert in the WASI-specific implementation of
thread sleep to ensure that sleeping for a very large period of time
blocks instead of panicking. This can come up when testing programs that
sleep "forever", for example.
2024-08-29 10:31:17 -07:00
Guillaume Gomez 4b08b2e400
Rollup merge of #128166 - ChaiTRex:isqrt, r=tgross35
Improved `checked_isqrt` and `isqrt` methods

### Improved tests of `isqrt` and `checked_isqrt` implementations

* Inputs chosen more thoroughly and systematically.
* Checks that `isqrt` and `checked_isqrt` have equivalent results for signed types, either equivalent numerically or equivalent as a panic and a `None`.
* Checks that `isqrt` has numerically-equivalent results for unsigned types and their `NonZero` counterparts.

### Added benchmarks for `isqrt` implementations

### Greatly sped up `checked_isqrt` and `isqrt` methods

* Uses a lookup table for 8-bit integers and then the Karatsuba square root algorithm for larger integers.
* Includes optimization hints that give the compiler the exact numeric range of results.

### Feature tracking issue

`isqrt` is an unstable feature tracked at #116226.

<details><summary>Benchmarked improvements</summary>

### Command used to benchmark

    ./x bench library/core -- int_sqrt

### Before

    benchmarks:
        num::int_sqrt::i128::isqrt           439591.65/iter  +/- 6652.70
        num::int_sqrt::i16::isqrt              5302.97/iter   +/- 160.93
        num::int_sqrt::i32::isqrt             62999.11/iter  +/- 2022.05
        num::int_sqrt::i64::isqrt            125248.81/iter  +/- 1674.43
        num::int_sqrt::i8::isqrt                123.56/iter     +/- 1.87
        num::int_sqrt::isize::isqrt          125356.56/iter  +/- 1017.03
        num::int_sqrt::non_zero_u128::isqrt  437443.75/iter  +/- 3535.43
        num::int_sqrt::non_zero_u16::isqrt     8604.58/iter    +/- 94.76
        num::int_sqrt::non_zero_u32::isqrt    62933.33/iter   +/- 517.30
        num::int_sqrt::non_zero_u64::isqrt   125076.38/iter +/- 11340.61
        num::int_sqrt::non_zero_u8::isqrt       221.51/iter     +/- 1.58
        num::int_sqrt::non_zero_usize::isqrt 136005.21/iter  +/- 2020.35
        num::int_sqrt::u128::isqrt           439014.55/iter  +/- 3920.45
        num::int_sqrt::u16::isqrt              8575.08/iter   +/- 148.06
        num::int_sqrt::u32::isqrt             63008.89/iter   +/- 803.67
        num::int_sqrt::u64::isqrt            125088.09/iter   +/- 879.29
        num::int_sqrt::u8::isqrt                230.18/iter     +/- 2.04
        num::int_sqrt::usize::isqrt          125237.51/iter  +/- 4747.83
### After

    benchmarks:
        num::int_sqrt::i128::isqrt           105184.89/iter +/- 1171.38
        num::int_sqrt::i16::isqrt              1910.26/iter   +/- 78.50
        num::int_sqrt::i32::isqrt             34260.34/iter  +/- 960.84
        num::int_sqrt::i64::isqrt             45939.19/iter +/- 2525.65
        num::int_sqrt::i8::isqrt                 22.87/iter    +/- 0.45
        num::int_sqrt::isize::isqrt           45884.17/iter  +/- 595.49
        num::int_sqrt::non_zero_u128::isqrt  106344.27/iter  +/- 780.99
        num::int_sqrt::non_zero_u16::isqrt     2790.19/iter   +/- 53.43
        num::int_sqrt::non_zero_u32::isqrt    33613.99/iter  +/- 362.96
        num::int_sqrt::non_zero_u64::isqrt    46235.42/iter  +/- 429.69
        num::int_sqrt::non_zero_u8::isqrt        31.78/iter    +/- 0.75
        num::int_sqrt::non_zero_usize::isqrt  46208.75/iter  +/- 375.27
        num::int_sqrt::u128::isqrt           106385.94/iter +/- 1649.95
        num::int_sqrt::u16::isqrt              2747.69/iter   +/- 28.72
        num::int_sqrt::u32::isqrt             33627.09/iter  +/- 475.68
        num::int_sqrt::u64::isqrt             46182.29/iter  +/- 311.16
        num::int_sqrt::u8::isqrt                 33.10/iter    +/- 0.30
        num::int_sqrt::usize::isqrt           46165.00/iter  +/- 388.41

</details>

Tracking Issue for {u8,i8,...}::isqrt #116226

try-job: test-various
2024-08-29 16:21:46 +02:00
Guillaume Gomez 015e9371e0
Rollup merge of #123940 - kornelski:remove-derived-debug, r=Urgau
debug-fmt-detail option

I'd like to propose a new option that makes `#[derive(Debug)]` generate no-op implementations that don't print anything, and makes `{:?}` in format strings a no-op.

There are a couple of motivations for this:

1. A more thorough stripping of debug symbols. Binaries stripped of debug symbols still retain some of them through `Debug` implementations. It's hard to avoid that without compiler's help, because debug formatting can be used in many places, including dependencies, and their loggers, asserts, panics, etc.
   * In my testing it gives about 2% binary size reduction on top of all other binary-minimizing best practices (including `panic_immediate_abort`). There are targets like Web WASM or embedded where users pay attention to binary sizes.
   * Users distributing closed-source binaries may not want to "leak" any symbol names as a matter of principle.
2. Adds ability to test whether code depends on specifics of the `Debug` format implementation in unwise ways (e.g. trying to get data unavailable via public interface, or using it as a serialization format). Because current Rust's debug implementation doesn't change, there's a risk of it becoming a fragile de-facto API that [won't be possible to change in the future](https://www.hyrumslaw.com/). An option that "breaks" it can act as a [grease](https://www.rfc-editor.org/rfc/rfc8701.html).

This implementation is a `-Z fmt-debug=opt` flag that takes:

* `full` — the default, current state.
* `none` — makes derived `Debug` and `{:?}` no-ops. Explicit `impl Debug for T` implementations are left unharmed, but `{:?}` format won't use them, so they may get dead-code eliminated if they aren't invoked directly.
* `shallow` — makes derived `Debug` print only the type's name, without recursing into fields. Fieldless enums print their variant names. `{:?}` works.

The `shallow` option is a compromise between minimizing the `Debug` code, and compatibility. There are popular proc-macro crates that use `Debug::fmt` as a way to convert enum values into their Rust source code.

There's a corresponding `cfg` flag: `#[cfg(fmt_debug = "none")]` that can be used in user code to react to this setting to minimize custom `Debug` implementations or remove unnecessary formatting helper functions.
2024-08-29 16:21:46 +02:00
Chai T. Rex 7af8e218da Speed up `checked_isqrt` and `isqrt` methods
* Use a lookup table for 8-bit integers and the Karatsuba square root
  algorithm for larger integers.
* Include optimization hints that give the compiler the exact numeric
  range of results.
2024-08-28 23:07:04 -04:00
Chai T. Rex 0cac915211 Improve `isqrt` tests and add benchmarks
* Choose test inputs more thoroughly and systematically.
* Check that `isqrt` and `checked_isqrt` have equivalent results for
  signed types, either equivalent numerically or equivalent as a panic
  and a `None`.
* Check that `isqrt` has numerically-equivalent results for unsigned
  types and their `NonZero` counterparts.
* Reuse `ilog10` benchmarks, plus benchmarks that use a uniform
  distribution.
2024-08-28 23:06:54 -04:00
Jubilee bd66fadd79
Rollup merge of #129715 - Amjad50:update-compiler-builtins, r=tgross35
Update `compiler_builtins` to `0.1.123`

Includes https://github.com/rust-lang/compiler-builtins/pull/680 and fixes https://github.com/rust-lang/rust/issues/128386.

Fixed by not including math symbols of `compiler_builtins` into any `unix` target or `wasi`, old behavior is restored

r? tgross35
2024-08-28 19:12:56 -07:00
Jubilee dfe66cf529
Rollup merge of #129683 - RalfJung:copysign, r=thomcc
copysign with sign being a NaN can have non-portable results

Follow-up to https://github.com/rust-lang/rust/pull/129559.
Cc ```@tgross35``` ```@beetrees```

There's no portable variant we can recommend instead here, is there? Something with a semantics like "if `sign` is a NaN, then return `self` unaltered, otherwise return `self` with the sign changed to that of `sign`"?
2024-08-28 19:12:54 -07:00
Jubilee 9ddb45e81a
Rollup merge of #129673 - matthewpipie:arc-weak-debug-trait, r=dtolnay
Add fmt::Debug to sync::Weak<T, A>

Currently, `sync::Weak<T>` implements `Debug`, but `sync::Weak<T, A>` does not. This appears to be an oversight, as `rc::Weak<T, A>` implements `Debug`. (Note: `sync::Weak` is the weak for `Arc`, and `rc::Weak` is the weak for `Rc`.)

This PR adds the Debug trait for `sync::Weak<T, A>`. The issue was initially brought up here: https://github.com/rust-lang/wg-allocators/issues/131
2024-08-28 19:12:54 -07:00
Jubilee 9d5f794312
Rollup merge of #129401 - workingjubilee:partial-initialization-of-stabilization, r=dtolnay,joboet
Partially stabilize `feature(new_uninit)`

Finished comment period: https://github.com/rust-lang/rust/issues/63291#issuecomment-2183022955

The following API has been stabilized from https://github.com/rust-lang/rust/issues/63291

```rust
impl<T> Box<T> { pub fn new_uninit() -> Box<MaybeUninit<T>> {…} }
impl<T> Rc<T> { pub fn new_uninit() -> Rc<MaybeUninit<T>> {…} }
impl<T> Arc<T> { pub fn new_uninit() -> Arc<MaybeUninit<T>> {…} }

impl<T> Box<[T]> { pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} }
impl<T> Rc<[T]> { pub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} }
impl<T> Arc<[T]> { pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} }

impl<T> Box<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Box<T> {…} }
impl<T> Box<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Box<[T]> {…} }
impl<T> Rc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Rc<T> {…} }
impl<T> Rc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Rc<[T]> {…} }
impl<T> Arc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Arc<T> {…} }
impl<T> Arc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Arc<[T]> {…} }
```

The remaining API is split between new issues
- `new_zeroed_alloc`: https://github.com/rust-lang/rust/issues/129396
- `box_uninit_write`: https://github.com/rust-lang/rust/issues/129397

All relevant code is thus either stabilized or split out of that issue, so this closes #63291 as, with the FCP concluded, that issue has served its purpose.

try-job: x86_64-rust-for-linux
2024-08-28 19:12:52 -07:00
Jubilee fcb6b7792d
Rollup merge of #129378 - goffrie:patch-3, r=ChrisDenton
Clean up cfg-gating of ProcessPrng extern

This removes a bit of duplication and is consistent with how `api-ms-win-core-synch-l1-2-0` externs are imported.
2024-08-28 19:12:51 -07:00
Jubilee 4c8c9e092d
Rollup merge of #128192 - mrkajetanp:feature-detect, r=Amanieu
rustc_target: Add various aarch64 features

Add various aarch64 features already supported by LLVM and Linux.
Additionally include some comment fixes to ensure consistency of feature names with the Arm ARM.
Compiler support for features added to stdarch by https://github.com/rust-lang/stdarch/pull/1614.
Tracking issue for unstable aarch64 features is https://github.com/rust-lang/rust/issues/127764.

List of added features:

- FEAT_CSSC
- FEAT_ECV
- FEAT_FAMINMAX
- FEAT_FLAGM2
- FEAT_FP8
- FEAT_FP8DOT2
- FEAT_FP8DOT4
- FEAT_FP8FMA
- FEAT_HBC
- FEAT_LSE128
- FEAT_LSE2
- FEAT_LUT
- FEAT_MOPS
- FEAT_LRCPC3
- FEAT_SVE_B16B16
- FEAT_SVE2p1
- FEAT_WFxT
- FEAT_SME
- FEAT_SME_F16F16
- FEAT_SME_F64F64
- FEAT_SME_F8F16
- FEAT_SME_F8F32
- FEAT_SME_FA64
- FEAT_SME_I16I64
- FEAT_SME_LUTv2
- FEAT_SME2
- FEAT_SME2p1
- FEAT_SSVE_FP8DOT2
- FEAT_SSVE_FP8DOT4
- FEAT_SSVE_FP8FMA

FEAT_FPMR is added in the first commit and then removed in a separate one to highlight it being removed from upstream LLVM 19. The intention is for it to be detectable at runtime through stdarch but not have a corresponding Rust compile-time feature.
2024-08-28 19:12:49 -07:00
Amjad Alsharafi 555414e683
Update `compiler_builtins` to `0.1.123`
Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
2024-08-29 08:38:19 +08:00
Kornel 88b9edc9db
fmt-debug option
Allows disabling `fmt::Debug` derive and debug formatting.
2024-08-28 23:32:40 +01:00
binarycat ae6f8a7764 allow BufReader::peek to be called on unsized types 2024-08-28 13:56:44 -04:00
bors 100fde5246 Auto merge of #129691 - matthiaskrgr:rollup-owlcr3m, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #129421 (add repr to the allowlist for naked functions)
 - #129480 (docs: correct panic conditions for rem_euclid and similar functions)
 - #129551 (ub_checks intrinsics: fall back to cfg(ub_checks))
 - #129608 (const-eval: do not make UbChecks behavior depend on current crate's flags)
 - #129613 (interpret: do not make const-eval query result depend on tcx.sess)
 - #129641 (rustdoc: fix missing resource suffix on `crates.js`)
 - #129657 (Rename `BikeshedIntrinsicFrom` to `TransmuteFrom`)
 - #129666 (interpret: add missing alignment check in raw_eq)
 - #129667 (Rustc driver cleanup)
 - #129668 (Fix Pin::set bounds regression)
 - #129686 (coverage: Rename `CodeRegion` to `SourceRegion`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-28 17:53:22 +00:00
Matthias Krüger 27d7fb0cfa
Rollup merge of #129668 - coolreader18:fix-pin-set-regr, r=dtolnay
Fix Pin::set bounds regression

Fixes #129601

Fixes the regression from #129449, where changing the bounds of the impl block containing `Pin::set` changed the method resolution behavior.

```rust
struct A;
impl A {
    fn set(&self) {}
}

let a: Pin<&A>;
a.set();
// before:
// - checks <impl<Ptr: DerefMut> Pin<Ptr>>::set(): `&A` doesn't impl `DerefMut`
// - autorefs -> &A: resolves to A::set()
// now:
// - checks <impl<Ptr: Deref> Pin<Ptr>>::set(): `&A` impls `Deref`! resolves to Pin::set()
// - check method bounds: `&A` doesn't impl DerefMut: error
```

r? `@dtolnay`
2024-08-28 17:12:20 +02:00
Matthias Krüger 29188a54b3
Rollup merge of #129657 - jswrenn:transmute-name, r=compiler-errors
Rename `BikeshedIntrinsicFrom` to `TransmuteFrom`

As our implementation of MCP411 nears completion and we begin to solicit testing, it's no longer reasonable to expect testers to type or remember `BikeshedIntrinsicFrom`. The name degrades the ease-of-reading of documentation, and the overall experience of using compiler safe transmute.

Tentatively, we'll instead adopt `TransmuteFrom`.

This name seems to be the one most likely to be stabilized, after discussion on Zulip [1]. We may want to revisit the ordering of `Src` and `Dst` before stabilization, at which point we'd likely consider `TransmuteInto` or `Transmute`.

[1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20should.20.60BikeshedIntrinsicFrom.60.20be.20named.3F

Tracking Issue: https://github.com/rust-lang/rust/issues/99571

r​? `@compiler-errors`
2024-08-28 17:12:18 +02:00
Matthias Krüger 015620869d
Rollup merge of #129551 - RalfJung:ub-checks-fallback, r=saethlin
ub_checks intrinsics: fall back to cfg(ub_checks)

Not sure why the fallback body uses `debug_assertions`, probably a leftover from when `cfg!(ub_checks)` did not exist yet?

r? `@saethlin`
2024-08-28 17:12:12 +02:00
Matthias Krüger 56ca2e23fe
Rollup merge of #129480 - lolbinarycat:euclid-docs, r=joboet
docs: correct panic conditions for rem_euclid and similar functions

fixes https://github.com/rust-lang/rust/issues/128857

also fixes the documentation for functions behind the `int_roundings` feature (#88581)
2024-08-28 17:12:12 +02:00
Ben Kimock 83de14c4ff Enable some ilog2 tests as well 2024-08-28 10:45:30 -04:00
Ben Kimock ee05de8e5e Re-enable android tests/benches in alloc 2024-08-28 10:45:30 -04:00
bors ac77e88f7a Auto merge of #129589 - saethlin:improve-panic-immediate-abort, r=tgross35
Tweak some attributes to improve panic_immediate_abort

This is similar to https://github.com/rust-lang/rust/pull/117332; I did the same approach as before where I build a really big project with `-Zbuild-std -Zbuild-std-features=panic_immediate_abort` and grep its symbols for things that look panic-related.
2024-08-28 13:13:09 +00:00
Ralf Jung 0589dc75d3 copysign with sign being a NaN is non-portable 2024-08-28 12:06:28 +02:00
Matthew Giordano c11d46f045 Add fmt::Debug to sync::Weak<T, A> 2024-08-27 17:38:51 -07:00
Noa 0d6c9152fa
Fix Pin::set bounds regression 2024-08-27 16:32:46 -05:00
Jubilee Young 169b2f0e6d library: Stabilize new_uninit for Box, Rc, and Arc
A partial stabilization that only affects:
- AllocType<T>::new_uninit
- AllocType<T>::assume_init
- AllocType<[T]>::new_uninit_slice
- AllocType<[T]>::assume_init
where "AllocType" is Box, Rc, or Arc
2024-08-27 10:17:05 -07:00
Matthias Krüger ac0cc709c3
Rollup merge of #129652 - RalfJung:ptr-to-ref, r=traviscross
fix Pointer to reference conversion docs

The aliasing rules documented in https://github.com/rust-lang/rust/pull/128157 are wrong, this fixes them.
2024-08-27 18:59:30 +02:00
Matthias Krüger 02491259c2
Rollup merge of #129645 - beetrees:fix-float-docs, r=tgross35
Fix typos in floating-point primitive type docs

Fixes a few typos. Also reflows the text of a couple of paragraphs in the source code to the standard line width to make the source easier to read (will have no effect on the rendered documentation).
2024-08-27 18:59:29 +02:00
Matthias Krüger 6ab180577f
Rollup merge of #129581 - RalfJung:exit, r=joshtriplett
exit: explain our expectations for the exit handlers registered in a Rust program

This documents the position of ``@Amanieu`` and others in https://github.com/rust-lang/rust/issues/126600: a library with an atexit handler that destroys state that other threads could still be working on is buggy. We do not consider it acceptable for a library to say "you must call the following cleanup function before exiting from `main` or calling `exit`". I don't know if this is established ``@rust-lang/libs-api``  consensus so I presume this will have to go through FCP.

Given that Rust supports concurrency, I don't think there is any way to write a sound Rust wrapper around a library that has such a required cleanup function: even if we made `exit` unsafe, and the Rust wrapper used the scope-with-callback approach to ensure it can run cleanup code before returning from the wrapper (like `thread::scope`), one could still call this wrapper in a second thread and then return from `main` while the wrapper runs. Making this sound would require `std` to provide a way to "block" returning from `main`, so that while the wrapper runs returning from `main` waits until the wrapper is done... that just doesn't seem feasible.

The `exit` docs do not seem like the best place to document this, but I also couldn't think of a better one.
2024-08-27 18:59:27 +02:00
Jack Wrenn 1ad218f3af safe transmute: Rename `BikeshedIntrinsicFrom` to `TransmuteFrom`
As our implementation of MCP411 nears completion and we begin to
solicit testing, it's no longer reasonable to expect testers to
type or remember `BikeshedIntrinsicFrom`. The name degrades the
ease-of-reading of documentation, and the overall experience of
using compiler safe transmute.

Tentatively, we'll instead adopt `TransmuteFrom`.

This name seems to be the one most likely to be stabilized, after
discussion on Zulip [1]. We may want to revisit the ordering of
`Src` and `Dst` before stabilization, at which point we'd likely
consider `TransmuteInto` or `Transmute`.

[1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20should.20.60BikeshedIntrinsicFrom.60.20be.20named.3F
2024-08-27 14:05:54 +00:00
bors 600edc948a Auto merge of #128134 - joboet:move_pal_alloc, r=cupiver
std: move allocators to `sys`

Part of #117276.
2024-08-27 13:51:39 +00:00
Ralf Jung ab4a743a38 fix Pointer to reference conversion docs 2024-08-27 12:28:43 +02:00
Kajetan Puchalski c3518067c7 rustc_target: Add SME aarch64 features
Add SME aarch64 features already supported by LLVM and Linux.

This commit adds compiler support for the following features:

- FEAT_SME
- FEAT_SME_F16F16
- FEAT_SME_F64F64
- FEAT_SME_F8F16
- FEAT_SME_F8F32
- FEAT_SME_FA64
- FEAT_SME_I16I64
- FEAT_SME_LUTv2
- FEAT_SME2
- FEAT_SME2p1
- FEAT_SSVE_FP8DOT2
- FEAT_SSVE_FP8DOT4
- FEAT_SSVE_FP8FMA
2024-08-27 11:11:47 +01:00
Kajetan Puchalski 4f847bd326 rustc_target: Add various aarch64 features
Add various aarch64 features already supported by LLVM and Linux.

The features are marked as unstable using a newly added symbol, i.e.
aarch64_unstable_target_feature.

Additionally include some comment fixes to ensure consistency of
feature names with the Arm ARM and support for architecture version
target features up to v9.5a.

This commit adds compiler support for the following features:

- FEAT_CSSC
- FEAT_ECV
- FEAT_FAMINMAX
- FEAT_FLAGM2
- FEAT_FP8
- FEAT_FP8DOT2
- FEAT_FP8DOT4
- FEAT_FP8FMA
- FEAT_FPMR
- FEAT_HBC
- FEAT_LSE128
- FEAT_LSE2
- FEAT_LUT
- FEAT_MOPS
- FEAT_LRCPC3
- FEAT_SVE_B16B16
- FEAT_SVE2p1
- FEAT_WFxT
2024-08-27 11:11:47 +01:00
joboet d456814842
std: move allocators to `sys` 2024-08-27 11:58:19 +02:00
Trevor Gross 75ae913ec0
Rollup merge of #129559 - RalfJung:float-nan-semantics, r=thomcc
float types: document NaN bit pattern guarantees

Part of https://github.com/rust-lang/rust/issues/128288: document the guarantees we make for NaN bit patterns.

Cc ``@tgross35``
2024-08-27 01:46:53 -05:00
Trevor Gross d2ff033302
Rollup merge of #128731 - RalfJung:simd-shuffle-vector, r=workingjubilee
simd_shuffle intrinsic: allow argument to be passed as vector

See https://github.com/rust-lang/rust/issues/128738 for context.

I'd like to get rid of [this hack](6c0b89dfac/compiler/rustc_codegen_ssa/src/mir/block.rs (L922-L935)). https://github.com/rust-lang/rust/pull/128537 almost lets us do that since constant SIMD vectors will then be passed as immediate arguments. However, simd_shuffle for some reason actually takes an *array* as argument, not a vector, so the hack is still required to ensure that the array becomes an immediate (which then later stages of codegen convert into a vector, as that's what LLVM needs).

This PR prepares simd_shuffle to also support a vector as the `idx` argument. Once this lands, stdarch can hopefully be updated to pass `idx` as a vector, and then support for arrays can be removed, which finally lets us get rid of that hack.
2024-08-27 01:46:50 -05:00
beetrees d0548359b5
Reflow a couple of paragraphs in floating-point primitive docs 2024-08-27 05:26:28 +01:00
beetrees 969f9702da
Fix typos in floating-point primitive type docs 2024-08-27 05:25:34 +01:00
Jubilee Young 0763a3afc8 Bump backtrace to rust-lang/backtrace@fc37b22
It should be 0.3.74~ish.

This should help with backtraces on Android, QNX NTO 7.0, and Windows.
2024-08-26 20:15:20 -07:00
Matthias Krüger 29923b6801
Rollup merge of #129032 - jswrenn:transmute-method, r=compiler-errors
Document & implement the transmutation modeled by `BikeshedIntrinsicFrom`

Documents that `BikeshedIntrinsicFrom` models transmute-via-union, which is slightly more expressive than the transmute-via-cast implemented by `transmute_copy`. Additionally, we provide an implementation of transmute-via-union as a method on the `BikeshedIntrinsicFrom` trait with additional documentation on the boundary between trait invariants and caller obligations.

Whether or not transmute-via-union is the right kind of transmute to model remains up for discussion [1]. Regardless, it seems wise to document the present behavior.

[1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20'kind'.20of.20transmute.20to.20model.3F/near/426331967

Tracking Issue: https://github.com/rust-lang/rust/issues/99571

r? `@compiler-errors`

cc `@scottmcm,` `@Lokathor`
2024-08-27 00:41:59 +02:00
Matthias Krüger c6ceb5be24
Rollup merge of #128157 - lolbinarycat:unify-ptr-ref-docs, r=cuviper
deduplicate and clarify rules for converting pointers to references

part of #124669
2024-08-27 00:41:58 +02:00
Josh Stone b11e0a883b
Apply suggestions from code review 2024-08-26 12:36:58 -07:00
Matthias Krüger b9dfb4d6f8
Rollup merge of #129592 - saethlin:core-cfg-test, r=tgross35
Remove cfg(test) from library/core

The diff here is very small with the ignore whitespace option.

`core` doesn't/can't have unit tests. All of its tests are just modules under `tests/`, so it has no use for `cfg(test)`, because the entire contents of `library/core/src` are only ever compiled with that cfg off, and the entire contents of `library/core/tests` are only ever compiled with that cfg on.

You can tell this is what's happening because we had `#[cfg(test)]` on a module declaration that has no source file.

I also deleted the extra `mod tests {` layer of nesting; there's no need to mention again in the module path that this is a module of tests. This exposes a name collision between the `u128` module of tests and `core::u128`. Fixed that by using `<u128>::MAX` like is done in the `check!` macro, which is what avoids this name ambiguity for the other types.
2024-08-26 17:25:33 +02:00
Matthias Krüger d0b3c3a110
Rollup merge of #129588 - hermit-os:sleep-micros, r=workingjubilee
pal/hermit: correctly round up microseconds in `Thread::sleep`

This fixes the Hermit-related part of https://github.com/rust-lang/rust/issues/129212 and thus the whole issue, since ESP-IDF is already fixed, as far as I understand.

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

r? `@workingjubilee`

CC: `@stlankes`
2024-08-26 17:25:32 +02:00