Historical Rules · 5 February 2021
Rule 104.3c
Official source text from the 5 February 2021 Rules release
If a player is required to draw more cards than are left in their library, they draw the remaining cards and then lose the game the next time a player would receive priority. (This is a state-based action. See rule 704.)