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