about summary refs log tree commit diff
path: root/compiler/rustc_error_codes
diff options
context:
space:
mode:
authorFolkert <folkert@folkertdev.nl>2024-07-16 22:06:34 +0200
committerFolkert <folkert@folkertdev.nl>2024-07-16 22:06:34 +0200
commitceec6ddf9e2d4a41828fce4587180029588ae8eb (patch)
tree08d6e9e73c2fccba460351a2490282fcfb29e532 /compiler/rustc_error_codes
parentd3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee (diff)
downloadrust-ceec6ddf9e2d4a41828fce4587180029588ae8eb.tar.gz
rust-ceec6ddf9e2d4a41828fce4587180029588ae8eb.zip
update text for E0736 and E0739
Diffstat (limited to 'compiler/rustc_error_codes')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0736.md20
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0739.md2
2 files changed, 16 insertions, 6 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0736.md b/compiler/rustc_error_codes/src/error_codes/E0736.md
index 0f3d41ba66d..08aa85e705d 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0736.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0736.md
@@ -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.
+
+See [the reference page for codegen attributes] for more information.
 
-[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
+[the reference page for codegen attributes]: https://doc.rust-lang.org/reference/attributes/codegen.html
diff --git a/compiler/rustc_error_codes/src/error_codes/E0739.md b/compiler/rustc_error_codes/src/error_codes/E0739.md
index 8d9039bef93..406d3d52779 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0739.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0739.md
@@ -1,4 +1,4 @@
-`#[track_caller]` can not be applied on struct.
+`#[track_caller]` must  be applied to a function
 
 Erroneous code example: