White promotes to a rook to avoid stalemate. Black moves his king- and then since white hasn't moved his king or rook yet, wouldn't he be allowed to castle? Or has the rook "moved" because it was a pawn?
No, that would be illegal.
Article 3.8b:
https://www.fide.com/fide/handbook.html?id=171&view=article
White promotes to a rook to avoid stalemate. Black moves his king- and then since white hasn't moved his king or rook yet, wouldn't he be allowed to castle? Or has the rook "moved" because it was a pawn?