new_without_default doesn't trigger on const fn · Issue #10877 · rust-lang/rust-clippy (original) (raw)

@robertbastian

Summary

Triggers on pub fn new() -> Self but not pub const fn new() -> Self

Lint Name

new_without_default

Reproducer

I tried this code:

pub struct Foo;

impl Foo { pub const fn new() -> { Self } }

I expected to see this happen: lint triggers

Instead, this happened: lint doesn't trigger

Version

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=256edf22e6afcae3a1f23322a19851de