It was narrated that Anas ibn Maalik (may Allaah be pleased with him) said: The Prophet of Allaah (peace and blessings of Allaah be upon him) said: “Whoever forgets a prayer or sleeps and misses it, the expiation for that is to pray it when he remembers it.” Narrated by al-Bukhaari (572) and Muslim (684).
This hadeeth indicates that the one who sleeps is not accountable during the time of his sleep, and there is consensus on this point.
The apparent meaning of the hadeeth is that there is no negligence in sleep if a person sleeps before the time for prayer begins or after that but before the time becomes too short. And it was said that if a person deliberately goes to sleep before the time becomes too short and he takes that as a means of not praying because he thinks it most likely that he will not wake up until the time for the prayer is over, then he is sinning. But the apparent meaning is that there is no sin on him because of sleeping, because he did that at a time when it was permissible to do it, so he is included in this hadeeth. But if he did it deliberately in order to miss the prayer, then there is no doubt that he is sinning thereby.