Hadithcore
Sahih al-Bukhari, 1143
sahih

Narrated Samura bin Jundab:

The Prophet (ﷺ) said in his narration of a dream that he saw, "He whose head was being crushed with a stone was one who learnt the Qur'an but never acted on it, and slept ignoring the compulsory prayers."

حَدَّثَنَا مُؤَمَّلُ بْنُ هِشَامٍ، قَالَ حَدَّثَنَا إِسْمَاعِيلُ، قَالَ حَدَّثَنَا عَوْفٌ، قَالَ حَدَّثَنَا أَبُو رَجَاءٍ، قَالَ حَدَّثَنَا سَمُرَةُ بْنُ جُنْدَبٍ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم فِي الرُّؤْيَا قَالَ ‏

‏ أَمَّا الَّذِي يُثْلَغُ رَأْسُهُ بِالْحَجَرِ فَإِنَّهُ يَأْخُذُ الْقُرْآنَ فَيَرْفِضُهُ وَيَنَامُ عَنِ الصَّلاَةِ الْمَكْتُوبَةِ ‏

‏‏.‏

References2 variants
In-Book Reference
Book 19, Hadith 24
USC-MSA web (English) reference
Vol. 2, Book 21, Hadith 244 (deprecated numbering scheme)