FYI, Tosfos Taanis 11a is a must for today's daf:
Taanis is a sin and chovel b'atzmo but allowed because the mitzvah to take it on outweighs the aveirah.
R Eliezer: The kal vechomer is from a nazir disallowing wine, to everyone not fasting and disallowing all food, which is exactly what Rashi says. Our Gemara just says that causing the body pain - whether from abstinence of just wine alone or from all food entirely shows the opinion that chabalah b'atzmo is not allowed.