"The adulterer shall not marry except an adulteress or a polytheist," and the verse. Some of them explain it by saying: It was revealed concerning every male and female adulterer, then it was abrogated.
Yahya narrated from Nasr ibn Tarif, who said: Sa'id ibn al-Musayyib said: "The verse 'And marry the unmarried among you' abrogated it."
["And that has been made unlawful to the believers," meaning: It is not permissible for a believer to marry a woman known for adultery, nor a female idolater, and it is not permissible for a believing woman to marry a male idolater, nor a man known for adultery.]
Surat an-Nur from (verse 4 to verse 10).