1 // SPDX-License-Identifier: Apache-2.0 OR MIT 2 3 use pin_project::pin_project; 4 5 // #[repr(packed)] cannot be apply on enums and will be rejected by rustc. 6 // However, we should not rely on the behavior of rustc that rejects this. 7 // https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001 8 9 #[repr(packed)] //~ ERROR E0517 10 enum E1 { 11 V(()), 12 } 13 14 #[pin_project] 15 #[repr(packed)] //~ ERROR E0517 16 enum E2 { 17 V(()), 18 } 19 20 #[repr(packed)] //~ ERROR E0517 21 #[pin_project] 22 enum E3 { 23 V(()), 24 } 25 main()26fn main() {} 27