Here is where I read that a Deacon
could hear a confession in a life or death situation:
newadvent.org/cathen/11618c.htm
If you scroll down about halfway you will see the following paragraph (emphasis mine):
The same exaggerated notion appears in the practice of confessing to the deacons in case of necessity. They were naturally preferred to laymen when no priest was accessible because in virtue of their office they administered Holy Communion. Moreover, some of the earlier councils (Elvira, A. D. 300; Toledo, 400) and penitentials (Theodore)
seemed to grant the power of penance to the deacon (in the priest’s absence). The Council of Tribur (895) declared in regard to bandits that if, when captured or wounded they confessed to a priest or a deacon, they should not be denied communion; and this expression “presbytero vel diacono” was incorporated in the Decree of Gratian and in many later documents from the tenth century to the thirteenth.** The Council of York (1195) decreed that except in the gravest necessity the deacon should not baptize, give communion, or “impose penance on one who confessed”. Substantially the same enactments are found in the Councils of London (1200) and Rouen (1231), the constitutions of St. Edmund of Canterbury (1236), and those of Walter of Kirkham, Bishop of Durham (1255). All these enactments, though stringent enough as regards ordinary circumstances, make exception for urgent necessity. **No such exception is allowed in the decree of the Synod of Poitiers (1280): “desiring to root out an erroneous abuse which has grown up in our diocese through dangerous ignorance, we forbid deacons to hear confessions or to give absolution in the tribunal of penance: for it is certain and beyond doubt that they cannot absolve, since they have not the keys which are conferred only in the priestly order”. This “abuse” probably disappeared in the fourteenth or fifteenth century; at all events no direct mention is made of it by the Council of Trent, though the reservation to bishops and priests of the absolving power shows plainly that the Council excluded deacons.
However Trent has removed that possibility now. I apologise for any confusion.