]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized5.rs
add (currently ICEing) test
[rust.git] / tests / ui / unsized / unsized5.rs
1 // Test `?Sized` types not allowed in fields (except the last one).
2
3 struct S1<X: ?Sized> {
4     f1: X,
5     //~^ ERROR the size for values of type
6     f2: isize,
7 }
8 struct S2<X: ?Sized> {
9     f: isize,
10     g: X,
11     //~^ ERROR the size for values of type
12     h: isize,
13 }
14 struct S3 {
15     f: str,
16     //~^ ERROR the size for values of type
17     g: [usize]
18 }
19 struct S4 {
20     f: [u8],
21     //~^ ERROR the size for values of type
22     g: usize
23 }
24 enum E<X: ?Sized> {
25     V1(X, isize),
26     //~^ ERROR the size for values of type
27 }
28 enum F<X: ?Sized> {
29     V2{f1: X, f: isize},
30     //~^ ERROR the size for values of type
31 }
32
33 pub fn main() {
34 }