304366 Commits

Author SHA1 Message Date
Jacob Pratt
5cfdbd6c08
Rollup merge of #145218 - nilptr:nilptr/feat/lldb-enum-pretty-printer, r=Mark-Simulacrum
[Debuginfo] improve enum value formatting in LLDB for better readability

> TL;DR: When debugging with CodeLLDB, I noticed enum values were often hard to read because LLDB lists every possible variant, resulting in a verbose and cluttered view, even though only one variant is actually valid. Interestingly, raw enum types display nicely. After some investigation, I found that `&enum` values get classified as `Other`, so it falls back to `DefaultSyntheticProvider`, which causes this verbose output.

## What does this PR do?

This PR contains 2 commits:

1. change the enum value formatting from showing 2 separate fields (`value` for attached data and `$discr$` for the discriminator) to a concise `<readable variant name>: <attached data>` format
2. dereference pointer types in `classify_rust_type` so that it can return more accurate type for reference type

## Self-test proof

Before:

<img width="1706" height="799" alt="before" src="https://github.com/user-attachments/assets/b66c7e22-990a-4da5-9036-34e3f9f62367" />

After:

<img width="1541" height="678" alt="after" src="https://github.com/user-attachments/assets/36db32e2-f822-4883-8f17-cb8067e509f6" />
2025-08-22 22:00:49 -04:00
Jacob Pratt
2dbd411d22
Rollup merge of #144897 - fee1-dead-contrib:raw_lifetimes_printing, r=fmease
print raw lifetime idents with r#

This replaces rust-lang/rust#143185 and fixes rust-lang/rust#143150

cc ``@fmease``
2025-08-22 22:00:47 -04:00
Jacob Pratt
2bd39222cd
Rollup merge of #144648 - connortsui20:nonpoison_rwlock, r=Mark-Simulacrum
Implementation: `#[feature(nonpoison_rwlock)]`

Tracking Issue: https://github.com/rust-lang/rust/issues/134645

This PR continues the effort made in https://github.com/rust-lang/rust/pull/144022 by adding the implementation of `nonpoison::rwlock`.

Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable.

### Related PRs

- `nonpoison_condvar` implementation: https://github.com/rust-lang/rust/pull/144651
- `nonpoison_once` implementation: https://github.com/rust-lang/rust/pull/144653
2025-08-22 22:00:46 -04:00
Jacob Pratt
bc4a6431eb
Rollup merge of #142185 - saethlin:refprop-moves, r=cjgillot
Convert moves of references to copies in ReferencePropagation

This is a fix for https://github.com/rust-lang/rust/issues/141101.

The root cause of this miscompile is that the SsaLocals analysis that MIR transforms use is supposed to detect locals that are only written to once, in their single assignment. But that analysis is subtly wrong; it does not consider `Operand::Move` to be a write even though the meaning ascribed to `Operand::Move` (at least as a function parameter) by Miri is that the callee may have done arbitrary writes to the caller's Local that the Operand wraps (because `Move` is pass-by-pointer). So Miri conwiders `Operand::Move` to be a write but both the MIR visitor system considers it a read, and so does SsaLocals.

I have tried fixing this by changing the `PlaceContext` that is ascribed to an `Operand::Move` to a `MutatingUseContext` but that seems to have borrow checker implications, and changing SsaLocals seems to have wide-ranging regressions in MIR optimizations.

So instead of doing those, this PR adds a new kludge to ReferencePropagation, which follows the same line of thinking as the kludge in CopyProp that solves this same problem inside that pass: a5584a8fe1/compiler/rustc_mir_transform/src/copy_prop.rs (L65-L98)
2025-08-22 22:00:46 -04:00
Jacob Pratt
467c89cd0b
Rollup merge of #137457 - JayAndJef:issue-132802-fix, r=Kobzol
Fix host code appearing in Wasm binaries

This is a direct fix for issue [132802](https://github.com/rust-lang/rust/issues/132802).
Followed the outline as follows:
> * give a hard error in bootstrap when using gcc to compile for wasm
> * change our CI to use clang instead of gcc
> * add a test that compiling a sample program for wasm32-unknown doesn't give any linker warnings

The `test-various` ci job was also changed.

try-job: test-various
try-job: dist-various-1
try-job: dist-various-2
try-job: x86_64-msvc-1
2025-08-22 22:00:45 -04:00
Jacob Pratt
85c9af57f4
Rollup merge of #137396 - compiler-errors:param-default, r=fmease
Recover `param: Ty = EXPR`

Fixes #137310

Pretty basic recovery here, but better than giving an unexpected token error.
2025-08-22 22:00:44 -04:00
Jacob Pratt
dbc38eed1d
Rollup merge of #132087 - ijchen:issue-131770-fix, r=dtolnay
Fix overly restrictive lifetime in `core::panic::Location::file` return type

Fixes #131770 by relaxing the lifetime to match what's stored in the struct. See that issue for more details and discussion.

Since this is a breaking change, I think a crater run is in order. Since this change should only have an effect at compile-time, I think just a check run is sufficient.
2025-08-22 22:00:44 -04:00
bit-aloo
b244f29777
remove default opts from config 2025-08-23 07:30:27 +05:30
bors
78b89ebb6b Auto merge of #145469 - cjgillot:split-transmute, r=nnethercote
Split transmute check from HIR typeck

This resolves a FIXME in the implementation of `check_transmute`.

`check_transmute` needs to compute type layout, hence needing to see reveal opaques and all type aliases.
Having this inside typeck causes a cycle. For instance: `tests/ui/impl-trait/transmute/in-defining-scope.rs`.

This PR moves the transmute check outside of typeck, by putting the list of deferred transmute checks in typeck results.
2025-08-23 01:58:57 +00:00
Waffle Lapkin
78c552d76f
suggest using @bors try jobs=... 2025-08-23 02:26:49 +02:00
Weihang Lo
75dc02878d
Update cargo 2025-08-22 19:32:50 -04:00
Guillaume Gomez
0e9b126695 Also support statements and patterns for macro expansion 2025-08-23 00:57:29 +02:00
Guillaume Gomez
bd5f3d7678 Improve code 2025-08-23 00:57:29 +02:00
Guillaume Gomez
b968ef8d19 Make macro expansion feature buttons accessible 2025-08-23 00:57:29 +02:00
Guillaume Gomez
f8b8cc4cce Do macro expansion at AST level rather than HIR 2025-08-23 00:57:29 +02:00
Guillaume Gomez
ab000e15e1 Clean up computation of macro expansion span and correctly handle spans open inside expansion spans 2025-08-23 00:57:28 +02:00
Guillaume Gomez
3de3b279f0 Go around firefox bug 2025-08-23 00:57:28 +02:00
Guillaume Gomez
e6f9e2e623 Add GUI test for --generate-macro-expansion option 2025-08-23 00:57:28 +02:00
Guillaume Gomez
b7a415017c Update rustdoc-gui tests 2025-08-23 00:57:28 +02:00
Guillaume Gomez
6c1b481e7b Correctly handle multiple macro expansions on a same line 2025-08-23 00:57:28 +02:00
Guillaume Gomez
18739ee997 Update tests/run-make/rustdoc-default-output test 2025-08-23 00:57:28 +02:00
Guillaume Gomez
36421286d5 Add documentation for --generate-macro-expansion 2025-08-23 00:57:28 +02:00
Guillaume Gomez
f8ce37621a Add new unstable --generate-macro-expansion rustdoc command line flag 2025-08-23 00:57:28 +02:00
Guillaume Gomez
ba3099f60b Add support for macro expansion in rustdoc source code pages 2025-08-23 00:57:28 +02:00
bors
6545b05638 Auto merge of #145494 - cjgillot:span-decode-once, r=lqd
Only unpack span data once to compute end_point and next_point.

Split from https://github.com/rust-lang/rust/pull/144930
2025-08-22 21:43:06 +00:00
Rémy Rakic
5a2b70b202 add regression test for issue 142488
there are a lot of MCVEs there, so this is only a few of them, not all
duplicates that were opened
2025-08-22 20:42:25 +00:00
Camille Gillot
0327e2b87e Bless rustdoc-ui. 2025-08-22 20:31:24 +00:00
Jana Dönszelmann
f6ac728aad
convert strings to symbols in attr diagnostics 2025-08-22 22:30:00 +02:00
Rémy Rakic
1f587e4d4f Revert "Detect method not being present that is present in other tuple types"
This reverts commit 585a40963ea59808e74803f8610659a505b145e0.
2025-08-22 20:26:52 +00:00
Camille Gillot
7494d927cb Fix stderr normalization. 2025-08-22 20:10:27 +00:00
Camille Gillot
9fe0b28db2 Simplify implementation. 2025-08-22 20:10:27 +00:00
Camille Gillot
a3c878f813 Separate transmute checking from typeck. 2025-08-22 20:10:27 +00:00
Nia Espera
7046ce89c6
interpret/allocation: get_range on ProvenanceMap 2025-08-22 21:49:48 +02:00
Michael Goulet
6caa586f57
Recover param: Ty = EXPR 2025-08-22 21:45:28 +02:00
Jakub Beránek
6315b4973a
Add warning to the Builder::llvm_config function 2025-08-22 21:43:14 +02:00
Jakub Beránek
c064521cc7
Ship LLVM tools for the correct target when cross-compiling 2025-08-22 21:43:14 +02:00
Connor Tsui
06eb782c4e
modify LazyLock poison panic message
Fixes an issue where if the underlying `Once` panics because it is
poisoned, the panic displays the wrong message.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
2025-08-22 14:59:34 -04:00
bors
46c219bd24 Auto merge of #145352 - Shourya742:2025-08-12-remove-default-config, r=Kobzol
Remove default config from bootstrap

This PR removes the default config initialization from parse_inner, as it introduced many assumptions during config setup. Instead, each variable is now manually initialized to eliminate certain invariants in parse_inner and streamline the process.

r? `@Kobzol`
2025-08-22 18:35:26 +00:00
Jakub Beránek
7785efd1b0
Rename llvm_config to host_llvm_config to avoid confusion 2025-08-22 20:25:48 +02:00
Jens Reidel
65847490bb
Add aarch64_be-unknown-hermit target
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-08-22 20:25:11 +02:00
Esteban Küber
049c32797b On E0277, point at type that doesn't implement bound
When encountering an unmet trait bound, point at local type that doesn't implement the trait:

```
error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied
  --> $DIR/issue-64855.rs:9:19
   |
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
   |                   ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |
help: the trait `Foo` is not implemented for `Bar<T>`
  --> $DIR/issue-64855.rs:9:1
   |
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
   | ^^^^^^^^^^^^^^^^^
```
2025-08-22 17:55:15 +00:00
okaneco
e42c1b1296 Stabilize round_char_boundary feature 2025-08-22 13:42:38 -04:00
Martin Nordholts
9637774e32 ci: Begin running ui tests with rust.debuginfo-level-tests=1
To reduce risk of regressing on generating debuginfo e.g. in the form of
ICE:s. This will also ensure that future ui tests support different
debuginfo levels.

When I looked at run time for different CI jobs, **x86_64-gnu-debug**
was far from the bottle neck, so it should be fine to make it perform
more work.
2025-08-22 17:27:47 +02:00
bors
d20509c2a0 Auto merge of #145749 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2025-08-22 15:09:33 +00:00
binarycat
771c6415b2 main.js: only call window.rustdocToggleSrcSidebar if it exists 2025-08-22 10:07:33 -05:00
binarycat
4a2d6dfe26 typecheck: add nonnull around element known to exist 2025-08-22 10:07:33 -05:00
binarycat
cb572cb876 typecheck tooltipBlurHandler 2025-08-22 10:07:32 -05:00
binarycat
dfec2bbdca typecheck window.CURRENT_TOOLTIP_ELEMENT 2025-08-22 10:07:32 -05:00
Ed Page
f43f974b9e fix(lexer): Allow '-' in the infostring continue set
This more closely matches the RFC and what our T-lang contact has asked
for, see https://github.com/rust-lang/rust/issues/136889#issuecomment-3212715312
2025-08-22 09:26:19 -05:00
Ed Page
9b0ddec2a8 test(frontmatter): Show current hyphen behavior 2025-08-22 09:17:41 -05:00