]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0552.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0552.md
1 A unrecognized representation attribute was used.
2
3 Erroneous code example:
4
5 ```compile_fail,E0552
6 #[repr(D)] // error: unrecognized representation hint
7 struct MyStruct {
8     my_field: usize
9 }
10 ```
11
12 You can use a `repr` attribute to tell the compiler how you want a struct or
13 enum to be laid out in memory.
14
15 Make sure you're using one of the supported options:
16
17 ```
18 #[repr(C)] // ok!
19 struct MyStruct {
20     my_field: usize
21 }
22 ```
23
24 For more information about specifying representations, see the ["Alternative
25 Representations" section] of the Rustonomicon.
26
27 ["Alternative Representations" section]: https://doc.rust-lang.org/nomicon/other-reprs.html