1 // Make sure that we cannot return a `&mut` that got already invalidated, not even in a tuple.
2 // Due to shallow reborrowing, the error only surfaces when we look into the tuple.
3 fn foo(x: &mut (i32, i32)) -> (&mut i32,) {
4 let xraw = x as *mut (i32, i32);
5 let ret = (unsafe { &mut (*xraw).1 },);
6 let _val = unsafe { *xraw }; // invalidate xref
11 foo(&mut (1, 2)).0; //~ ERROR: /retag .* tag does not exist in the borrow stack/