]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0537.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / 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 the section on
28 [Conditional Compilation][conditional-compilation] in the Reference.
29
30 [conditional-compilation]: https://doc.rust-lang.org/reference/conditional-compilation.html