Commit Graph

27615 Commits

Author SHA1 Message Date
github-actions b8271c3270 cargo update
compiler & tools dependencies:     Locking 144 packages to latest compatible versions
    Updating addr2line v0.24.2 -> v0.25.1
    Updating annotate-snippets v0.12.10 -> v0.12.13
      Adding anstream v1.0.0
    Updating anstyle v1.0.13 -> v1.0.14
    Updating anstyle-lossy v1.1.4 -> v1.1.5
      Adding anstyle-parse v1.0.0
    Updating anstyle-svg v0.1.11 -> v0.1.12 (available: v1.1.0)
    Updating anyhow v1.0.100 -> v1.0.102
    Updating assert_cmd v2.1.1 -> v2.2.0
    Updating backtrace v0.3.75 -> v0.3.76
    Updating bitflags v2.10.0 -> v2.11.0
    Updating blake3 v1.8.2 -> v1.8.3
    Updating bumpalo v3.19.0 -> v3.20.2
    Updating camino v1.2.1 -> v1.2.2
    Updating cargo-platform v0.3.1 -> v0.3.2
    Updating chrono v0.4.42 -> v0.4.44
    Updating clap v4.5.54 -> v4.6.0
    Updating clap_builder v4.5.54 -> v4.6.0
    Updating clap_derive v4.5.49 -> v4.6.0
    Removing clap_lex v0.7.6
      Adding clap_lex v0.7.7
      Adding clap_lex v1.1.0
    Updating colorchoice v1.0.4 -> v1.0.5
    Updating colored v3.0.0 -> v3.1.1
      Adding console v0.16.3
    Updating constant_time_eq v0.3.1 -> v0.4.2
    Updating ctrlc v3.5.1 -> v3.5.2
    Updating curl-sys v0.4.84+curl-8.17.0 -> v0.4.85+curl-8.18.0
    Updating cxx v1.0.188 -> v1.0.194
    Updating cxx-build v1.0.188 -> v1.0.194
    Updating cxxbridge-cmd v1.0.188 -> v1.0.194
    Updating cxxbridge-flags v1.0.188 -> v1.0.194
    Updating cxxbridge-macro v1.0.188 -> v1.0.194
      Adding darling v0.21.3
      Adding darling_core v0.21.3
      Adding darling_macro v0.21.3
    Updating dbus v0.9.9 -> v0.9.10
    Updating derive-where v1.6.0 -> v1.6.1
    Updating derive_setters v0.1.8 -> v0.1.9
    Updating env_filter v0.1.4 -> v1.0.0
    Updating env_logger v0.11.8 -> v0.11.9
    Updating erased-serde v0.4.9 -> v0.4.10
    Updating filetime v0.2.26 -> v0.2.27
    Updating find-msvc-tools v0.1.5 -> v0.1.9
    Updating flate2 v1.1.5 -> v1.1.9
    Removing getrandom v0.2.16
      Adding getrandom v0.2.17
      Adding getrandom v0.4.2
    Updating git2 v0.20.2 -> v0.20.4
    Updating iana-time-zone v0.1.64 -> v0.1.65
    Updating icu_locale_data v2.1.1 -> v2.1.2
    Updating icu_properties v2.1.1 -> v2.1.2
    Updating icu_properties_data v2.1.1 -> v2.1.2
      Adding indicatif v0.18.4
    Updating itoa v1.0.15 -> v1.0.17
    Updating jiff v0.2.16 -> v0.2.23
    Updating jiff-static v0.2.16 -> v0.2.23
    Updating js-sys v0.3.82 -> v0.3.91
    Updating lexopt v0.3.1 -> v0.3.2
    Updating libc v0.2.177 -> v0.2.183
    Updating libdbus-sys v0.2.6 -> v0.2.7
    Updating libgit2-sys v0.18.2+1.9.1 -> v0.18.3+1.9.2
    Updating libm v0.2.15 -> v0.2.16
    Updating libredox v0.1.10 -> v0.1.14
    Updating libz-sys v1.1.23 -> v1.1.25
    Updating linux-raw-sys v0.11.0 -> v0.12.1
    Updating log v0.4.28 -> v0.4.29
    Updating memchr v2.7.6 -> v2.8.0
    Updating mio v1.1.0 -> v1.1.1
      Adding nix v0.31.2
    Updating objc2 v0.6.3 -> v0.6.4
    Updating once_cell v1.21.3 -> v1.21.4
    Updating openssl-sys v0.9.111 -> v0.9.112
    Updating owo-colors v4.2.3 -> v4.3.0
    Updating pest v2.8.3 -> v2.8.6
    Updating pest_derive v2.8.3 -> v2.8.6
    Updating pest_generator v2.8.3 -> v2.8.6
    Updating pest_meta v2.8.3 -> v2.8.6
    Updating pin-project-lite v0.2.16 -> v0.2.17
      Adding plain v0.2.3
    Updating portable-atomic v1.11.1 -> v1.13.1
    Updating portable-atomic-util v0.2.4 -> v0.2.6
    Updating predicates v3.1.3 -> v3.1.4
    Updating predicates-core v1.0.9 -> v1.0.10
    Updating predicates-tree v1.0.12 -> v1.0.13
      Adding prettyplease v0.2.37
    Updating proc-macro2 v1.0.103 -> v1.0.106
    Updating quote v1.0.42 -> v1.0.45
      Adding r-efi v6.0.0
    Updating rand_core v0.9.3 -> v0.9.5
      Adding redox_syscall v0.7.3
    Updating regex v1.12.2 -> v1.12.3
    Updating regex-automata v0.4.13 -> v0.4.14
    Updating regex-lite v0.1.8 -> v0.1.9
    Updating regex-syntax v0.8.8 -> v0.8.10
    Updating rustix v1.1.2 -> v1.1.4
    Removing ryu v1.0.20
    Updating schannel v0.1.28 -> v0.1.29
    Updating schemars v1.1.0 -> v1.2.1
    Updating schemars_derive v1.1.0 -> v1.2.1
    Updating self_cell v1.2.1 -> v1.2.2
    Updating serde_json v1.0.145 -> v1.0.149
    Updating serde_spanned v1.0.3 -> v1.0.4
    Updating simd-adler32 v0.3.7 -> v0.3.8
    Updating siphasher v1.0.1 -> v1.0.2
    Updating socket2 v0.6.1 -> v0.6.3
    Updating syn v2.0.110 -> v2.0.117
    Updating tempfile v3.23.0 -> v3.27.0
    Updating thiserror v2.0.17 -> v2.0.18
    Updating thiserror-impl v2.0.17 -> v2.0.18
    Updating tinyvec v1.10.0 -> v1.11.0
    Updating toml v0.9.8 -> v0.9.12+spec-1.1.0 (available: v1.0.6+spec-1.1.0)
    Updating toml_datetime v0.7.3 -> v0.7.5+spec-1.1.0
    Updating toml_parser v1.0.4 -> v1.0.9+spec-1.1.0
    Updating toml_writer v1.0.4 -> v1.0.6+spec-1.1.0
    Updating tracing v0.1.41 -> v0.1.44
    Updating tracing-attributes v0.1.30 -> v0.1.31
    Updating tracing-core v0.1.34 -> v0.1.36
    Updating tracing-subscriber v0.3.20 -> v0.3.23
    Updating ui_test v0.30.3 -> v0.30.4
    Updating unicase v2.8.1 -> v2.9.0
    Updating unicode-ident v1.0.22 -> v1.0.24
    Updating unicode-script v0.5.7 -> v0.5.8
      Adding unit-prefix v0.5.2
    Updating url v2.5.7 -> v2.5.8
    Updating utf8-width v0.1.7 -> v0.1.8
    Updating uuid v1.18.1 -> v1.22.0
    Updating wasi-preview1-component-adapter-provider v40.0.0 -> v40.0.4
      Adding wasip2 v1.0.2+wasi-0.2.9
      Adding wasip3 v0.4.0+wasi-0.3.0-rc-2026-01-06
    Updating wasm-bindgen v0.2.105 -> v0.2.114
    Updating wasm-bindgen-macro v0.2.105 -> v0.2.114
    Updating wasm-bindgen-macro-support v0.2.105 -> v0.2.114
    Updating wasm-bindgen-shared v0.2.105 -> v0.2.114
      Adding wasm-encoder v0.244.0
      Adding wasm-metadata v0.244.0
      Adding wasmparser v0.244.0
    Removing windows-sys v0.60.2
    Removing windows-targets v0.53.5
    Removing windows_aarch64_gnullvm v0.53.1
    Removing windows_aarch64_msvc v0.53.1
    Removing windows_i686_gnu v0.53.1
    Removing windows_i686_gnullvm v0.53.1
    Removing windows_i686_msvc v0.53.1
    Removing windows_x86_64_gnu v0.53.1
    Removing windows_x86_64_gnullvm v0.53.1
    Removing windows_x86_64_msvc v0.53.1
    Updating winnow v0.7.13 -> v0.7.15
      Adding wit-bindgen v0.51.0
      Adding wit-bindgen-core v0.51.0
      Adding wit-bindgen-rust v0.51.0
      Adding wit-bindgen-rust-macro v0.51.0
      Adding wit-component v0.244.0
      Adding wit-parser v0.244.0
    Updating zerocopy v0.8.27 -> v0.8.42
    Updating zerocopy-derive v0.8.27 -> v0.8.42
      Adding zmij v1.0.21
note: pass `--verbose` to see 46 unchanged dependencies behind latest

library dependencies:     Locking 5 packages to latest compatible versions
    Updating dlmalloc v0.2.11 -> v0.2.13
    Updating libc v0.2.178 -> v0.2.183
    Updating memchr v2.7.6 -> v2.8.0
    Updating rand_core v0.9.3 -> v0.9.5
    Updating windows-sys v0.60.2 -> v0.61.2
    Removing windows-targets v0.53.5
    Removing windows_aarch64_gnullvm v0.53.1
    Removing windows_aarch64_msvc v0.53.1
    Removing windows_i686_gnu v0.53.1
    Removing windows_i686_gnullvm v0.53.1
    Removing windows_i686_msvc v0.53.1
    Removing windows_x86_64_gnu v0.53.1
    Removing windows_x86_64_gnullvm v0.53.1
    Removing windows_x86_64_msvc v0.53.1
note: pass `--verbose` to see 11 unchanged dependencies behind latest

rustbook dependencies:     Locking 84 packages to latest compatible versions
    Updating anstream v0.6.21 -> v1.0.0
    Updating anstyle v1.0.13 -> v1.0.14
    Updating anstyle-parse v0.2.7 -> v1.0.0
    Updating anstyle-query v1.1.4 -> v1.1.5
    Updating anstyle-wincon v3.0.10 -> v3.0.11
    Updating anyhow v1.0.100 -> v1.0.102
    Updating bitflags v2.10.0 -> v2.11.0
    Updating bumpalo v3.19.0 -> v3.20.2
    Updating cc v1.2.45 -> v1.2.57
    Updating chrono v0.4.42 -> v0.4.44
    Updating clap v4.5.51 -> v4.6.0
    Updating clap_builder v4.5.51 -> v4.6.0
    Updating clap_derive v4.5.49 -> v4.6.0
    Updating clap_lex v0.7.6 -> v1.1.0
    Updating colorchoice v1.0.4 -> v1.0.5
    Updating crypto-common v0.1.6 -> v0.1.7
    Updating find-msvc-tools v0.1.4 -> v0.1.9
    Updating flate2 v1.1.5 -> v1.1.9
      Adding foldhash v0.1.5
 Downgrading generic-array v0.14.9 -> v0.14.7 (available: v0.14.9)
    Updating getrandom v0.3.4 -> v0.4.2
    Updating handlebars v6.3.2 -> v6.4.0
      Adding hashbrown v0.15.5
    Updating iana-time-zone v0.1.64 -> v0.1.65
      Adding id-arena v2.3.0
    Updating indexmap v2.12.1 -> v2.13.0
    Updating itoa v1.0.15 -> v1.0.17
    Updating js-sys v0.3.82 -> v0.3.91
      Adding leb128fmt v0.1.0
    Updating libc v0.2.177 -> v0.2.183
    Updating linux-raw-sys v0.11.0 -> v0.12.1
    Updating log v0.4.28 -> v0.4.29
    Updating memchr v2.7.6 -> v2.8.0
    Updating once_cell v1.21.3 -> v1.21.4
    Updating pest v2.8.3 -> v2.8.6
    Updating pest_derive v2.8.3 -> v2.8.6
    Updating pest_generator v2.8.3 -> v2.8.6
    Updating pest_meta v2.8.3 -> v2.8.6
    Updating pin-project-lite v0.2.16 -> v0.2.17
      Adding prettyplease v0.2.37
    Updating proc-macro2 v1.0.103 -> v1.0.106
    Updating pulldown-cmark v0.13.0 -> v0.13.1
    Updating quote v1.0.42 -> v1.0.45
    Updating r-efi v5.3.0 -> v6.0.0
    Updating regex v1.12.2 -> v1.12.3
    Updating regex-automata v0.4.13 -> v0.4.14
    Updating regex-syntax v0.8.8 -> v0.8.10
    Updating rustix v1.1.2 -> v1.1.4
    Removing ryu v1.0.20
    Updating serde_json v1.0.145 -> v1.0.149
    Updating serde_spanned v1.0.3 -> v1.0.4
    Updating simd-adler32 v0.3.7 -> v0.3.8
    Updating siphasher v1.0.1 -> v1.0.2
    Updating syn v2.0.110 -> v2.0.117
    Updating tempfile v3.23.0 -> v3.27.0
    Updating thiserror v2.0.17 -> v2.0.18
    Updating thiserror-impl v2.0.17 -> v2.0.18
    Updating toml v0.9.8 -> v0.9.12+spec-1.1.0
    Updating toml_datetime v0.7.3 -> v0.7.5+spec-1.1.0
    Updating toml_parser v1.0.4 -> v1.0.9+spec-1.1.0
    Updating toml_writer v1.0.4 -> v1.0.6+spec-1.1.0
    Updating tracing v0.1.43 -> v0.1.44
    Updating tracing-core v0.1.35 -> v0.1.36
    Updating tracing-subscriber v0.3.22 -> v0.3.23
    Updating unicase v2.8.1 -> v2.9.0
    Updating unicode-ident v1.0.22 -> v1.0.24
      Adding unicode-xid v0.2.6
    Updating wasip2 v1.0.1+wasi-0.2.4 -> v1.0.2+wasi-0.2.9
      Adding wasip3 v0.4.0+wasi-0.3.0-rc-2026-01-06
    Updating wasm-bindgen v0.2.105 -> v0.2.114
    Updating wasm-bindgen-macro v0.2.105 -> v0.2.114
    Updating wasm-bindgen-macro-support v0.2.105 -> v0.2.114
    Updating wasm-bindgen-shared v0.2.105 -> v0.2.114
      Adding wasm-encoder v0.244.0
      Adding wasm-metadata v0.244.0
      Adding wasmparser v0.244.0
    Updating web_atoms v0.2.0 -> v0.2.3
    Removing windows-sys v0.60.2
    Removing windows-targets v0.53.5
    Removing windows_aarch64_gnullvm v0.53.1
    Removing windows_aarch64_msvc v0.53.1
    Removing windows_i686_gnu v0.53.1
    Removing windows_i686_gnullvm v0.53.1
    Removing windows_i686_msvc v0.53.1
    Removing windows_x86_64_gnu v0.53.1
    Removing windows_x86_64_gnullvm v0.53.1
    Removing windows_x86_64_msvc v0.53.1
    Updating winnow v0.7.13 -> v0.7.15
    Updating wit-bindgen v0.46.0 -> v0.51.0
      Adding wit-bindgen-core v0.51.0
      Adding wit-bindgen-rust v0.51.0
      Adding wit-bindgen-rust-macro v0.51.0
      Adding wit-component v0.244.0
      Adding wit-parser v0.244.0
      Adding zmij v1.0.21
