Commit graph

18707 commits

Author SHA1 Message Date
Takayuki Maeda
5df0c684f4
Rollup merge of #139215 - clubby789:std-size-tweaks, r=joboet
Add `opt-level = "s"` for more std symbolication crates

This reduces the size of a hello world binary built by stage 1 in release by a few kilobytes
2025-04-02 22:52:46 +09:00
bors
79de6c0bbe Auto merge of #138848 - clubby789:cargo-update, r=Mark-Simulacrum
Update dependencies

#136077 needs manual tweaking
```
    compiler and tools dependencies
        Updating anyhow v1.0.95 -> v1.0.97
        Updating basic-toml v0.1.9 -> v0.1.10
        Updating bitflags v2.8.0 -> v2.9.0
        Updating blake3 v1.5.5 -> v1.8.0
        Updating bumpalo v3.16.0 -> v3.17.0
        Removing byteorder v1.5.0
        Updating bytes v1.9.0 -> v1.10.1
        Updating cargo_metadata v0.19.1 -> v0.19.2
        Updating chrono v0.4.39 -> v0.4.40
        Updating chrono-tz v0.10.1 -> v0.10.3
        Updating chrono-tz-build v0.4.0 -> v0.4.1
        Updating clap v4.5.26 -> v4.5.35
        Updating clap_builder v4.5.26 -> v4.5.35
        Updating clap_derive v4.5.24 -> v4.5.35
        Updating console v0.15.10 -> v0.15.11
        Updating cpufeatures v0.2.16 -> v0.2.17
        Updating curl-sys v0.4.78+curl-8.11.0 -> v0.4.80+curl-8.12.1
        Updating darling v0.20.10 -> v0.20.11
        Updating darling_core v0.20.10 -> v0.20.11
        Updating darling_macro v0.20.10 -> v0.20.11
        Updating deranged v0.3.11 -> v0.4.1
        Updating dissimilar v1.0.9 -> v1.0.10
        Updating either v1.13.0 -> v1.15.0
        Updating elsa v1.11.0 -> v1.11.2
        Updating env_logger v0.11.6 -> v0.11.7
        Updating equivalent v1.0.1 -> v1.0.2
        Updating flate2 v1.0.35 -> v1.1.0
        Updating foldhash v0.1.4 -> v0.1.5
        Updating getrandom v0.3.1 -> v0.3.2
        Updating globset v0.4.15 -> v0.4.16
     Downgrading html5ever v0.29.2 -> v0.29.1 (available: v0.30.0)
        Updating humantime v2.1.0 -> v2.2.0
        Updating icu_list_data v1.5.0 -> v1.5.1
        Updating icu_locid_transform_data v1.5.0 -> v1.5.1
        Updating icu_normalizer_data v1.5.0 -> v1.5.1
        Updating icu_properties_data v1.5.0 -> v1.5.1
        Updating indexmap v2.7.0 -> v2.8.0
        Updating indicatif v0.17.9 -> v0.17.11
        Updating inout v0.1.3 -> v0.1.4
        Updating itoa v1.0.14 -> v1.0.15
          Adding jiff v0.2.5
          Adding jiff-static v0.2.5
        Updating jobserver v0.1.32 -> v0.1.33
        Updating lexopt v0.3.0 -> v0.3.1
          Adding leb128fmt v0.1.0
        Updating libc v0.2.169 -> v0.2.171
        Updating libz-sys v1.1.21 -> v1.1.22
        Updating linux-raw-sys v0.4.15 -> v0.9.3
        Updating litemap v0.7.4 -> v0.7.5
        Updating log v0.4.25 -> v0.4.27
     Downgrading markup5ever v0.15.0 -> v0.14.1
        Updating miniz_oxide v0.8.3 -> v0.8.5
        Updating once_cell v1.20.2 -> v1.21.3
        Updating openssl-probe v0.1.5 -> v0.1.6
        Updating openssl-sys v0.9.104 -> v0.9.106
        Updating pest v2.7.15 -> v2.8.0
        Updating pest_derive v2.7.15 -> v2.8.0
        Updating pest_generator v2.7.15 -> v2.8.0
        Updating pest_meta v2.7.15 -> v2.8.0
        Updating pkg-config v0.3.31 -> v0.3.32
        Updating portable-atomic v1.10.0 -> v1.11.0
          Adding portable-atomic-util v0.2.4
        Updating ppv-lite86 v0.2.20 -> v0.2.21
        Updating proc-macro2 v1.0.93 -> v1.0.94
        Updating quote v1.0.38 -> v1.0.40
          Adding r-efi v5.2.0
        Updating rand_core v0.9.0 -> v0.9.3
        Updating redox_syscall v0.5.8 -> v0.5.10
        Updating rustc-stable-hash v0.1.1 -> v0.1.2
        Updating rustc_tools_util v0.4.0 -> v0.4.2
        Updating rustix v0.38.43 -> v1.0.5
        Updating rustversion v1.0.19 -> v1.0.20
        Updating ryu v1.0.18 -> v1.0.20
        Updating semver v1.0.24 -> v1.0.26
        Updating serde v1.0.217 -> v1.0.219
        Updating serde_derive v1.0.217 -> v1.0.219
        Updating serde_json v1.0.135 -> v1.0.140
        Updating similar v2.6.0 -> v2.7.0
        Updating smallvec v1.13.2 -> v1.14.0
        Updating socket2 v0.5.8 -> v0.5.9
        Updating stacker v0.1.18 -> v0.1.20
        Updating string_cache v0.8.8 -> v0.8.9
        Updating syn v2.0.96 -> v2.0.100
        Updating tar v0.4.43 -> v0.4.44
        Updating tempfile v3.15.0 -> v3.19.1
        Updating thin-vec v0.2.13 -> v0.2.14
        Updating thiserror v2.0.11 -> v2.0.12
        Updating thiserror-impl v2.0.11 -> v2.0.12
        Updating time v0.3.37 -> v0.3.41
        Updating time-core v0.1.2 -> v0.1.4
        Updating time-macros v0.2.19 -> v0.2.22
        Updating tinyvec v1.8.1 -> v1.9.0
        Updating tokio v1.43.0 -> v1.44.1
        Updating typenum v1.17.0 -> v1.18.0
        Updating unicode-ident v1.0.14 -> v1.0.18
        Updating uuid v1.12.0 -> v1.16.0
        Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
        Removing wasm-encoder v0.219.1
        Removing wasm-encoder v0.223.0
          Adding wasm-encoder v0.219.2 (available: v0.227.1)
          Adding wasm-encoder v0.223.1
          Adding wasm-encoder v0.228.0
        Updating wasm-metadata v0.223.0 -> v0.223.1
        Removing wasmparser v0.219.1
        Removing wasmparser v0.222.0
        Removing wasmparser v0.223.0
          Adding wasmparser v0.219.2 (available: v0.227.1)
          Adding wasmparser v0.222.1
          Adding wasmparser v0.223.1
          Adding wasmparser v0.228.0
        Updating wast v223.0.0 -> v228.0.0
        Updating wat v1.223.0 -> v1.228.0
        Updating windows-core v0.52.0 -> v0.61.0
          Adding windows-implement v0.60.0
        Updating windows-interface v0.59.0 -> v0.59.1
          Adding windows-link v0.1.1
        Updating windows-result v0.3.0 -> v0.3.2
        Updating windows-strings v0.3.0 -> v0.3.1
          Adding windows-strings v0.4.0
        Updating wit-bindgen-rt v0.33.0 -> v0.39.0
        Updating wit-component v0.223.0 -> v0.223.1
        Updating wit-parser v0.223.0 -> v0.223.1
        Updating xattr v1.4.0 -> v1.5.0
        Updating zerocopy v0.8.14 -> v0.8.24
        Updating zerocopy-derive v0.8.14 -> v0.8.24
        Updating zerofrom v0.1.5 -> v0.1.6
        Updating zerofrom-derive v0.1.5 -> v0.1.6
```
2025-04-02 06:58:57 +00:00
clubby789
4c92418610 Add opt-level = "s" for more std symbolication crates 2025-04-01 20:50:19 +00:00
clubby789
23667ada6d compiler and tools dependencies
Updating anyhow v1.0.95 -> v1.0.97
    Updating basic-toml v0.1.9 -> v0.1.10
    Updating bitflags v2.8.0 -> v2.9.0
    Updating blake3 v1.5.5 -> v1.8.0
    Updating bumpalo v3.16.0 -> v3.17.0
    Removing byteorder v1.5.0
    Updating bytes v1.9.0 -> v1.10.1
    Updating cargo_metadata v0.19.1 -> v0.19.2
    Updating chrono v0.4.39 -> v0.4.40
    Updating chrono-tz v0.10.1 -> v0.10.3
    Updating chrono-tz-build v0.4.0 -> v0.4.1
    Updating clap v4.5.26 -> v4.5.35
    Updating clap_builder v4.5.26 -> v4.5.35
    Updating clap_derive v4.5.24 -> v4.5.32
    Updating console v0.15.10 -> v0.15.11
    Updating cpufeatures v0.2.16 -> v0.2.17
    Updating curl-sys v0.4.78+curl-8.11.0 -> v0.4.80+curl-8.12.1
    Updating darling v0.20.10 -> v0.20.11
    Updating darling_core v0.20.10 -> v0.20.11
    Updating darling_macro v0.20.10 -> v0.20.11
    Updating deranged v0.3.11 -> v0.4.0
    Updating dissimilar v1.0.9 -> v1.0.10
    Updating either v1.13.0 -> v1.15.0
    Updating elsa v1.11.0 -> v1.11.2
    Updating env_logger v0.11.6 -> v0.11.7
    Updating equivalent v1.0.1 -> v1.0.2
    Updating flate2 v1.0.35 -> v1.1.0
    Updating foldhash v0.1.4 -> v0.1.5
    Updating getrandom v0.3.1 -> v0.3.2
    Updating globset v0.4.15 -> v0.4.16
 Downgrading html5ever v0.29.2 -> v0.29.1 (available: v0.30.0)
    Updating humantime v2.1.0 -> v2.2.0
    Updating iana-time-zone v0.1.61 -> v0.1.63
    Updating icu_list_data v1.5.0 -> v1.5.1
    Updating icu_locid_transform_data v1.5.0 -> v1.5.1
    Updating icu_normalizer_data v1.5.0 -> v1.5.1
    Updating icu_properties_data v1.5.0 -> v1.5.1
    Updating indexmap v2.7.0 -> v2.8.0
    Updating indicatif v0.17.9 -> v0.17.11
    Updating inout v0.1.3 -> v0.1.4
    Updating itoa v1.0.14 -> v1.0.15
      Adding jiff v0.2.5
      Adding jiff-static v0.2.5
    Updating jobserver v0.1.32 -> v0.1.33
      Adding leb128fmt v0.1.0
    Updating lexopt v0.3.0 -> v0.3.1
    Updating libc v0.2.169 -> v0.2.171
    Updating libz-sys v1.1.21 -> v1.1.22
    Updating linux-raw-sys v0.4.15 -> v0.9.3
    Updating litemap v0.7.4 -> v0.7.5
    Updating log v0.4.25 -> v0.4.27
 Downgrading markup5ever v0.15.0 -> v0.14.1
    Updating miniz_oxide v0.8.3 -> v0.8.5
    Updating once_cell v1.20.2 -> v1.21.3
    Updating openssl-probe v0.1.5 -> v0.1.6
    Updating openssl-sys v0.9.104 -> v0.9.106
    Updating pest v2.7.15 -> v2.8.0
    Updating pest_derive v2.7.15 -> v2.8.0
    Updating pest_generator v2.7.15 -> v2.8.0
    Updating pest_meta v2.7.15 -> v2.8.0
    Updating pkg-config v0.3.31 -> v0.3.32
    Updating portable-atomic v1.10.0 -> v1.11.0
      Adding portable-atomic-util v0.2.4
    Updating ppv-lite86 v0.2.20 -> v0.2.21
    Updating proc-macro2 v1.0.93 -> v1.0.94
    Updating quote v1.0.38 -> v1.0.40
      Adding r-efi v5.2.0
    Updating rand_core v0.9.0 -> v0.9.3
    Updating redox_syscall v0.5.8 -> v0.5.10
    Updating rustc-stable-hash v0.1.1 -> v0.1.2
    Updating rustc_tools_util v0.4.0 -> v0.4.2
    Updating rustix v0.38.43 -> v1.0.5
    Updating rustversion v1.0.19 -> v1.0.20
    Updating ryu v1.0.18 -> v1.0.20
    Updating semver v1.0.24 -> v1.0.26
    Updating serde v1.0.217 -> v1.0.219
    Updating serde_derive v1.0.217 -> v1.0.219
    Updating serde_json v1.0.135 -> v1.0.140
    Updating similar v2.6.0 -> v2.7.0
    Updating smallvec v1.13.2 -> v1.14.0
    Updating socket2 v0.5.8 -> v0.5.9
    Updating stacker v0.1.18 -> v0.1.20
    Updating string_cache v0.8.8 -> v0.8.9
    Updating syn v2.0.96 -> v2.0.100
    Updating tar v0.4.43 -> v0.4.44
    Updating tempfile v3.15.0 -> v3.19.1
    Updating thin-vec v0.2.13 -> v0.2.14
    Updating thiserror v2.0.11 -> v2.0.12
    Updating thiserror-impl v2.0.11 -> v2.0.12
    Updating time v0.3.37 -> v0.3.41
    Updating time-core v0.1.2 -> v0.1.4
    Updating time-macros v0.2.19 -> v0.2.22
    Updating tinyvec v1.8.1 -> v1.9.0
    Updating tokio v1.43.0 -> v1.44.1
    Updating typenum v1.17.0 -> v1.18.0
    Updating unicode-ident v1.0.14 -> v1.0.18
    Updating uuid v1.12.0 -> v1.16.0
    Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
    Removing wasm-encoder v0.219.1
    Removing wasm-encoder v0.223.0
      Adding wasm-encoder v0.219.2 (available: v0.228.0)
      Adding wasm-encoder v0.223.1
      Adding wasm-encoder v0.228.0
    Updating wasm-metadata v0.223.0 -> v0.223.1
    Removing wasmparser v0.219.1
    Removing wasmparser v0.222.0
    Removing wasmparser v0.223.0
      Adding wasmparser v0.219.2 (available: v0.228.0)
      Adding wasmparser v0.222.1
      Adding wasmparser v0.223.1
      Adding wasmparser v0.228.0
    Updating wast v223.0.0 -> v228.0.0
    Updating wat v1.223.0 -> v1.228.0
    Updating windows-core v0.52.0 -> v0.61.0
      Adding windows-implement v0.60.0
    Updating windows-interface v0.59.0 -> v0.59.1
      Adding windows-link v0.1.1
    Updating windows-result v0.3.0 -> v0.3.2
    Removing windows-strings v0.3.0
      Adding windows-strings v0.3.1
      Adding windows-strings v0.4.0
    Updating wit-bindgen-rt v0.33.0 -> v0.39.0
    Updating wit-component v0.223.0 -> v0.223.1
    Updating wit-parser v0.223.0 -> v0.223.1
    Updating xattr v1.4.0 -> v1.5.0
    Removing zerocopy v0.7.35
    Removing zerocopy v0.8.14
      Adding zerocopy v0.8.24
    Removing zerocopy-derive v0.7.35
    Removing zerocopy-derive v0.8.14
      Adding zerocopy-derive v0.8.24
    Updating zerofrom v0.1.5 -> v0.1.6
    Updating zerofrom-derive v0.1.5 -> v0.1.6

