Spin-up of a rapidly rotating star by angular momentum loss