The Messenger of Allah ﷺ saw a man being shaded while a crowd pressed around him, so he said, "It is not righteousness to fast while traveling."
حدثنا أبو الوليد الطيالسي حدثنا شعبة عن محمد بن عبد الرحمن يعني ابن سعد بن زرارة عن محمد بن عمرو بن حسن
أن رسول الله ﷺ رأى رجلا يظلل عليه والزحام عليه فقال ليس من البر الصيام في السفر
Bukhari narrated it in the Book of Fasting, chapter titled "The saying of the Prophet ﷺ to the one who was being shaded while the heat was intense," hadith no. 1946, and Muslim narrated it in the Book of Fasting, chapter titled "The permissibility of fasting and breaking the fast during the month of Ramadan for the traveler when not committing a sin," etc., hadith no. 1115, both from the hadith of Shubah, with the same chain.