rust/tests/ui/lifetimes/lifetime-mismatch-between-trait-and-impl.rs

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

13 lines
263 B
Rust
Raw Normal View History

trait Foo {
fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32;
}
impl Foo for () {
fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
2019-10-04 03:14:48 +00:00
//~^ ERROR `impl` item signature doesn't match `trait` item signature
if x > y { x } else { y }
}
}
fn main() {}