]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/matching-lifetimes.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / matching-lifetimes.rs
1 // Tests that the trait matching code takes lifetime parameters into account.
2 // (Issue #15517.)
3
4 struct Foo<'a,'b> {
5     x: &'a isize,
6     y: &'b isize,
7 }
8
9 trait Tr : Sized {
10     fn foo(x: Self) {}
11 }
12
13 impl<'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     }
18 }
19
20 fn main(){}