3314 Commits

Author SHA1 Message Date
Jana Dönszelmann
64a1a98f47
encode_cross_crate for hir attributes 2025-06-25 22:10:40 +02:00
bors
a17780db7b Auto merge of #142997 - workingjubilee:rollup-6lxec87, r=workingjubilee
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#135731 (Implement parsing of pinned borrows)
 - rust-lang/rust#138780 (Add `#[loop_match]` for improved DFA codegen)
 - rust-lang/rust#142453 (Windows: make `read_dir` stop iterating after the first error is encountered)
 - rust-lang/rust#142633 (Error on invalid signatures for interrupt ABIs)
 - rust-lang/rust#142768 (Avoid a bitcast FFI call in transmuting)
 - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system)
 - rust-lang/rust#142844 (Enable short-ice for Windows)
 - rust-lang/rust#142934 (Tweak `-Zmacro-stats` measurement.)
 - rust-lang/rust#142955 (Couple of test suite fixes for cg_clif)
 - rust-lang/rust#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠)
 - rust-lang/rust#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect)
 - rust-lang/rust#142982 (Corrected spelling mistake in c_str.rs)
 - rust-lang/rust#142983 (Taint body on invalid call ABI)
 - rust-lang/rust#142988 (Update wasm-component-ld to 0.5.14)
 - rust-lang/rust#142993 (Update cargo)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-25 04:05:47 +00:00
Jubilee
1d4955461b
Rollup merge of #142988 - alexcrichton:update-wasm-component-ld, r=Mark-Simulacrum
Update wasm-component-ld to 0.5.14

This brings in a few updates to the bundled `wasm-component-ld` dependency used by the `wasm32-wasip2` target. This primarily includes support for upcoming component model async/WASIp3 support which will be convenient to have native support for a few months from now.
2025-06-24 19:45:36 -07:00
Jubilee
2ad6272649
Rollup merge of #142825 - jdonszelmann:track-caller, r=oli-obk
Port `#[track_caller]` to the new attribute system

r? ``@oli-obk``

depends on https://github.com/rust-lang/rust/pull/142493

Closes rust-lang/rust#142783

(didn't add a test for this, this situation should simply never come up again, the code was simply wrong. lmk if I should add it, but it won't test something very useful)
2025-06-24 19:45:32 -07:00
Jubilee
891dc0fb09
Rollup merge of #142633 - folkertdev:interrupt-abi-restrict-signature, r=workingjubilee
Error on invalid signatures for interrupt ABIs

We recently added `extern "custom"`, which must have type `fn()`. The various `extern "interrupt"` ABIs impose similar constraints on the signature of functions with that ABI: `x86-interrupt` should not have a return type (linting on the exact argument types is left as future work), and the other interrupt ABIs cannot have any parameters or a return type.

r? ```@workingjubilee```
2025-06-24 19:45:31 -07:00
Jubilee
f542909d1c
Rollup merge of #138780 - trifectatechfoundation:loop_match_attr, r=oli-obk,traviscross
Add `#[loop_match]` for improved DFA codegen

tracking issue: https://github.com/rust-lang/rust/issues/132306
project goal: https://github.com/rust-lang/rust-project-goals/issues/258

This PR adds the `#[loop_match]` attribute, which aims to improve code generation for state machines. For some (very exciting) benchmarks, see https://github.com/rust-lang/rust-project-goals/issues/258#issuecomment-2732965199

Currently, a very restricted syntax pattern is accepted. We'd like to get feedback and merge this now before we go too far in a direction that others have concerns with.

## current state

We accept code that looks like this

```rust
#[loop_match]
loop {
    state = 'blk: {
        match state {
            State::A => {
                #[const_continue]
                break 'blk State::B
            }
            State::B => { /* ... */ }
            /* ... */
        }
    }
}
```

- a loop should have the same semantics with and without `#[loop_match]`: normal `continue` and `break` continue to work
- `#[const_continue]` is only allowed in loops annotated with `#[loop_match]`
- the loop body needs to have this particular shape (a single assignment to the match scrutinee, with the body a labelled block containing just a match)

## future work

- perform const evaluation on the `break` value
- support more state/scrutinee types

## maybe future work

- allow `continue 'label value` syntax, which `#[const_continue]` could then use.
- allow the match to be on an arbitrary expression (e.g. `State::Initial`)
- attempt to also optimize `break`/`continue` expressions that are not marked with `#[const_continue]`

r? ``@traviscross``
2025-06-24 19:45:30 -07:00
bors
2c2bb995af Auto merge of #140999 - hkBst:update-escaper, r=nnethercote
update to literal-escaper 0.0.4 for better API without `unreachable` and faster string parsing

This is the replacement for just the part of https://github.com/rust-lang/rust/pull/138163 dealing with the changed API of unescape functionality, since that got moved into its own crate.

<del>This uses an unpublished version of literal-escaper (https://github.com/rust-lang/literal-escaper/pull/8).</del>

r? `@nnethercote`
2025-06-25 01:03:30 +00:00
Alex Crichton
4a112db96b Update wasm-component-ld to 0.5.14
This brings in a few updates to the bundled `wasm-component-ld`
dependency used by the `wasm32-wasip2` target. This primarily includes
support for upcoming component model async/WASIp3 support which will be
convenient to have native support for a few months from now.
2025-06-24 15:59:35 -07:00
Jana Dönszelmann
5d44fdd972
Rewrite #[track_caller] 2025-06-24 23:00:31 +02:00
Vadim Petrochenkov
0be37cab97 rustc_session: Add a structure for keeping both explicit and default sysroots
Also avoid creating and cloning sysroot unnecessarily.
2025-06-24 16:00:04 +03:00
Folkert de Vries
943d37958b
Error on invalid signatures for interrupt ABIs 2025-06-24 14:40:11 +02:00
bjorn3
ba5556d239
Add #[loop_match] for improved DFA codegen
Co-authored-by: Folkert de Vries <folkert@folkertdev.nl>
2025-06-23 20:43:04 +02:00
Marijn Schouten
707a6f5463 update to literal-escaper 0.0.4 for better API without unreachable and faster string parsing 2025-06-23 06:36:22 +00:00
Trevor Gross
7b355110df
Rollup merge of #142384 - celinval:chores-rayon-mv, r=oli-obk
Bringing `rustc_rayon_core` in tree as `rustc_thread_pool`

This PR moves [`rustc_rayon_core`](https://github.com/rust-lang/rustc-rayon/tree/5fadf44/rayon-core) from commit `5fadf44` as suggested in [this zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Bringing.20.60rustc_rayon_core.60.20in.20tree). I tried to split the work into separate commits so it is easy to review. The first commit is a simple copy and paste from the fork, and subsequent changes were made to use the new crate and to ensure the new crate complies with different format and lint expectations.

**Call-out:** I was also wondering if I need to make any further changes to accommodate licensing requirements.

r? oli-obk
2025-06-20 23:25:54 -04:00
Trevor Gross
a021227fb5
Rollup merge of #142524 - rust-lang:cargo_update, r=Mark-Simulacrum
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 31 packages to latest compatible versions
    Updating adler2 v2.0.0 -> v2.0.1
    Updating cfg-if v1.0.0 -> v1.0.1
    Updating clap v4.5.39 -> v4.5.40
    Updating clap_builder v4.5.39 -> v4.5.40
    Updating clap_derive v4.5.32 -> v4.5.40
    Updating clap_lex v0.7.4 -> v0.7.5
    Updating getopts v0.2.21 -> v0.2.23
    Updating hermit-abi v0.5.1 -> v0.5.2
    Updating jiff v0.2.14 -> v0.2.15
    Updating jiff-static v0.2.14 -> v0.2.15
    Updating libc v0.2.172 -> v0.2.173
    Updating memchr v2.7.4 -> v2.7.5
    Updating minifier v0.3.5 -> v0.3.6
    Updating miniz_oxide v0.8.8 -> v0.8.9
    Updating object v0.37.0 -> v0.37.1
    Updating redox_syscall v0.5.12 -> v0.5.13
    Updating rustc-demangle v0.1.24 -> v0.1.25
    Updating syn v2.0.101 -> v2.0.103
    Updating thread_local v1.1.8 -> v1.1.9
    Updating unicode-width v0.2.0 -> v0.2.1
    Updating wasi v0.11.0+wasi-snapshot-preview1 -> v0.11.1+wasi-snapshot-preview1
    Updating wasm-encoder v0.233.0 -> v0.235.0
    Removing wasmparser v0.232.0
    Removing wasmparser v0.233.0
      Adding wasmparser v0.234.0
      Adding wasmparser v0.235.0
    Updating wast v233.0.0 -> v235.0.0
    Updating wat v1.233.0 -> v1.235.0
    Updating windows v0.61.1 -> v0.61.3
    Updating windows-link v0.1.1 -> v0.1.3
      Adding windows-sys v0.60.2
    Updating windows-targets v0.53.0 -> v0.53.2
    Updating winnow v0.7.10 -> v0.7.11
note: pass `--verbose` to see 39 unchanged dependencies behind latest

library dependencies:
     Locking 1 package to latest compatible version
    Updating libc v0.2.172 -> v0.2.173
note: pass `--verbose` to see 4 unchanged dependencies behind latest

rustbook dependencies:
     Locking 19 packages to latest compatible versions
    Updating adler2 v2.0.0 -> v2.0.1
    Updating cc v1.2.26 -> v1.2.27
    Updating cfg-if v1.0.0 -> v1.0.1
    Updating clap v4.5.39 -> v4.5.40
    Updating clap_builder v4.5.39 -> v4.5.40
    Updating clap_complete v4.5.52 -> v4.5.54
    Updating clap_derive v4.5.32 -> v4.5.40
    Updating clap_lex v0.7.4 -> v0.7.5
    Updating getopts v0.2.21 -> v0.2.23
    Updating jiff v0.2.14 -> v0.2.15
    Updating jiff-static v0.2.14 -> v0.2.15
    Updating libc v0.2.172 -> v0.2.173
    Updating memchr v2.7.4 -> v2.7.5
    Updating miniz_oxide v0.8.8 -> v0.8.9
    Updating redox_syscall v0.5.12 -> v0.5.13
    Updating syn v2.0.101 -> v2.0.103
    Removing unicode-width v0.1.14
    Removing unicode-width v0.2.0
      Adding unicode-width v0.2.1
    Updating windows-link v0.1.1 -> v0.1.3
    Updating winnow v0.7.10 -> v0.7.11
```
2025-06-18 20:22:50 -04:00
Jakub Beránek
fd6b24f162
Rollup merge of #142383 - scottmcm:operandref-builder, r=workingjubilee
CodeGen: rework Aggregate implemention for rvalue_creates_operand cases

A non-trivial refactor pulled out from rust-lang/rust#138759
r? workingjubilee

The previous implementation I'd written here based on `index_by_increasing_offset` is complicated to follow and difficult to extend to non-structs.

This changes the implementation, without actually changing any codegen (thus no test changes either), to be more like the existing `extract_field` (<2b0274c71d/compiler/rustc_codegen_ssa/src/mir/operand.rs (L345-L425)>) in that it allows setting a particular field directly.

Notably I've found this one much easier to get right, in particular because having the `OperandRef<Result<V, Scalar>>` gives a really useful thing to include in ICE messages if something did happen to go wrong.
2025-06-18 18:06:50 +02:00
Scott McMurray
e4f196a7b4 CodeGen: rework Aggregate implemention for rvalue_creates_operand cases
Another refactor pulled out from 138759

The previous implementation I'd written here based on `index_by_increasing_offset` is complicated to follow and difficult to extend to non-structs.

This changes the implementation, without actually changing any codegen (thus no test changes either), to be more like the existing `extract_field` (<2b0274c71d/compiler/rustc_codegen_ssa/src/mir/operand.rs (L345-L425)>) in that it allows setting a particular field directly.

Notably I've found this one much easier to get right, in particular because having the `OperandRef<Result<V, Scalar>>` gives a really useful thing to include in ICE messages if something did happen to go wrong.
2025-06-17 18:59:22 -07:00
Trevor Gross
57fdde331b Update libc to 0.2.174
This includes a fix for building on gnux32.

[1]: https://github.com/rust-lang/libc/releases/tag/0.2.174
2025-06-17 18:03:45 +00:00
github-actions
870e5a26ee cargo update
compiler & tools dependencies:
     Locking 31 packages to latest compatible versions
    Updating adler2 v2.0.0 -> v2.0.1
    Updating cfg-if v1.0.0 -> v1.0.1
    Updating clap v4.5.39 -> v4.5.40
    Updating clap_builder v4.5.39 -> v4.5.40
    Updating clap_derive v4.5.32 -> v4.5.40
    Updating clap_lex v0.7.4 -> v0.7.5
    Updating getopts v0.2.21 -> v0.2.23
    Updating hermit-abi v0.5.1 -> v0.5.2
    Updating jiff v0.2.14 -> v0.2.15
    Updating jiff-static v0.2.14 -> v0.2.15
    Updating libc v0.2.172 -> v0.2.173
    Updating memchr v2.7.4 -> v2.7.5
    Updating minifier v0.3.5 -> v0.3.6
    Updating miniz_oxide v0.8.8 -> v0.8.9
    Updating object v0.37.0 -> v0.37.1
    Updating redox_syscall v0.5.12 -> v0.5.13
    Updating rustc-demangle v0.1.24 -> v0.1.25
    Updating syn v2.0.101 -> v2.0.103
    Updating thread_local v1.1.8 -> v1.1.9
    Updating unicode-width v0.2.0 -> v0.2.1
    Updating wasi v0.11.0+wasi-snapshot-preview1 -> v0.11.1+wasi-snapshot-preview1
    Updating wasm-encoder v0.233.0 -> v0.235.0
    Removing wasmparser v0.232.0
    Removing wasmparser v0.233.0
      Adding wasmparser v0.234.0
      Adding wasmparser v0.235.0
    Updating wast v233.0.0 -> v235.0.0
    Updating wat v1.233.0 -> v1.235.0
    Updating windows v0.61.1 -> v0.61.3
    Updating windows-link v0.1.1 -> v0.1.3
      Adding windows-sys v0.60.2
    Updating windows-targets v0.53.0 -> v0.53.2
    Updating winnow v0.7.10 -> v0.7.11
note: pass `--verbose` to see 39 unchanged dependencies behind latest

library dependencies:
     Locking 1 package to latest compatible version
    Updating libc v0.2.172 -> v0.2.173
note: pass `--verbose` to see 4 unchanged dependencies behind latest

rustbook dependencies:
     Locking 19 packages to latest compatible versions
    Updating adler2 v2.0.0 -> v2.0.1
    Updating cc v1.2.26 -> v1.2.27
    Updating cfg-if v1.0.0 -> v1.0.1
    Updating clap v4.5.39 -> v4.5.40
    Updating clap_builder v4.5.39 -> v4.5.40
    Updating clap_complete v4.5.52 -> v4.5.54
    Updating clap_derive v4.5.32 -> v4.5.40
    Updating clap_lex v0.7.4 -> v0.7.5
    Updating getopts v0.2.21 -> v0.2.23
    Updating jiff v0.2.14 -> v0.2.15
    Updating jiff-static v0.2.14 -> v0.2.15
    Updating libc v0.2.172 -> v0.2.173
    Updating memchr v2.7.4 -> v2.7.5
    Updating miniz_oxide v0.8.8 -> v0.8.9
    Updating redox_syscall v0.5.12 -> v0.5.13
    Updating syn v2.0.101 -> v2.0.103
    Removing unicode-width v0.1.14
    Removing unicode-width v0.2.0
      Adding unicode-width v0.2.1
    Updating windows-link v0.1.1 -> v0.1.3
    Updating winnow v0.7.10 -> v0.7.11
2025-06-15 00:26:43 +00:00
Michael Goulet
6fa6d0e097 Uplift BoundVarReplacer 2025-06-13 17:54:45 +00:00
Matthias Krüger
7cf087060c
Rollup merge of #142340 - RalfJung:miri-apfloat-mul-add, r=oli-obk
miri: we can use apfloat's mul_add now

With https://github.com/rust-lang/rustc_apfloat/issues/11 fixed, there is no reason to still use host floats here.
Fixes https://github.com/rust-lang/miri/issues/2995

We already have a test for this:
a7153db254/src/tools/miri/tests/pass/float.rs (L998-L1003)

r? ``@oli-obk``
2025-06-13 05:16:58 +02:00
bors
573a015690 Auto merge of #138164 - jdonszelmann:attr-parsing-lint-infra, r=oli-obk
Infrastructure for lints during attribute parsing, specifically duplicate usages of attributes

r? `@oli-obk`

This PR adds a new field to OwnerInfo to buffer lints which are generated during attribute parsing and ast lowering in general. They can't be emitted at this stage because at that point there's no HIR yet, and early lints are already emitted.

This also adds the generic `S: Stage` to attribute parsers. Currently we don't emit any lints during early attribute parsing, but if we ever want to that logic will be different. That's because there we don't have hir ids yet, while at the same time still having access to node ids and early lints. Even though that logic isn't completely there in this PR (no worries, we don't use it), that's why the parameter is there.

With this PR, we also add 2 associated consts  to `SingleAttributeParser`. Those determine what logic should be applied when finding a duplicate attribute.

This PR was getting pretty large, so the first code using this logic is in rust-lang/rust#138165. This code is all new things that weren't possible before so it also doesn't break any behaviour. However, some of it will be dead code right now. I recommend reviewing both before merging, though in some sense that doubles the size of the review again, and the other PR might be more controversial. Let me know how you want to do this `@oli-obk`
2025-06-12 19:48:49 +00:00
Jana Dönszelmann
6072207a11
introduce new lint infra
lint on duplicates during attribute parsing
To do this we stuff them in the diagnostic context to be emitted after
hir is constructed
2025-06-12 09:56:47 +02:00
Mark Rousskov
24fd5b4087 Cargo wants wasmparser in different order
It's not clear to me how we ended up with the other order here --
hopefully this isn't an indicator of some form of instability in Cargo?

But either order is fine...
2025-06-11 21:12:45 -04:00
github-actions
94b41f6dd0 cargo update
compiler & tools dependencies:
     Locking 57 packages to latest compatible versions
    Updating anstream v0.6.18 -> v0.6.19
    Updating anstyle v1.0.10 -> v1.0.11
    Updating anstyle-lossy v1.1.3 -> v1.1.4
    Updating anstyle-parse v0.2.6 -> v0.2.7
    Updating anstyle-query v1.1.2 -> v1.1.3
    Updating anstyle-svg v0.1.7 -> v0.1.8
    Updating anstyle-wincon v3.0.7 -> v3.0.9
    Updating bitflags v2.9.0 -> v2.9.1
    Updating bumpalo v3.17.0 -> v3.18.1
    Updating bytecount v0.6.8 -> v0.6.9
    Updating camino v1.1.9 -> v1.1.10
    Updating clap v4.5.38 -> v4.5.39
    Updating clap_builder v4.5.38 -> v4.5.39
    Updating color-eyre v0.6.4 -> v0.6.5
    Updating color-spantrace v0.2.2 -> v0.3.0
    Updating colorchoice v1.0.3 -> v1.0.4
    Updating curl v0.4.47 -> v0.4.48
    Updating curl-sys v0.4.80+curl-8.12.1 -> v0.4.82+curl-8.14.1
    Updating errno v0.3.11 -> v0.3.12
    Updating flate2 v1.1.1 -> v1.1.2
    Updating hashbrown v0.15.3 -> v0.15.4
    Updating hermit-abi v0.3.9 -> v0.5.1
    Updating icu_properties v2.0.0 -> v2.0.1
    Updating icu_properties_data v2.0.0 -> v2.0.1
    Updating jiff v0.2.13 -> v0.2.14
    Updating jiff-static v0.2.13 -> v0.2.14
    Updating jsonpath-rust v1.0.1 -> v1.0.2
    Updating libloading v0.8.7 -> v0.8.8
    Updating lock_api v0.4.12 -> v0.4.13
    Updating num_cpus v1.16.0 -> v1.17.0
      Adding once_cell_polyfill v1.70.1
    Updating openssl-sys v0.9.108 -> v0.9.109
    Updating owo-colors v4.2.0 -> v4.2.1
    Updating parking_lot v0.12.3 -> v0.12.4
    Updating parking_lot_core v0.9.10 -> v0.9.11
    Updating portable-atomic v1.11.0 -> v1.11.1
    Updating rustc-build-sysroot v0.5.7 -> v0.5.8
    Updating rustversion v1.0.20 -> v1.0.21
    Updating serde_spanned v0.6.8 -> v0.6.9
    Updating smallvec v1.15.0 -> v1.15.1
    Updating socket2 v0.5.9 -> v0.5.10
    Updating sysinfo v0.35.0 -> v0.35.2
    Updating tokio v1.45.0 -> v1.45.1
    Updating toml_datetime v0.6.9 -> v0.6.11
    Updating tracing-attributes v0.1.28 -> v0.1.29
    Updating type-map v0.5.0 -> v0.5.1
    Updating uuid v1.16.0 -> v1.17.0
    Updating wasm-encoder v0.230.0 -> v0.233.0
    Updating wasmparser v0.230.0 -> v0.233.0
    Updating wast v230.0.0 -> v233.0.0
    Updating wat v1.230.0 -> v1.233.0
    Updating windows-bindgen v0.61.0 -> v0.61.1
    Updating windows-core v0.61.0 -> v0.61.2
    Updating windows-future v0.2.0 -> v0.2.1
    Updating windows-result v0.3.2 -> v0.3.4
    Updating windows-strings v0.4.0 -> v0.4.2
      Adding windows-threading v0.1.0
note: pass `--verbose` to see 38 unchanged dependencies behind latest

library dependencies:
     Locking 1 package to latest compatible version
    Updating hashbrown v0.15.3 -> v0.15.4
note: pass `--verbose` to see 5 unchanged dependencies behind latest

rustbook dependencies:
     Locking 39 packages to latest compatible versions
    Updating anstream v0.6.18 -> v0.6.19
    Updating anstyle v1.0.10 -> v1.0.11
    Updating anstyle-parse v0.2.6 -> v0.2.7
    Updating anstyle-query v1.1.2 -> v1.1.3
    Updating anstyle-wincon v3.0.7 -> v3.0.9
    Updating bitflags v2.9.0 -> v2.9.1
    Updating bumpalo v3.17.0 -> v3.18.1
    Updating cc v1.2.22 -> v1.2.26
    Updating clap v4.5.38 -> v4.5.39
    Updating clap_builder v4.5.38 -> v4.5.39
    Updating clap_complete v4.5.50 -> v4.5.52
    Updating colorchoice v1.0.3 -> v1.0.4
    Updating errno v0.3.11 -> v0.3.12
    Updating flate2 v1.1.1 -> v1.1.2
    Updating hashbrown v0.15.3 -> v0.15.4
    Updating icu_properties v2.0.0 -> v2.0.1
    Updating icu_properties_data v2.0.0 -> v2.0.1
    Updating jiff v0.2.13 -> v0.2.14
    Updating jiff-static v0.2.13 -> v0.2.14
    Updating lock_api v0.4.12 -> v0.4.13
      Adding once_cell_polyfill v1.70.1
    Updating opener v0.8.1 -> v0.8.2
    Updating parking_lot v0.12.3 -> v0.12.4
    Updating parking_lot_core v0.9.10 -> v0.9.11
    Updating portable-atomic v1.11.0 -> v1.11.1
    Updating railroad v0.3.2 -> v0.3.3
    Updating rustversion v1.0.20 -> v1.0.21
    Updating serde_spanned v0.6.8 -> v0.6.9
    Updating smallvec v1.15.0 -> v1.15.1
    Updating tempfile v3.19.1 -> v3.20.0
    Updating toml v0.8.22 -> v0.8.23
    Updating toml_datetime v0.6.9 -> v0.6.11
    Updating toml_edit v0.22.26 -> v0.22.27
    Updating toml_write v0.1.1 -> v0.1.2
      Adding unicode-width v0.2.0
    Updating web_atoms v0.1.2 -> v0.1.3
    Updating windows-core v0.61.0 -> v0.61.2
    Updating windows-result v0.3.2 -> v0.3.4
    Updating windows-strings v0.4.0 -> v0.4.2
2025-06-11 21:11:54 -04:00
Celina G. Val
4aa62ea9e9 Use rustc_thread_pool instead of rustc-rayon-core 2025-06-11 12:26:42 -07:00
Ralf Jung
30f3725e0d bump apfloat dependency 2025-06-11 07:54:08 +02:00
Ralf Jung
88e3e68286 update lockfile 2025-06-10 14:01:03 +02: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
b6685d748f Auto merge of #141435 - RalfJung:unsupported_calling_conventions, r=workingjubilee
Add (back) `unsupported_calling_conventions` lint to reject more invalid calling conventions

This adds back the `unsupported_calling_conventions` lint that was removed in https://github.com/rust-lang/rust/pull/129935, in order to start the process of dealing with https://github.com/rust-lang/rust/issues/137018. Specifically, we are going for the plan laid out [here](https://github.com/rust-lang/rust/issues/137018#issuecomment-2672118326):
- thiscall, stdcall, fastcall, cdecl should only be accepted on x86-32
- vectorcall should only be accepted on x86-32 and x86-64

The difference to the status quo is that:
- We stop accepting stdcall, fastcall on targets that are windows && non-x86-32 (we already don't accept these on targets that are non-windows && non-x86-32)
- We stop accepting cdecl on targets that are non-x86-32
- (There is no difference for thiscall, this was already a hard error on non-x86-32)
- We stop accepting vectorcall on targets that are windows && non-x86-*

Vectorcall is an unstable ABI so we can just make this a hard error immediately. The others are stable, so we emit the `unsupported_calling_conventions` forward-compat lint. I set up the lint to show up in dependencies via cargo's future-compat report immediately, but we could also make it show up just for the local crate first if that is preferred.

try-job: i686-msvc-1
try-job: x86_64-msvc-1
try-job: test-various
2025-06-09 05:21:49 +00:00
Jubilee
41bc5d7f73
Rollup merge of #142089 - bjorn3:sysroot_handling_cleanup3, r=petrochenkov
Replace all uses of sysroot_candidates with get_or_default_sysroot

Before this change we had two different ways to attempt to locate the sysroot which are inconsistently used:
* `get_or_default_sysroot` which tries to locate based on the 0th cli argument and if that doesn't work falls back to locating it using the librustc_driver.so location and returns a single path.,
* `sysroot_candidates` which takes the former and additionally does another attempt at locating using `librustc_driver.so` except without linux multiarch handling and then returns both paths.,

The latter was originally introduced to be able to locate the codegen backend back when cg_llvm was dynamically linked even for a custom driver when the `--sysroot` passed in does not contain a copy of cg_llvm. Back then `get_or_default_sysroot` did not attempt to locate the sysroot based on the location of librustc_driver.so yet. Because that is now done, the only case where removing `sysroot_candidates` can break things is if you have a custom driver inside what looks like a sysroot including the `lib/rustlib` directory, but which is missing some parts of the full sysroot like eg rust-lld.

Follow up to https://github.com/rust-lang/rust/pull/138404
2025-06-08 17:17:54 -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
Ralf Jung
873122c006 add (back) unsupported_calling_conventions lint to reject more invalid calling conventions 2025-06-08 07:34:41 +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
bjorn3
e4c4c4c677 Fix review comments 2025-06-06 14:20:48 +00:00
WANG Rui
27f8efbae2 Bump object 2025-06-05 07:59:51 +08:00
Alona Enraght-Moony
763663ad56 rustdoc-json-type: Depend on serde and serde_derive seperately
Before this commit, serde_derive is built before serde. But serde does
not depend on serde_derive, so that is not needed. Instead, build serde
and serde_derive in parallel.

This speeds up compilation for users depending on rustdoc-json-types out
of tree.

Imports: https://www.github.com/rust-lang/rustdoc-types/pull/49
Co-authored-by: Martin Nordholts <martin.nordholts@codetale.se>
2025-06-03 21:17:33 +00:00
Philipp Krones
8ac5f7fe18
Update Cargo.lock 2025-05-31 14:22:28 +02:00
Matthias Krüger
5fc3f26748
Rollup merge of #141004 - matthewjasper:unicode-before-expansion, r=davidtwco
Report text_direction_codepoint_in_literal when parsing

The lint is now reported in code that gets removed/modified/duplicated by macro expansion, and spans are more accurate so we don't get ICEs from trying to split a span in the middle of a character.

This removes support for lint level attributes for `text_direction_codepoint_in_literal` except at the crate level, I don't think that there's an easy way around this when the lint can be reported on code that's removed by `cfg` or that is only in the input of a macro.

Fixes #140281
2025-05-30 07:01:28 +02:00
bors
13718eb788 Auto merge of #141595 - bjorn3:rustc_no_sysroot_proc_macro, r=onur-ozkan
Do not get proc_macro from the sysroot in rustc

With the stage0 refactor the proc_macro version found in the sysroot will no longer always match the proc_macro version that proc-macros get compiled with by the rustc executable that uses this proc_macro. This will cause problems as soon as the ABI of the bridge gets changed to implement new features or change the way existing features work.

To fix this, this commit changes rustc crates to depend directly on the local version of proc_macro which will also be used in the sysroot that rustc will build.
2025-05-29 12:07:53 +00:00
Matthew Jasper
e5bfd02c5e Avoid including text direction codepoints in lint messages 2025-05-27 15:57:41 +00:00
bjorn3
026baa1c6f Do not get proc_macro from the sysroot in rustc
With the stage0 refactor the proc_macro version found in the sysroot
will no longer always match the proc_macro version that proc-macros get
compiled with by the rustc executable that uses this proc_macro. This
will cause problems as soon as the ABI of the bridge gets changed to
implement new features or change the way existing features work.

To fix this, this commit changes rustc crates to depend directly on the
local version of proc_macro which will also be used in the sysroot that
rustc will build.
2025-05-27 15:49:28 +00:00
klensy
e6312c9232 bump fluent-* crates 2025-05-27 14:11:14 +03:00
Guillaume Gomez
0846035d2d
Rollup merge of #141487 - GuillaumeGomez:update-askama, r=notriddle
Update askama to `0.14.0`

[Askama 0.14.0 release notes](https://github.com/askama-rs/askama/releases/tag/v0.14.0)

Just one change needed for a filter in rustdoc.

r? ```@notriddle```
2025-05-24 21:23:48 +02:00
Guillaume Gomez
2885e5578e Update askama version to 0.14.0 in generate-copyright tool 2025-05-24 12:28:50 +02:00
Guillaume Gomez
f53473320a Update askama version to 0.14.0 in librustdoc 2025-05-24 12:23:18 +02:00
Matthias Krüger
ee1768c2a3
Rollup merge of #141383 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-05-23 13:34:21 +02:00
Ralf Jung
3f0c39de36 update lockfile 2025-05-22 10:13:45 +02:00
Philipp Krones
0e203f3914
Update Cargo.lock 2025-05-21 15:20:26 +02:00
bohan
097b7a2ac7 collect doc alias as tips during resolution 2025-05-21 00:47:36 +08:00