Skip to content

Commit ad5fc2a

Browse files
committed
Add test for #35676
Closes #35676
1 parent ed532c0 commit ad5fc2a

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/test/run-pass/issue-35376.rs

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2016 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+
#![feature(specialization)]
12+
13+
fn main() {}
14+
15+
pub trait Alpha<T> { }
16+
17+
pub trait Beta {
18+
type Event;
19+
}
20+
21+
pub trait Delta {
22+
type Handle;
23+
fn process(&self);
24+
}
25+
26+
pub struct Parent<A, T>(A, T);
27+
28+
impl<A, T> Delta for Parent<A, T>
29+
where A: Alpha<T::Handle>,
30+
T: Delta,
31+
T::Handle: Beta<Event = <Handle as Beta>::Event> {
32+
type Handle = Handle;
33+
default fn process(&self) {
34+
unimplemented!()
35+
}
36+
}
37+
38+
impl<A, T> Delta for Parent<A, T>
39+
where A: Alpha<T::Handle> + Alpha<Handle>,
40+
T: Delta,
41+
T::Handle: Beta<Event = <Handle as Beta>::Event> {
42+
fn process(&self) {
43+
unimplemented!()
44+
}
45+
}
46+
47+
pub struct Handle;
48+
49+
impl Beta for Handle {
50+
type Event = ();
51+
}

0 commit comments

Comments
 (0)