remove useless `transmute_immut` function
auto merge of #10756 : thestinger/rust/transmute, r=alexcrichton