]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/traits-issue-23003-overflow.rs
2f694e3ca7c5ec962e27cb69386cf6615d511712
[rustc.git] / src / test / ui / traits / traits-issue-23003-overflow.rs
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 // A variant of traits-issue-23003 in which an infinite series of
12 // types are required. This test now just compiles fine, since the
13 // relevant rules that triggered the overflow were removed.
14
15 // compile-pass
16 #![allow(dead_code)]
17
18 use std::marker::PhantomData;
19
20 trait Async {
21 type Cancel;
22 }
23
24 struct Receipt<A:Async> {
25 marker: PhantomData<A>,
26 }
27
28 struct Complete<B> {
29 core: Option<B>,
30 }
31
32 impl<B> Async for Complete<B> {
33 type Cancel = Receipt<Complete<Option<B>>>;
34 }
35
36 fn foo(_: Receipt<Complete<()>>) { }
37
38
39 fn main() { }