1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![recursion_limit="1024"]
13 pub struct S0<T>(T,T);
14 pub struct S1<T>(Option<Box<S0<S0<T>>>>,Option<Box<S0<S0<T>>>>);
15 pub struct S2<T>(Option<Box<S1<S1<T>>>>,Option<Box<S1<S1<T>>>>);
16 pub struct S3<T>(Option<Box<S2<S2<T>>>>,Option<Box<S2<S2<T>>>>);
17 pub struct S4<T>(Option<Box<S3<S3<T>>>>,Option<Box<S3<S3<T>>>>);
18 pub struct S5<T>(Option<Box<S4<S4<T>>>>,Option<Box<S4<S4<T>>>>,Option<T>);
20 trait Foo { fn xxx(&self); }
21 trait Bar {} // anything local or #[fundamental]
23 impl<T> Foo for T where T: Bar, T: Sync {
27 impl Foo for S5<u32> { fn xxx(&self) {} }
28 impl Foo for S5<u64> { fn xxx(&self) {} }
31 let _ = <S5<_>>::xxx; //~ ERROR cannot resolve `S5<_>: Foo`