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

Add a count parameter to the expect attribute #3400

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JarredAllen
Copy link

@JarredAllen JarredAllen commented Mar 13, 2023

This RFC proposes extending the expect attribute` from #2383

Rendered

@xFrednet
Copy link
Member

Hey and thank you for the RFC! Currently, there is a discussion in the tracking issue rust-lang/rust#54503 and on Zulip what lint emission should actually be suppressed and fulfill the lint expectation. I would recommend putting this RFC on hold, until a decision was made in that regard.

@xFrednet xFrednet added the T-lang Relevant to the language team, which will review and decide on the RFC. label Mar 13, 2023
# Unresolved questions
[unresolved-questions]: #unresolved-questions

- Can we allow `#[expect(..., count = 0)]` with some useful behavior? What about
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect(lint, count = 0) seems like it should be the same as deny(lint).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I could see count = 0 being convenient for a tool that decreases the expected count when it is too high. Such a tool would then not have to deal with this edge case.

In my mind expect(lint, count = 0) should compile with a warning (or clippy lint) suggesting using deny instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants