Skip to content

Add disallowed_pub_return_types lint#16997

Open
orthros wants to merge 1 commit into
rust-lang:masterfrom
orthros:disallowed_pub_return_types
Open

Add disallowed_pub_return_types lint#16997
orthros wants to merge 1 commit into
rust-lang:masterfrom
orthros:disallowed_pub_return_types

Conversation

@orthros
Copy link
Copy Markdown

@orthros orthros commented May 11, 2026

changelog: [disallowed_pub_return_types]: New lint that checks the return values of all pub functions, methods, and trait methods within a crate, emitting a warning if any proscribed types are returned.

Configurable via disallowed-pub-return-types in clippy.toml. This is intended to prevent internal error types (e.g., anyhow::Result) from leaking into public APIs.

@rustbot rustbot added the needs-fcp PRs that add, remove, or rename lints and need an FCP label May 11, 2026
@orthros orthros force-pushed the disallowed_pub_return_types branch 3 times, most recently from 060c36b to db19d27 Compare May 11, 2026 19:55
@orthros orthros marked this pull request as ready for review May 11, 2026 20:04
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 11, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 11, 2026

r? @Jarcho

rustbot has assigned @Jarcho.
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: 7 candidates
  • 7 candidates expanded to 7 candidates
  • Random selection from Jarcho, llogiq, samueltardieu

This lint checks the return values of all `pub` functions, methods, and trait
methods within a crate, emitting a warning if any proscribed types are returned.

Configurable via `disallowed-pub-return-types` in `clippy.toml`. This is intended
to prevent internal error types (e.g., `anyhow::Result`) from leaking into public
APIs.

changelog: [`disallowed_pub_return_types`]: New lint
@orthros orthros force-pushed the disallowed_pub_return_types branch from db19d27 to e7d5080 Compare May 11, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-fcp PRs that add, remove, or rename lints and need an FCP S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants