Skip to content

Don't trigger const_is_empty lint inside const blocks#13114

Closed
tesuji wants to merge 2 commits into
rust-lang:masterfrom
tesuji:fix_const_is_empty
Closed

Don't trigger const_is_empty lint inside const blocks#13114
tesuji wants to merge 2 commits into
rust-lang:masterfrom
tesuji:fix_const_is_empty

Conversation

@tesuji

@tesuji tesuji commented Jul 17, 2024

Copy link
Copy Markdown
Contributor

changelog: [const_is_empty] Don't trigger lint inside const blocks
Fixes #13106 .

@rustbot

rustbot commented Jul 17, 2024

Copy link
Copy Markdown
Collaborator

r? @dswij

rustbot has assigned @dswij.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 17, 2024
@dswij

dswij commented Aug 3, 2024

Copy link
Copy Markdown
Member

This does mean that we're going to ignore all const blocks, e.g. this is going to be ignored too.

const {
   "".is_empty();
}

Is there an alternative we can do?

I think we can also check for assert!. This FP seems to be for compile-time assertions.

@tesuji

tesuji commented Aug 7, 2024

Copy link
Copy Markdown
Contributor Author

You have a good point.
Unfortunately I don't have enough motivation for fixing clippy right now.
Closing for now.
Thanks for your thoughful review!

@tesuji tesuji closed this Aug 7, 2024
@tesuji tesuji deleted the fix_const_is_empty branch August 7, 2024 03:50
@dswij

dswij commented Aug 7, 2024

Copy link
Copy Markdown
Member

Thanks for taking the time to open this PR!

bors added a commit that referenced this pull request Oct 20, 2024
Don't trigger `const_is_empty` for inline const assertions

Close #13106

Considered case was described [here](#13114 (comment))

changelog [`const_is_empty`]: skip const_is_empty for inline const assertions
bors added a commit that referenced this pull request Oct 22, 2024
Don't trigger `const_is_empty` for inline const assertions

Close #13106

Considered case was described [here](#13114 (comment))

changelog [`const_is_empty`]: skip const_is_empty for inline const assertions
bors added a commit that referenced this pull request Oct 24, 2024
Don't trigger `const_is_empty` for inline const assertions

Close #13106

Considered case was described [here](#13114 (comment))

changelog: [`const_is_empty`]: skip const_is_empty for inline const assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

const_is_empty emits for inline const assertions

3 participants