Commit Graph

94 Commits

Author SHA1 Message Date
Zachary S
d2068be4a0 Rename (Mapped)(RwLock|Mutex)Guard::try_map to filter_map.
1. analogous to std::cell::Ref(Mut)::filter_map.
2. doesn't imply `Try` genericizability.
2025-04-30 19:43:24 -05:00
Trevor Gross
dfa972e454 Use feature(target_has_reliable_f16_f128) in library tests
New compiler configuration has been introduced that is designed to
replace the build script configuration `reliable_f16`, `reliable_f128`,
`reliable_f16_math`, and `reliable_f128_math`. Do this replacement here,
which allows us to clean up `std`'s build script.

All tests are gated by `#[cfg(bootstrap)]` rather than doing a more
complicated `cfg(bootstrap)` / `cfg(not(bootstrap))` split since the
next beta split is within two weeks.
2025-04-27 20:10:33 +00:00
Ralf Jung
e7a865448a test_nan: ensure the NAN contant is quiet 2025-04-22 09:06:43 +02:00
Glyn Normington
1376810d44 Basic tests of MPMC receiver cloning
Ref: https://github.com/rust-lang/rust/issues/126840#issuecomment-2802321146
2025-04-15 02:37:57 +01:00
Stuart Cook
92bb7261c4
Rollup merge of #137897 - xTachyon:tls-fix, r=thomcc,jieyouxu
fix pthread-based tls on apple targets

Tries to fix #127773.
2025-04-05 13:18:13 +11:00
Calder Coalson
8ff70529f2 Expose algebraic floating point intrinsics 2025-04-04 16:13:57 -07:00
Matthias Krüger
53076de369
Rollup merge of #138294 - paulmenage:test-panic-unwind, r=bjorn3
Mark some std tests as requiring `panic = "unwind"`

This allows these test modules to pass on builds/targets without unwinding support, where `panic = "abort"` - the ignored tests are for functionality that's not supported on those targets.
2025-03-22 21:34:36 +01:00
Andrei Damian
e41cce03a0 fix pthread-based tls on apple targets 2025-03-18 20:31:52 +02:00
Jacob Pratt
62c2a7b93b
Rollup merge of #137793 - NobodyXu:stablise-annoymous-pipe, r=joshtriplett
Stablize anonymous pipe

Since #135822 is staled, I create this PR to stablise anonymous pipe

Closes #127154

try-job: test-various
2025-03-17 05:47:50 -04:00
bors
c3dd4eefd6 Auto merge of #138363 - beetrees:f16-f128-integer-convert, r=Amanieu
Add `From<{integer}>` for `f16`/`f128` impls

This PR adds `impl From<{bool,i8,u8}> for f16` and `impl From<{bool,i8,u8,i16,u16,i32,u32}> for f128`.

The `From<{i64,u64}> for f128` impls are left commented out as adding them would allow using `f128` on stable before it is stabilised like in the following example:
```rust
fn f<T: From<u64>>(x: T) -> T { x }

fn main() {
    let x = f(1.0); // the type of the literal is inferred to be `f128`
}
```
None of the impls added in this PR have this issue as they are all, at minimum, also implemented by `f64`.

This PR will need a crater run for the `From<{i32,u32}>` impls, as `f64` is no longer the only float type to implement them (similar to the cause of #125198).

cc `@bjoernager`
r? `@tgross35`

Tracking issue: #116909
2025-03-17 00:33:36 +00:00
许杰友 Jieyou Xu (Joe)
8210b84aaf
Rollup merge of #138275 - folkertdev:expose-is-s390x-feature-detected, r=Mark-Simulacrum
expose `is_s390x_feature_detected!` from `std::arch`

tracking issue: https://github.com/rust-lang/rust/issues/135413
implementation: https://github.com/rust-lang/stdarch/pull/1699 (more features added in https://github.com/rust-lang/stdarch/pull/1720)

This macro was part of the recent `stdarch` synchronization, but not yet exposed via `std::arch`.

r? libs
2025-03-16 09:40:05 +08:00
Jiahao XU
340a45282a
Stablize feature anonymous_pipe
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-03-14 00:52:45 +11:00
beetrees
7c0726521f
Add From<{integer}> for f16/f128 impls 2025-03-11 18:58:54 +00:00
Trevor Gross
47ba5bd41e Enable f16 tests for powf
The LLVM issue [1] was fixed with [2], which is included in the LLVM20
upgrade. Tests no longer fail, so enable them here.

[1]: https://github.com/llvm/llvm-project/pull/98681
[2]: https://github.com/llvm/llvm-project/pull/98681
2025-03-11 12:13:01 +00:00
Paul Menage
9e5c942286 Mark some std tests as requiring panic = "unwind"
This allows these test modules to pass on builds/targets without
unwinding support, where `panic = "abort"` - the ignored tests are for
functionality that's not supported on those targets.
2025-03-10 08:31:06 -07:00
Folkert de Vries
a312635821
expose is_s390x_feature_detected from std::arch 2025-03-09 14:04:39 +01:00
Eric Huss
ef20a1b1f8 std: Apply deprecated_safe_2024 2025-02-13 13:10:28 -08:00
Eric Huss
b7c975b22e library: Update rand to 0.9.0 2025-02-13 12:20:55 -08:00
Jubilee
ffa8a96040
Rollup merge of #136805 - RalfJung:miri-win-delete-self, r=Noratrieb
ignore win_delete_self test in Miri

Follow-up to https://github.com/rust-lang/rust/pull/134679, fixes miri-test-libstd on Windows

Cc `@ChrisDenton` `@Mark-Simulacrum`
2025-02-10 00:51:58 -08:00
Ralf Jung
2f3c943f42 ignore win_delete_self test in Miri 2025-02-10 08:08:32 +01:00
Michael Goulet
a4e7f8f9bf Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
bors
a26e97be88 Auto merge of #136754 - Urgau:rollup-qlkhjqr, r=Urgau
Rollup of 5 pull requests

Successful merges:

 - #134679 (Windows: remove readonly files)
 - #136213 (Allow Rust to use a number of libc filesystem calls)
 - #136530 (Implement `x perf` directly in bootstrap)
 - #136601 (Detect (non-raw) borrows of null ZST pointers in CheckNull)
 - #136659 (Pick the max DWARF version when LTO'ing modules with different versions )

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-09 12:54:26 +00:00
Urgau
34182470eb
Rollup merge of #134679 - ChrisDenton:rm-readonly, r=Mark-Simulacrum
Windows: remove readonly files

When calling `remove_file`, we shouldn't fail to delete readonly files. As the test makes clear, this make the Windows behaviour consistent with other platforms. This also makes us internally consistent with `remove_dir_all`.

try-job: x86_64-msvc-ext1
2025-02-09 00:37:26 +01:00
Matthias Krüger
02b8bea084
Rollup merge of #135696 - joboet:move_pal_io, r=Noratrieb
std: move `io` module out of `pal`, get rid of `sys_common::io`

Part of #117276.

This does two related things:
1. It moves the platform-specific definitions for `IoSlice`, `IoSliceMut` and `is_terminal` out of `pal` and into `sys` and unifies some of them.
2. It gets rid of `sys_common::io`, moving the non-platform-specific test helpers into `std::test_helpers` and the buffer size definition to the new `sys::io` module.
2025-02-08 21:37:24 +01:00
joboet
7433ba62b1
std: get rid of sys_common::io 2025-02-07 16:54:07 +01:00
Esteban Küber
3815ed63ed Remove some unnecessary parens in assert! conditions
While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
2025-02-06 22:28:44 +00:00
bjorn3
cc7e3a6228 Remove stabilized feature gate 2025-02-02 18:28:08 +00:00
bjorn3
05cbf03d8f Move env modifying tests to a separate integration test 2025-01-26 10:28:05 +00:00
bjorn3
52907d713a Fix for SGX 2025-01-26 10:28:05 +00:00
bjorn3
b8ae372e48 Move std::sync unit tests to integration tests
This removes two minor OnceLock tests which test private methods. The
rest of the tests should be more than enough to catch mistakes in those
private methods. Also makes ReentrantLock::try_lock public. And finally
it makes the mpmc tests actually run.
2025-01-26 10:28:05 +00:00
bjorn3
332fb7e6f1 Move std::thread_local unit tests to integration tests 2025-01-26 10:28:05 +00:00
bjorn3
4ce917dfd5 Move std::time unit tests to integration tests 2025-01-26 10:28:04 +00:00
bjorn3
b8fa843a1a Move std::path unit tests to integration tests 2025-01-26 10:28:04 +00:00
bjorn3
09c4dbf7fb Move std::panic unit tests to integration tests 2025-01-26 10:28:04 +00:00
bjorn3
9baeb45309 Move std::num unit tests to integration tests 2025-01-26 10:28:04 +00:00
bjorn3
29166cd617 Move std float unit tests to integration tests 2025-01-26 10:28:04 +00:00
bjorn3
03d44a641b Move std::error unit tests to integration tests 2025-01-26 10:28:04 +00:00
bjorn3
e00cbf304c Move std::env unit tests to integration tests 2025-01-26 10:28:04 +00:00
Chris Denton
962ebf0a48
Windows: Test that deleting a running binary fails 2025-01-26 06:17:12 +00:00
bjorn3
d0a70d9328 Fix testing of the standard library with Emscripten
This does need EMCC_CFLAGS="-s MAXIMUM_MEMORY=2GB" avoid several OOMs.
2025-01-24 09:25:34 +00:00
Jiahao XU
efe888871c
Move std::pipe::* into std::io
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-01-17 01:30:05 +11:00
Kornel
4b7f56ac9d
Fix and undeprecate home_dir() 2024-11-04 03:06:09 +00:00
许杰友 Jieyou Xu (Joe)
7b2320c3df Avoid shadowing user provided types or type aliases in thread_local!
By using qualified imports, i.e. `$crate::...::LocalKey`.
2024-10-18 10:27:41 +08:00
Kajetan Puchalski
335f67b652 rustc_target: Add sme-b16b16 as an explicit aarch64 target feature
LLVM 20 split out what used to be called b16b16 and correspond to aarch64
FEAT_SVE_B16B16 into sve-b16b16 and sme-b16b16.
Add sme-b16b16 as an explicit feature and update the codegen accordingly.
2024-10-10 10:24:57 +00:00
Nicola Krumschmidt
87f17f3ccb
Fix std tests for wasm32-wasip2 target 2024-09-29 04:48:13 +02:00
Oli Iliffe
e9b0bc9432 Add test for available_parallelism()
This is a redo of (this PR)[https://github.com/rust-lang/rust/pull/104095].

Add test for available_parallelism

Add test for available_parallelism

Add test for

Add test for
2024-09-22 23:46:08 +01: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
Nicholas Nethercote
84ac80f192 Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00
Jiahao XU
c9c8a14884
Initial implementation of anonymous_pipe
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2024-07-23 23:13:56 +10:00