rust/src/test/ui/nll/where_clauses_in_functions.rs
2019-01-17 20:39:06 -06:00

18 lines
293 B
Rust

// compile-flags: -Zborrowck=mir
#![allow(dead_code)]
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32)
where
'a: 'b,
{
(x, y)
}
fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
foo(x, y)
//~^ ERROR lifetime may not live long enough
}
fn main() {}