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