]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-20763-1.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-20763-1.rs
CommitLineData
d9bb1a4e 1// check-pass
0bf4aa26 2#![allow(dead_code)]
c34b1796
AL
3// pretty-expanded FIXME #23616
4
85aaf69f
SL
5trait T0 {
6 type O;
7 fn dummy(&self) { }
8}
9
10struct S<A>(A);
11impl<A> T0 for S<A> { type O = A; }
12
13trait T1: T0 {
14 // this looks okay but as we see below, `f` is unusable
15 fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool;
16}
17
18// complains about the bounds on F here not being required by the trait
19impl<A> T1 for S<A> {
20 fn m0<F: Fn(A) -> bool>(self, f: F) -> bool { f(self.0) }
21}
22
23// // complains about mismatched types: <S<A> as T0>::O vs. A
24// impl<A> T1 for S<A>
25// {
26// fn m0<F: Fn(<Self as T0>::O) -> bool>(self, f: F) -> bool { f(self.0) }
27// }
28
29fn main() { }