Commit Graph

8375 Commits

Author SHA1 Message Date
bors
c6768de2d6 Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung
Enable Non-determinism of float operations in Miri and change std tests

Links to [#4208](https://github.com/rust-lang/miri/issues/4208) and [#3555](https://github.com/rust-lang/miri/issues/3555) in Miri.

Non-determinism of floating point operations was disabled in rust-lang/rust#137594 because it breaks the tests and doc-tests in core/coretests and std. This PR enables some of them.

This pr includes the following changes:

- Enables the float non-determinism but with a lower relative error of 4ULP instead of 16ULP
- These operations now have a fixed output based on the C23 standard, except the pow operations, this is tracked in [#4286](https://github.com/rust-lang/miri/issues/4286#issue-3010677983)
- Changes tests that made incorrect assumptions about the operations, not to make that assumption anymore (from `assert_eq!` to `assert_approx_eq!`.
- Changed the doctests of the stdlib of these operations to compare against fixed constants instead of `f*::EPSILON`, which now succeed with Miri and `-Zmiri-many-seeds`
- Added a constant `APPROX_DELTA` in `std/tests/floats/f32.rs` which is used for approximation tests, but with a different value when run in Miri. This is to make these tests succeed.
- Added tests in the float tests of Miri to test the C23 behaviour.

Fixes https://github.com/rust-lang/miri/issues/4208
2025-06-09 21:21:58 +00:00
Trevor Gross
fd06f6d658 Rollup merge of #142238 - RalfJung:nonnull_provenance, r=workingjubilee
stabilize nonnull_provenance

Fixes https://github.com/rust-lang/rust/issues/135243
FCP passed in https://github.com/rust-lang/rust/issues/135243
2025-06-09 12:17:55 -05:00
Trevor Gross
ab87ed150b Rollup merge of #141993 - tgross35:use-in-tree-builtins, r=bjorn3
Use the in-tree `compiler-builtins` for the sysroot

Many of `std`'s dependency have a dependency on the crates.io `compiler-builtins` when used with the feature `rustc-std-workspace-core`. Use a Cargo patch to select the in-tree version instead.

`compiler-builtins` is also added as a dependency of `rustc-std-workspace-core` so these crates can remove their crates.io dependency in the future.

Zulip discussion: [#t-compiler > Using in-tree compiler-builtins](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Using.20in-tree.20compiler-builtins/with/522445336)

Once this merges, the following PRs will need to make it to a release for the relevant crates:

- https://github.com/rust-lang/getopts/pull/119 (can merge at any time)
- https://github.com/rust-lang/hashbrown/pull/625 (can merge at any time)
- https://github.com/rust-lang/stdarch/pull/1825
- https://github.com/rust-lang/rustc-demangle/pull/80
- https://github.com/rust-lang/cfg-if/pull/84
- https://github.com/unicode-rs/unicode-width/pull/77

The above should cover all tier 1 targets with no `std` features enabled. The remaining cover the rest:

- https://github.com/alexcrichton/dlmalloc-rs/pull/50 (wasm, xous, sgx)
- https://github.com/gimli-rs/gimli/pull/769
- https://github.com/r-efi/r-efi/pull/89 (efi)
- https://github.com/r-efi/r-efi-alloc/pull/9 (efi)
- https://github.com/fortanix/rust-sgx/pull/770 (sgx)
- https://github.com/hermit-os/hermit-rs/pull/718 (hermit)
- https://github.com/bytecodealliance/wasi-rs/pull/108 (wasi)
- https://github.com/gimli-rs/addr2line/pull/345
- https://github.com/oyvindln/adler2/pull/2
- https://github.com/BurntSushi/memchr/pull/180
- https://github.com/Frommi/miniz_oxide/pull/173
- https://github.com/gimli-rs/object/pull/777

try-job: x86_64-gnu
try-job: test-various
2025-06-09 12:17:53 -05:00
bors
14863ea077 Auto merge of #142242 - matthiaskrgr:rollup-1sgx0ji, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#129121 (Stabilize `tcp_quickack`)
 - rust-lang/rust#142192 (De-duplicate f16 & f128 doctest attributes)
 - rust-lang/rust#142193 (add tests for pattern binding drop order edge cases)
 - rust-lang/rust#142222 (Dont make `ObligationCtxt`s with diagnostics unnecessarily)
 - rust-lang/rust#142228 (rustc-dev-guide subtree update)
 - rust-lang/rust#142231 (Run `calculate_matrix` job on `master` to cache citool builds)
 - rust-lang/rust#142232 (add `Cargo.lock` to CI-rustc allowed list for non-CI env)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-09 12:21:14 +00:00
Matthias Krüger
25de98fd41 Rollup merge of #142192 - Urgau:dedup-f16-f128-test-attrs, r=tgross35
De-duplicate f16 & f128 doctest attributes

Now that rustdoc supports `#[doc(test(attr(...)))]` at every level, thanks to https://github.com/rust-lang/rust/pull/140560, we can de-duplicate the f16 & f128 doctest attributes.

Unfortunately we can de-duplicate the `cfg`s attribute as rustdoc would complain about missing `main`, but it's already much better than before.

Addresses https://github.com/rust-lang/rust/pull/140323/files#r2062702761
r? `@tgross35`
2025-06-09 13:55:33 +02:00
Matthias Krüger
d9563a5aa4 Rollup merge of #129121 - devnexen:stabilize_ext_linux_tcp_layer, r=tgross35
Stabilize `tcp_quickack`

to stabilise the quickack part for now, tcp_deferaccept had been added at a later stage.

The related API calls are the following

```rust
// std::os::linux::net

// sealed trait, implemented for std::net::TcpStream
pub trait TcpStreamExt: Sealed{
  fn quickack(&self) -> io::Result<bool>;
  fn set_quickack(&self, quickack: bool) -> io::Result<()>;
}
```

Closes: https://github.com/rust-lang/rust/issues/96256
2025-06-09 13:55:32 +02:00
Ralf Jung
3164ca8bb4 stabilize nonnull_provenance 2025-06-09 12:36:24 +02:00
Matthias Krüger
bf17f139d3 Rollup merge of #142224 - joshtriplett:remove-gratuitous-wait-in-stress-test, r=workingjubilee
Avoid a gratuitous 10s wait in a stress test

`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites, is a stress test of the `recv_timeout` function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred.

The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the *total* runtime of the `library/std` testsuite, and is the only standard library test that takes more than a second.

Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s.

Add a check that at least one timeout occurred.
2025-06-09 10:20:54 +02:00
Josh Triplett
889f7cbffa Avoid a gratuitous 10s wait in a stress test
`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites,
is a stress test of the `recv_timeout` function. This test processes and
ignores timeouts, and just ensures that every sent value gets received.
As such, the exact length of the timeouts is not critical, only that
the timeout and sleep durations ensure that at least one timeout
occurred.

The current tests have 100 iterations, half of which sleep for 200ms,
causing the test to take 10s. This represents around 2/3rds of the
*total* runtime of the `library/std` testsuite.

Reduce this to 50 iterations where half of them sleep for 10ms, causing
the test to take 0.25s.

Add a check that at least one timeout occurred.
2025-06-08 20:22:07 -07:00
Jubilee
840baa46ff Rollup merge of #142053 - heiher:loong32-none, r=wesleywiser
Add new Tier-3 targets: `loongarch32-unknown-none*`

MCP: https://github.com/rust-lang/compiler-team/issues/865

NOTE: LoongArch32 ELF object support is available starting with object v0.37.0.
2025-06-08 17:17:53 -07:00
Urgau
fdae3448ba De-duplicate f16 & f128 doctest attributes 2025-06-08 14:51:13 +02:00
Trevor Gross
cc3e57147e Use the in-tree compiler-builtins
Many of `std`'s dependency have a dependency on the crates.io
`compiler-builtins` when used with the feature
`rustc-std-workspace-core`. Use a Cargo patch to select the in-tree
version instead.

`compiler-builtins` is also added as a dependency of
`rustc-std-workspace-core` so these crates can remove their crates.io
dependency in the future.
2025-06-08 02:36:58 +00:00
Jacob Pratt
06a2daf4db Rollup merge of #137992 - its-the-shrimp:stabilise_os_string_pathbuf_leak, r=dtolnay
Stabilise `os_string_pathbuf_leak`

This PR stabilises `#[feature(os_string_pathbuf_leak)]`, which defines 2 new methods in the std:

```rs
impl OsString {
    pub fn leak<'a>(self) -> &'a mut OsStr;
}

impl PathBuf {
    pub fn leak<'a>(self) -> &'a mut Path;
}
```

ACP: https://github.com/rust-lang/libs-team/issues/389
Tracking issue: https://github.com/rust-lang/rust/issues/125965
Implementation: https://github.com/rust-lang/rust/pull/125966
2025-06-07 07:05:44 +02:00
Guillaume Gomez
15d9b9619c Rollup merge of #141471 - RalfJung:unsafe-fn-in-trait, r=traviscross
unsafe keyword docs: emphasize that an unsafe fn in a trait does not get to choose its safety contract

Inspired by discussion in https://github.com/rust-lang/rust/issues/139368.
Cc `@hanna-kruppe`
2025-06-06 23:53:16 +02:00
Guillaume Gomez
3fee6cccde Rollup merge of #140418 - tgross35:std-c-size_t, r=workingjubilee
Reexport types from `c_size_t` in `std`

These are unstably available in `core` and should be in `std` too, but are not currently reexported. Resolve this here.

Tracking issue: https://github.com/rust-lang/rust/issues/88345
2025-06-06 23:53:15 +02:00
Ralf Jung
910a59dfae unsafe keyword docs: emphasize that an unsafe fn in a trait does not get to choose its safety contract 2025-06-06 22:34:10 +02:00
schvv31n
eba3a61067 Stabilised os_string_pathbuf_leak 2025-06-06 12:06:42 -07:00
Ayush Singh
669564d028 std: sys: random: uefi: Provide rdrand based fallback
Some UEFI systems based on American Megatrends Inc. v3.3 do not provide
RNG support [1]. So fallback to rdrand in such cases.

[1]: https://github.com/rust-lang/rust/issues/138252#issuecomment-2891270323

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-06-06 10:14:08 +05:30
WANG Rui
38d69c3f57 Add new Tier-3 targets: loongarch32-unknown-none*
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-06-06 08:19:38 +08:00
Matthias Krüger
9c895558ec Rollup merge of #142091 - thaliaarchi:aix-getenv, r=workingjubilee
Fix AIX build

Fix rust-lang/rust#141543.

`getenv` was moved out of this file to `sys::env::getenv` in rust-lang/rust#140143. Replace its usage with `std::env::var_os`, the publicly exposed version. This matches the other usages of the same function in this file.
2025-06-06 00:58:48 +02:00
Thalia Archibald
46ce08ef06 Fix AIX build 2025-06-05 10:29:50 -07:00
Tobias Bucher
4b1e28b21f Clarify description of Seek::stream_len
It can only describe the inner workings of the default implementation,
other implementations might not be implemented using seeks at all.
2025-06-05 16:27:28 +02:00
Tobias Bucher
fde8a8d518 Optimize Seek::stream_len impl for File
It uses the file metadata on Unix with a fallback for files incorrectly
reported as zero-sized. It uses `GetFileSizeEx` on Windows.

This reduces the number of syscalls needed for determining the file size
of an open file from 3 to 1.
2025-06-05 16:27:27 +02:00
LorrensP-2158466
00452bd783 change tests to use fixed constants to let them pass with miri 2025-06-05 16:22:13 +02:00
Matthias Krüger
88620b400e Rollup merge of #141467 - cyrgani:const-empty-stringlikes, r=Amanieu
make `OsString::new` and `PathBuf::new` unstably const

Since #129041, `String::into_bytes` is `const`, which allows making `OsString::new` and `PathBuf::new` unstably const now.
Not sure what the exact process for this is; does it need an ACP?
2025-06-04 07:54:33 +02:00
Matthias Krüger
c8a0f69d0e Rollup merge of #141925 - cuviper:vestigial-bootstrap, r=workingjubilee
Remove bootstrap cfgs from library/

These `cfg(bootstrap)` are always false now that rust-lang/rust#119899 has landed, and likewise `cfg(not(bootstrap))` is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.
2025-06-03 21:53:37 +02:00
Matthias Krüger
d096ebf8d9 Rollup merge of #141455 - joboet:tls_exhaustion_abort, r=tgross35
std: abort the process on failure to allocate a TLS key

The panic machinery uses TLS, so panicking if no TLS keys are left can lead to infinite recursion (see https://github.com/rust-lang/rust/issues/140798#issuecomment-2872307377). Rather than having separate logic for the panic count and the thread name, just always abort the process if a TLS key allocation fails. This also has the benefit of aligning the key-based TLS implementation with the documentation, which does not mention that a panic could also occur because of resource exhaustion.
2025-06-03 21:53:36 +02:00
LorrensP-2158466
5bafe9d8fc Enable Float non-determinism in miri. Update and add tests and change
change tests in std, core and coretests.
2025-06-03 19:46:13 +02:00
Matthias Krüger
55f7571a7e Rollup merge of #140715 - lukaslueg:oncecellsyncdocs, r=tgross35
Clarify &mut-methods' docs on sync::OnceLock

Three small changes to the docs of `sync::OnceLock`:

* The docs for `OnceLock::take()` used to [say](https://doc.rust-lang.org/std/sync/struct.OnceLock.html#method.take) "**Safety** is guaranteed by requiring a mutable reference." (emphasis mine). While technically correct, imho its not necessary to even mention safety - as opposed to unsafety - here: Safety never comes up wrt `OnceLock`, as there is (currently) no way to interact with a `OnceLock` in an unsafe way; there are no unsafe methods on `OnceLock`, so there is "safety" guarantee required anywhere. What we simply meant to say is "**Synchronization** is guaranteed...".
* I've add that phrase to the other methods of `OnceLock` which take a `&mut self`, to highlight the fact that having a `&mut OnceLock` guarantees that synchronization with other threads is not required. This is the same as with [`Mutex::get_mut()`](https://doc.rust-lang.org/std/sync/struct.Mutex.html#method.get_mut), [`Cell::get_mut()`](https://doc.rust-lang.org/std/cell/struct.Cell.html#method.get_mut), and others.
* In that spirit, the half-sentence "or being initialized" was removed from `get_mut()`, as there is no way that the `OnceLock` is being initialized while we are holding `&mut` to it. Probably a copy&paste from `.get()`
2025-06-03 07:03:42 +02:00
Josh Stone
c87b072952 Remove more library bootstrap 2025-06-02 14:46:19 -07:00
Josh Stone
19e02c8211 Remove bootstrap cfgs from library/ 2025-06-02 10:19:58 -07:00
xizheyin
e95751a9ff Explain TOCTOU on the top of std::fs, and ref it in functions
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-02 17:45:00 +08:00
Jacob Pratt
7f306d5729 Rollup merge of #141832 - workingjubilee:explain-what-toctou-races-are, r=thomcc,ChrisDenton
library: explain TOCTOU races in `fs::remove_dir_all`

In the previous description it said there was a TOCTOU race but did not explain exactly what the problem was. I sat down with the CVE, reviewed its text, and created this explanation. This context should hopefully help people understand the actual risk as-such.

Incidentally, it also fixes the capitalization on the name of Redox OS.

Original CVE and advisory:
- CVE: https://www.cve.org/CVERecord?id=CVE-2022-21658
- security advisory: https://groups.google.com/g/rustlang-security-announcements/c/R1fZFDhnJVQ?pli=1
- github cross-post: https://github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2
2025-06-01 00:35:54 +02:00
Jacob Pratt
ac49339e03 Rollup merge of #141521 - ruancomelli:const-float-rounding, r=RalfJung
Add `const` support for float rounding methods

# Add `const` support for float rounding methods

This PR makes the following float rounding methods `const`:

- `f64::{floor, ceil, trunc, round, round_ties_even}`
- and the corresponding methods for `f16`, `f32` and `f128`

Tracking issue: https://github.com/rust-lang/rust/issues/141555

## Procedure

I followed c09ed3e767 as closely as I could in making float methods `const`, and also received great guidance from https://internals.rust-lang.org/t/const-rounding-methods-in-float-types/22957/3?u=ruancomelli.

## Note

This is my first code contribution to the Rust project, so please let me know if I missed anything - I'd be more than happy to revise and learn more. Thank you for taking the time to review it!
2025-06-01 00:35:53 +02:00
Chris Denton
921b6c02aa If HOME is empty, use the fallback instead 2025-05-31 21:55:26 +00:00
Jubilee Young
7f7c415d03 library: explain TOCTOU races in fs::remove_dir_all
In the previous description it said there was a TOCTOU race but did not
explain exactly what the problem was. I sat down with the CVE, reviewed
its text, and created this explanation. This context should hopefully
help people understand the actual risk as-such.

Incidentally, it also fixes the capitalization on the name of Redox OS.
2025-05-31 14:05:29 -07:00
Ruan Comelli
f8e97badb2 Add const support for float rounding methods
Add const support for the float rounding methods floor, ceil, trunc,
fract, round and round_ties_even.
This works by moving the calculation logic from

     src/tools/miri/src/intrinsics/mod.rs

into

     compiler/rustc_const_eval/src/interpret/intrinsics.rs.

All relevant method definitions were adjusted to include the `const`
keyword for all supported float types: f16, f32, f64 and f128.

The constness is hidden behind the feature gate

     feature(const_float_round_methods)

which is tracked in

     https://github.com/rust-lang/rust/issues/141555

This commit is a squash of the following commits:
- test: add tests that we expect to pass when float rounding becomes const
- feat: make float rounding methods `const`
- fix: replace `rustc_allow_const_fn_unstable(core_intrinsics)` attribute with `#[rustc_const_unstable(feature = "f128", issue = "116909")]` in `library/core/src/num/f128.rs`
- revert: undo update to `library/stdarch`
- refactor: replace multiple `float_<mode>_intrinsic` rounding methods with a single, parametrized one
- fix: add `#[cfg(not(bootstrap))]` to new const method tests
- test: add extra sign tests to check `+0.0` and `-0.0`
- revert: undo accidental changes to `round` docs
- fix: gate `const` float round method behind `const_float_round_methods`
- fix: remove unnecessary `#![feature(const_float_methods)]`
- fix: remove unnecessary `#![feature(const_float_methods)]` [2]
- revert: undo changes to `tests/ui/consts/const-eval/float_methods.rs`
- fix: adjust after rebase
- test: fix float tests
- test: add tests for `fract`
- chore: add commented-out `const_float_round_methods` feature gates to `f16` and `f128`
- fix: adjust NaN when rounding floats
- chore: add FIXME comment for de-duplicating float tests
- test: remove unnecessary test file `tests/ui/consts/const-eval/float_methods.rs`
- test: fix tests after upstream simplification of how float tests are run
2025-05-31 15:26:57 -03:00
bors
4d08223c05 Auto merge of #141824 - matthiaskrgr:rollup-7nffwd0, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#140787 (Note expr being cast when encounter NonScalar cast error)
 - rust-lang/rust#141112 (std: note that `std::str::from_utf8*` functions are aliases to `<str>::from_utf8*` methods)
 - rust-lang/rust#141646 (Document what `distcheck` is intended to exercise)
 - rust-lang/rust#141740 (Hir item kind field order)
 - rust-lang/rust#141793 (`tests/ui`: A New Order [1/N])
 - rust-lang/rust#141805 (Update `compiler-builtins` to 0.1.160)
 - rust-lang/rust#141815 (Enable non-leaf Frame Pointers for mingw-w64 Arm64 Windows)
 - rust-lang/rust#141819 (Fixes for building windows-gnullvm hosts)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-31 18:16:35 +00:00
Matthias Krüger
04641b14a3 Rollup merge of #141805 - tgross35:update-builtins, r=tgross35
Update `compiler-builtins` to 0.1.160

Includes the following changes:

* Enable `__powitf2` on MSVC [1]
* Update `CmpResult` to use a pointer-sized return type [2]
* Better code reuse between `libm` and `compiler-builtins` [3], [4]
* Stop building C versions of `__netf2` [5] since we have our own implementation

[1]: https://github.com/rust-lang/compiler-builtins/pull/918
[2]: https://github.com/rust-lang/compiler-builtins/pull/920
[3]: https://github.com/rust-lang/compiler-builtins/pull/879
[4]: https://github.com/rust-lang/compiler-builtins/pull/925
[5]: https://github.com/rust-lang/compiler-builtins/pull/828
2025-05-31 18:51:50 +02:00
bors
852f15c0f1 Auto merge of #141685 - orlp:inplace-tls-drop, r=joboet
Do not move thread-locals before dropping

Fixes rust-lang/rust#140816. I also (potentially) improved the speed of `get_or_init` a bit by having an explicit hot/cold path.

We still move the value before dropping in the event of a recursive initialization (leading to double-initialization with one value being silently dropped). This is the old behavior, but changing this to panic instead would involve changing tests and also the other OS-specific `thread_local/os.rs` implementation, which is more than I'd like in this PR.
2025-05-31 14:56:33 +00:00
Trevor Gross
ca1c67ad76 Update compiler-builtins to 0.1.160
Includes the following changes:

* Enable `__powitf2` on MSVC [1]
* Update `CmpResult` to use a pointer-sized return type [2]
* Better code reuse between `libm` and `compiler-builtins` [3], [4]
* Stop building C versions of `__netf2` [5] since we have our own
  implementation

[1]: https://github.com/rust-lang/compiler-builtins/pull/918
[2]: https://github.com/rust-lang/compiler-builtins/pull/920
[3]: https://github.com/rust-lang/compiler-builtins/pull/879
[4]: https://github.com/rust-lang/compiler-builtins/pull/925
[5]: https://github.com/rust-lang/compiler-builtins/pull/828
2025-05-30 16:09:12 +00:00
Orson Peters
b374adc9db Address review comments. 2025-05-30 12:14:27 +02:00
Trevor Gross
a5f3b1e5df Make std/src/num mirror core/src/num
The float modules in `std` are currently top-level but for `core`, they
are nested within the `num` directory and referenced by `#[path = ...]`.
For consistency, adjust `std` to use the same structure as `core`.

Also change the `f16` and `f128` gates from outer attributes to inner
attributes like `core` has.
2025-05-29 13:10:32 +00:00
Jacob Pratt
e7ef07a523 Rollup merge of #141690 - Patrick-6:intercept-mutex, r=m-ou-se
Add `rustc_diagnostic_item` to `sys::Mutex` methods

For an ongoing project for adding a concurrency model checker to Miri we need to be able to intercept locking/unlocking operations on standard library mutexes.

This PR adds diagnostic items to the relevant calls `lock`, `try_lock` and `unlock` for the `sys::Mutex` implementation on the targets we care about.
This PR also makes the internals of `pthread::Mutex` less public, to reduce the chance of anyone locking/unlocking a mutex without going through the intercepted methods.

r? ``@RalfJung``
2025-05-29 04:49:47 +02:00
Jacob Pratt
ffdd3b16dc Rollup merge of #141477 - tshepang:patch-1, r=ChrisDenton
Path::with_extension: show that it adds an extension where one did no…

…t exist

I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions.

Also, this replaced example already has a similar example below.
2025-05-29 04:49:41 +02:00
Jacob Pratt
d9ed86729b Rollup merge of #141104 - PaulDance:fix-win7-test_eq_windows_file_type, r=ChrisDenton
Test(fs): Fix `test_eq_windows_file_type` for Windows 7

Would otherwise fail on:

```
thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20:
called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }
```

This came from the read-only attribute set on the test file. In order to fix this, instead of simply disabling the test, the attribute is reset before the test's end so it may still run successfully.

`@rustbot` label T-libs A-filesystem A-testsuite O-windows-7 O-windows-msvc
2025-05-29 04:49:40 +02:00
Lukas Lueg
200d742984 Clarify &mut-methods' docs on sync::OnceLock 2025-05-28 18:31:28 +02:00
Orson Peters
9ffbc62cb6 When replacing an old value we may not drop it in place 2025-05-28 17:53:14 +02:00
Orson Peters
8785f7b122 Add same unsafe bound on get_or_init_slow 2025-05-28 17:10:50 +02:00
Patrick-6
8237107d88 Add comments to diagnostic items 2025-05-28 17:05:45 +02:00