Skip to content

Express c_void pointer types as types derived from NULL in LLVM DI - #166441

Open
vadorovsky wants to merge 1 commit into
rust-lang:mainfrom
vadorovsky:vad/c-void-di
Open

vadorovsky wants to merge 1 commit into
rust-lang:mainfrom
vadorovsky:vad/c-void-di

Conversation

@vadorovsky

@vadorovsky vadorovsky commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

LLVM expects void pointer types (e.g. const *void, *void in C, *const c_void, *mut c_void in Rust) to be expressed as types derived from NULL. [0] Furthermore, c_void is a lang item, therefore treating it as a special case, instead of emitting the underlying enum as a base type, is appropriate.

[0] https://github.com/llvm/llvm-project/blob/llvmorg-23.1.6/llvm/docs/LangRef.md?plain=1#L6819

r? @workingjubilee

Fixes: #166408

LLVM expects void pointer types (e.g. `const *void`, `*void` in C,
`*const c_void`, `*mut c_void` in Rust) to be expressed as types derived
from NULL. [0] Furthermore, `c_void` is a lang item, therefore treating
it as a special case, instead of emitting the underlying `enum` as a
base type, is appropriate.

[0] https://github.com/llvm/llvm-project/blob/llvmorg-23.1.6/llvm/docs/LangRef.md?plain=1#L6819
@rustbot

rustbot commented Nov 24, 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 24, 2026
@rustbot

rustbot commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

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. 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.

c_void's debug info leaks the implementation detail (an inner enum)

3 participants