Abu Hurairah (RAA) narrated, The Messenger of Allah (ﷺ) forbade us from practicing wisal in fasting (i.e. fasting continuously without breaking one's fast in the evening or eating before the following dawn). So a man said to him, 'But you practice wisal O Messenger of Allah!' The Prophet Allah (ﷺ) replied, "Which one of you is like me? I am given food and drink during my sleep by Allah." So when people refused to stop wisal, the Prophet fasted day and night continuously along with them for a day and then another day and then they saw the crescent (of the new month of Shawwal). The Prophet said to them, "If the crescent had not appeared, I would have made you fast for a longer period." That was a punishment for them because they refused to stop (practicing Wisal). Agreed upon.
English reference: Book 5, Hadith 683
Arabic reference: Book 5, Hadith 662