2026-03-15 00:34:28 +00:00
bors 35f1109ece Auto merge of #153866 - tgross35:update-builtins, r=tgross35
compiler-builtins subtree update

Subtree update of `compiler-builtins` to https://github.com/rust-lang/compiler-builtins/commit/8173070e590c04a0d36ee9f3e0397c6006596976.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-14 16:56:25 +00:00
Trevor Gross 7a698be605 min,max: Add tests for signaling NaNs and update documentation
We do handle signaling NaNs properly, with the exception of raising
exceptions as IEEE 754 requires. Add tests to this effect for
`fmin`, `fminimum`, `fminimum_num`, and the max variants.
2026-03-14 07:26:20 -05:00
Trevor Gross 3a352497c3 support: Print sNaN or qNaN for hex floats
Give more descriptive output in tests since we sometimes need to treat
these differently. We still don't parse `sNaN`/`qNaN` for now, though we
could in the future.
2026-03-14 07:26:20 -05:00
Trevor Gross ccd1042884 support: Add different NaN types to the Float trait
Make `Float::NAN` a qNaN, add sNaNs, and add operations to check whether
a NaN is quiet or signaling.

The MIPS values are checked against https://gcc.godbolt.org/z/1bhsd5ana.
2026-03-14 07:26:20 -05:00
Trevor Gross 67633abc17 support: Add Hexi for printing integers in hex
Add a wrapper similar to `Hexf` to print integers with proper padding.
2026-03-14 07:26:20 -05:00
Stuart Cook 4b35702611 Rollup merge of #153774 - sardok:fix_sgx_std_doctest_build, r=WaffleLapkin
Fix std doctest build for SGX target.

