]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/traits-issue-23003-overflow.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / traits / traits-issue-23003-overflow.rs
1 // A variant of traits-issue-23003 in which an infinite series of
2 // types are required. This test now just compiles fine, since the
3 // relevant rules that triggered the overflow were removed.
4
5 // check-pass
6 #![allow(dead_code)]
7
8 use std::marker::PhantomData;
9
10 trait Async {
11 type Cancel;
12 }
13
14 struct Receipt<A:Async> {
15 marker: PhantomData<A>,
16 }
17
18 struct Complete<B> {
19 core: Option<B>,
20 }
21
22 impl<B> Async for Complete<B> {
23 type Cancel = Receipt<Complete<Option<B>>>;
24 }
25
26 fn foo(_: Receipt<Complete<()>>) { }
27
28
29 fn main() { }