library dependencies
    Updating dlmalloc v0.2.7 -> v0.2.8
    Updating miniz_oxide v0.8.3 -> v0.8.5
    Updating proc-macro2 v1.0.93 -> v1.0.94
    Updating quote v1.0.38 -> v1.0.40
    Updating rand_core v0.9.0 -> v0.9.3
    Updating syn v2.0.98 -> v2.0.100
    Updating unicode-ident v1.0.16 -> v1.0.18
    Updating zerocopy v0.8.17 -> v0.8.24
    Updating zerocopy-derive v0.8.17 -> v0.8.24

rustbook dependencies
    Updating anyhow v1.0.95 -> v1.0.97
    Updating bitflags v2.8.0 -> v2.9.0
    Removing byteorder v1.5.0
    Updating cc v1.2.10 -> v1.2.17
    Updating chrono v0.4.39 -> v0.4.40
    Updating clap v4.5.27 -> v4.5.32
    Updating clap_builder v4.5.27 -> v4.5.32
    Updating clap_complete v4.5.43 -> v4.5.47
    Updating clap_derive v4.5.24 -> v4.5.32
    Updating env_logger v0.11.6 -> v0.11.7
    Updating equivalent v1.0.1 -> v1.0.2
    Updating flate2 v1.0.35 -> v1.1.0
    Updating getrandom v0.2.15 -> v0.3.2
    Updating handlebars v6.3.0 -> v6.3.2
    Removing humantime v2.1.0
    Updating indexmap v2.7.1 -> v2.8.0
    Updating itoa v1.0.14 -> v1.0.15
      Adding jiff v0.2.5
      Adding jiff-static v0.2.5
    Updating libc v0.2.169 -> v0.2.171
    Updating linux-raw-sys v0.4.15 -> v0.9.3
    Updating litemap v0.7.4 -> v0.7.5
    Updating log v0.4.25 -> v0.4.26
    Updating mdbook-i18n-helpers v0.3.5 -> v0.3.6
    Updating miniz_oxide v0.8.3 -> v0.8.5
    Updating once_cell v1.20.2 -> v1.21.1
    Removing phf_generator v0.10.0
    Removing phf_shared v0.10.0
    Updating pkg-config v0.3.31 -> v0.3.32
      Adding portable-atomic v1.11.0
      Adding portable-atomic-util v0.2.4
    Removing ppv-lite86 v0.2.20
    Updating proc-macro2 v1.0.93 -> v1.0.94
    Removing pulldown-cmark v0.11.3
    Updating pulldown-cmark-to-cmark v15.0.1 -> v20.0.1
    Updating quote v1.0.38 -> v1.0.40
      Adding r-efi v5.2.0
    Removing rand_chacha v0.3.1
    Updating redox_syscall v0.5.8 -> v0.5.10
    Updating rustix v0.38.44 -> v1.0.3
    Updating rustversion v1.0.19 -> v1.0.20
    Updating ryu v1.0.19 -> v1.0.20
    Updating semver v1.0.25 -> v1.0.26
    Updating serde v1.0.217 -> v1.0.219
    Updating serde_derive v1.0.217 -> v1.0.219
    Updating serde_json v1.0.138 -> v1.0.140
    Removing siphasher v0.3.11
    Updating smallvec v1.13.2 -> v1.14.0
    Updating string_cache v0.8.7 -> v0.8.8
    Updating string_cache_codegen v0.5.2 -> v0.5.4
    Updating syn v2.0.96 -> v2.0.100
    Updating tempfile v3.15.0 -> v3.19.1
    Updating terminal_size v0.4.1 -> v0.4.2
    Updating textwrap v0.16.1 -> v0.16.2
    Updating thiserror v2.0.11 -> v2.0.12
    Updating thiserror-impl v2.0.11 -> v2.0.12
    Updating toml v0.8.19 -> v0.8.20
    Updating toml_edit v0.22.22 -> v0.22.24
    Updating typenum v1.17.0 -> v1.18.0
    Updating unicode-ident v1.0.16 -> v1.0.18
    Updating wasi v0.11.0+wasi-snapshot-preview1 -> v0.14.2+wasi-0.2.4
      Adding windows-link v0.1.1
    Updating winnow v0.6.25 -> v0.7.4
      Adding wit-bindgen-rt v0.39.0
    Removing zerocopy v0.7.35
    Removing zerocopy-derive v0.7.35
    Updating zerofrom v0.1.5 -> v0.1.6
    Updating zerofrom-derive v0.1.5 -> v0.1.6
