Skip to content

Commit ebebb31

Browse files
Add E0536 error explanation
1 parent 9fe31a1 commit ebebb31

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/libsyntax/diagnostic_list.rs

+27-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn main() {}
6969
```
7070
7171
For more information about the inline attribute, take a look here:
72-
https://doc.rust-lang.org/reference.html#inline-attributes)
72+
https://doc.rust-lang.org/reference.html#inline-attributes
7373
"##,
7474

7575
E0535: r##"
@@ -100,13 +100,37 @@ fn main() {}
100100
```
101101
102102
For more information about the inline attribute, take a look here:
103-
https://doc.rust-lang.org/reference.html#inline-attributes)
103+
https://doc.rust-lang.org/reference.html#inline-attributes
104+
"##,
105+
106+
E0536: r##"
107+
No cfg-pattern was found for `not` statement.
108+
109+
Erroneous code example:
110+
111+
```compile_fail,E0536
112+
#[cfg(not())] // error: expected 1 cfg-pattern
113+
pub fn something() {}
114+
115+
pub fn main() {}
116+
```
117+
118+
The `not` statement expects at least one cfg-pattern. Example:
119+
120+
```
121+
#[cfg(not(target_os = "linux"))] // ok!
122+
pub fn something() {}
123+
124+
pub fn main() {}
125+
```
126+
127+
For more information about the cfg attribute, take a look here:
128+
https://doc.rust-lang.org/reference.html#conditional-compilation
104129
"##,
105130

106131
}
107132

108133
register_diagnostics! {
109-
E0536, // expected 1 cfg-pattern
110134
E0537, // invalid predicate
111135
E0538, // multiple [same] items
112136
E0539, // incorrect meta item

0 commit comments

Comments
 (0)