3 // Check that we assert that pointers have a common subtype for comparisons
5 fn compare_const<'a, 'b>(x: *const &mut &'a i32, y: *const &mut &'b i32) {
7 //~^ ERROR lifetime may not live long enough
8 //~| ERROR lifetime may not live long enough
11 fn compare_mut<'a, 'b>(x: *mut &'a i32, y: *mut &'b i32) {
13 //~^ ERROR lifetime may not live long enough
14 //~| ERROR lifetime may not live long enough
17 fn compare_fn_ptr<'a, 'b, 'c>(f: fn(&'c mut &'a i32), g: fn(&'c mut &'b i32)) {
19 //~^ ERROR lifetime may not live long enough
20 //~| ERROR lifetime may not live long enough
23 fn compare_hr_fn_ptr<'a>(f: fn(&'a i32), g: fn(&i32)) {
24 // Ideally this should compile with the operands swapped as well, but HIR
25 // type checking prevents it (and stops compilation) for now.
29 fn compare_const_fn_ptr<'a>(f: *const fn(&'a i32), g: *const fn(&i32)) {