update text for E0736 and E0739
This commit is contained in:
parent
d3dd34a1d4
commit
ceec6ddf9e
@ -1,14 +1,24 @@
|
||||
`#[track_caller]` and `#[naked]` cannot both be applied to the same function.
|
||||
Functions marked with the `#[naked]` attribute are restricted in what other
|
||||
code generation attributes they may be marked with.
|
||||
|
||||
The following code generation attributes are incompatible with `#[naked]`:
|
||||
|
||||
* `#[inline]`
|
||||
* `#[track_caller]`
|
||||
* `#[target_feature]`
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0736
|
||||
#[inline]
|
||||
#[naked]
|
||||
#[track_caller]
|
||||
fn foo() {}
|
||||
```
|
||||
|
||||
This is primarily due to ABI incompatibilities between the two attributes.
|
||||
See [RFC 2091] for details on this and other limitations.
|
||||
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.
|
||||
|
||||
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
|
||||
See [the reference page for codegen attributes] for more information.
|
||||
|
||||
[the reference page for codegen attributes]: https://doc.rust-lang.org/reference/attributes/codegen.html
|
||||
|
@ -1,4 +1,4 @@
|
||||
`#[track_caller]` can not be applied on struct.
|
||||
`#[track_caller]` must be applied to a function
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user