The wash-sale rule decrees that an investor cannot sell an investment at a loss, repurchase a substantially identical investment in 30 days or less, and then use the loss to offset the taxes owed on capital gains. The purpose of this IRS rule is to prevent taxpayers from claiming artificial losses.