Skip to content

Commit 93bc599

Browse files
committed
extended information for E0552 unrecognized representation hint
1 parent 6fa140b commit 93bc599

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/libsyntax/diagnostic_list.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,36 @@ For more information about the cfg attribute, read:
162162
https://doc.rust-lang.org/reference.html#conditional-compilation
163163
"##,
164164

165+
E0552: r##"
166+
A unrecognized representation attribute was used.
167+
168+
Erroneous code example:
169+
170+
```compile_fail,E0552
171+
#[repr(D)] // error: unrecognized representation hint
172+
struct MyStruct {
173+
my_field: usize
174+
}
175+
```
176+
177+
You can use a `repr` attribute to tell the compiler how you want a struct or
178+
enum to be laid out in memory.
179+
180+
Make sure you're using one of the supported options:
181+
182+
```
183+
#[repr(C)] // ok!
184+
struct MyStruct {
185+
my_field: usize
186+
}
187+
```
188+
189+
For more information about specifying representations, see the ["Alternative
190+
Representations" section] of the Rustonomicon.
191+
192+
["Alternative Representations" section]: https://doc.rust-lang.org/nomicon/other-reprs.html
193+
"##,
194+
165195
E0554: r##"
166196
Feature attributes are only allowed on the nightly release channel. Stable or
167197
beta compilers will not comply.
@@ -315,7 +345,6 @@ register_diagnostics! {
315345
E0549, // rustc_deprecated attribute must be paired with either stable or unstable attribute
316346
E0550, // multiple deprecated attributes
317347
E0551, // incorrect meta item
318-
E0552, // unrecognized representation hint
319348
E0555, // malformed feature attribute, expected #![feature(...)]
320349
E0556, // malformed feature, expected just one word
321350
E0557, // feature has been removed

0 commit comments

Comments
 (0)