Dominion: what happens when I play Throne Room on a Feast since Feast gets trashed when played?

Throne Room: "Choose any action in your hand and play it twice"

Feast: "Trash this card and gain a card costing up to 5\$"

So I use the Throne Room and play Feast twice. The first time it gets played it gets trashed and I gain a card up to five. The second time its played the Feast card is in the trash, and to play a Feast it needs to get trashed to gain a card.

I recall the rules say something like when you play an action you must follow as many of the rules as you can, so I assume you would just trash the one Feast and gain 2 cards up to 5\$. Is this correct?

-

As other answerers have written, the end result is you gain 2 cards (costing up to 5) and the Feast goes to the trash.

The general idea I like to remember is on page 6 of the rules (emphasis mine):

The player may still play an Action card even if he is not able to do everything the Action card tells him to do; but the player must do as much as he can.

With just this rule you can see what the result is of playing Throne Room + Feast - do everything the card tells you to that you can do... twice. (In this case, Trash the Feast and gain the 2 cards).

This also covers several other tricky scenarios - for example, playing Upgrade to trash a Copper. In this case, you will gain nothing because no card costs exactly 1 (unless you also played a Bridge earlier that turn).

-

The first time Feast is played, it is moved to the trash, and you get a card costing up to 5. Then, Feast goes (stays) in the trash, and you get a card costing up to 5. In Dominion, the only times one instruction on a card is dependent on another (that I can think of) is when it's prefaced by something like "If you do, ", as in Moneylender, or when the following instruction calculates based off the preceding one, as in Remodel.

-

Gain two cards.

From the rules, pg5

If you use Throne Room on Feast, you will gain two cards, even though you can only trash Feast once. Gaining the card isn't contingent on trashing Feast; they're just two things that the card tries to make you do.

As @MagRoader pointed out, the general rule is on page 6.

The player may still play an Action card even if he is not able to do everything the Action card tells him to do; but the player must do as much as he can.

Therefore the gaining of a card is not dependent on the trashing of the Feast (obviously you can't trash one card twice).

-
While there is a general rule to this effect, keep in mind that a card may specifically disallow some of its actions. For example, Tactician doesn't give you its next turn bonuses unless you discarded any cards... and you must discard all the cards in your hand when playing it the first time. Likewise, Outpost restricts you to two consecutive turns. – Powerlord Jan 5 '11 at 21:55