1 // Test the more elaborate outlives suggestions.
3 // Should suggest: 'a: 'c, 'b: 'd
4 fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) {
5 (x, y) //~ERROR lifetime may not live long enough
6 //~^ERROR lifetime may not live long enough
9 // Should suggest: 'a: 'c and use 'static instead of 'b
10 fn foo2<'a, 'b, 'c>(x: &'a usize, y: &'b usize) -> (&'c usize, &'static usize) {
11 (x, y) //~ERROR lifetime may not live long enough
12 //~^ERROR lifetime may not live long enough
15 // Should suggest: 'a and 'b are the same and use 'static instead of 'c
16 fn foo3<'a, 'b, 'c, 'd, 'e>(
20 ) -> (&'b usize, &'a usize, &'static usize) {
21 (x, y, z) //~ERROR lifetime may not live long enough
22 //~^ERROR lifetime may not live long enough
23 //~^^ERROR lifetime may not live long enough