Add a count parameter to the expect attribute#3400
Add a count parameter to the expect attribute#3400JarredAllen wants to merge 2 commits intorust-lang:masterfrom
Conversation
|
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. |
| # Unresolved questions | ||
| [unresolved-questions]: #unresolved-questions | ||
|
|
||
| - Can we allow `#[expect(..., count = 0)]` with some useful behavior? What about |
There was a problem hiding this comment.
expect(lint, count = 0) seems like it should be the same as deny(lint).
There was a problem hiding this comment.
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.
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. |
This RFC proposes extending the
expectattribute` from #2383Rendered