2025-04-01 20:48:17 +00:00
bors
e2014e876e Auto merge of #138928 - ChrisDenton:fix-uwp, r=tgross35
Fix UWP reparse point check

Fixes #138921
2025-04-01 18:22:03 +00:00
bors
0b4a81a4ef Auto merge of #138492 - lcnr:rm-inline_const_pat, r=oli-obk
remove `feature(inline_const_pat)`

Summarizing https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/remove.20feature.28inline_const_pat.29.20and.20shared.20borrowck.

With https://github.com/rust-lang/types-team/issues/129 we will start to borrowck items together with their typeck parent. This is necessary to correctly support opaque types, blocking the new solver and TAIT/ATPIT stabilization with the old one. This means that we cannot really support `inline_const_pat` as they are implemented right now:

- we want to typeck inline consts together with their parent body to allow inference to flow both ways and to allow the const to refer to local regions of its parent.This means we also need to borrowck the inline const together with its parent as that's necessary to properly support opaque types
- we want the inline const pattern to participate in exhaustiveness checking
- to participate in exhaustiveness checking we need to evaluate it, which requires borrowck, which now relies on borrowck of the typeck root, which ends up checking exhaustiveness again. **This is a query cycle**.

There are 4 possible ways to handle this:
- stop typechecking inline const patterns together with their parent
  - causes inline const patterns to be different than inline const exprs
  - prevents bidirectional inference, we need to either fail to compile `if let const { 1 } = 1u32` or `if let const { 1u32 } = 1`
  - region inference for inline consts will be harder, it feels non-trivial to support inline consts referencing local regions from the parent fn
- inline consts no longer participate in exhaustiveness checking. Treat them like `pat if pat == const { .. }`  instead. We then only evaluate them after borrowck
  - difference between `const { 1 }`  and `const FOO: usize = 1; match x { FOO => () }`. This is confusing
  - do they carry their weight if they are now just equivalent to using an if-guard
- delay exhaustiveness checking until after borrowck
  - should be possible in theory, but is a quite involved change and may have some unexpected challenges
- remove this feature for now

I believe we should either delay exhaustiveness checking or remove the feature entirely. As moving exhaustiveness checking to after borrow checking is quite complex I think the right course of action is to fully remove the feature for now and to add it again once/if we've got that implementation figured out.

`const { .. }`-expressions remain stable. These seem to have been the main motivation for https://github.com/rust-lang/rfcs/issues/2920.

r? types

cc `@rust-lang/types` `@rust-lang/lang` #76001
2025-04-01 14:20:46 +00:00
Matthias Krüger
6cf2d185ea
Rollup merge of #139157 - mejrs:never, r=Noratrieb
Remove mention of `exhaustive_patterns` from `never` docs

The example shows an exhaustive match:
```rust
#![feature(exhaustive_patterns)]
use std::str::FromStr;
let Ok(s) = String::from_str("hello");
```
But https://github.com/rust-lang/rust/issues/119612 moved this functionality to `#![feature(min_exhaustive_patterns)` and then stabilized it.
2025-03-31 14:36:23 +02:00
bors
3c0f72271b Auto merge of #139154 - jhpratt:rollup-rv8f915, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - #139044 (bootstrap: Avoid cloning `change-id` list)
 - #139111 (Properly document FakeReads)
 - #139122 (Remove attribute `#[rustc_error]`)
 - #139132 (Improve hir_pretty for struct expressions.)
 - #139141 (Switch some rustc_on_unimplemented uses to diagnostic::on_unimplemented)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-31 01:10:33 +00:00
