about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src/error_codes/E0805.md
blob: b1ed3a11d48246b436f696be758fb5ac595582ce (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
An attribute was given an invalid number of arguments

Erroneous code example:

```compile_fail,E0805
#[inline()] // error! should either have a single argument, or no parentheses
fn foo() {}

#[inline(always, never)] // error! should have only one argument, not two
fn bar() {}
```

To fix this, either give the right number of arguments the attribute needs.
In the case of inline, this could be none at all:

```
#[inline]
fn foo() {}
```

or only one:

```
#[inline(always)]
fn foo() {}
```