Narrated Al-Bara
It was the custom among the companions of Muhammad that if any of them was fasting and the food was presented (for breaking his fast), but he slept before eating, he would not eat that night and the following day till sunset. Qais bin Sirma-al-Ansari was fasting and came to his wife at the time of Iftar (breaking one's fast) and asked her whether she had anything to eat. She replied, "No, but I would go and bring some for you." He used to do hard work during the day, so he was overwhelmed by sleep and slept. When his wife came and saw him, she said, "Disappointment for you." When it was midday on the following day, he fainted and the Prophet (ﷺ) was informed about the whole matter and the following verses were revealed: "You are permitted To go to your wives (for sexual relation) At the night of fasting." So, they were overjoyed by it. And then Allah also revealed: "And eat and drink Until the white thread Of dawn appears to you Distinct from the black thread (of the night)." (2.187)