about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
diff options
context:
space:
mode:
authorJonathan Brouwer <jonathantbrouwer@gmail.com>2025-07-07 09:10:54 +0200
committerJonathan Brouwer <jonathantbrouwer@gmail.com>2025-07-15 09:21:27 +0200
commit7a7c74ad89df9f87824fa17fbbe0448d9ab6f7cc (patch)
tree635bf7b454df9fe8fbb5d76d8f75102f59e33b6b /compiler/rustc_error_codes/src
parentc7f5ddc09871dc74c9f451435b042707eef5dc6c (diff)
downloadrust-7a7c74ad89df9f87824fa17fbbe0448d9ab6f7cc.tar.gz
rust-7a7c74ad89df9f87824fa17fbbe0448d9ab6f7cc.zip
New example for E0536
Diffstat (limited to 'compiler/rustc_error_codes/src')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0536.md16
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0536.md b/compiler/rustc_error_codes/src/error_codes/E0536.md
index c081a3d9cfa..f00d1773944 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0536.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0536.md
@@ -3,22 +3,20 @@ The `not` cfg-predicate was malformed.
 Erroneous code example:
 
 ```compile_fail,E0536
-#[cfg(not())] // error: expected 1 cfg-pattern
-pub fn something() {}
-
-pub fn main() {}
+pub fn main() {
+    if cfg!(not()) { }
+}
 ```
 
 The `not` predicate expects one cfg-pattern. Example:
 
 ```
-#[cfg(not(target_os = "linux"))] // ok!
-pub fn something() {}
-
-pub fn main() {}
+pub fn main() {
+    if cfg!(not(target_os = "linux")) { } // ok!
+}
 ```
 
-For more information about the `cfg` attribute, read the section on
+For more information about the `cfg` macro, read the section on
 [Conditional Compilation][conditional-compilation] in the Reference.
 
 [conditional-compilation]: https://doc.rust-lang.org/reference/conditional-compilation.html