(36) بَابُ قَوْلِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لِمَنْ ظُلِّلَ عَلَيْهِ، وَاشْتَدَّ الْحَرُّ: «لَيْسَ مِنَ الْبِرِّ الصَّوْمُ فِي السَّفَرِ»
Narrated Jabir bin `Abdullah:
Allah's Messenger (ﷺ) was on a journey and saw a crowd of people, and a man was being shaded (by them). He asked, "What is the matter?" They said, "He (the man) is fasting." The Prophet (ﷺ) said, "It is not righteousness that you fast on a journey."
Reference: Sahih al-Bukhari 1946
In-book reference: Book 30, Hadith 53
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 3, Book 31, Hadith 167