Historical Rules · 8 September 2022
Rule 104.3c
Official source text from the 8 September 2022 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.)