]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0537.md
New upstream version 1.42.0+dfsg0+pve1
[rustc.git] / src / librustc_error_codes / error_codes / E0537.md
1 An unknown predicate was used inside the `cfg` attribute.
2
3 Erroneous code example:
4
5 ```compile_fail,E0537
6 #[cfg(unknown())] // error: invalid predicate `unknown`
7 pub fn something() {}
8
9 pub fn main() {}
10 ```
11
12 The `cfg` attribute supports only three kinds of predicates:
13
14 * any
15 * all
16 * not
17
18 Example:
19
20 ```
21 #[cfg(not(target_os = "linux"))] // ok!
22 pub fn something() {}
23
24 pub fn main() {}
25 ```
26
27 For more information about the cfg attribute, read:
28 https://doc.rust-lang.org/reference.html#conditional-compilation