E.g. 1 "Not learning French is my biggest regret."
E.g. 2 "Not to learn French is my biggest regret."
I know that e.g. 1 is correct and e.g. 2 is wrong, but what is the grammar rule making e.g. 2 incorrect?
(At first I thought the rule was that you shouldn't use to-infinitive as the subject, but then I realized it couldn't be the rule as to-infinitive is sometimes used as the subject, as in "To tell the truth is always right.")