mejrs
73d33ed1ba Remove mention of exhaustive_patterns from never docs 2025-03-31 01:26:55 +02:00
Jacob Pratt
a99b5339f4
Rollup merge of #139141 - mejrs:on_unimpl, r=Noratrieb
Switch some rustc_on_unimplemented uses to diagnostic::on_unimplemented

The use on the SliceIndex impl appears unreachable, there is no mention of "vector indices" in any test output and I could not get it to show up in error messages.
2025-03-30 17:59:29 -04:00
bors
2ea33b5910 Auto merge of #139131 - m-ou-se:format-args-struct-expr, r=Mark-Simulacrum
Simplify expansion for format_args!().

Instead of calling `Placeholder::new()`, we can just use a struct expression directly.

Before:

```rust
        Placeholder::new(…, …, …, …)
```

After:

```rust
        Placeholder {
                position: …,
                flags: …,
                width: …,
                precision: …,
        }
```

(I originally avoided the struct expression, because `Placeholder` had a lot of fields. But now that https://github.com/rust-lang/rust/pull/136974 is merged, it only has four fields left.)

This will make the `fmt` argument to `fmt::Arguments::new_v1_formatted()` a candidate for const promotion, which is important if we ever hope to tackle https://github.com/rust-lang/rust/issues/92698 (It doesn't change anything yet though, because the `args` argument to `fmt::Arguments::new_v1_formatted()` is not const-promotable.)
2025-03-30 21:59:02 +00:00
mejrs
41bee761bb use diagnostic::on_unimplemented instead 2025-03-30 15:25:47 +02:00
mejrs
b1bc7255bb Delete unreacheable #[rustc_on_unimplemented] 2025-03-30 15:25:27 +02:00
Mara Bos
cc5ee70b1a Simplify expansion for format_args!().
Instead of calling new(), we can just use a struct expression directly.

Before:

        Placeholder::new(…, …, …, …)

After:

        Placeholder {
                position: …,
                flags: …,
                width: …,
                precision: …,
        }
2025-03-30 10:42:00 +02:00
bors
2196affd01 Auto merge of #139119 - matthiaskrgr:rollup-7l2ri0f, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #137928 (stabilize const_cell)
 - #138431 (Fix `uclibc` LLVM target triples)
 - #138832 (Start using `with_native_path` in `std::sys::fs`)
 - #139081 (std: deduplicate `errno` accesses)
 - #139100 (compiletest: Support matching diagnostics on lines below)
 - #139105 (`BackendRepr::is_signed`: comment why this may panics)
 - #139106 (Mark .pp files as Rust)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-29 23:12:40 +00:00
Matthias Krüger
821e0fe0a2
Rollup merge of #139081 - joboet:errno_dedup, r=Noratrieb
std: deduplicate `errno` accesses

By marking `__errno_location` as `#[ffi_const]` and `std::sys::os::errno` as `#[inline]`, this PR allows merging multiple calls to `io::Error::last_os_error()` into one.
2025-03-29 21:08:12 +01:00
Matthias Krüger
fb6d10e13b
Rollup merge of #138832 - ChrisDenton:with_native_path, r=joboet
Start using `with_native_path` in `std::sys::fs`

Ideally, each platform should use their own native path type internally. This will, for example, allow passing a `CStr` directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated C string.

However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around.

r? joboet
2025-03-29 21:08:12 +01:00
Matthias Krüger
7ef7034caf
Rollup merge of #137928 - RalfJung:const_cell, r=m-ou-se
stabilize const_cell

``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval`` I see no reason to wait any longer, so I propose we stabilize the use of `Cell` in `const fn`  -- specifically the APIs listed here:
```rust
// core::cell

impl<T> Cell<T> {
    pub const fn replace(&self, val: T) -> T;
}

impl<T: Copy> Cell<T> {
    pub const fn get(&self) -> T;
}

impl<T: ?Sized> Cell<T> {
    pub const fn get_mut(&mut self) -> &mut T;
    pub const fn from_mut(t: &mut T) -> &Cell<T>;
}

impl<T> Cell<[T]> {
    pub const fn as_slice_of_cells(&self) -> &[Cell<T>];
}
```
Unfortunately, `set` cannot be made `const fn` yet as it drops the old contents.

Fixes https://github.com/rust-lang/rust/issues/131283
2025-03-29 21:08:10 +01:00
bors
1799887bb2 Auto merge of #133572 - frank-king:feature/unique_arc, r=Amanieu
Implement `alloc::sync::UniqueArc`

This implements the `alloc::sync::UniqueArc` part of #112566.
2025-03-29 20:05:06 +00:00
Chris Denton
89c9c21b06
Start using with_native_path in std::sys::fs 2025-03-29 14:43:41 +00:00
Matthias Krüger
8b7088ab5f
Rollup merge of #139097 - m-ou-se:pin-tests, r=WaffleLapkin
Add more tests for pin!().

This adds the tests suggested by `@danielhenrymantilla` in this comment: https://github.com/rust-lang/rust/pull/138717#discussion_r2005433640 by
2025-03-29 11:43:49 +01:00
Matthias Krüger
111351fcc1
Rollup merge of #138988 - madsmtm:internal-weak-macro-syntax, r=ibraheemdev
Change the syntax of the internal `weak!` macro

Change the syntax to include parameter names and a trailing semicolon.

Motivation:
- Mirror the `syscall!` macro.
- Allow rustfmt to format it (when wrapped in parentheses, and when not inside `cfg_if!`).
- For better documentation (having the parameter names available in the source code is a bit nicer).
- Allow a future improvement to this macro where we can sometimes use the symbol directly when it's statically known to be available (and thus need the parameter names to be available), see https://github.com/rust-lang/rust/pull/136868.

r? libs
2025-03-29 11:43:46 +01:00
Matthias Krüger
c82b88b009
Rollup merge of #138757 - rust-wasi-web:wasi-thread-stack-size, r=alexcrichton
wasm: increase default thread stack size to 1 MB

The default stack size for the [main thread is 1 MB as specified by linker options](38cf49dde8/compiler/rustc_target/src/spec/base/wasm.rs (L14)).
However, the default stack size for threads was only 64 kB.

This is surprisingly small and thus we increase it to 1 MB to match the main thread.
2025-03-29 11:43:46 +01:00
Mara Bos
163ea4acd0 Add more tests for pin!().
Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
2025-03-29 08:10:15 +01:00
Frank King
5004e10ceb Add a test for Weak created from UniqueArc::downgrade 2025-03-29 12:13:38 +08:00
Matthias Krüger
7c0a14f030
Rollup merge of #139069 - a1phyr:better_take, r=joboet
`io::Take`: avoid new `BorrowedBuf` creation in some case

If `self.limit == buf.capacity()`, doing the whole `BorrowedBuf` dance is not necessary.
2025-03-28 21:18:31 +01:00
Matthias Krüger
660e8633f3
Rollup merge of #139058 - barafael:patch-1, r=joboet
Fix formatting nit in process.rs

Minor formatting issue in `process.rs`.
2025-03-28 21:18:29 +01:00
Matthias Krüger
3060c77815
Rollup merge of #139052 - m-ou-se:pin-macro-tests, r=joboet
Put pin!() tests in the right file.

In #138717, these tests were put in `tests/pin.rs`, but they should go in `tests/pin_macro.rs`.

r? `@jdonszelmann`
2025-03-28 21:18:28 +01:00
Matthias Krüger
e82557e9ad
Rollup merge of #138976 - xizheyin:issue-138969, r=RalfJung
Explain one-past-the-end pointer in std library

Closing #138969

r? libs
2025-03-28 21:18:27 +01:00
joboet
dd4f616423
std: deduplicate errno accesses
By marking `__errno_location` as `#[ffi_const]` and `std::sys::os::errno` as `#[inline]`, this PR allows merging multiple calls to `io::Error::last_os_error()` into one.
2025-03-28 19:32:36 +01:00
Benoît du Garreau
9055765ce1 io::Take: avoid new BorrowedBuf creation in some case 2025-03-28 16:36:49 +01:00
xizheyin
074edbd89c std: Explain range follows standard half-open range in offset
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-28 22:28:48 +08:00
Rafael Bachmann
0f418520c6
Fix formatting nit in process.rs 2025-03-28 13:22:09 +01:00
Mara Bos
c41476034d Put pin!() tests in the right file. 2025-03-28 10:18:04 +01:00
Jacob Pratt
5bd0fd6323
Rollup merge of #139021 - joboet:pre-vista-fallback, r=ChrisDenton
std: get rid of pre-Vista fallback code

We haven't had any Windows XP targets for a long while now...

r? ChrisDenton
2025-03-27 21:41:49 -04:00
bors
7586a9f99a Auto merge of #138702 - m-ou-se:spawn-in-atexit, r=Mark-Simulacrum
Allow spawning threads after TLS destruction

Fixes #138696
2025-03-27 21:46:58 +00:00
joboet
3371d498b1
std: get rid of pre-Vista fallback code
We haven't had any Windows XP targets for a long while now...
2025-03-27 15:41:46 +01:00
Christopher Durham
2e5a76cd1e Use cfg_match in core 2025-03-26 14:32:35 -04:00
Mads Marquart
a7bafc0afc Change the syntax of the internal weak! macro
Change the syntax to include parameter names and a trailing semicolon.

Motivation:
- Mirror the `syscall!` macro.
- Allow rustfmt to format it (when wrapped in parentheses).
- For better documentation (having the parameter names available in
  the source code is a bit nicer).
- Allow future improvements to this macro where we can sometimes use the
  symbol directly when it's statically known to be available.
2025-03-26 16:25:05 +01:00
Thalia Archibald
a475f5d181 Fix typo in error message 2025-03-25 23:37:22 -07:00
bors
6e8abb5ec6 Auto merge of #138956 - jhpratt:rollup-6g7ppwd, r=jhpratt
Rollup of 11 pull requests

Successful merges:

 - #138128 (Stabilize `#![feature(precise_capturing_in_traits)]`)
 - #138834 (Group test diffs by stage in post-merge analysis)
 - #138867 (linker: Fix staticlib naming for UEFI)
 - #138874 (Batch mark waiters as unblocked when resuming in the deadlock handler)
 - #138875 (Trusty: Fix build for anonymous pipes and std::sys::process)
 - #138877 (Ignore doctests only in specified targets)
 - #138885 (Fix ui pattern_types test for big-endian platforms)
 - #138905 (Add target maintainer information for powerpc64-unknown-linux-musl)
 - #138911 (Allow defining opaques in statics and consts)
 - #138917 (rustdoc: remove useless `Symbol::is_empty` checks.)
 - #138945 (Override PartialOrd methods for bool)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-26 03:21:26 +00:00
Jacob Pratt
deb987b69d
Rollup merge of #138945 - DaniPopes:override-partialord-bool, r=scottmcm
Override PartialOrd methods for bool

I noticed that `PartialOrd` implementation for `bool` does not override the individual operator methods, unlike the other primitive types like `char` and integers.

This commit extracts these `PartialOrd` overrides shared by the other primitive types into a macro and calls it on `bool` too.

CC `@scottmcm` for our recent adventures in `PartialOrd` land
2025-03-25 20:34:50 -04:00
Jacob Pratt
0d61b83f59
Rollup merge of #138875 - thaliaarchi:trusty-build, r=randomPoison,saethlin
Trusty: Fix build for anonymous pipes and std::sys::process

PRs #136842 (Add libstd support for Trusty targets), #137793 (Stablize anonymous pipe), and #136929 (std: move process implementations to `sys`) merged around the same time, so update Trusty to take them into account.

cc `@randomPoison`
2025-03-25 20:34:47 -04:00
bors
068609ce76 Auto merge of #138601 - RalfJung:wasm-abi-fcw, r=alexcrichton
add FCW to warn about wasm ABI transition

See https://github.com/rust-lang/rust/issues/122532 for context: the "C" ABI on wasm32-unk-unk will change. The goal of this lint is to warn about any function definition and calls whose behavior will be affected by the change. My understanding is the following:
- scalar arguments are fine
  - including 128 bit types, they get passed as two `i64` arguments in both ABIs
- `repr(C)` structs (recursively) wrapping a single scalar argument are fine (unless they have extra padding due to over-alignment attributes)
- all return values are fine

`@bjorn3` `@alexcrichton` `@Manishearth` is that correct?

I am making this a "show up in future compat reports" lint to maximize the chances people become aware of this. OTOH this likely means warnings for most users of Diplomat so maybe we shouldn't do this?

IIUC, wasm-bindgen should be unaffected by this lint as they only pass scalar types as arguments.

Tracking issue: https://github.com/rust-lang/rust/issues/138762
Transition plan blog post: https://github.com/rust-lang/blog.rust-lang.org/pull/1531

try-job: dist-various-2
2025-03-26 00:06:46 +00:00
DaniPopes
154cb083e7
Override PartialOrd methods for bool
I noticed that `PartialOrd` implementation for `bool` does not override the
individual operator methods, unlike the other primitive types like `char`
and integers.

This commit extracts these `PartialOrd` overrides shared by the other
primitive types into a macro and calls it on `bool` too.
2025-03-25 21:02:55 +01:00
Matthias Krüger
5f6c1a9f57
Rollup merge of #135745 - bardiharborow:std/net/rfc9602, r=cuviper
Recognise new IPv6 non-global range from IETF RFC 9602

This PR adds the `5f00::/16` range defined by [IETF RFC 9602](https://datatracker.ietf.org/doc/rfc9602/) to those ranges which `Ipv6Addr::is_global` recognises as a non-global IP. This range is used for Segment Routing (SRv6) SIDs.

See also: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
Unstable tracking issue: #27709
2025-03-25 18:09:03 +01:00
Chris Denton
8524a7c4b7
Fix UWP reparse point check 2025-03-25 10:31:05 +00:00
Ralf Jung
61e24e630d allow wasm_c_abi in proc_macro bridge 2025-03-25 08:22:35 +01:00
Matthias Krüger
0c25157784
Rollup merge of #138800 - RalfJung:const_box, r=oli-obk
remove remnants of const_box feature

This feature requires major design work, and the few methods it gates currently aren't actually useful. Let's reset to a clean slate so when a design materializes, we can start from scratch.

Closes https://github.com/rust-lang/rust/issues/92521 by removing the feature it tracks.

r? ````@oli-obk````
2025-03-24 20:40:07 +01:00
Matthias Krüger
b157594165
Rollup merge of #138662 - Ayush1325:uefi-fs-1, r=nicholasbishop,petrochenkov
Implement some basics in UEFI fs

- Just getting some basics out of the way while waiting for #138236 to be merged.
- Adds `fs::canonicalize`. Should be same as absolute in case of UEFI since there is no symlink support and absolute path is guaranteed to be uniqe according to spec.
- Make `fs::lstat` same as `fs::stat`. Should be same since UEFI does not have symlink support.
- Implement `OptionOptions`.

cc ````@nicholasbishop```` ````@dvdhrm````
2025-03-24 20:40:06 +01:00