Skip to content

Unimplement fmt::Debug for c_void - #160115

Open
Jules-Bertholet wants to merge 1 commit into
rust-lang:mainfrom
Jules-Bertholet:no-c-void-debug
Open

Unimplement fmt::Debug for c_void#160115
Jules-Bertholet wants to merge 1 commit into
rust-lang:mainfrom
Jules-Bertholet:no-c-void-debug

Conversation

@Jules-Bertholet

@Jules-Bertholet Jules-Bertholet commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Taking a shared reference to c_void is never correct, and this impl should never have been added.

This is obviously a breaking change, so needs crater and FCP.

@rustbot label T-libs-api needs-fcp A-FFI

See also #159986, #159935

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 29, 2026
@rustbot

rustbot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

r? @Darksonn

rustbot has assigned @Darksonn.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from 7 candidates

@rustbot rustbot added A-FFI Area: Foreign function interface (FFI) needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 29, 2026
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 29, 2026
@rust-log-analyzer

This comment has been minimized.

Taking a shared reference to `c_void` is always wrong.
@rust-bors

rust-bors Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 82b0460 (82b04601f285a69721a2b7d1db460b48a7edeef4)
Base parent: 26ae60a (26ae60a9eeb20b4935be49d7a931a650fa1d2923)

@theemathas

Copy link
Copy Markdown
Contributor

@craterbot check

@craterbot

Copy link
Copy Markdown
Collaborator

👌 Experiment pr-160115 created and queued.
🤖 Automatically detected try build 82b0460
⚠️ Try build based on commit 03942bc, but latest commit is 588c33e. Did you forget to make a new try build?
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 29, 2026
@clarfonthey

clarfonthey commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Worth also commenting that there's a blanket Debug impl for *const T and *mut T, and so, this would not affect anything reasonable that uses c_void from deriving Debug.

(Regardless, it would be unsound to actually access data inside these pointers without verifying it's valid, but I could imagine some scenario where someone thought those only implemented Debug when T: Debug, for some weird reason. Those weird reasons don't exist.)

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

Labels

A-FFI Area: Foreign function interface (FFI) needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-crater Status: Waiting on a crater run to be completed. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants