Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new_without_default could include blanket impls #13668

Open
CGamesPlay opened this issue Nov 9, 2024 · 0 comments
Open

new_without_default could include blanket impls #13668

CGamesPlay opened this issue Nov 9, 2024 · 0 comments
Labels
A-lint Area: New lints

Comments

@CGamesPlay
Copy link

What it does

Playground link

The existing new_without_default lint could be expanded to catch smart pointers that have a blanket impl Default, such as Arc, Mutex, etc.

Advantage

Expands on the advantages of the existing new_without_default lint.

Drawbacks

No response

Example

pub struct Bar;

impl Bar {
    #[expect(clippy::new_without_default)]
    pub fn new() -> std::sync::Arc<Self> { Arc::new(Self) }
}
@CGamesPlay CGamesPlay added the A-lint Area: New lints label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

1 participant