summary refs log tree commit diff
path: root/library/std/tests
AgeCommit message (Collapse)AuthorLines
2025-02-13std: Apply deprecated_safe_2024Eric Huss-33/+51
2025-02-13library: Update rand to 0.9.0Eric Huss-2/+2
2025-02-10Rollup merge of #136805 - RalfJung:miri-win-delete-self, r=NoratriebJubilee-0/+1
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-10ignore win_delete_self test in MiriRalf Jung-0/+1
2025-02-09Mark extern blocks as unsafeMichael Goulet-2/+2
2025-02-09Auto merge of #136754 - Urgau:rollup-qlkhjqr, r=Urgaubors-0/+8
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-09Rollup merge of #134679 - ChrisDenton:rm-readonly, r=Mark-SimulacrumUrgau-0/+8
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-08Rollup merge of #135696 - joboet:move_pal_io, r=NoratriebMatthias Krüger-1/+1
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-07std: get rid of `sys_common::io`joboet-1/+1
2025-02-06Remove some unnecessary parens in `assert!` conditionsEsteban Küber-13/+13
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-02Remove stabilized feature gatebjorn3-2/+1
2025-01-26Move env modifying tests to a separate integration testbjorn3-160/+166
2025-01-26Fix for SGXbjorn3-1/+1
2025-01-26Move std::sync unit tests to integration testsbjorn3-0/+4120
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-26Move std::thread_local unit tests to integration testsbjorn3-0/+420
2025-01-26Move std::time unit tests to integration testsbjorn3-0/+229
2025-01-26Move std::path unit tests to integration testsbjorn3-0/+1978
2025-01-26Move std::panic unit tests to integration testsbjorn3-0/+56
2025-01-26Move std::num unit tests to integration testsbjorn3-0/+230
2025-01-26Move std float unit tests to integration testsbjorn3-0/+3797
2025-01-26Move std::error unit tests to integration testsbjorn3-0/+442
2025-01-26Move std::env unit tests to integration testsbjorn3-0/+120
2025-01-26Windows: Test that deleting a running binary failsChris Denton-0/+8
2025-01-24Fix testing of the standard library with Emscriptenbjorn3-2/+3
This does need EMCC_CFLAGS="-s MAXIMUM_MEMORY=2GB" avoid several OOMs.
2025-01-17Move `std::pipe::*` into `std::io`Jiahao XU-2/+1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2024-11-04Fix and undeprecate home_dir()Kornel-6/+6
2024-10-18Avoid shadowing user provided types or type aliases in `thread_local!`许杰友 Jieyou Xu (Joe)-0/+23
By using qualified imports, i.e. `$crate::...::LocalKey`.
2024-10-10rustc_target: Add sme-b16b16 as an explicit aarch64 target featureKajetan Puchalski-0/+1
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-09-29Fix std tests for wasm32-wasip2 targetNicola Krumschmidt-3/+3
2024-09-22Add test for `available_parallelism()`Oli Iliffe-0/+18
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-08-27rustc_target: Add SME aarch64 featuresKajetan Puchalski-0/+13
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-27rustc_target: Add various aarch64 featuresKajetan Puchalski-0/+21
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-07-29Reformat `use` declarations.Nicholas Nethercote-16/+15
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-23Initial implementation of anonymous_pipeJiahao XU-0/+39
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-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+1
Most modules have such a blank line, but some don't. Inserting the blank line makes it clearer that the `//!` comments are describing the entire module, rather than the `use` declaration(s) that immediately follows.
2024-06-12Make PathBuf less Ok with adding UTF-16 then `into_string`Jubilee Young-0/+14
2024-05-24Stop using the avx512er and avx512pf x86 target featuresHans Wennborg-2/+0
They are no longer supported by LLVM 19. Fixes #125492
2024-05-05Rename test for issue 21058Ryan Lowe-8/+8
2024-04-28Run tidy on testsRyan Lowe-27/+45
2024-04-28Move various stdlib tests to library/std/testsRyan Lowe-0/+312
2024-04-15disable create_dir_all_bare on all(miri, windows)Ralf Jung-0/+1
2024-04-07also test parts of stdRalf Jung-1/+4
requires disabling some tests that do not work
2024-01-30Update feature names for new stdarchAmanieu d'Antras-6/+10
2024-01-20Add test of thread_local containing multiline const blockDavid Tolnay-0/+22
Before making thread_local accept statements inside the const block, this test would fail to compile as follows: error: no rules expected the token `let` --> library/std/tests/thread.rs:26:13 | 26 | let value = 1; | ^^^ no rules expected this token in macro call | note: while trying to match meta-variable `$init:expr` --> library/std/src/thread/local.rs:189:69 | 189 | ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }; $($rest:tt)*) => ( | ^^^^^^^^^^
2024-01-11apply fmtklensy-1/+1
2023-11-02Move RandomState and DefaultHasher into std::hash, but don't export for nowltdk-2/+2
2023-10-31Fix switch_stdout_to on Windows7roblabla-3/+21
The switch_stdout_to test was broken on Windows7, as the test infrastructure would refuse to delete the temporary test folder because the switch-stdout-output file we redirected the stdout to was still opened. To fix this issue, we make switch_stdout_to return the previous handle, and add a new switch_stdout_to call at the end of the test to return the stdio handles to their original state. The handle the second switch_stdout_to returns will be automatically closed, which should allow the temporary test folder to be deleted properly.
2023-08-20Add data race test to `std::env::{get, set}`ShE3py-0/+20
2023-07-29Rollup merge of #114172 - fortanix:raoul/fix_process-spawning_test, ↵Matthias Krüger-0/+2
r=workingjubilee Fix issue_15149 test for the SGX target PR https://github.com/rust-lang/rust/pull/112390 moved tests to std. Unfortunately, this caused the `issue_15149` test to be enabled for the SGX target. This is incorrect as the SGX target does not support the `env::current_exe()` call.
2023-07-28Fix issue_15149 test for the SGX targetRaoul Strackx-0/+2