File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 13
13
// - repr-transparent-other-reprs.rs
14
14
// - repr-transparent-other-items.rs
15
15
16
- #![ feature( repr_align) ]
16
+ #![ feature( extern_types , repr_align) ]
17
17
18
18
use std:: marker:: PhantomData ;
19
19
@@ -49,4 +49,14 @@ struct ZstAlign32<T>(PhantomData<T>);
49
49
#[ repr( transparent) ]
50
50
struct GenericAlign < T > ( ZstAlign32 < T > , u32 ) ; //~ ERROR alignment larger than 1
51
51
52
+ extern "C" {
53
+ type ExternType ;
54
+ }
55
+
56
+ #[ repr( transparent) ]
57
+ struct NontrivialAlignZstExtern ( [ u16 ; 0 ] , ExternType ) ; //~ ERROR alignment larger than 1
58
+
59
+ #[ repr( transparent) ]
60
+ struct GenericAlignExtern < T > ( ZstAlign32 < T > , ExternType ) ; //~ ERROR alignment larger than 1
61
+
52
62
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -66,7 +66,19 @@ error[E0691]: zero-sized field in transparent struct has alignment larger than 1
66
66
LL | struct GenericAlign<T>(ZstAlign32<T>, u32); //~ ERROR alignment larger than 1
67
67
| ^^^^^^^^^^^^^
68
68
69
- error: aborting due to 8 previous errors
69
+ error[E0691]: zero-sized field in transparent struct has alignment larger than 1
70
+ --> $DIR/repr-transparent.rs:57:33
71
+ |
72
+ LL | struct NontrivialAlignZstExtern([u16; 0], ExternType); //~ ERROR alignment larger than 1
73
+ | ^^^^^^^^
74
+
75
+ error[E0691]: zero-sized field in transparent struct has alignment larger than 1
76
+ --> $DIR/repr-transparent.rs:60:30
77
+ |
78
+ LL | struct GenericAlignExtern<T>(ZstAlign32<T>, ExternType); //~ ERROR alignment larger than 1
79
+ | ^^^^^^^^^^^^^
80
+
81
+ error: aborting due to 10 previous errors
70
82
71
83
Some errors occurred: E0690, E0691.
72
84
For more information about an error, try `rustc --explain E0690`.
You can’t perform that action at this time.
0 commit comments