302427 Commits

Author SHA1 Message Date
Esteban Küber
26c12c7462 Account for bare tuples in field searching logic
When looking for the field names and types of a given type, account for tuples. This allows suggestions for incorrectly nested field accesses and field name typos to trigger as intended. Previously these suggestions only worked on `ty::Adt`, including tuple structs which are no different to tuples, so they should behave the same in suggestions.

```
error[E0599]: no method named `get_ref` found for tuple `(BufReader<File>,)` in the current scope
  --> $DIR/missing-field-access.rs:11:15
   |
LL |     let x = f.get_ref();
   |               ^^^^^^^ method not found in `(BufReader<File>,)`
   |
help: one of the expressions' fields has a method of the same name
   |
LL |     let x = f.0.get_ref();
   |               ++
```
2025-08-07 21:39:00 +00:00
bors
2fd855fbfc Auto merge of #145056 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to clippy version bump
2025-08-07 17:29:24 +00:00
Philipp Krones
770e6f131d
Update Cargo.lock 2025-08-07 17:10:36 +02:00
Philipp Krones
d9385437c2
Merge commit '334fb906aef13d20050987b13448f37391bb97a2' into clippy-subtree-update 2025-08-07 17:05:15 +02:00
Philipp Krones
334fb906ae
Rustup (#15431)
r? @ghost

changelog: none
2025-08-07 14:53:47 +00:00
Philipp Krones
d5f9f7576c
Bump Clippy version -> 0.1.91 2025-08-07 16:48:16 +02:00
Philipp Krones
2893dc8019
Bump nightly version -> 2025-08-07 2025-08-07 16:47:57 +02:00
Philipp Krones
f2b7e9ff52
Merge remote-tracking branch 'upstream/master' into rustup 2025-08-07 16:47:42 +02:00
bors
321a89bec5 Auto merge of #145043 - Zalathar:rollup-3dbvdrm, r=Zalathar
Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#137831 (Tweak auto trait errors)
 - rust-lang/rust#138689 (add nvptx_target_feature)
 - rust-lang/rust#140267 (implement continue_ok and break_ok for ControlFlow)
 - rust-lang/rust#143028 (emit `StorageLive` and schedule `StorageDead` for `let`-`else`'s bindings after matching)
 - rust-lang/rust#143764 (lower pattern bindings in the order they're written and base drop order on primary bindings' order)
 - rust-lang/rust#143808 (Port `#[should_panic]` to the new attribute parsing infrastructure )
 - rust-lang/rust#143906 (Miri: non-deterministic floating point operations in `foreign_items`)
 - rust-lang/rust#143929 (Mark all deprecation lints in name resolution as deny-by-default and report-in-deps)
 - rust-lang/rust#144133 (Stabilize const TypeId::of)
 - rust-lang/rust#144369 (Upgrade semicolon_in_expressions_from_macros from warn to deny)
 - rust-lang/rust#144439 (Introduce ModernIdent type to unify macro 2.0 hygiene handling)
 - rust-lang/rust#144473 (Address libunwind.a inconsistency issues in the bootstrap program)
 - rust-lang/rust#144601 (Allow `cargo fix` to partially apply `mismatched_lifetime_syntaxes`)
 - rust-lang/rust#144650 (Additional tce tests)
 - rust-lang/rust#144659 (bootstrap: refactor mingw dist and fix gnullvm)
 - rust-lang/rust#144682 (Stabilize `strict_overflow_ops`)
 - rust-lang/rust#145026 (Update books)
 - rust-lang/rust#145033 (Reimplement `print_region` in `type_name.rs`.)
 - rust-lang/rust#145040 (rustc-dev-guide subtree update)

Failed merges:

 - rust-lang/rust#143857 (Port #[macro_export] to the new attribute parsing infrastructure)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-07 14:01:43 +00:00
bors
cd434309ef Auto merge of #144997 - BoxyUwU:bootstrap_bump, r=Mark-Simulacrum
bump bootstrap compiler to 1.90 beta

There were significantly less `cfg(bootstrap)` and `cfg(not(bootstrap))` this release. Presumably due to the fact that we change the bootstrap stage orderings to reduce the need for them and it was successful 🙏
2025-08-07 10:56:05 +00:00
Stuart Cook
bd8e7fdc54
Rollup merge of #145040 - tshepang:rdg-sync, r=Kobzol
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 1beca6333e.

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

r? `@ghost`
2025-08-07 20:49:49 +10:00
Stuart Cook
33f1862ef0
Rollup merge of #145033 - nnethercote:fix-144994, r=fmease
Reimplement `print_region` in `type_name.rs`.

Broken by rust-lang/rust#144776; this is reachable after all.

Fixes rust-lang/rust#144994.

The commit also adds a lot more cases to the `type-name-basic.rs`, because it's currently very anaemic. This includes some cases where region omission does very badly; these are marked with FIXME.

r? `@fmease`
2025-08-07 20:49:48 +10:00
Stuart Cook
3af6bb1f22
Rollup merge of #145026 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

5 commits in b2d1a0821e12a676b496d61891b8e3d374a8e832..3e9dc46aa563ca0c53ec826c41b05f10c5915925
2025-08-02 01:33:29 UTC to 2025-07-14 21:23:38 UTC

- Appendix B and Appendix D from tech review (rust-lang/book#4466)
- Chapter 21 from tech review (rust-lang/book#4464)
- Chapter 20 from tech review (rust-lang/book#4460)
- Chapter 19 from tech review (rust-lang/book#4446)
- Chapter 18 from tech review (rust-lang/book#4445)

## rust-lang/reference

12 commits in 1f45bd41fa6c17b7c048ed6bfe5f168c4311206a..1be151c051a082b542548c62cafbcb055fa8944f
2025-08-05 19:51:40 UTC to 2025-07-14 19:49:01 UTC

- Fix build output directory in README (rust-lang/reference#1950)
- Update `link_name` to use the attribute template (rust-lang/reference#1896)
- Update `no_link` to use the attribute template (rust-lang/reference#1898)
- Update `proc_macro_derive` to use the attribute template (rust-lang/reference#1888)
- Update `automatically_derived` to use the attribute template (rust-lang/reference#1884)
- Update `derive` to use the attribute template (rust-lang/reference#1883)
- Fix and clarify CR LF normalization and CR in string literals (rust-lang/reference#1944)
- glossary.md: tweak description of "dispatch" (rust-lang/reference#1938)
- add missing id, r[asm.operand-type.supported-operands.const] (rust-lang/reference#1939)
- &str and &[u8] have the same layout (rust-lang/reference#1848)
- Rename and rewrite the "question mark operator" (rust-lang/reference#1931)
- Change "allocated object" to "allocation". (rust-lang/reference#1930)

## rust-lang/rust-by-example

3 commits in e386be5f44af711854207c11fdd61bb576270b04..bd1279cdc9865bfff605e741fb76a0b2f07314a7
2025-08-04 13:41:04 UTC to 2025-08-02 15:41:59 UTC

- Improve the activity instructions in `print_display` (rust-lang/rust-by-example#1948)
- Minor fixes (whitespace, typo, i32->u32) (rust-lang/rust-by-example#1947)
- Document drawbacks of alternatives to match binding (rust-lang/rust-by-example#1946)
2025-08-07 20:49:47 +10:00
Stuart Cook
622b21e80b
Rollup merge of #144682 - nxsaken:strict_overflow_ops, r=Mark-Simulacrum
Stabilize `strict_overflow_ops`

Closes rust-lang/rust#118260
2025-08-07 20:49:47 +10:00
Stuart Cook
27ab08811f
Rollup merge of #144659 - mati865:gnullvm-vendor-libunwind, r=Kobzol
bootstrap: refactor mingw dist and fix gnullvm

Fixes https://github.com/rust-lang/rust/issues/144533

The first two commits are NFC and only clean up the code, paving the way for the third commit. That said, I think they are worthwhile even without that fix - reusing the same function for two different outcomes was confusing.

The third commit is the fix for https://github.com/rust-lang/rust/issues/144533, but due to the cross-compilation dance it requires a workaround to find the DLL since that logic really was meant only for Windows builders. That workaround is short-lived and will be removed as soon as gnullvm bootstraps itself.
2025-08-07 20:49:46 +10:00
Stuart Cook
3636042664
Rollup merge of #144650 - Borgerr:additional-tce-tests, r=WaffleLapkin,tgross35
Additional tce tests

r? `@oli-obk`

Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC.

Depends on rust-lang/rust#144232

Closes rust-lang/rust#144293
2025-08-07 20:49:45 +10:00
Stuart Cook
d8ed17a568
Rollup merge of #144601 - kornelski:cargo-fix-mismatched_lifetime_syntaxes, r=petrochenkov
Allow `cargo fix` to partially apply `mismatched_lifetime_syntaxes`

Workaround for https://github.com/rust-lang/rust/issues/144588#issuecomment-3128445308

Not all suggestions have to be hidden from `cargo fix`, only redundant ones. The redundant ones are already hidden from the user, so the same `tool_only` flag can be used to hide them from `cargo fix`. This way `cargo fix` will be able to correctly apply the fixes, and will apply only the fix that the compiler visibly suggests to the user.
2025-08-07 20:49:45 +10:00
Stuart Cook
21cf201797
Rollup merge of #144473 - zeroomega:rustc_inconsistency, r=Mark-Simulacrum
Address libunwind.a inconsistency issues in the bootstrap program

We noticed when building rustc multiple time in a roll, some files will not be consistent across the build despite the fact that they are built from same source under the same environment. This patch addresses the inconsistency issue we found on libunwind.a, by sorting the order of the files passed to the linker.
2025-08-07 20:49:44 +10:00
Stuart Cook
c97e64a01d
Rollup merge of #144439 - xizheyin:symbol-rs, r=petrochenkov
Introduce ModernIdent type to unify macro 2.0 hygiene handling

This pr introduce ModernIdent type to unify macro 2.0 hygiene handling

1. Added ModernIdent type. Wraps Ident and automatically calls `normalize_to_macros_2_0()`
2. Unified identifier normalization. Replaced scattered ident.normalize_to_macros_2_0() calls with ModernIdent::new(ident)

r? ````@petrochenkov````
2025-08-07 20:49:44 +10:00
Stuart Cook
238e3bf9e9
Rollup merge of #144369 - joshtriplett:mbe-expr-semi-deny-by-default, r=petrochenkov
Upgrade semicolon_in_expressions_from_macros from warn to deny

This is already warn-by-default, and a future compatibility warning (FCW) that warns in dependencies. Upgrade it to deny-by-default, as the next step towards hard error.

Per https://github.com/rust-lang/rust/issues/79813#issuecomment-3109105631
2025-08-07 20:49:43 +10:00
Stuart Cook
65114d6f81
Rollup merge of #144133 - oli-obk:stabilize-const-type-id, r=lcnr
Stabilize const TypeId::of

fixes rust-lang/rust#77125

# Stabilization report for `const_type_id`

## General design

### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?

N/A the constness was never RFCed

### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.

`const_type_id` was kept unstable because we are currently unable to stabilize the `PartialEq` impl for it (in const contexts), so we feared people would transmute the type id to an integer and compare that integer.

### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?

`TypeId::eq` is not const at this time, and will only become const once const traits are stable.

## Has a Call for Testing period been conducted? If so, what feedback was received?

This feature has been unstable for a long time, and most people just worked around it on stable by storing a pointer to `TypeId::of` and calling that at "runtime" (usually LLVM devirtualized the function pointer and inlined the call so there was no real performance difference).

A lot of people seem to be using the `const_type_id` feature gate (600 results for the feature gate on github: https://github.com/search?q=%22%23%21%5Bfeature%28const_type_id%29%5D%22&type=code)

We have had very little feedback except desire for stabilization being expressed.

## Implementation quality

Until these three PRs

* https://github.com/rust-lang/rust/pull/142789
* https://github.com/rust-lang/rust/pull/143696
* https://github.com/rust-lang/rust/pull/143736

there was no difference between the const eval feature and the runtime feature except that we prevented you from using `TypeId::of` at compile-time. These three recent PRs have hardened the internals of `TypeId`:

* it now contains an array of pointers instead of integers
* these pointers at compile-time (and in miri) contain provenance that makes them unique and prevents inspection. Both miri and CTFE will in fact error if you mess with the bits or the provenance of the pointers in any way and then try to use the `TypeId` for an equality check. This also guards against creating values of type `TypeId` by any means other than `TypeId::of`

### Summarize the major parts of the implementation and provide links into the code (or to PRs)

N/A see above

### Summarize existing test coverage of this feature

Since we are not stabilizing any operations on `TypeId` except for creating `TypeId`s, the test coverage of the runtime implementation of `TypeId` covers all the interesting use cases not in the list below

#### Hardening against transmutes

* https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id.rs
* https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id2.rs
* https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id3.rs
* https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id4.rs
* https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id5.rs

#### TypeId::eq is still unstable

* https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_cmp_type_id.rs

### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?

https://github.com/rust-lang/rust/issues/129014 is still unresolved, but it affects more the runtime version of `TypeId` than the compile-time.

### What FIXMEs are still in the code for that feature and why is it ok to leave them there?

none

### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization

* `@eddyb`
* `@RalfJung`

### Which tools need to be adjusted to support this feature. Has this work been done?

N/A

## Type system and execution rules

### What compilation-time checks are done that are needed to prevent undefined behavior?

Already covered above. Transmuting types with private fields to expose those fields has always been library UB, but for the specific case of `TypeId` CTFE and Miri will detect it if that is done in any way other than for reconstructing the exact same `TypeId` in another location.

### Does the feature's implementation need checks to prevent UB or is it sound by default and needs opt in in places to perform the dangerous/unsafe operations? If it is not sound by default, what is the rationale?

N/A

### Can users use this feature to introduce undefined behavior, or use this feature to break the abstraction of Rust and expose the underlying assembly-level implementation? (Describe.)

N/A

### What updates are needed to the reference/specification? (link to PRs when they exist)

Nothing more than what needs to exist for `TypeId` already.

## Common interactions

### Does this feature introduce new expressions and can they produce temporaries? What are the lifetimes of those temporaries?

N/A

### What other unstable features may be exposed by this feature?

N/A
2025-08-07 20:49:42 +10:00
Stuart Cook
412eb764f9
Rollup merge of #143929 - petrochenkov:depresolve, r=lcnr
Mark all deprecation lints in name resolution as deny-by-default and report-in-deps

This affects the next lints:
- `MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS` - https://github.com/rust-lang/rust/issues/144408
- `LEGACY_DERIVE_HELPERS` - https://github.com/rust-lang/rust/issues/79202
- `PRIVATE_MACRO_USE` - https://github.com/rust-lang/rust/issues/120192
- `OUT_OF_SCOPE_MACRO_CALLS` - https://github.com/rust-lang/rust/issues/144406
2025-08-07 20:49:42 +10:00
Stuart Cook
71f04692c3
Rollup merge of #143906 - LorrensP-2158466:miri-float-nondet-foreign-items, r=RalfJung
Miri: non-deterministic floating point operations in `foreign_items`

Part of [rust-lang/miri/#3555](https://github.com/rust-lang/miri/issues/3555#issue-2278914000), this pr does the `foreign_items` work.

Some things have changed since rust-lang/rust#138062 and rust-lang/rust#142514. I moved the "helpers" used for creating fixed outputs and clamping operations to their defined ranges to `math.rs`. These are now also extended to handle the floating-point operations in `foreign_items`. Tests in `miri/tests/float.rs` were changed/added.

Failing tests in `std` were extracted, run under miri with `-Zmiri-many-seeds=0..1000` and changed accordingly. Double checked with `-Zmiri-many-seeds`.

I noticed that the C standard doesn't specify the output ranges for all of its mathematical operations; it just specifies them as:
```
Returns
The sinh functions return sinh x.
```
So I used [Wolfram|Alpha](https://www.wolframalpha.com/).
2025-08-07 20:49:41 +10:00
Stuart Cook
995ca3e532
Rollup merge of #143808 - JonathanBrouwer:should_panic_parser, r=jdonszelmann
Port `#[should_panic]` to the new attribute parsing infrastructure

Ports `#[should_panic]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163

r? ```@jdonszelmann```
2025-08-07 20:49:40 +10:00
Stuart Cook
5e781d05f6
Rollup merge of #143764 - dianne:primary-binding-drop-order, r=Nadrieril,traviscross
lower pattern bindings in the order they're written and base drop order on primary bindings' order

To fix rust-lang/rust#142163, this PR does two things:
- Makes match arms base their drop order on the first sub-branch instead of the last sub-branch. Together with the second change, this makes bindings' drop order correspond to the relative order of when each binding first appears (i.e. the order of the "primary" bindings).
- Lowers pattern bindings in the order they're written (still treating the right-hand side of a ``@`` as coming before the binding on the left). In each sub-branch of a match arm, this is the order that would be obtained if the or-alternatives chosen in that sub-branch were inlined into the arm's pattern. This both affects drop order (making bindings in or-patterns not be dropped first) and fixes the issue in [this test](2a023bf80a/tests/ui/pattern/bindings-after-at/bind-by-copy-or-pat.rs) from rust-lang/rust#121716.

My approach to the second point is admittedly a bit trickier than may be necessary. To avoid passing around a counter when building `FlatPat`s, I've instead added just enough information to recover the original structure of the pattern's bindings from a `MatchTreeSubBranch`'s path through the `Candidate` tree. Some alternatives:
- We could use a counter, then sort bindings by their ordinals when making `MatchTreeSubBranch`es.
- I'd like to experiment with always merging sub-candidates and removing `test_remaining_match_pairs_after_or`; that would require lowering bindings and guards in a different way. That makes it a bigger change too, though, so I figure it might be simplest to start here.
- For a very big change, we could track which or-alternatives succeed at runtime to base drop order on the binding order in the particular alternatives matched.

This is a breaking change. It will need a crater run, language team sign-off, and likely updates to the Reference.

This will conflict with rust-lang/rust#143376 and probably also rust-lang/rust#143028, so they shouldn't be merged at the same time.

r? `@matthewjasper` or `@Nadrieril`
2025-08-07 20:49:39 +10:00
Stuart Cook
4529dd9192
Rollup merge of #143028 - dianne:let-else-storage, r=oli-obk,traviscross
emit `StorageLive` and schedule `StorageDead` for `let`-`else`'s bindings after matching

This PR removes special handling of `let`-`else`, so that `StorageLive`s are emitted and `StorageDead`s are scheduled only after pattern-matching has succeeded. This means `StorageDead`s will no longer appear for all of its bindings on the `else` branch (because they're not live yet) and its drops&`StorageDead`s will happen together like they do elsewhere, rather than having all drops first, then all `StorageDead`s.

This fixes rust-lang/rust#142056, and is therefore a breaking change. I believe it'll need a crater run and a T-lang nomination/fcp thereafter. Specifically, this makes drop-checking slightly more restrictive for `let`-`else` to match the behavior of other variable binding forms. An alternative approach could be to change the relative order of drops and `StorageDead`s for other binding forms to make drop-checking more permissive, but making that consistent would be a significantly more involved change.

r? mir
cc `````@dingxiangfei2009`````

`````@rustbot````` label +T-lang +needs-crater
2025-08-07 20:49:38 +10:00
Stuart Cook
b0fc38a362
Rollup merge of #140267 - jogru0:control_flow, r=dtolnay
implement continue_ok and break_ok for ControlFlow

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

r? ``````@dtolnay``````
2025-08-07 20:49:37 +10:00
Stuart Cook
1cd368a744
Rollup merge of #138689 - jedbrown:jed/nvptx-target-feature, r=ZuseZ4
add nvptx_target_feature

Tracking issue: #141468 (nvptx), which is part of #44839 (catch-all arches)
The feature gate is `#![feature(nvptx_target_feature)]`

This exposes the target features `sm_20` through `sm_120a` [as defined](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.1/llvm/lib/Target/NVPTX/NVPTX.td#L59-L85) by LLVM.

Cc: ``````@gonzalobg``````
``````@rustbot`````` label +O-NVPTX +A-target-feature
2025-08-07 20:49:36 +10:00
Stuart Cook
bcd50fd45f
Rollup merge of #137831 - estebank:auto-trait-err, r=compiler-errors
Tweak auto trait errors

Make suggestions to remove params and super traits verbose and make spans more accurate.

```
error[E0567]: auto traits cannot have generic parameters
  --> $DIR/auto-trait-validation.rs:6:19
   |
LL | auto trait Generic<T> {}
   |            -------^^^
   |            |
   |            auto trait cannot have generic parameters

error[E0568]: auto traits cannot have super traits or lifetime bounds
  --> $DIR/auto-trait-validation.rs:8:20
   |
LL | auto trait Bound : Copy {}
   |            -----   ^^^^
   |            |
   |            auto traits cannot have super traits or lifetime bounds
```

```
error[E0380]: auto traits cannot have associated items
  --> $DIR/issue-23080.rs:5:8
   |
LL | unsafe auto trait Trait {
   |                   ----- auto traits cannot have associated items
LL |     fn method(&self) {
   |        ^^^^^^
```
2025-08-07 20:49:36 +10:00
Samuel Tardieu
faba846a09
Fix typo in lint issue template (#15427)
Small typo I found while looking at recent lint requests/issues.

changelog: none
2025-08-07 08:24:01 +00:00
y21
a5af84c399 Fix "comparision" typo in new lint template 2025-08-07 10:09:15 +02:00
bors
9b1a30e5e6 Auto merge of #145014 - bjorn3:revert_preserve_debug_gdb_scripts, r=lqd
Revert "Preserve the .debug_gdb_scripts section"

https://github.com/rust-lang/rust/pull/143679 introduces a significant build time perf regression for ripgrep. Let's revert it such that we can investigate it without pressure.
2025-08-07 07:47:18 +00:00
Tshepang Mbambo
a730daa067
Merge pull request #2539 from rust-lang/rustc-pull
Rustc pull update
2025-08-07 09:06:25 +02:00
The rustc-josh-sync Cronjob Bot
e296468a47 Merge ref '6bcdcc73bd11' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 6bcdcc73bd11568fd85f5a38b58e1eda054ad1cd
Filtered ref: 6cc4ce79e1f8dc0ec5a2e18049b9c1a51dee3221

This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-07 04:18:21 +00:00
The rustc-josh-sync Cronjob Bot
4f96b2aa5e Prepare for merging from rust-lang/rust
This updates the rust-version file to 6bcdcc73bd11568fd85f5a38b58e1eda054ad1cd.
2025-08-07 04:18:12 +00:00
Nicholas Nethercote
8074e672f0 Reimplement print_region in type_name.rs.
Broken by #144776; this is reachable after all.

Fixes #144994.

The commit also adds a lot more cases to the `type-name-basic.rs`,
because it's currently very anaemic. This includes some cases where
region omission does very badly; these are marked with FIXME.
2025-08-07 12:46:33 +10:00
bors
61cb1e97fc Auto merge of #115746 - tgross35:unnamed-threads-panic-message, r=cuviper
Print thread ID in panic message

`panic!` does not print any identifying information for threads that are
unnamed. However, in many cases, the thread ID can be determined.

This changes the panic message from something like this:

    thread '<unnamed>' panicked at src/main.rs:3:5:
    explicit panic

To something like this:

    thread '<unnamed>' (12345) panicked at src/main.rs:3:5:
    explicit panic

Stack overflow messages are updated as well.

This change applies to both named and unnamed threads. The ID printed is
the OS integer thread ID rather than the Rust thread ID, which should
also be what debuggers print.

try-job: aarch64-apple
try-job: aarch64-gnu
try-job: dist-apple-various
try-job: dist-various-*
try-job: dist-x86_64-freebsd
try-job: dist-x86_64-illumos
try-job: dist-x86_64-netbsd
try-job: dist-x86_64-solaris
try-job: test-various
try-job: x86_64-gnu
try-job: x86_64-mingw-1
try-job: x86_64-msvc-1
2025-08-07 02:32:55 +00:00
ash
916fb6a464 explicit tail call tests with indirect operands in LLVM, small test for indexing into a function table as described by RFC 3407 2025-08-06 18:13:56 -06:00
Trevor Gross
289fe36d37 Print thread ID in panic message if thread name is unknown
`panic!` does not print any identifying information for threads that are
unnamed. However, in many cases, the thread ID can be determined.

This changes the panic message from something like this:

    thread '<unnamed>' panicked at src/main.rs:3:5:
    explicit panic

To something like this:

    thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5:
    explicit panic

Stack overflow messages are updated as well.

This change applies to both named and unnamed threads. The ID printed is
the OS integer thread ID rather than the Rust thread ID, which should
also be what debuggers print.
2025-08-06 23:59:47 +00:00
Trevor Gross
0c8b3870bd Add normalization for thread IDs in panic messages
So we don't need to add normalization to every test that includes a
panic message, add a global normalization to compiletest.
2025-08-06 23:59:46 +00:00
bors
6bcdcc73bd Auto merge of #145020 - GuillaumeGomez:rollup-5prs9kw, r=GuillaumeGomez
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#144195 (Parser: Recover from attributes applied to types and generic args)
 - rust-lang/rust#144794 (Port `#[coroutine]` to the new attribute system)
 - rust-lang/rust#144835 (Anonymize binders in tail call sig)
 - rust-lang/rust#144861 (Stabilize `panic_payload_as_str` feature)
 - rust-lang/rust#144917 (Enforce tail call type is related to body return type in borrowck)
 - rust-lang/rust#144948 (we only merge candidates for trait and normalizes-to goals)
 - rust-lang/rust#144956 (Gate const trait syntax)
 - rust-lang/rust#144970 (rustdoc: fix caching of intra-doc links on reexports)
 - rust-lang/rust#144972 (add code example showing that file_prefix treats dotfiles as the name of a file, not an extension)
 - rust-lang/rust#144975 (`File::set_times`: Update documentation and example to support setting timestamps on directories)
 - rust-lang/rust#144977 (Fortify generic param default checks)
 - rust-lang/rust#144996 (simplifycfg: Mark as changed when start is modified in collapse goto chain)
 - rust-lang/rust#144998 (mir: Do not modify NonUse in `super_projection_elem`)
 - rust-lang/rust#145000 (Remove unneeded `stage` parameter when setting up stdlib Cargo)
 - rust-lang/rust#145008 (Fix rustdoc scrape examples crash)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-06 23:23:26 +00:00
rustbot
790682b089 Update books 2025-08-07 01:02:58 +02:00
Tshepang Mbambo
976bceeea2
Merge pull request #2538 from lolbinarycat/patch-6
Link from "Overview of the compiler § Queries" to the Queries chapter
2025-08-06 22:16:30 +02:00
lolbinarycat
162b908eb6
Make link relative an link to md not html 2025-08-06 15:01:41 -05:00
Jonathan Brouwer
4281e05a20
Changes to the tests for the #[should_panic] port
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-06 21:38:00 +02:00
Jonathan Brouwer
f7ad4065fe
Port #[should_panic] to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-06 21:37:51 +02:00
Guillaume Gomez
d369a1fe5e
Rollup merge of #145008 - GuillaumeGomez:fix-rustdoc-scrape-examples-crash, r=fmease
Fix rustdoc scrape examples crash

Fixes rust-lang/rust#144752.

The regression was introduced in https://github.com/rust-lang/rust/pull/144600. Although I don't understand why it is an issue currently, this allows to bypass the failure for now until we can figure out what's wrong as it's currently blocking new `bevy`'s release.

cc `@alice-i-cecile`
r? `@fmease`
2025-08-06 21:29:35 +02:00
Guillaume Gomez
c17f50be73
Rollup merge of #145000 - Kobzol:std-cargo-stage, r=jieyouxu
Remove unneeded `stage` parameter when setting up stdlib Cargo

The standard library can't be built using a compiler that has a lower stage than 1 anymore, so the condition was useless (you can test that with e.g. `x doc std --stage 0`, which is broken - I aim to forbid doing that soon).

Found this while doing an unrelated cleanup.

r? `@jieyouxu`
2025-08-06 21:29:34 +02:00
Guillaume Gomez
c152aa87a1
Rollup merge of #144998 - dianqk:visit-no-use-proj, r=cjgillot
mir: Do not modify NonUse in `super_projection_elem`

Split from rust-lang/rust#142771.
r? cjgillot
2025-08-06 21:29:34 +02:00
Guillaume Gomez
e56c24129e
Rollup merge of #144996 - dianqk:simplifycfg-collapse_goto_chain-changed, r=cjgillot
simplifycfg: Mark as changed when start is modified in collapse goto chain

Split from rust-lang/rust#142771.
r? cjgillot
2025-08-06 21:29:33 +02:00