]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0787.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0787.md
1 An unsupported naked function definition.
2
3 Erroneous code example:
4
5 ```compile_fail,E0787
6 #![feature(naked_functions)]
7
8 #[naked]
9 pub extern "C" fn f() -> u32 {
10     42
11 }
12 ```
13
14 The naked functions must be defined using a single inline assembly
15 block.
16
17 The execution must never fall through past the end of the assembly
18 code so the block must use `noreturn` option. The asm block can also
19 use `att_syntax` and `raw` options, but others options are not allowed.
20
21 The asm block must not contain any operands other than `const` and
22 `sym`.
23
24 ### Additional information
25
26 For more information, please see [RFC 2972].
27
28 [RFC 2972]: https://github.com/rust-lang/rfcs/blob/master/text/2972-constrained-naked.md