This PR fixes standard library doctest build for `x86_64-fortanix-unknown-sgx` target.
2026-03-14 17:30:24 +11:00
Matthias Krüger 42c7f52939 Rollup merge of #153569 - abh1nav10:fix-pin-docs, r=joboet
Fix grammar in Pin documentation

Changed "has an address-sensitive" to "has address-sensitive states" in the `Drop` implementation section of the documentation of `Pin` thereby making it grammatically complete.
2026-03-13 19:50:13 +01:00
Matthias Krüger 12d320f884 Rollup merge of #153418 - softmoth:patch-1, r=joboet
core: remove FIXME comment in option.rs FromIterator

The referenced issue rust-lang/rust#11084 was closed in 2021, and the related PR rust-lang/rust#59605 was not merged due to inconclusive results. Similar code (in result.rs, for example) doesn't have this FIXME comment; this is the only reference to issue 11084 (or pull request 59605).

This FIXME was not mentioned in issue rust-lang/rust#44366.
2026-03-13 19:50:13 +01:00
Jonathan Brouwer 935805e80a Rollup merge of #153384 - safer-rust:main, r=oli-obk
Add missing safety doc for CString::from_vec_unchecked and async_drop_in_place

Add missing safety documentation for two unsafe APIs:

* `CString::from_vec_unchecked` – # Safety: the caller must ensure `v` contains no NUL bytes in its contents.
* `async_drop_in_place` – # Safety: see [`ptr::drop_in_place`] for safety requirements.
2026-03-13 13:27:49 +01:00
aisr 3771c65b53 add safety doc for CString::from_vec_unchecked and async_drop_in_place 2026-03-13 20:08:37 +08:00
Abhinav 49163144b1 Fix grammar in Pin documentation 2026-03-13 10:40:59 +05:30
Tim Siegel ea674ecb09 core: lift FIXME comment from option.rs to iter::try_process
This FIXME is relevant not only to Option but other similar cases that
use iter::try_process(). The referenced issue 11084 was closed in 2021,
and the related PR 59605 was not merged due to inconclusive results.
2026-03-13 01:00:48 -04:00
Stuart Cook c5faf3a23a Rollup merge of #152258 - asder8215:vecdeque_splice_151758, r=joboet
fixed VecDeque::splice() not filling the buffer correctly when resizing the buffer on start = end range

This PR fixes rust-lang/rust#151758. The issue came from `Splice::move_tail`, which as joboet pointed out:
> The issue is in move_tail, which resizes the buffer, but fails to account for the resulting hole.

The problem with reserving more space through `VecDeque`'s `buf.reserve()` is that it doesn't update `VecDeque`'s `head`, which means that this code in `move_tail`:
```rust
deque.wrap_copy(
    deque.to_physical_idx(tail_start),
    deque.to_physical_idx(new_tail_start),
    self.tail_len,
);
```
could move over the section of data that `tail_start..tail_start + self.tail_len` of the buffer is supposed to be held at to the incorrect destination since all `.to_physical_idx()` is doing is a wrapping add on the `VecDeque`'s head with the passed in `idx` value.

To avoid this I decided to use `VecDeque::reserve` to both allocate more space into the `VecDeque` if necessary and update head appropriately. However, `VecDeque::reserve` internally relies on the `VecDeque`'s `len` field. Earlier in `VecDeque::splice`, it modifies the `VecDeque`'s `len` constructing the drain via `Drain::new` (as it does a `mem::replace` on `deque.len` with the start bound of the passed in `range`). The `VecDeque`'s `len` can also be potentially modified in the earlier `Splice::fill()` call if it does any replacement towards elements within the passed in `range` value for `VecDeque::splice()`. I needed to temporarily restore the `VecDeque`'s `len` to its actual len, so that `VecDeque::reserve` can work properly. Afterward, you can bring back the `VecDeque`'s `len` to what its value was before and fill the gap appropriately with the rest of the `replace_with` content.

r? @joboet
2026-03-13 14:14:11 +11:00
Sinan Nalkaya 8459d6bf3a Fix std doctest build for SGX target. 2026-03-12 15:49:13 +01:00
Jonathan Brouwer ad0e037d39 Rollup merge of #153722 - RalfJung:miri-test-benches, r=Kobzol
miri-test-libstd: use --tests and update some comments

rust-lang/rust#153143 added `./x test --tests` matching `cargo --tests`, which is exactly what Miri wants when testing the standard library. So let's use it for that. We can then also remove a hack in `library/alloctests/benches/vec_deque_append.rs`.

Also update the comment for why the other benchmarks still need to be disabled in Miri, and remove some `cfg_attr` that seem unnecessary since the entire crate that contains them is already disabled in Miri. Those were copied over in https://github.com/rust-lang/rust/commit/b8fa843a1a60146b93ca5b1d11bbe23c1b1076f3 -- they used to be needed since benches and tests were in the same crate, but they aren't any more.
2026-03-11 22:05:46 +01:00
Ralf Jung bc4dfa5e33 miri-test-libstd: use --tests and update some comments 2026-03-11 15:17:23 +01:00
Jonathan Brouwer 2263a8e19e Rollup merge of #153072 - ferrocene:jyn/libcore-doctest-merge, r=jdonszelmann
Allow merging all libcore/alloc doctests into a single binary

This is only the changes needed to *allow* merging the tests. This doesn't actually turn doctest merging on in bootstrap. I think that might be a useful follow-up, since it makes them much faster to run, but it's not without downsides because it means we'll no longer be testing that doctests have all necessary `feature()` attributes.

The motivation for this change is to run the tests with `-C instrument-coverage` and then generate a coverage report from the output. Currently, this is very expensive because it requires parsing DWARF for each doctest binary. Merging the binaries decreases the time taken from several hours to ~30 seconds.

---

There are several parts to this change, most of which are independent and I'm happy to split out into other PRs.

- Upgrade process spawning logging from debug->info so it's easier to see, including in a rustdoc built without debug symbols.
- Core doctests now support being run with `-C panic=abort`. Ferrocene needs this downstream for complicated reasons; it's a one-line change so I figured it's not a big deal.
- Downgrade errors about duplicate features from a hard error to a warning. The meaning is clear here, and doctest merging often creates duplicate features since it lifts them all to the crate root. This involves changes to the compiler but generally I expect this to be low-impact.
  - Enable this new warning, as well as several related feature lints, in rustdoc. By default rustdoc doesn't lint on anything except the lints it manually adds.
- Rustdoc now treats `allow(incomplete_features)` as a crate-level attribute, just like `internal_features`. Without this, it's possible to get hard errors if rustdoc lifts features to the crate level but not `allow`s.
- Core doctests now support being built with `--merge-doctests=yes`. In particular, I removed a few `$crate` usages and explicitly marked a few doctests as `standalone_crate`.
2026-03-11 10:58:50 +01:00
Jonathan Brouwer 4c6755ca61 Rollup merge of #153143 - ferrocene:jh/bootstrap-test-targets, r=Mark-Simulacrum,kobzol
Allow `./x test` to run tests without doc tests and without benchmarks

# Problem

For Ferrocene we would like to run only the `coretests` and `alloctests` test suites when measuring code coverage. Running `corebenches` and `allocbenches` would alter the numbers, which is not compliant with the certification.

This is currently not possible in bootstrap. By default `./x test` runs unit, integration and doc tests. `./x test --doc` only runs doc tests. So far, so good.

The problem is that while `./x test --no-doc` stops bootstrap from executing doc tests, it surprisingly starts executing benchmarks (next to examples and bins as well). It basically behaves like `cargo test --all-targets`.

# Solution

This PR renames the existing `--no-doc` flag to `--all-targets` and keeps the same behaviour as before. Unfortunately it is not possible to internally switch from `cargo --bins --examples --tests --benches` to `cargo --all-targets` because it will fail e.g. `./x test library/alloc --all-targets` with an error like "use of unstable library feature `test`".

Additionally, this PR add a `./x test --tests` flag (equivalent to `cargo test --tests`) that only executes unit and integration tests.

Both changes we are doing in https://github.com/ferrocene/ferrocene anyways, but believe that they may be useful for other people as well and therefore would like to contribute them.

Note that this PR does _not_ change the behaviour of either `./x test` or `./x test --doc`.

## Note on `test = true`

While this change enables bootstrap to run tests without doc tests and without benchmarks, executing `./x test library/core library/alloc --tests` will still build and execute `corebenches` and `allocbenches`.

What?! 😱 Why all of this effort to enable it then?

Good question! The reason they are still executed is, that they are marked with `test = true` in their respective `Cargo.toml` ([corebenches](https://github.com/rust-lang/rust/blob/3f9853562c73af38a5e6af8b0da1b2734a327e19/library/coretests/Cargo.toml#L24), [allocbenches](https://github.com/rust-lang/rust/blob/3f9853562c73af38a5e6af8b0da1b2734a327e19/library/alloctests/Cargo.toml#L32)).

@bjorn3 mentioned that it is important for upstream that those benchmarks are executed by default, even if no `./x --all-targets` is passed. This is perfectly possible with this PR. Benchmarks marked with `test = true` will be executed when calling either of `./x test`, `./x test --tests` or `./x --all-targets`. Therefore this PR does not include a commit to change that. We will just do this change in https://github.com/ferrocene/ferrocene.

## Open questions

### Error message

I added one commit that adds an error message if a user passes `--no-doc` and points them to `--all-targets` and `--tests`. I think it might be nice to have, but if you think it is not necessary, I can remove it.

# How to test this change

You can see the change in action by running `./x test library/alloc --tests` and `./x test library/alloc --all-targets`. The first will execute `alloctests` and `allocbenches` (which is marked with `test = true`), while the second will additionally run `benches/vec_deque_append.rs` (which is _not_ marked with `test = true`).
2026-03-10 22:44:03 +01:00
Urhengulas 2a2cafa722 Reflect removal of --no-doc in documentation
- `./x run generate-completions`
- Search and replace `--no-doc` with `--all-targets`
  This is to keep the behaviour the same.
- Document `./x test --tests` in `rustc-dev-guide`
- Add change info
2026-03-10 12:20:17 +01:00
Jynn Nelson 505d07da28 core and alloc doctests support doctest merging 2026-03-10 11:56:29 +01:00
Jynn Nelson acba81e689 core doctests support panic=abort 2026-03-10 11:56:29 +01:00
bors 0c68443b0a Auto merge of #153642 - matthiaskrgr:rollup-IHw8KqK, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#148562 (In `Option::get_or_insert_with()`, forget the `None` instead of dropping it.)
 - rust-lang/rust#153325 (tests/ui/cfg: add annotations for reference rules)
 - rust-lang/rust#153621 (Remove `TyCtxt::node_span_lint` method)
 - rust-lang/rust#153627 (rustdoc-json: Improve docs for `ItemEnum::item_kind`)
2026-03-10 10:31:56 +00:00
Matthias Krüger ce972294a5 Rollup merge of #148562 - kpreid:get-init-drop, r=oli-obk
In `Option::get_or_insert_with()`, forget the `None` instead of dropping it.

Per https://github.com/rust-lang/rust/pull/148486#issuecomment-3493665688

In `Option::get_or_insert_with()`, after replacing the `None` with `Some`, forget the `None` instead of dropping it.

This allows eliminating the `T: [const] Destruct` bounds, making the functions more flexible in (unstable) const contexts, and avoids generating an implicit `drop_in_place::<Option<T>>()` that will never do anything (and which might even persist after optimization).
2026-03-10 07:21:58 +01:00
bors 3bc6ea5673 Auto merge of #152954 - Kmeakin:km/unicode-data/case-mapping, r=Mark-Simulacrum
Unicode data: reduce size of to_lower/to_upper tables

Reduces the combined size of to_lower and to_upper from 25,364 bytes to 3,110 bytes. Explained in detail in the doc comments
2026-03-10 06:20:10 +00:00
Jonathan Brouwer b8e01edc24 Rollup merge of #153413 - joboet:organize-pal-os, r=Mark-Simulacrum
std: organise `sys::pal::os`

Continuing rust-lang/rust#153341, this moves around some functions in `sys::pal`, so that `pal::os` only contains standard-path-related code (which I'll move later as part of rust-lang/rust#117276).

Best reviewed commit-by-commit.
2026-03-09 11:49:22 +01:00
bors 98e7077b90 Auto merge of #153025 - joboet:bytestr_precision_display, r=Mark-Simulacrum
core: respect precision in `ByteStr` `Display`

Fixes rust-lang/rust#153022.

`ByteStr`'s `Display` implementation didn't respect the precision parameter. Just like `Formatter::pad`, this is fixed by counting off the characters in the string and truncating after the requested length – with the added complication that the `ByteStr` needs to be divided into chunks first. By including a fast path that avoids counting the characters when no parameters were specified this should also fix the performance regressions caused by rust-lang/rust#152865.
2026-03-09 04:13:35 +00:00
Karl Meakin 902199b5b1 Compress case-mapping tables 2026-03-08 22:39:35 +00:00
Karl Meakin 95365cc5bf Make unicode_data tests normal
Instead of generating a standalone executable to test `unicode_data`,
generate normal tests in `coretests`. This ensures tests are always
generated, and will be run as part of the normal testsuite.

Also change the generated tests to loop over lookup tables, rather than
generating a separate `assert_eq!()` statement for every codepoint. The
old approach produced a massive (20,000 lines plus) file which took
minutes to compile!
2026-03-08 22:38:31 +00:00
Jonathan Brouwer 83e6dbf9e1 Rollup merge of #151900 - tgross35:num-internal-imp, r=Mark-Simulacrum
num: Separate public API from internal implementations

Currently we have a single `core::num` module that contains both thin wrapper API and higher-complexity numeric routines. Restructure this by moving implementation details to a new `imp` module.

This results in a more clean separation of what is actually user-facing compared to items that have a stability attribute because they are public for testing.

The first commit does the actual change then the second moves a portion back.
2026-03-08 22:51:52 +01:00
Jonathan Brouwer e21a5df27e Rollup merge of #152646 - zachs18:unsafeunpin-marker-impls-pointee, r=Mark-Simulacrum
Update `UnsafeUnpin` impls involving extern types.

`UnsafeUnpin` tracking issue: https://github.com/rust-lang/rust/issues/125735

Relaxes from `T: ?Sized` (i.e. `T: MetaSized`) to `T: PointeeSized` for the `UnsafeUnpin` impls for pointers, references, and `PhantomData<T>`, and for the negative `UnsafeUnpin` impl for `UnsafePinned<T>`. (Compare to the impls for `Freeze` on lines 911-921.)

Both `UnsafeUnpin` and `extern type`s (the only way to have a `!MetaSized` type) are unstable, so this should have no effect on stable code.

Also updates the marker_impls macro docs to use PointeeSized bound, as most uses of the macro now do.

Concretely, this change means that the following types will newly implement `UnsafeUnpin`:

* pointers and references to `T` where `T` is an `extern type`
* `PhantomData<T>` where `T` is an extern type
* either of the above where `T` is a `struct` or tuple with `extern type` tail

Additionally, the negative `UnsafeUnpin` impl for `UnsafePinned<T>` is also relaxed to `T: PointeeSized` to align with the analogous negative `Freeze` impl for `UnsafeCell<T>`, even though both structs have `T: ?Sized` in their declaration (which probably should be relaxed, but that is a separate issue), so this part of the change doesn't actually *do* anything currently, but if `UnsafeCell` and `UnsafePinned` are later relaxed to `T: PointeeSized`, then the negative impl will apply to the newly possible instantiations. Also cc https://github.com/rust-lang/rust/issues/152645 that these impls compile at all.
2026-03-08 22:51:51 +01:00
Jonathan Brouwer 1ef29e7af6 Rollup merge of #152535 - joboet:xous_env_once_lock, r=Mark-Simulacrum
std: use `OnceLock` for Xous environment variables

There's no need for exposed-provenance-shenanigans here...

CC @xobs
2026-03-08 22:51:51 +01:00
Stuart Cook a508c476ac Rollup merge of #153437 - RalfJung:miri-libtest-unstable, r=cuviper
coretest in miri: fix using unstable libtest features

Alternative (IMO preferable) to https://github.com/rust-lang/rust/pull/153369. Also reverts that PR.
2026-03-08 14:01:35 +11:00
Josh Stone eb093cfd5d Reformat with the new stage0 2026-03-07 10:42:02 -08:00
Josh Stone 78157ddde9 Replace version placeholders with 1.95.0
(cherry picked from commit bad24ccbec)
2026-03-07 10:42:01 -08:00
Jonathan Brouwer 6b42067e18 Rollup merge of #153485 - RalfJung:float-macros-const, r=tgross35
libcore float tests: replace macro shadowing by const-compatible macro

This lets us avoid https://github.com/rust-lang/rust/issues/153478.
However this means we generate 3 function items per assertion -- or rather, 3*8, since every assertion gets duplicated 8 times (4 float types, each in a const and a non-const variant). That's a lot; is it enough to be concerned about?
coretest already takes forever to build. In a quick test, build time increased from 29.8s to 30.8s, but that may also entirely be noise.

r? @tgross35
2026-03-06 18:49:48 +01:00
Jonathan Brouwer 4e50a44530 Rollup merge of #153174 - Trivo25:fix-wasm64-sync-cfg, r=joboet
std: add wasm64 to sync::Once and thread_parking atomics cfg guards

When targeting `wasm64-unknown-unknown` with atomics enabled, `std::sync::Once` and `thread_parking` fall through to the `no_threads`/`unsupported` implementations because the cfg guards only check for `wasm32`. This causes worker threads to panic with `unreachable` at runtime. The underlying futex implementations already handle both wasm32 and wasm64 correctly, only the cfg guards were missing wasm64.

I tested this manually with a multithreaded wasm64 application ([o1js](https://github.com/o1-labs/o1js/)) compiled with `-Z build-std=panic_abort,std` and `-C target-feature=+atomics,+bulk-memory,+mutable-globals`

Related: rust-lang/rust#83879 rust-lang/rust#77839

Happy to adjust anything based on feedback
2026-03-06 18:49:47 +01:00
Trevor Gross aeab5b5cab c-b: Export fminimum_num, fmaximum_num and variants
Since we are starting to use the `fmaximum_num` intrinsics, LLVM may
emit these.
2026-03-06 07:59:19 -05:00
Ralf Jung 0fd3ac4c97 libcore float tests: replace macro shadowing by const-compatible macro 2026-03-06 12:07:25 +01:00
Florian 6a950e74b7 add wasm64 to sync::Once and thread_parking atomics cfg guard
Update library/std/src/sys/sync/once/mod.rs

Update library/std/src/sys/sync/thread_parking/mod.rs

Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2026-03-06 13:15:05 +03:00
Daniel Scherzer c1d0e35db0 c-b: fix path to CONTRIBUTING.md in README.md 2026-03-06 09:47:22 +00:00
Trevor Gross 6c28ca9101 meta: Allow or fix unused_features
These warnings are showing up on the most recent nightly:

    error: feature `f128` is declared but not used
     --> builtins-test/tests/addsub.rs:3:35
      |
    3 | #![cfg_attr(f128_enabled, feature(f128))]
      |                                   ^^^^

It isn't always easy to be more exact with the features we enable, so
mostly ignore this.
2026-03-06 04:18:12 -05:00
Trevor Gross 44ee391300 meta: Allow a clippy lint that appears in recent versions
We are now getting this warning:

    warning: the variable `j` is used as a loop counter
       --> libm/src/math/rem_pio2_large.rs:268:5
        |
    268 |     for i in 0..=m {
        |     ^^^^^^^^^^^^^^ help: consider using: `for (j, i) in ((jv as i32) - (jx as i32)..).zip((0..=m))`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop
        = note: `#[warn(clippy::explicit_counter_loop)]` on by default

    warning: `libm` (lib) generated 1 warning

Where the suggestion is definitely not an improvement.
2026-03-05 19:57:57 -05:00
Trevor Gross 2891905c7d meta: Commit changes applied by recent versions of rustfmt 2026-03-05 19:57:57 -05:00
Ralf Jung 4d314065a4 Revert "library/test: always enable unstable features for miri"
This reverts commit 30d7ed4c47.
It should not be needed any more.
2026-03-05 22:00:14 +01:00
joboet 6f980d4cbf std: use OnceLock for Xous environment variables 2026-03-05 19:59:15 +01:00
Jonathan Brouwer 082d0cacd7 Rollup merge of #153399 - bend-n:constify-into-raw-parts, r=Amanieu
constify `Vec::{into, from}_raw_parts{_in|_alloc}`

due to Vec::drop not being const this is kinda necessary to make use of `const_heap`.
2026-03-05 19:41:57 +01:00
bors 64b72a1fa5 Auto merge of #150447 - WaffleLapkin:maybe-dangling-semantics, r=RalfJung
Implement `MaybeDangling` compiler support



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



cc @RalfJung
2026-03-05 12:21:27 +00:00
Waffle Lapkin 8aafa53504 add semantics to MaybeDangling 2026-03-05 11:53:38 +01:00
bendn 1f1a0bcbb0 constify Vec::{into, from}_raw_parts{_in|_alloc} 2026-03-05 16:01:40 +07:00