I was also interested on knowing this and I got an answer on the zig discord and this code is correct for now and will likely be formalized as defined behavior.
referenced rvalues (temporaries) live until the end of the function, or until the end of the innermost loop they were in