Skip to content

Honor private type aliases in allow-unwrap-types - #124

Open
charliermarsh wants to merge 1 commit into
charlie/track-configured-module-namesfrom
charlie/expand-private-unwrap-aliases
Open

charliermarsh wants to merge 1 commit into
charlie/track-configured-module-namesfrom
charlie/expand-private-unwrap-aliases

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

With allow-unwrap-types = ["sample::Payload"], a private type Payload = Option<u32>; in the library should let the binary unwrap an Option<u32>. Ohm can reject the call. If the library imports the alias under another name and then changes it to Option<u64>, an incremental check can crash.

We now look up allowed types the same way we look up configured bans. We read private aliases from the current metadata and expand each alias once per lint pass, even if the crate never calls unwrap or expect. After the edit, Clippy reports the Option<u32> call again.

All 3,448 checks matched stock Clippy, including 1,584 with nested types. Public aliases and clients without the setting continued to use the same compiler jobs and inputs.

Closes #123.

@charliermarsh
charliermarsh marked this pull request as ready for review November 25, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant