test: Remove all `~[T]` from tests, libgetopts, compiletest, librustdoc, and libnum

Revival of #12837