]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/trait-matching-lifetimes.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / traits / trait-matching-lifetimes.rs
CommitLineData
1a4d82fc
JJ
1// Tests that the trait matching code takes lifetime parameters into account.
2// (Issue #15517.)
223e47cc 3
1a4d82fc
JJ
4struct Foo<'a,'b> {
5 x: &'a isize,
6 y: &'b isize,
223e47cc
LB
7}
8
1a4d82fc
JJ
9trait Tr : Sized {
10 fn foo(x: Self) {}
223e47cc
LB
11}
12
1a4d82fc
JJ
13impl<'a,'b> Tr for Foo<'a,'b> {
14 fn foo(x: Foo<'b,'a>) {
15 //~^ ERROR method not compatible with trait
16 //~^^ ERROR method not compatible with trait
17 }
223e47cc
LB
18}
19
1a4d82fc 20fn main(){}