what happens when a main-sequence star exhausts its core hydrogen fuel supply?