blob: 023c38c730cd4ab40d39955eb26908d3b6884f0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#### Note: this error code is no longer emitted by the compiler
This is because it was too specific to the `inline` attribute.
Similar diagnostics occur for other attributes too.
The example here will now emit `E0805`
The `inline` attribute was malformed.
Erroneous code example:
```compile_fail,E0805
#[inline()] // error: expected one argument
pub fn something() {}
fn main() {}
```
The parenthesized `inline` attribute requires the parameter to be specified:
```
#[inline(always)]
fn something() {}
```
or:
```
#[inline(never)]
fn something() {}
```
Alternatively, a paren-less version of the attribute may be used to hint the
compiler about inlining opportunity:
```
#[inline]
fn something() {}
```
For more information see the [`inline` attribute][inline-attribute] section
of the Reference.
[inline-attribute]: https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute
|