]> git.lizzy.rs Git - rust.git/blob - src/test/ui/extern/extern-types-unsized.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / extern / extern-types-unsized.rs
1 // Make sure extern types are !Sized.
2
3 #![feature(extern_types)]
4
5 extern {
6     type A;
7 }
8
9 struct Foo {
10     x: u8,
11     tail: A,
12 }
13
14 struct Bar<T: ?Sized> {
15     x: u8,
16     tail: T,
17 }
18
19 fn assert_sized<T>() { }
20
21 fn main() {
22     assert_sized::<A>();
23     //~^ ERROR the size for values of type
24
25     assert_sized::<Foo>();
26     //~^ ERROR the size for values of type
27
28     assert_sized::<Bar<A>>();
29     //~^ ERROR the size for values of type
30
31     assert_sized::<Bar<Bar<A>>>();
32     //~^ ERROR the size for values of type
33 }