Skip to content

Commit 9fe31a1

Browse files
Add E0535 error explanation
1 parent 38a0177 commit 9fe31a1

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/libsyntax/diagnostic_list.rs

+31-1
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,40 @@ For more information about the inline attribute, take a look here:
7272
https://doc.rust-lang.org/reference.html#inline-attributes)
7373
"##,
7474

75+
E0535: r##"
76+
An unknown argument was given to inline attribute.
77+
78+
Erroneous code example:
79+
80+
```compile_fail,E0535
81+
#[inline(unknown)] // error: invalid argument
82+
pub fn something() {}
83+
84+
fn main() {}
85+
```
86+
87+
The inline attribute only knows two arguments:
88+
89+
* always
90+
* never
91+
92+
All other arguments given to the inline attribute will return this error.
93+
Example:
94+
95+
```
96+
#[inline(never)] // ok!
97+
pub fn something() {}
98+
99+
fn main() {}
100+
```
101+
102+
For more information about the inline attribute, take a look here:
103+
https://doc.rust-lang.org/reference.html#inline-attributes)
104+
"##,
105+
75106
}
76107

77108
register_diagnostics! {
78-
E0535, // invalid argument
79109
E0536, // expected 1 cfg-pattern
80110
E0537, // invalid predicate
81111
E0538, // multiple [same] items

0 commit comments

Comments
 (0)