It is brought down by various poskim that Torah study is forbidden in the bathroom, albeit it is a debate whether today’s bathrooms have the same status.
May one perform mitzvos in a bathroom? Specifically, in the case of the six constant mitzvos which are performed through thought, May one think about these in a bathroom?