Narrated Al-Bara bin 'Azib: 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).

حَدَّثَنَا بِذَلِكَ مُحَمَّدُ بْنُ بَشَّارٍ بُنْدَارٌ، حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي إِسْحَاق بِهَذَا، ‏‏‏‏‏‏قَالَ:‏‏‏‏ قَالَ الْبَرَاءُ بْنُ عَازِبٍ:‏‏‏‏ مَاتَ نَاسٌ مِنْ أَصْحَابِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَهُمْ يَشْرَبُونَ الْخَمْرَ، ‏‏‏‏‏‏فَلَمَّا نَزَلَ تَحْرِيمُهَا، ‏‏‏‏‏‏قَالَ نَاسٌ مِنْ أَصْحَابِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ:‏‏‏‏ فَكَيْفَ بِأَصْحَابِنَا الَّذِينَ مَاتُوا وَهُمْ يَشْرَبُونَهَا ؟ فَنَزَلَتْ لَيْسَ عَلَى الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ جُنَاحٌ فِيمَا طَعِمُوا سورة المائدة آية 93 ، ‏‏‏‏‏‏قَالَ أَبُو عِيسَى:‏‏‏‏ هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ.

Explanation
تفسير الحديث

This hadith discusses the topic of alcohol and its prohibition in Islam. It narrates an incident that occurred when the prohibition of alcohol was revealed during the time of the Prophet Muhammad (peace be upon him). Al-Bara' ibn 'Azib mentions that some companions died while still consuming alcohol, which raised concerns among other companions about the fate of those who passed away before the prohibition was established. Subsequently, the verse from Surah Al-Ma'idah (Verse 93) was revealed to reassure them that those who believed and did righteous deeds would not be blamed for what they consumed, as their faith and good actions would absolve them of the consequences of their previous sins. This highlights God's mercy and vast forgiveness.

هذا الحديث يتناول موضوع الخمر وتحريمه في الإسلام. يتحدث عن الواقعة التي حدثت عندما نزل تحريم الخمر في عهد النبي محمد صلى الله عليه وسلم. يشير البراء بن عازب إلى أن مجموعة من الصحابة قد ماتوا بينما كانوا يشربون الخمر، وهذا أثار قلق بعض الصحابة الآخرين بخصوص مصير هؤلاء الذين توفوا في حال عدم تحريمها بعد. لذلك، جاءت الآية الكريمة من سورة المائدة (آية 93) لتطمئنهم بأن الذين آمنوا وعملوا الصالحات ليس عليهم جُنَاحٌ فيمَا طَعِمُوا بما أن إيمانهم وأعمالهم الصالحة تلغي من آثار ذنوبهم السابقة. وهذا يظهر رحمة الله وواسع مغفرته.

Source: Jami' Al-Tirmidhi by Abu `Isa Muhammad at-Tirmidhi