Sahih Muslim , Book 35, Hadith 6482 (USC-MSA)

Nadr b. Anas reported, as when Anas was alive, that he said: Had Allah's Messenger not stated this.." None should make a request for death," I would have definitely done that.

حَدَّثَنِي حَامِدُ بْنُ عُمَرَ، حَدَّثَنَا عَبْدُ الْوَاحِدِ، حَدَّثَنَا عَاصِمٌ، عَنِ النَّضْرِ بْنِ أَنَسٍ، وَأَنَسٌ، يَوْمَئِذٍ حَىٌّ قَالَ أَنَسٌ لَوْلاَ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ لاَ يَتَمَنَّيَنَّ أَحَدُكُمُ الْمَوْتَ ‏" ‏ ‏.‏ لَتَمَنَّيْتُهُ ‏.‏

sunnah.com