Commit graph

23252 commits

Author SHA1 Message Date
Jonathan Brouwer
f5a90728e3
Rollup merge of #152081 - clubby789:port-depgraph-attrs, r=JonathanBrouwer
Port depgraph testing attributes to parser

Tracking issue: rust-lang/rust#131229

Ports `#[rustc_clean]`, `#[rustc_if_this_changed]` and `#[rustc_then_this_would_need]` attributes.

Removes references to `rustc_dirty` as that attribute was folded into `rustc_clean` some time ago and rename some code accordingly.

r? JonathanBrouwer
2026-02-05 08:32:50 +01:00
Jonathan Brouwer
c0b4db118b
Rollup merge of #150379 - ChrisDenton:exitcode, r=jieyouxu
Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`

This makes rustc simply return an exit code from main rather than calling `std::process::exit` with an exit code. This means that drops run normally and the process exits cleanly. This is similar to what happens when an ICE occurs (due to being a panic that's caught by std's `lang_start`).

Also instead of hard coding success and failure codes this uses `ExitCode::SUCCESS` and `ExitCode::FAILURE`, which in turn effectively uses `libc::EXIT_SUCCESS` and `libc::EXIT_FAILURE` (via std). These are `0` and `1` respectively for all currently supported host platforms so it doesn't actually change the exit code.
2026-02-05 08:32:43 +01:00
bors
9f4b56a5ae Auto merge of #151739 - Zalathar:short-backtrace, r=fee1-dead
Use fewer intermediate functions for short backtraces in queries

If we make sure that `compute_fn` in the query's vtable is actually named `__rust_begin_short_backtrace`, we can avoid the need for some additional intermediate functions and stack frames.

This is similar to how the `get_query_incr` and `get_query_non_incr` functions are actually named `__rust_end_short_backtrace`.

---

Before/after comparison: https://github.com/rust-lang/rust/pull/151739#issuecomment-3815432527

---

- Earlier draft of this PR: https://github.com/rust-lang/rust/pull/151719
- Introduction of this backtrace-trimming: https://github.com/rust-lang/rust/pull/108938
2026-02-05 01:56:57 +00:00
Jamie Hill-Daniel
94a0ba50e1 Port rustc_clean to attribute parser
Also remove mentions of removed `rustc_dirty`
2026-02-04 20:58:02 +00:00
Zalathar
2c89741a35 Overhaul tests/run-make/short-ice to make it easier to read 2026-02-04 23:41:48 +11:00
Daniel Scherzer
c77779e529
rustbook/README.md: add missing )
To match the opening `(` before the reference to PR 127786
2026-02-03 22:26:19 -08:00
Stuart Cook
6d064d9b90
Rollup merge of #151691 - Enselic:dylib-only-for-prefer-dynamic-v2, r=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`

Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:

    error: test compilation failed although it shouldn't!
    --- stderr -------------------------------
    error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
      --> .../no-prefer-dynamic-means-no-so.rs:9:5
       |
    LL |     no_prefer_dynamic_lib::return_42();
       |     ^^^^^^^^^^^^^^^^^^^^^

### Needed by:
-  https://github.com/rust-lang/rust/pull/150591 because of https://github.com/rust-lang/rust/issues/151271. But IMHO this PR makes sense on its own.

### Must wait for:
- [x] https://github.com/rust-lang/rust/pull/151695
2026-02-03 21:58:40 +11:00
Stuart Cook
37ece9cf9b
Rollup merge of #151109 - tyhdefu:float_bits_const, r=tgross35
fN::BITS constants for feature float_bits_const

Also enables the feature for compiler_builtins as otherwise this causes a warning and conflicts with the Float extension trait.

---
Implementation for rust-lang/rust#151073

Feature flag: `#![feature(float_bits_const)]`

Note that this is likely to conflict with some extension traits, as it has with compiler builtins. However, assuming correct values for the constants, they are either `u32`, the same type, which should not cause a problem (as shown by enabling the feature for compiler_builtins), or a different type (e.g. `usize`), which should cause a compiler error. Either way this should never change behaviour unless the extension trait implemented an incorrect value.

Also note that it doesn't seem to be possible to put multiple unstable attributes on an item, so `f128::BITS` and `f16::BITS` are gated behind the feature flags for those primitives, rather than `#![feature(float_bits_const)]`
2026-02-03 21:58:39 +11:00
Stuart Cook
c4a254f7f3
Rollup merge of #152008 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 7cb789d982.

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

r? @ghost
2026-02-03 21:58:38 +11:00
Laurențiu Nicola
e9ec12a225 Fix postcard test too 2026-02-03 10:23:35 +02:00
Martin Nordholts
f14e3ee38f compiletest: Don't assume aux-crate becomes a *.so with no-prefer-dynamic
Since it does not make sense to do so. If someone prefers no dynamic
stuff, the last thing they want to look for is an `.so` file. Also add a
regression test. Without the fix, the test fails with:

    error: test compilation failed although it shouldn't!
    --- stderr -------------------------------
    error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
      --> .../no-prefer-dynamic-means-no-so.rs:9:5
       |
    LL |     no_prefer_dynamic_lib::return_42();
       |     ^^^^^^^^^^^^^^^^^^^^^
2026-02-03 06:00:28 +01:00
bors
46c86aef65 Auto merge of #152025 - jhpratt:rollup-Kxb6k3Y, r=jhpratt
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#151378 (Codegen tests for Arm Cortex-R82)
 - rust-lang/rust#151936 (Move the `fingerprint_style` special case into `DepKindVTable` creation)
 - rust-lang/rust#152018 (Move bigint helper tracking issues)
 - rust-lang/rust#151958 (Add codegen test for SLP vectorization)
 - rust-lang/rust#151974 (Update documentation for `Result::ok()`)
 - rust-lang/rust#151975 (Work around rustfmt giving up on a large expression)
 - rust-lang/rust#151990 (Fix missing unused_variables lint when using a match guard)
 - rust-lang/rust#151995 (stabilize ptr_as_ref_unchecked)
 - rust-lang/rust#151999 (attribute parsing: pass recovery mode to Parser.)
 - rust-lang/rust#152009 (Port rustc_preserve_ub_checks to attr parser)
 - rust-lang/rust#152022 (rustc-dev-guide subtree update)

Failed merges:

 - rust-lang/rust#151968 (Remove `HasDepContext` by merging it into `QueryContext`)
2026-02-03 04:44:02 +00:00
Jacob Pratt
55590344ba
Rollup merge of #151995 - RalfJung:ptr_as_ref_unchecked, r=jhpratt
stabilize ptr_as_ref_unchecked

FCP passed in rust-lang/rust#122034.

Closes rust-lang/rust#122034.
2026-02-02 23:12:07 -05:00
Ralf Jung
6490e0ecb5 stabilize ptr_as_ref_unchecked 2026-02-02 19:47:32 +01:00
Jonathan Brouwer
0a7697c23d
Rollup merge of #151695 - Enselic:proc-macro-priv-v2, r=Zalathar
compiletest: Support `--extern` modifiers with `proc-macro` directive

So that the `src/tools/compiletest/src/directives/auxiliary/tests.rs` test does not have to (ab)use the `aux-crate` directive for this purpose.

This is very edge-casey so I don't think we should document this in rustc-dev-guide. Mentioning it will confuse more than it helps. If someone needs to do this they will look at the code and easily find the functionality.

This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted.

r? @Zalathar

---

Follow-up to:

- https://github.com/rust-lang/rust/pull/151353
- https://github.com/rust-lang/rust/pull/151670

### Unblocks:
- https://github.com/rust-lang/rust/pull/151691, because without this fix that test fails (see https://github.com/rust-lang/rust/pull/151691#issuecomment-3800315302)
2026-02-02 18:52:12 +01:00
Alan Egerton
5aba6b1635
Fix missing unused_variables lint when using a match guard
Within a binding pattern match guard, only real reads of a bound local
impact its liveness analysis - not the fake read that is injected.
2026-02-02 10:57:54 +00:00
Lukas Wirth
9aebf045fb
Merge pull request #21564 from Veykril/push-kvlytkymtvks
fix: Fix upvar analysis of nested closures
2026-02-01 13:08:38 +00:00
Lukas Wirth
16b79b3310 fix: Fix upvar analysis of nested closures 2026-02-01 13:59:13 +01:00
bit-aloo
fcb55722d4
correct handler generic input 2026-02-01 15:19:03 +05:30
bit-aloo
9838073481
replace panic_any with resume_unwind on Client panic cancelled message 2026-02-01 15:17:00 +05:30
bit-aloo
50e2330dce
add suggested changes: have a internal error variant, comment on unwindsafe 2026-02-01 15:17:00 +05:30
bit-aloo
a37aa50bca
adapt ByteRange to new roundtrip 2026-02-01 15:17:00 +05:30
bit-aloo
724606d349
add error variant for cancelled expansion 2026-02-01 15:16:59 +05:30
bit-aloo
8d2811a7c3
remove repititive error block in callbacks 2026-02-01 15:16:32 +05:30
bit-aloo
489245903e
don't kill server on cancellation 2026-02-01 15:15:49 +05:30
bit-aloo
26bc8cbc77
make sure we panic in callback so the srv panics and stops 2026-02-01 15:15:48 +05:30
bit-aloo
d2ac252cf2
add proc-macro-client error variant 2026-02-01 15:15:10 +05:30
bit-aloo
fb2cb46ea8
catch unwind on client side, and accordingly send Cancel subResponse to server 2026-02-01 15:15:09 +05:30
bit-aloo
5c8d7dbe8e
add cancel variant to SubResponse 2026-02-01 15:14:20 +05:30
bors
8afe9ff1ca Auto merge of #151911 - JonathanBrouwer:rollup-ACi3J2a, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#151908 (Remove unused method `DroplessArena::contains_slice`)
 - rust-lang/rust#151850 (refactor: add an `enum DerefAdjustKind` in favor of `Option<OverloadedDeref>`)
 - rust-lang/rust#151889 (Fix ICE when parsing frontmatter without newline)
2026-01-31 16:24:16 +00:00
Lukas Wirth
cc65ee5f0c
Merge pull request #21548 from Shourya742/2026-01-29-decouple-codec-with-proc-macro
Make json and postcard protocols explicit, drop generic Codec
2026-01-31 11:00:42 +00:00
Lukas Wirth
cc24765f3c
Merge pull request #21460 from Veykril/push-vyqmuvkouywu
feat: Implement support for `feature(new_range)`
2026-01-31 10:31:38 +00:00
Matthias Krüger
df7d12a24d
Rollup merge of #151262 - Shunpoco:tidy-clap, r=Zalathar
Introducing clap on tidy

### Context
Currently tidy parses paths/flags from args_os manually, and the extraction is spreading multiple files. It may be a breeding ground for bugs.

ref: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/How.20--ci.3Dtrue.20interact.20with.20CiEnv.3F/near/543171560
(N.B. We've talked about introducing a ci flag in tidy in that thread, but I don't do it in this PR as I don't want to put multiple changes into a PR. I will introduce the flag in a coming PR.)

### Changes
This PR replaces current parsing logic with clap. To confirm the new parser works fine, I introduce an unit test for it.

### Build time
We've concerned about how clap increases the build time. In order to confirm the increment is acceptable, I did an experiment on CI:
- Run cargo build without cache for tidy 50 times in each environment on CI
- Calculate an average and a standard deviation from the result, and plot them

Here is the graph:
<img width="943" height="530" alt="rust_tidy_build_time" src="https://github.com/user-attachments/assets/c7deee69-9f38-4044-87dc-76d6e7384f76" />

- Clap tends to increase build time ~2s. We think this is not a big problem
- Build time differs in each environment
- In some cases standard deviation are high, I suppose that busyness of CI instances affect build time
2026-01-31 10:41:52 +01:00
Frank King
996425b295 refactor: add an enum DerefAdjustKind in favor of Option<OverloadedDeref> 2026-01-31 16:25:32 +08:00
Weihang Lo
f7ffe31390
Update cargo submodule
also fixed tests/run-make-cargo/apple-slow-tls/rmake.rs
accordingly for the new `-Zjson-target-spec` requirement
2026-01-30 19:15:24 -05:00
bors
a293cc4af8 Auto merge of #151679 - clubby789:lockfile-fix, r=Mark-Simulacrum
Fix lockfile update script

Fixes https://github.com/rust-lang/rust/pull/151354#issuecomment-3795764510

Now passes `shellcheck`

cc @ehuss
2026-01-30 18:57:41 +00:00
Lukas Wirth
b6e4f13583
Merge pull request #21555 from Veykril/push-vlrmztunpmtm
fix: Fix diagnostics being leaked when diagnostics panic
2026-01-30 15:13:26 +00:00
Lukas Wirth
85f2923dc5 fix: Fix diagnostics being leaked when diagnostics panic 2026-01-30 16:00:31 +01:00
bit-aloo
617ac8c0d4
correct visibility of transport layer 2026-01-30 07:47:40 +05:30
bit-aloo
be833ca74c
remove postcard dep from proc-macro-srv-cli 2026-01-30 07:30:41 +05:30
bit-aloo
0bab96e98f
adapt proc-macro-srv-cli and test 2026-01-30 00:12:14 +05:30
bit-aloo
dfb22b9406
adapt proc-macro-api to remove codec abstraction 2026-01-30 00:11:52 +05:30
bit-aloo
06c0fde840
move json and postcard as top level api's 2026-01-30 00:10:09 +05:30
bit-aloo
2b0ce429ff
remove codec and framing 2026-01-30 00:09:31 +05:30
Jonathan Brouwer
0f318f9cea
Rollup merge of #151834 - GuillaumeGomez:update-askama, r=GuillaumeGomez
Update `askama` version to `0.15.4`

Hopefully it's the last `askama` update before a while. ^^'

r? ghost
2026-01-29 17:47:32 +01:00
Jonathan Brouwer
40d7cb890f
Rollup merge of #150271 - Jamesbarford:chore/refactor-struct-placeholder-pt2, r=lcnr
Move struct placeholder pt2

r? ghost
2026-01-29 17:47:29 +01:00
Laurențiu Nicola
a36549333a
Merge pull request #21541 from rust-lang/rustc-pull
Rustc pull update
2026-01-29 16:20:26 +00:00
Guillaume Gomez
6397395362 Update askama version to 0.15.4 2026-01-29 17:08:19 +01:00
Lukas Wirth
d99fbb9a6c
Merge pull request #21533 from ChayimFriedman2/autoderef-panic
fix: Fix a panic where an opaque was constrained to an impossible type in method autoderef
2026-01-29 12:33:52 +00:00
Lukas Wirth
c2532c16f8
Merge pull request #21542 from A4-Tacks/inferred-static
fix: complete inferred type in static
2026-01-29 12:33:16 +00:00