What happens when I play a Swindler and no cards with the same cost as the trashed card are in the kingdom set?
As always in Dominion, you do as much as you can of what the card instructs. Since there is no card to gain that has the same cost, your opponent gains nothing. You still trash the card that was turned over because you can do that part of the card's instructions.