1 // Test the more elaborate outlives suggestions.
5 // Should suggest: 'a: 'c, 'b: 'd
6 fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usize) {
7 (x, y) //~ERROR lifetime may not live long enough
8 //~^ERROR lifetime may not live long enough
11 // Should suggest: 'a: 'c and use 'static instead of 'b
12 fn foo2<'a, 'b, 'c>(x: &'a usize, y: &'b usize) -> (&'c usize, &'static usize) {
13 (x, y) //~ERROR lifetime may not live long enough
14 //~^ERROR lifetime may not live long enough
17 // Should suggest: 'a and 'b are the same and use 'static instead of 'c
18 fn foo3<'a, 'b, 'c, 'd, 'e>(
22 ) -> (&'b usize, &'a usize, &'static usize) {
23 (x, y, z) //~ERROR lifetime may not live long enough
24 //~^ERROR lifetime may not live long enough
25 //~^^ERROR lifetime may not live long enough