2015-01-06 14:03:46 +13:00
|
|
|
// Test `?Sized` types not allowed in fields (except the last one).
|
2014-04-08 21:00:20 +12:00
|
|
|
|
2015-01-06 10:16:49 +13:00
|
|
|
struct S1<X: ?Sized> {
|
2018-06-09 16:53:36 -07:00
|
|
|
f1: X,
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2015-01-08 21:54:35 +11:00
|
|
|
f2: isize,
|
2014-04-08 21:00:20 +12:00
|
|
|
}
|
2015-01-06 10:16:49 +13:00
|
|
|
struct S2<X: ?Sized> {
|
2015-01-08 21:54:35 +11:00
|
|
|
f: isize,
|
2018-06-09 16:53:36 -07:00
|
|
|
g: X,
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2015-01-08 21:54:35 +11:00
|
|
|
h: isize,
|
2014-04-08 21:00:20 +12:00
|
|
|
}
|
2014-09-09 16:54:13 +12:00
|
|
|
struct S3 {
|
2018-06-09 16:53:36 -07:00
|
|
|
f: str,
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2015-01-08 22:02:42 +11:00
|
|
|
g: [usize]
|
2014-09-09 16:54:13 +12:00
|
|
|
}
|
|
|
|
struct S4 {
|
2018-06-09 16:53:36 -07:00
|
|
|
f: [u8],
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2015-01-08 22:02:42 +11:00
|
|
|
g: usize
|
2014-09-09 16:54:13 +12:00
|
|
|
}
|
2015-01-06 10:16:49 +13:00
|
|
|
enum E<X: ?Sized> {
|
2018-06-09 16:53:36 -07:00
|
|
|
V1(X, isize),
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2014-11-07 20:23:33 -05:00
|
|
|
}
|
2015-01-06 10:16:49 +13:00
|
|
|
enum F<X: ?Sized> {
|
2018-06-09 16:53:36 -07:00
|
|
|
V2{f1: X, f: isize},
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2014-04-08 21:00:20 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
}
|