Yahya related to me from Malik that Humayd ibn Qays and Thawr ibn Zayd adDili both informed him that the Messenger of Allah ﷺ (and one of them gave more detail than the other),saw a man standing in the sun. The Messenger asked, "What's wrong with him?" The people said, "He has vowed not to speak or to seek shade from the sun or to sit and to fast." The Messenger of Allah ﷺ said, "Go and tell him to speak, seek shade, and sit, but let him complete his fast." Malik said, "I have not heard that the Messenger of Allah ﷺ ordered the man in question to do any kaffara. The Messenger of Allah ﷺ only ordered him to complete that in which there was obedience to Allah and to abandon that in which there was disobedience to Allah."
عَنْ رَسُولِ اللَّهِ ﷺ وَأَحَدُهُمَا يَزِيدُ فِي الْحَدِيثِ عَلَى صَاحِبِهِ أَنَّ رَسُولَ اللَّهِ ﷺ رَأَى رَجُلاً قَائِمًا فِي الشَّمْسِ فَقَالَ مَا بَالُ هَذَا فَقَالُوا نَذَرَ أَنْ لاَ يَتَكَلَّمَ وَلاَ يَسْتَظِلَّ مِنَ الشَّمْسِ وَلاَ يَجْلِسَ وَيَصُومَ فَقَالَ رَسُولُ اللَّهِ ﷺ مُرُوهُ فَلْيَتَكَلَّمْ وَلْيَسْتَظِلَّ وَلْيَجْلِسْ وَلْيُتِمَّ صِيَامَهُ قَالَ مَالِكٌ وَلَمْ أَسْمَعْ أَنَّ رَسُولَ اللَّهِ ﷺ أَمَرَهُ بِكَفَّارَةٍ وَقَدْ أَمَرَهُ رَسُولُ اللَّهِ ﷺ أَنْ يُتِمَّ مَا كَانَ لِلَّهِ طَاعَةً وَيَتْرُكَ مَا كَانَ لِلَّهِ مَعْصِيَةً