]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | A lint check attribute was overruled by a `forbid` directive set as an |
2 | attribute on an enclosing scope, or on the command line with the `-F` option. | |
3 | ||
4 | Example of erroneous code: | |
5 | ||
6 | ```compile_fail,E0453 | |
7 | #![forbid(non_snake_case)] | |
8 | ||
9 | #[allow(non_snake_case)] | |
10 | fn main() { | |
11 | let MyNumber = 2; // error: allow(non_snake_case) overruled by outer | |
12 | // forbid(non_snake_case) | |
13 | } | |
14 | ``` | |
15 | ||
16 | The `forbid` lint setting, like `deny`, turns the corresponding compiler | |
17 | warning into a hard error. Unlike `deny`, `forbid` prevents itself from being | |
18 | overridden by inner attributes. | |
19 | ||
20 | If you're sure you want to override the lint check, you can change `forbid` to | |
21 | `deny` (or use `-D` instead of `-F` if the `forbid` setting was given as a | |
22 | command-line option) to allow the inner lint check attribute: | |
23 | ||
24 | ``` | |
25 | #![deny(non_snake_case)] | |
26 | ||
27 | #[allow(non_snake_case)] | |
28 | fn main() { | |
29 | let MyNumber = 2; // ok! | |
30 | } | |
31 | ``` | |
32 | ||
33 | Otherwise, edit the code to pass the lint check, and remove the overruled | |
34 | attribute: | |
35 | ||
36 | ``` | |
37 | #![forbid(non_snake_case)] | |
38 | ||
39 | fn main() { | |
40 | let my_number = 2; | |
41 | } | |
42 | ``` |