1 // Test that we consider equal regions when checking for hidden regions in
6 // `'a == 'static` so `&'a i32` is fine as the return type
7 fn equal_regions_static<'a: 'static>(x: &'a i32) -> impl Sized {
8 //~^ WARNING unnecessary lifetime parameter `'a`
12 // `'a == 'b` so `&'b i32` is fine as the return type
13 fn equal_regions<'a: 'b, 'b: 'a>(x: &'b i32) -> impl Sized + 'a {
19 // `'a == 'b` so `&'a i32` is fine as the return type
20 fn equal_regions_rev<'a: 'b, 'b: 'a>(x: &'a i32) -> impl Sized + 'b {
26 // `'a == 'b` so `*mut &'b i32` is fine as the return type
27 fn equal_regions_inv<'a: 'b, 'b: 'a>(x: *mut &'b i32) -> impl Sized + 'a {
28 let y: *mut &'a i32 = x;
29 let z: *mut &'b i32 = y;
33 // `'a == 'b` so `*mut &'a i32` is fine as the return type
34 fn equal_regions_inv_rev<'a: 'b, 'b: 'a>(x: *mut &'a i32) -> impl Sized + 'b {
35 let y: *mut &'a i32 = x;
36 let z: *mut &'b i32 = y;
40 // Should be able to infer `fn(&'static ())` as the return type.
41 fn contravariant_lub<'a, 'b: 'a, 'c: 'a, 'd: 'b + 'c>(
45 ) -> impl Sized + 'a {