Skip to content

new_without_default doesn't trigger on const fn #10877

Closed
@robertbastian

Description

@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

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions