• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: Apache-2.0 OR MIT
2 
3 use pin_project::pin_project;
4 
5 // #[repr(packed = "")] is not valid format of #[repr(packed)] and will be
6 // rejected by rustc.
7 // However, we should not rely on the behavior of rustc that rejects this.
8 // https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
9 
10 // https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
11 // https://github.com/rust-lang/rust/issues/83921
12 // #[repr(packed = "")] //~ ERROR E0552
13 // struct S1 {
14 //     f: (),
15 // }
16 
17 #[pin_project]
18 #[repr(packed = "")] //~ ERROR attribute should not be name-value pair
19 struct S2 {
20     f: (),
21 }
22 
23 #[repr(packed = "")] //~ ERROR attribute should not be name-value pair
24 #[pin_project]
25 struct S3 {
26     f: (),
27 }
28 
main()29 fn main() {}
30