]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-29147-rpass.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-29147-rpass.rs
1 // run-pass
2 #![recursion_limit="1024"]
3
4 use std::mem;
5
6 pub struct S0<T>(T,T);
7 pub struct S1<T>(Option<Box<S0<S0<T>>>>,Option<Box<S0<S0<T>>>>);
8 pub struct S2<T>(Option<Box<S1<S1<T>>>>,Option<Box<S1<S1<T>>>>);
9 pub struct S3<T>(Option<Box<S2<S2<T>>>>,Option<Box<S2<S2<T>>>>);
10 pub struct S4<T>(Option<Box<S3<S3<T>>>>,Option<Box<S3<S3<T>>>>);
11 pub struct S5<T>(Option<Box<S4<S4<T>>>>,Option<Box<S4<S4<T>>>>,Option<T>);
12
13 trait Foo { fn xxx(&self); }
14 /// some local of #[fundamental] trait
15 trait Bar {}
16
17 impl<T> Foo for T where T: Bar, T: Sync {
18 fn xxx(&self) {}
19 }
20
21 impl Foo for S5<u8> { fn xxx(&self) {} }
22
23 fn main() {
24 let s = S5(None,None,None);
25 s.xxx();
26 assert_eq!(mem::size_of_val(&s.2), mem::size_of::<Option<u8>>());
27 }