]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0536.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0536.md
1 The `not` cfg-predicate was malformed.
2
3 Erroneous code example:
4
5 ```compile_fail,E0536
6 #[cfg(not())] // error: expected 1 cfg-pattern
7 pub fn something() {}
8
9 pub fn main() {}
10 ```
11
12 The `not` predicate expects one cfg-pattern. Example:
13
14 ```
15 #[cfg(not(target_os = "linux"))] // ok!
16 pub fn something() {}
17
18 pub fn main() {}
19 ```
20
21 For more information about the `cfg` attribute, read the section on
22 [Conditional Compilation][conditional-compilation] in the Reference.
23
24 [conditional-compilation]: https://doc.rust-lang.org/reference/conditional-compilation.html