]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/issue-29147.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / issue-29147.rs
CommitLineData
92a42be0
SL
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.
4//
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.
10
11#![recursion_limit="1024"]
12
13pub struct S0<T>(T,T);
14pub struct S1<T>(Option<Box<S0<S0<T>>>>,Option<Box<S0<S0<T>>>>);
15pub struct S2<T>(Option<Box<S1<S1<T>>>>,Option<Box<S1<S1<T>>>>);
16pub struct S3<T>(Option<Box<S2<S2<T>>>>,Option<Box<S2<S2<T>>>>);
17pub struct S4<T>(Option<Box<S3<S3<T>>>>,Option<Box<S3<S3<T>>>>);
18pub struct S5<T>(Option<Box<S4<S4<T>>>>,Option<Box<S4<S4<T>>>>,Option<T>);
19
20trait Foo { fn xxx(&self); }
21trait Bar {} // anything local or #[fundamental]
22
23impl<T> Foo for T where T: Bar, T: Sync {
24 fn xxx(&self) {}
25}
26
27impl Foo for S5<u32> { fn xxx(&self) {} }
28impl Foo for S5<u64> { fn xxx(&self) {} }
29
30fn main() {
54a0048b 31 let _ = <S5<_>>::xxx; //~ ERROR cannot resolve `S5<_>: Foo`
92a42be0 32}