Skip to content

debuginfo: do not treat all ZST return types as void - #166307

Open
Darksonn wants to merge 1 commit into
rust-lang:mainfrom
Darksonn:debuginfo-zst-return-type
Open

Darksonn wants to merge 1 commit into
rust-lang:mainfrom
Darksonn:debuginfo-zst-return-type

Conversation

@Darksonn

@Darksonn Darksonn commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Currently debuginfo does not report a return type when the return type is a ZST. This is an issue for tools using the debuginfo to detect signature changes, as changing -> () to/from -> Token is an important API change even if ABI-compatible.

Note that most ZST types are ABI compatible with each other, but debuginfo does not take such things into account elsewhere, so I don't see why it should here. For example, ZST arguments are also ignored in the ABI, but they are still included in the debuginfo.

In the past, debuginfo actually did check for () specifically instead of ZST, but this was changed as part of #65947 in a refactor. As far as I can tell, the distintion between these was not discussed in that PR and I think the change was unintentional.

See prior discussion: #t-compiler > Quality of DWARF information @ 💬

@rustbot label llm-assisted
r? dingxiangfei2009

LLM-disclosure: Implementation and test was written by LLM.

@rustbot

rustbot commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_codegen_llvm/src/debuginfo

cc @Walnut356

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 21, 2026
@rustbot rustbot added the llm-assisted An LLM-assisted PR as defined by the LLM policy. Requires ahead-of-time consent by assignee. label Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. llm-assisted An LLM-assisted PR as defined by the LLM policy. Requires ahead-of-time consent by assignee. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants