fn validate_registry( pkgs: &[&Package], reg_or_index: Option<&RegistryOrIndex>, ) -> CargoResult<()>