]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0534.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0534.md
1 The `inline` attribute was malformed.
2
3 Erroneous code example:
4
5 ```compile_fail,E0534
6 #[inline()] // error: expected one argument
7 pub fn something() {}
8
9 fn main() {}
10 ```
11
12 The parenthesized `inline` attribute requires the parameter to be specified:
13
14 ```
15 #[inline(always)]
16 fn something() {}
17 ```
18
19 or:
20
21 ```
22 #[inline(never)]
23 fn something() {}
24 ```
25
26 Alternatively, a paren-less version of the attribute may be used to hint the
27 compiler about inlining opportunity:
28
29 ```
30 #[inline]
31 fn something() {}
32 ```
33
34 For more information see the [`inline` attribute][inline-attribute] section
35 of the Reference.
36
37 [inline-attribute]: https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute