He asked Umm Salama about a man who wakes up in a state of major ritual impurity, can he fast?She replied, "The Messenger of Allah ﷺ used to wake up in a state of major ritual impurity, not from a wet dream, and then fast."
أنه سأل أم سلمة عن الرجل يصبح جنبا أيصوم؟ قالت: كان رسول الله ﷺ يصبح جنبا من غير احتلام، ثم يصوم.
Muslim narrated it in the Book of Fasting (1109) from Ahmad bin Uthman Nawfali, who said, Abu Asim narrated to us, Ibn Jurayj narrated to us, Muhammad bin Yusuf informed me, from Sulayman bin Yasar, and he mentioned it. It is also in Ibn Majah (1704) and others through another route from Nafi, that he asked Umm Salama, and she said the same.People have found it problematic that Abu Hurairah said that whoever wakes up in a state of major impurity has no fast, and he used to narrate this from the Messenger of Allah ﷺ. But when the hadith of Ayesha and Umm Salama reached him, he said, "They know better about that. It was only Fadl bin Abbas who told me it," meaning that abrogation had occurred in the matter, for the hadith of Fadl bin Abbas came before the hadith of Ayesha and Umm Salama.This is the best interpretation, as Khattabi said, and this is his wording, "People have spoken about the meaning of this, and the best thing I have heard in interpreting what Abu Hurairah narrated on this matter is that it should be understood as abrogated. That is because intercourse was, at the beginning of Islam, forbidden to the fasting person at night after sleeping, just like food and drink. When Allah then permitted intercourse up until the break of Fajr, it became permissible for a person in a state of major impurity, if he woke up before performing ghusl, to fast that day, since the earlier prohibition had been lifted. So the interpretation of his statement, 'Whoever wakes up in a state of major impurity should not fast,' is that whoever has intercourse during the fast after having slept, his fast for the following day does not count, because a person cannot wake up in a state of major impurity unless he had the right to have intercourse right up until the blink of an eye before Fajr. So Abu Hurairah used to give the ruling he had heard from Fadl bin Abbas, based on the earlier ruling, without knowing about the abrogation. Then, when he heard the report of Ayesha and Umm Salama, he adopted it."It has been narrated from Ibn Musayab that he said, "Abu Hurairah retracted his ruling that whoever wakes up in a state of major impurity has no fast."Khattabi said, "This may also be interpreted in another way, one in which no abrogation occurs, namely that its meaning is, 'Whoever wakes up having just had intercourse has no fast.' A thing may sometimes be named after something else, when its ultimate outcome leads to it." This is the end of Khattabi's statement.Likewise, a menstruating woman or one in postpartum bleeding, if she becomes pure at night but does not perform ghusl until after the break of Fajr, her fast is valid.