File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -1700,6 +1700,30 @@ To understand better how closures work in Rust, read:
17001700https://doc.rust-lang.org/book/ch13-01-closures.html
17011701"## ,
17021702
1703+ E0566 : r##"
1704+ Conflicting representation hints have been used on a same item.
1705+
1706+ Erroneous code example:
1707+
1708+ ```compile_fail,E0566
1709+ # #![deny(warnings)]
1710+ # fn main() {
1711+ #[repr(u32, u64)] // error!
1712+ enum Repr { A }
1713+ # }
1714+ ```
1715+
1716+ In most cases (if not all), using just one representation hint is more than
1717+ enough. If you want to have a representation hint depending on the current
1718+ architecture, use `cfg_attr`. Example:
1719+
1720+ ```
1721+ #[cfg_attr(linux, repr(u32))]
1722+ #[cfg_attr(not(linux), repr(u64))]
1723+ enum Repr { A }
1724+ ```
1725+ "## ,
1726+
17031727E0580 : r##"
17041728The `main` function was incorrectly declared.
17051729
@@ -2097,7 +2121,6 @@ rejected in your own crates.
20972121 E0490 , // a value of type `..` is borrowed for too long
20982122 E0495 , // cannot infer an appropriate lifetime due to conflicting
20992123 // requirements
2100- E0566 , // conflicting representation hints
21012124 E0623 , // lifetime mismatch where both parameters are anonymous regions
21022125 E0628 , // generators cannot have explicit parameters
21032126 E0631 , // type mismatch in closure arguments
You can’t perform that action at this time.
0 commit comments