]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0778.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0778.md
1 The `instruction_set` attribute was malformed.
2
3 Erroneous code example:
4
5 ```compile_fail,E0778
6 #![feature(isa_attribute)]
7
8 #[instruction_set()] // error: expected one argument
9 pub fn something() {}
10 fn main() {}
11 ```
12
13 The parenthesized `instruction_set` attribute requires the parameter to be
14 specified:
15
16 ```
17 #![feature(isa_attribute)]
18
19 #[cfg_attr(target_arch="arm", instruction_set(arm::a32))]
20 fn something() {}
21 ```
22
23 or:
24
25 ```
26 #![feature(isa_attribute)]
27
28 #[cfg_attr(target_arch="arm", instruction_set(arm::t32))]
29 fn something() {}
30 ```
31
32 For more information see the [`instruction_set` attribute][isa-attribute]
33 section of the Reference.
34
35 [isa-attribute]: https://doc.rust-lang.org/reference/attributes/codegen.html