It came in the Sahih Hadith narrated by Imam Ahmad in his Musnad and Abu Dawud in his Sunan and Ibn Hibban from the route of Ibn Ad-Daylamiyy that he said,
“I came to Ubayy Ibn Ka^b and I said, ‘O Aba-l-Mundhir, something in myself has taken place in reference to the Qadar; so talk to me, perhaps Allah will Benefit me.’ He said:
‘Certainly Allah, had He tortured the people of His earth and His skies, He would have tortured them without being unjust to them; and had He had Mercy upon them, His Mercy would have been Generosity, not due to them because of their good deeds. And had you given in charity the likes of Mount Uhud in gold, Allah will not Accept it from you until you believe in the Qadar and know that whatever hit you would not have missed you, and whatever missed you was not going to hit you; and if you die on other than this, you have entered Hell.’
Then I went to ^Abdullah Ibn Mas^ud and he told me the same, then I went to Hudhayfah Ibn Al-Yaman and he told me the same, then I went to Zayd Ibn Thabit and he told me the same from the Prophet.”