syntax/rustc: Make some metadata-related functions take slices, kill bad copies

Too small to review.