Commit Graph

78 Commits

Author SHA1 Message Date
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
Nicholas Nethercote 665821cb60 Add blank lines after module-level //! comments.
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-20 09:23:20 +10:00
Jubilee Young af04418a05 Make PathBuf less Ok with adding UTF-16 then into_string 2024-06-12 01:00:21 -07:00
Hans Wennborg 3fe3157858 Stop using the avx512er and avx512pf x86 target features
They are no longer supported by LLVM 19.

Fixes #125492
2024-05-24 20:12:42 +02:00
Ryan Lowe 1bec124ab8 Rename test for issue 21058 2024-05-05 10:47:12 -04:00
Ryan Lowe 419924d878 Run tidy on tests 2024-04-28 18:04:25 -04:00
Ryan Lowe ed9d6e0c03 Move various stdlib tests to library/std/tests 2024-04-28 16:10:12 -04:00
Ralf Jung 24dac6cd45 disable create_dir_all_bare on all(miri, windows) 2024-04-15 10:15:14 +02:00
Ralf Jung 1242093da2 also test parts of std
requires disabling some tests that do not work
2024-04-07 10:05:57 +02:00
Amanieu d'Antras 9a39e41637 Update feature names for new stdarch 2024-01-30 03:33:12 +00:00
David Tolnay c43344e839 Add test of thread_local containing multiline const block
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-20 19:00:27 -08:00
klensy aa696c5a22 apply fmt 2024-01-11 15:04:48 +03:00
ltdk 075409ddd9 Move RandomState and DefaultHasher into std::hash, but don't export for now 2023-11-02 20:35:20 -04:00
roblabla 4971e997e5 Fix switch_stdout_to on Windows7
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-10-31 09:50:07 +01:00
ShE3py f8a2f31ae4 Add data race test to std::env::{get, set} 2023-08-20 21:50:45 +02:00
Matthias Krüger 68dc159241 Rollup merge of #114172 - fortanix:raoul/fix_process-spawning_test, 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-29 06:13:07 +02:00
Raoul Strackx 8548689af2 Fix issue_15149 test for the SGX target 2023-07-28 14:48:06 +02:00