The Messenger of Allah ﷺ was on a journey. Abu Nadr said, meaning Hashim. Yazid, meaning Ibn Harun, said, "While the Messenger of Allah ﷺ was on a journey, he saw a man around whom people had gathered, and shade was being provided for him."They said, "This is a man who is fasting."The Messenger of Allah ﷺ said, "It is not righteousness to fast while traveling."
حدثنا محمد بن جعفر حدثنا شعبة عن محمد بن عبد الرحمن بن سعد بن زرارة الأنصاري عن محمد بن عمرو بن الحسن بن علي
كان رسول الله ﷺ قال أبو النضر يعني هاشما في سفر قال يزيد يعني ابن هارون بينا رسول الله ﷺ في سفر فرأى رجلا قد اجتمع الناس عليه وقد ظلل عليه قالوا هذا رجل صائم فقال رسول الله ﷺ ليس البر أن تصوموا في السفر
Its isnad is sahih. Muhammad bin Abdul-Rahman bin Saad bin Zurara is trustworthy and virtuous, and even more virtuous than him is Muhammad bin Amr bin Hasan bin Ali bin Abu Talib. The hadith is found in Bukhari, 4/183, no. 1946, Fath al-Bari, in the chapter on fasting, concerning the Prophet's ﷺ statement to the one who had shade cast over him and who suffered from intense heat.