rust/tests/ui/traits/matching-lifetimes.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
388 B
Rust
Raw Normal View History

// Tests that the trait matching code takes lifetime parameters into account.
// (Issue #15517.)
struct Foo<'a,'b> {
x: &'a isize,
y: &'b isize,
}
2014-12-19 11:54:09 +00:00
trait Tr : Sized {
fn foo(x: Self) {}
}
impl<'a,'b> Tr for Foo<'a,'b> {
fn foo(x: Foo<'b,'a>) {
//~^ ERROR method not compatible with trait
//~^^ ERROR method not compatible with trait
}
}
fn main(){}