(18) بَاب لَا تَقُومُ السَّاعَةُ حَتَّى يَمُرَّ الرَّجُلُ بِقَبْرِ الرَّجُلِ فَيَتَمَنَّى أَنْ يَكُونَ مَكَانَ الْمَيِّتِ مِنْ الْبَلَاءِ
This hadith has been transmitted on the authority of Abu Huraira with a slight variation of wording.
Reference: Sahih Muslim 157 m
In-book reference: Book 54, Hadith 109
USC-MSA web (English) reference(deprecated numbering scheme): Book 41, Hadith 6989