rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

Support generic arguments in `disallowed_types`

Open hkalbasi opened this issue 6 months ago • 1 comments

What it does

I want to ban Result<_, String> on my project, but current disallowed_types lint only accepts simple paths.

Advantage

The same advantages of disallowed_types but for more types.

Drawbacks

It will increase complexity of the implementation, probably.

Example

fn foo() -> Result<(), String>

Could be written as:

fn foo() -> Result<(), TypedErr>

Comparison with existing lints

It can make some lints such as result_unit_err redundant.

Additional Context

No response

hkalbasi avatar May 21 '26 14:05 hkalbasi

@rustbot claim

moses7054 avatar May 28 '26 09:05 moses7054