Skip to content

[pull] master from rust-lang:master#507

Merged
pull[bot] merged 13 commits intoshigma:masterfrom
rust-lang:master
Oct 3, 2025
Merged

[pull] master from rust-lang:master#507
pull[bot] merged 13 commits intoshigma:masterfrom
rust-lang:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Oct 3, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

dianqk and others added 13 commits October 2, 2025 14:55
for example, if we're showing `Iterator::next`,
we don't need to also show `Range::next` in the results.

Co-authored-by: Michael Howell <michael@notriddle.com>
If the `LocalRef` is `LocalRef::Place`, we can refer to it directly,
because the local of place is an indirect pointer.
Such a statement is `_1 = &(_2.1)`.
If the `LocalRef` is `LocalRef::Operand`,
the `OperandRef` should provide the pointer of the reference.
Such a statement is `_1 = &((*_2).1)`.

But there is a special case that hasn't been handled, scalar pairs like `(&[i32; 16], i32)`.
…uillaumeGomez,notriddle

If a trait item appears in rustdoc search, hide the corrosponding impl items

fixes #138251

cc `@notriddle`
Introduce debuginfo to statements in MIR

The PR introduces support for debug information within dead statements. Currently, only the reference statement is supported, which is sufficient to fix #128081.

I don't modify Stable MIR, as I don't think we need debug information when using it.

This PR represents the debug information for the dead reference statement via `#dbg_value`. For example, `let _foo_b = &foo.b` becomes `#dbg_value(ptr %foo, !22, !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value), !26)`. You can see this here: https://rust.godbolt.org/z/d43js6adv.

The general principle for handling debug information is to never provide less debug information than the optimized LLVM IR.

The current rules for dropping debug information in this PR are:

- If the LLVM IR cannot represent a reference address, it's replaced with poison or simply dropped. For example, see: https://rust.godbolt.org/z/shGqPec8W. I'm using poison in all such cases now.
- All debuginfos is dropped when merging multiple successor BBs. An example is available here: https://rust.godbolt.org/z/TE1q3Wq6M.

I doesn't drop debuginfos in `MatchBranchSimplification`, because LLVM also pick one branch for it.
@pull pull bot locked and limited conversation to collaborators Oct 3, 2025
@pull pull bot added the ⤵️ pull label Oct 3, 2025
@pull pull bot merged commit 8b6b15b into shigma:master Oct 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants