extended information for E0552 unrecognized representation hint
This commit is contained in:
parent
6fa140b869
commit
93bc599d65
@ -162,6 +162,36 @@ pub fn main() {}
|
|||||||
https://doc.rust-lang.org/reference.html#conditional-compilation
|
https://doc.rust-lang.org/reference.html#conditional-compilation
|
||||||
"##,
|
"##,
|
||||||
|
|
||||||
|
E0552: r##"
|
||||||
|
A unrecognized representation attribute was used.
|
||||||
|
|
||||||
|
Erroneous code example:
|
||||||
|
|
||||||
|
```compile_fail,E0552
|
||||||
|
#[repr(D)] // error: unrecognized representation hint
|
||||||
|
struct MyStruct {
|
||||||
|
my_field: usize
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can use a `repr` attribute to tell the compiler how you want a struct or
|
||||||
|
enum to be laid out in memory.
|
||||||
|
|
||||||
|
Make sure you're using one of the supported options:
|
||||||
|
|
||||||
|
```
|
||||||
|
#[repr(C)] // ok!
|
||||||
|
struct MyStruct {
|
||||||
|
my_field: usize
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information about specifying representations, see the ["Alternative
|
||||||
|
Representations" section] of the Rustonomicon.
|
||||||
|
|
||||||
|
["Alternative Representations" section]: https://doc.rust-lang.org/nomicon/other-reprs.html
|
||||||
|
"##,
|
||||||
|
|
||||||
E0554: r##"
|
E0554: r##"
|
||||||
Feature attributes are only allowed on the nightly release channel. Stable or
|
Feature attributes are only allowed on the nightly release channel. Stable or
|
||||||
beta compilers will not comply.
|
beta compilers will not comply.
|
||||||
@ -315,7 +345,6 @@ fn main() {
|
|||||||
E0549, // rustc_deprecated attribute must be paired with either stable or unstable attribute
|
E0549, // rustc_deprecated attribute must be paired with either stable or unstable attribute
|
||||||
E0550, // multiple deprecated attributes
|
E0550, // multiple deprecated attributes
|
||||||
E0551, // incorrect meta item
|
E0551, // incorrect meta item
|
||||||
E0552, // unrecognized representation hint
|
|
||||||
E0555, // malformed feature attribute, expected #![feature(...)]
|
E0555, // malformed feature attribute, expected #![feature(...)]
|
||||||
E0556, // malformed feature, expected just one word
|
E0556, // malformed feature, expected just one word
|
||||||
E0557, // feature has been removed
|
E0557, // feature has been removed
|
||||||
|
Loading…
Reference in New Issue
Block a user