How did the Messenger of Allah ﷺ sleep when he was in a state of major ritual impurity? Did he bathe before sleeping, or sleep before bathing?She replied, "He did all of that. Sometimes he would bathe and then sleep, and sometimes he would perform ablution and then sleep."
أخبرنا شعيب بن يوسف قال حدثنا عبد الرحمن بن مهدي عن معاوية بن صالح عن عبد الله بن أبي قيس قال
كيف كان نوم رسول الله ﷺ في الجنابة أيغتسل قبل أن ينام أو ينام قبل أن يغتسل قالت كل ذلك قد كان يفعل ربما اغتسل فنام وربما توضأ فنام
Muslim included it in the chapter on Menstruation, in the section on the permissibility of a person in a state of major ritual impurity sleeping, and the recommendation of performing wudu for it, etc, hadith 307, from the hadith of Abdul-Rahman bin Mahdi through this same chain.