Actually, I went and looked up some more teachings on the implicit baptism by desire.
It seems to have been promoted not just by St. Pius X, but also by Pope Pius IX, and St Alphonsus Ligouri
“17 Q: Can the absence of Baptism be supplied in any other way?
A: The absence of Baptism can be supplied by martyrdom, which is called Baptism of Blood, or by an act of perfect love of God, or of contrition, along with the desire, at least implicit, of Baptism, and this is called Baptism of Desire.” Catechism of Pope St. Pius X, The Sacraments - Baptism, Necessity of Baptism and Obligations of the Baptized
“baptism of desire is perfect conversion to God by contrition or love of God above all things accompanied by an explicit or implicit desire for true baptism of water, the place of which it takes as to the remission of guilt, but not as to the impression of the [baptismal] character or as to the removal of all debt of punishment. It is called “of wind” “flaminis”] because it takes place by the impulse of the Holy Ghost who is called a wind “flamen”]. Now it is “de fide” that men are also saved by Baptism of desire, by virtue of the Canon Apostolicam, “de presbytero non baptizato” and of the Council of Trent” St. Alphonsus Ligouri’s Moral Theology Manual (15th century), Bk. 6, no. 95., Concerning Baptism
“Here, too, our beloved sons and venerable brothers, it is again necessary to mention and censure a very grave error entrapping some Catholics who believe that it is possible to arrive at eternal salvation although living in error and alienated from the true faith and Catholic unity. Such belief is certainly opposed to Catholic teaching. There are, of course, those who are struggling with invincible ignorance about our most holy religion. Sincerely observing the natural law and its precepts inscribed by God on all hearts and ready to obey God, they live honest lives and are able to attain eternal life by the efficacious virtue of divine light and grace. Because God knows, searches and clearly understands the minds, hearts, thoughts, and nature of all, his supreme kindness and clemency do not permit anyone at all who is not guilty of deliberate sin to suffer eternal punishments.” Encyclical On Promotion of False Doctrines (Quanto Conficiamur Moerore) by Pope Pius IX, 1863
Also… I found an interesting blog article which claims that St. Thomas also believes in an implicit baptism by desire. I am well aware of the dangers of taking St. Thomas out of context, so I cannot vouch for it, but here is the link in case you are interested.
cantuar.blogspot.com/2009/04/implicit-baptism-of-desire-in-thomas.html