The recent proposal to allow downgradable mut references seems like it would extend naturally to this:
pub fn get_some_ref<'a, 'm>( &'a mut<'m> self, key: i32 ) -> &'a mut<'m> i32 {
if key == 42 {
&mut self.data1
} else {
&mut self.data2
}
}
…if we can say that &'a T
is equivalent to &'a mut<'!> T
or something.