Skip to content

Commit ceec6dd

Browse files
committed
update text for E0736 and E0739
1 parent d3dd34a commit ceec6dd

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
`#[track_caller]` and `#[naked]` cannot both be applied to the same function.
1+
Functions marked with the `#[naked]` attribute are restricted in what other
2+
code generation attributes they may be marked with.
3+
4+
The following code generation attributes are incompatible with `#[naked]`:
5+
6+
* `#[inline]`
7+
* `#[track_caller]`
8+
* `#[target_feature]`
29

310
Erroneous code example:
411

512
```compile_fail,E0736
13+
#[inline]
614
#[naked]
7-
#[track_caller]
815
fn foo() {}
916
```
1017

11-
This is primarily due to ABI incompatibilities between the two attributes.
12-
See [RFC 2091] for details on this and other limitations.
18+
These incompatibilities are due to the fact that naked functions deliberately
19+
impose strict restrictions regarding the code that the compiler is
20+
allowed to produce for this function.
21+
22+
See [the reference page for codegen attributes] for more information.
1323

14-
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
24+
[the reference page for codegen attributes]: https://doc.rust-lang.org/reference/attributes/codegen.html

compiler/rustc_error_codes/src/error_codes/E0739.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
`#[track_caller]` can not be applied on struct.
1+
`#[track_caller]` must be applied to a function
22

33
Erroneous code example:
44

0 commit comments

Comments
 (0)