]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_error_codes/src/error_codes/E0453.md
New upstream version 1.68.2+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0453.md
CommitLineData
60c5eb7d
XL
1A lint check attribute was overruled by a `forbid` directive set as an
2attribute on an enclosing scope, or on the command line with the `-F` option.
3
4Example of erroneous code:
5
6```compile_fail,E0453
7#![forbid(non_snake_case)]
8
9#[allow(non_snake_case)]
10fn main() {
11 let MyNumber = 2; // error: allow(non_snake_case) overruled by outer
12 // forbid(non_snake_case)
13}
14```
15
16The `forbid` lint setting, like `deny`, turns the corresponding compiler
17warning into a hard error. Unlike `deny`, `forbid` prevents itself from being
18overridden by inner attributes.
19
20If 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
22command-line option) to allow the inner lint check attribute:
23
24```
25#![deny(non_snake_case)]
26
27#[allow(non_snake_case)]
28fn main() {
29 let MyNumber = 2; // ok!
30}
31```
32
33Otherwise, edit the code to pass the lint check, and remove the overruled
34attribute:
35
36```
37#![forbid(non_snake_case)]
38
39fn main() {
40 let my_number = 2;
41}
42```