Allow #[deny(..)]
inside #[forbid(..)]
as a no-op with a warning
Forbid cannot be overriden. When someome tries to do this anyways, it results in a hard error. That makes sense. Except it doesn't, because macros. Macros may reasonably use `#[deny]` in their expansion to assert that their expanded code follows the lint. This is doesn't work when the output gets expanded into a `forbid()` context. This is pretty silly, since both the macros and the code agree on the lint! Therefore, we allow `#[deny(..)]`ing a lint that's already forbidden, keeping the level at forbid.
This commit is contained in:
parent
3a85d3fa78
commit
e78d78868a
11 changed files with 84 additions and 32 deletions
|
@ -156,7 +156,7 @@ declare_lint! {
|
|||
///
|
||||
/// ```rust
|
||||
/// #![forbid(warnings)]
|
||||
/// #![deny(bad_style)]
|
||||
/// #![warn(bad_style)]
|
||||
///
|
||||
/// fn main() {}
|
||||
/// ```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue