Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
tirmidhi:3051Abū Isḥāq > al-Barāʾ Ayḍ > Bidhalik Muḥammad b. Bashhār Bundār > Muḥammad b. Jaʿfar > Shuʿbah > Abū Isḥāq Bihadhā

"Some people among the Companions of the Prophet ﷺ died while they had been drinking Khamr. So when it was revealed that it was unlawful, some people among the Companions of the Messenger of Allah ﷺ said: 'How about our companions who died while they were drinking it?' So (the following) Ayah was revealed: Those who believe and do righteous good deeds, there is no sin on them for what they ate (5:93)."  

Abū ʿĪsá said that this Ḥadīth is Ḥasan-Ṣaḥīḥ.
الترمذي:٣٠٥١وَقَدْ رَوَاهُ شُعْبَةُ عَنْ أَبِي إِسْحَاقَ عَنِ الْبَرَاءِ أَيْضًا حَدَّثَنَا بِذَلِكَ مُحَمَّدُ بْنُ بَشَّارٍ بُنْدَارٌ حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ حَدَّثَنَا شُعْبَةُ عَنْ أَبِي إِسْحَاقَ بِهَذَا قَالَ قَالَ

الْبَرَاءُ بْنُ عَازِبٍ مَاتَ نَاسٌ مِنْ أَصْحَابِ النَّبِيِّ ﷺ وَهُمْ يَشْرَبُونَ الْخَمْرَ فَلَمَّا نَزَلَ تَحْرِيمُهَا قَالَ نَاسٌ مِنْ أَصْحَابِ النَّبِيِّ ﷺ فَكَيْفَ بِأَصْحَابِنَا الَّذِينَ مَاتُوا وَهُمْ يَشْرَبُونَهَا فَنَزَلَتْْ ( لَيْسَ عَلَى الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ ) الآيَةَ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ

See similar narrations below:

Collected by Ibn Ḥibbān

ذِكْرُ مَغْفِرَةِ اللَّهِ جَلَّ وَعَلَا لِمَنْ مَاتَ مِنْ شَرَابِ الْخَمْرِ مِنَ الْمُسْلِمِينَ قَبْلَ نُزُولِ تَحْرِيمِهَا

ibnhibban:5350ʿUmar b. Muḥammad al-Hamdānī > Muḥammad b. Bashhār > Muḥammad > Shuʿbah > Abū Isḥāq > al-Barāʾ

"Some people among the Companions of the Prophet ﷺ died while they had been drinking Khamr. So when it was revealed that it was unlawful, some people among the Companions of the Messenger of Allah ﷺ said: 'How about our companions who died while they were drinking it?' So (the following) Ayah was revealed: Those who believe and do righteous good deeds, there is no sin on them for what they ate (5:93)." (Using translation from Tirmidhī 3051)   

ابن حبّان:٥٣٥٠أَخْبَرَنَا عُمَرُ بْنُ مُحَمَّدٍ الْهَمْدَانِيُّ قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ قَالَ حَدَّثَنَا مُحَمَّدٌ قَالَ حَدَّثَنَا شُعْبَةُ عَنْ أَبِي إِسْحَاقَ عَنِ الْبَرَاءِ قَالَ

«مَاتَ نَاسٌ مِنْ أَصْحَابِ رَسُولِ اللَّهِ ﷺ وَهُمْ يَشْرَبُونَ الْخَمْرَ فَلَمَّا نَزَلَ تَحْرِيمُهَا قَالَ نَاسٌ مِنْ أَصْحَابِ رَسُولِ اللَّهِ ﷺ فَكَيْفَ بِأَصْحَابِنَا الَّذِينَ مَاتُوا وَهُمْ يَشْرَبُونَهَا؟ فَنَزَلَتْ {لَيْسَ عَلَى الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ جُنَاحٌ فِيمَا طَعِمُوا إِذَا مَا اتَّقَوْا وَآمَنُوا وَعَمِلُوا الصَّالِحَاتِ}»  

ذِكْرُ تَحْرِيمِ اللَّهِ جَلَّ وَعَلَا الْخَمْرَ عَلَى الْمُسْلِمِينَ بَعْدَ أَنْ كَانَ مُبَاحًا لَهُمْ شُرْبُهُ

ibnhibban:5351al-Faḍl b. al-Ḥubāb > Abū al-Walīd > Shuʿbah > Abū Isḥāq al-Sabīʿī > al-Barāʾ b. ʿĀzib

"Some people among the Companions of the Prophet ﷺ died while they had been drinking Khamr. So when it was revealed that it was unlawful, some people among the Companions of the Messenger of Allah ﷺ said: 'How about our companions who died while they were drinking it?' So (the following) Ayah was revealed: Those who believe and do righteous good deeds, there is no sin on them for what they ate (5:93)." (Using translation from Tirmidhī 3051)   

ابن حبّان:٥٣٥١أَخْبَرَنَا الْفَضْلُ بْنُ الْحُبَابِ قَالَ حَدَّثَنَا أَبُو الْوَلِيدِ قَالَ حَدَّثَنَا شُعْبَةُ قَالَ أَنْبَأَنَا أَبُو إِسْحَاقَ السَّبِيعِيُّ عَنِ الْبَرَاءِ بْنِ عَازِبٍ قَالَ

«مَاتَ نَاسٌ مِنْ أَصْحَابِ النَّبِيِّ ﷺ وَهُمْ يَشْرَبُونَ الْخَمْرَ فَلَمَّا حُرِّمَتْ قَالَ نَاسٌ مِنْ أَصْحَابِ النَّبِيِّ ﷺ كَيْفَ بِأَصْحَابِنَا مَاتُوا وَهُمْ يَشْرَبُونَهَا؟ فَنَزَلَتْ هَذِهِ الْآيَةُ {لَيْسَ عَلَى الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ جُنَاحٌ فِيمَا طَعِمُوا}»