blob: 66d5fbb80cf294386b98e41ab897e9b0846a9bf2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
Functions marked with the `#[naked]` attribute are restricted in what other
attributes they may be marked with.
Notable attributes that are incompatible with `#[naked]` are:
* `#[inline]`
* `#[track_caller]`
* `#[test]`, `#[ignore]`, `#[should_panic]`
Erroneous code example:
```compile_fail,E0736
#[inline]
#[unsafe(naked)]
fn foo() {}
```
These incompatibilities are due to the fact that naked functions deliberately
impose strict restrictions regarding the code that the compiler is
allowed to produce for this function.
|