Skip to content

Conversation

JarredAllen
Copy link

@JarredAllen JarredAllen commented Mar 13, 2023

This RFC proposes extending the expect attribute` from #2383

Rendered

@xFrednet
Copy link

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.

@JarredAllen
Copy link
Author

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.

The decision has been reached and the attribute has been stabilized, so can we un-hold this RFC? I'd still love to see this feature happen.

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